top | item 30720175

(no title)

thibauts | 4 years ago

How does TDD force you to a better design ?

discuss

order

tremon|4 years ago

By forcing you to think about your code's interface before thinking about its implementation. That means you get larger components that fit together based on the problem requirements, rather than components with interfaces that are only locally optimal.

You can see this same thing in action when watching functional programming live coding sessions: most live coding is bottom-up, but they still write the function signatures before writing any code.

duped|4 years ago

This strikes me as tautological. If you're using anything statically typed you have to write the function signature before it's body.

afarrell|4 years ago

It doesn't. It signals a particular point in time to improve the design.

Good design is a creative activity and cannot really be forced, only given space to grow.