4 ms·
The book's design approach suites TDD perfectly. Narrow deep modules allow to freely refactor internals and keep tests green.
by bvrmn 5y ago
The book's design approach suites TDD perfectly. Narrow deep modules allow to freely refactor internals and keep tests green.
- _wp_ 5y agoI didn't say that the book's approach contradicted TDD, I'm merely quoting from the book and refuting one its claims (that TDD doesn't lead to good design). I agree that narrow and deep modules support refactoring internals if their unit tests are written to treat them as black boxes.
- bvrmn 5y agoTDD in classical form (understood by most devs) aka "one test per function/method" leads to poor design indeed. There is a little training about why this approach couples code with tests and what to do instead.
- rileymat2 5y agoYes, that would make for both terrible design and terrible tests. I think sometimes people refuse to go past the words naming a practice or past the tldr; and it causes problems.