¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: How to learn good design using TDD ?


 

On the subject of learning a language via TDD: of related interest is that for many languages you can find "<Language name> Koans", where someone has already written a suite of failing unit tests of language features, complete with helpful error messages that allow you to get the tests passing. I first learned of it via??which I believe to be the original, but it's easy enough to Google e.g. "Java Koans" and find something like?.

Returning to the OP, I think it's worth pointing out that?improving the design of your code is one motivation for TDD. So it should be possible to study the two in parallel.?Moreover, the fact that in TDD your tests serve a dual purpose- acting as API design as well as regression safety- in some cases causes a tension between these competing requirements. The "London" (or "outside-in"/"top-down") approach to TDD differs from the "Chicago" ("inside-out"/ "bottom-up") approach largely due to the role played by test doubles, which are introduced to aid design at the cost of increasing the risk of false positives/negatives in tests for the correctness of your code. (?is a good free resource to read more about this stuff.)?

Cheers,
Rob

Join [email protected] to automatically receive all group messages.