SandorHQ — Yes, But Does It Work?
Some programmers are still reluctant to write tests for their code, and even fewer embrace the paradigm of Test Driven Development, even though many legendary developers explain tirelessly that tests and the code complete each other – indeed, code tests the tests –, and they remove the element of fear from refactoring or touching someone else’s code or one’s own after a few months.
When the code is well covered with tests, if anything breaks during a modification it will be immediately revealed by a failing test.
Not having fast automated tests with good code coverage is like playing russian roulette. Seldom pleasant.
A Cup of Confidence
For Node.js one of the most popular testing framework is Mocha, which provides a truly expressive and clean format for describing the behavior of the product and how it should deliver everything according to the expectactions.
It’s fast, it’s easy to use, and it makes the world a happier place.
Of Course It’s War
I’ve always admired medical doctors as they have to diagnose people without proper tools that allows them to really understand what’s going on under the skin. Furthermore, usually when they make a mistake it’s much harder to restart the process – or the patient.
Luckily, programmers have access to advanced tools like debuggers which can save precious time from having to analyze endless heaps of logs. Personally I prefer to use PHPStorm (I also work with PHP and it supports Node.js out of the box), because it’s a breeze to set breakpoints in the code and inspect the actual values and flow of business logic.