Scenario to illustrate how unit testing leads to better design

Posted by Cocowalla on Programmers See other posts from Programmers or by Cocowalla
Published on 2014-05-26T09:31:48Z Indexed on 2014/05/26 22:00 UTC
Read the original article Hit count: 210

Filed under:
|
|
|

For an internal training session, I'm trying to come up with a simple scenario that illustrates how unit testing leads to better design, by forcing you to think about things like coupling before you start coding.

The idea is that I get the participants to code something first, without considering unit testing, then we do it again, but considering unit testing. Hopefully the code produced second time round should be more decoupled and maintainable.

I'm struggling to come up with a scenario that can be coded quickly, yet can still demonstrate how unit testing can lead to better overall design.

© Programmers or respective owner

Related posts about design

Related posts about unit-testing