Re:Unit Testing: Is There Really Any Debate Any Longer?
by lukev on Wednesday September 12, 2012 @10:11AM
(#4510716)
I believe the parent post was referring to QuickCheck (http://en.wikipedia.org/wiki/QuickCheck) as opposed to "quickly checking" code in the REPL.
Tests definitely need to be repeatable.
I usually code in a terminal running screen with many shells going, one of which is running ipython so I can interactively import and test snippets, classes, or small functions that I'm writing in a larger module. It works great.
However - those tests disappear! Once a recent project of mine was handed off to a team for maintenance and more features, I found that, in particular places, where the code was subtle, it was subject to breaking by others who were just trying to fix something unrelated. This was when I, personally, realized the value of unit testing.
Yes, its slower and takes more time up front, but if your code may someday be worked on by others, it protects the sections of your code that have test coverage against breaking - which over a longer time scale can save time.