33 ms·
Technically, we write tests to document what the code does. We could use any language, including english, to do that. However, using a programming language carr
by randomdata 10y ago
Technically, we write tests to document what the code does. We could use any language, including english, to do that. However, using a programming language carries the side benefit of being able to allow automatic verification that the documentation is at least in sync with the code (although not necessarily accurate with respect to the project goals).
- sidlls 10y agoAnd then who or what documents the tests? Test code is code. That's important and all too often that fact is sort of elided. "We" write comments and use "plain" language documentation, or formatted but otherwise plain language for documentation generators to parse to document our code, and that includes "what the code does." I'd argue that if your test code is what you're relying on to "document what the code does" then you are probably (almost certainly) over-testing, testing the wrong things, or some combination. Oh, and also using test code incorrectly (as documentation).