Category Archives: tdd
Test Driven Development – Clean Code Video
While watching the episode 6 of the clean coders video I noted down some important points.
- Design and Code rots lead to fragile, rigit and in-mobile code base. Debugging becomes difficult, estimates mount and implementing any new changes becomes difficult. Uncertainity in the code increases.
- Maintaining a test suite with a high code coverage has below benefits
1. Keeps defects under control
2. Gives us the courage to change the code in order to clean it
3. Unit tests act as code examples for your API. They are low level design documents. For e.g. The test cases helps us to know all the possible ways to call a particular API.
4. Writing tests first, makes the production code testable. To write unit tests you would have to make your functions decoupled from each other. This leads to an improved design.