TDD is NOT about high code coverage
Code Coverage shows you what code you haven't executed, not how good your tests are
🚀 Join the ATDD Accelerator waitlist
🔒 Hello, this is Valentina with a premium issue of the Optivem Journal. I help Engineering Leaders & Senior Software Developers apply TDD in Legacy Code.
You can achieve 100% code coverage having tests with zero assertions!
TDD isn’t about having useless or illogical tests just for the sake of reaching a certain metric.
The main goal of TDD is that we’re driven by specifications, and that the code we produce is testable and aligned with specifications.
High code coverage is just a byproduct of TDD, but not the goal.
100% code coverage, 0 assertions
You can literally hit every line of code with your tests — and still have no validation of behavior. This is called a “zero assertion test“.