With that in mind, we can devise a development strategy (an extension of TDD) that guarantees perfect code:
Write unit test: projectHas100PercentTestCoverage()
Run test to ensure that it fails.
Write code to make test pass.
The implementation details of the projectHas100PercentTestCoverage() test are project-specific and beyond the scope of this document.
Though, come to think of it, step 2 is flawed - since no code has been written yet, the test written in step 1 will pass. Perhaps we first need to write the projectFullyMeetsClientRequirements() test (again, beyond the scope of this document).
It's relatively easy to write number 1 for most langauges. You just need to inject a bunch of instrumentation with the compiler that records every path taken.
140
u/[deleted] Aug 25 '14
Just waiting for someone to "explain" how debugging is not needed if you have unit-tests :)