2 ms·
That illustrates a very serious problem with TDD, the idea of coverage. 100% code coverage is not 100% coverage of every different possible code path. In fact,
by InclinedPlane 13y ago
That illustrates a very serious problem with TDD, the idea of coverage.
100% code coverage is not 100% coverage of every different possible code path. In fact, for most software systems it is not even remotely feasible to achieve that level of code path coverage. The "100%" figure can easily lull less experienced devs into thinking they have sufficient test coverage when nothing could be further from the truth.
- mbrock 13y agoHowever, TDD encourages – ideally – a style of programming where 100% branch coverage is likely to mean the program is correct. That's part of the idea of the "unit" in "unit test." You decompose the program into units for which correctness is relatively simple – and testable. How to do this properly is not obvious, and for teams on which TDD is imposed without this understanding, it will all become a bizarre and useless ideology. When it is understood, the resulting program will have properties that resemble those of purely functional programs, especially composability and correctness.
- seanmcdirmid 13y ago> when it is understood, the resulting program will have properties that purely functional programs, especially composability and correctness. It is not that hard to write pure functional code that is not very compassable or correct. Keeping it simple stupid is more important.