Today I want to bring under your attention the use of unit-testing, especially in agile test-driven development.
Even my grandma knows why unit tests are just ***cool***.
The primary goal of unit testing is to take the smallest piece of testable software in the application, isolate it from the remainder of the code, and determine whether it behaves exactly as you expect. Each unit is tested separately before integrating them into modules to test the interfaces between modules. Unit testing has proven its value in that a large percentage of defects are identified during its use.
If even my grandma knows, how come that there are still developers down there in their cave or under their piece of rock that still need to be convinced that unit testing is more than beneficial?
- they are not true believers. They are convinced that writing god classes is just okay.
- they have writers block and have no idea where and how to start writing good unit tests.
- they are residing in an anti-pattern: no unit tests.
Of course, it is easy to create some for newly created code. (Although the reality often proves otherwise.) Real ***black belt*** unit testers also unit test all legacy code!