The tragedy of 100% code coverage | IG Labs

It is funny how things turn around. ​ For fifteen years I have been preaching TDD (Test-driven development, or as it used to be called: test-first approach), or at least for developers to write some unit tests. However, in recent times I have found myself saying more often, “Why did you write that test?” instead of, “You should write a test.”

Source: The tragedy of 100% code coverage | IG Labs

 

This is something I struggle with too. I see too many unit tests written to cover single line methods. Sometimes, static method calls are moved to wrapper methods for unit tests. It seems to make code cluttered instead of making it easy to read.

Leave a Reply