3 ms·
> TDD is about designing how a module is going to be used before actually implementing it. My problem with this is that Tests != Design. I hear this all the t
by bluefirebrand 5y ago
> TDD is about designing how a module is going to be used before actually implementing it.
My problem with this is that Tests != Design.
I hear this all the time "Oh, TDD isn't about having 100% coverage it's just making sure developers think about what they make before they make it"
If your developers don't think before they build, fire them
Tests aren't design.
Tests also aren't documentation, which is the other thing I hear a lot.
- necovek 5y agoCode is the canonical source of truth. Tests are executable examples of code under use in different scenarios, usually showing both input and output. Textual documentation is an attempt to extract the most useful bits of the first two into a more manageable form, and potentially explain the reasons for said code's existence if it's not obvious. It will always go out of sync with code in small ways that will bite you, unless you've got executable documentation like some OpenAPI implementations or the venerable "doctests" in Python. All of them are ways to learn about the API, or iow, "documentation".