[Tutor] Do you use unit testing?

Alan Gauld alan.gauld at btinternet.com
Tue Nov 17 09:04:58 CET 2009


"Stephen Nelson-Smith" <sanelson at gmail.com> wrote 

> As a discipline - work out what we want to test, write the test, watch
> it fail, make it pass - I find this a very productive way to think and
> work.

Warning:
It can be seductively addictive and lead to very bad code structure.
You start focussing on just passing the test rather than the overall 
structure and design of the solution. Make sure that once it passes 
the tests you go back and refactor the code to be clean and maintainable.

Then test it again of course!

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list