Hacker News new | ask | show | jobs
by kernel_sanders 5021 days ago
I find that the same quickcheck style testing is the fastest way to get out quality code for a project that I am the sole devleoper of.

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.

1 comments

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.