2 ms·
Yet what I found even more troubling was that in order to write effective tests, a programmer had to know all of the ways that a piece of software could fail in
by stcredzero 8y ago
Yet what I found even more troubling was that in order to write effective tests, a programmer had to know all of the ways that a piece of software could fail in order to write tests for those cases.
So the programmer needs to think about all the ways the code can fail. Writing the tests concretely documents that thinking in the source code repository and automates re-checking that thinking. A really good programmer then tries to organize the code, such that it's easy to think about how any given unit of code can fail. Writing unit tests rewards such organization and penalizes bad organization.
That said, TDD doesn't seem to work out that way in practice, most of the time.