4 ms·
This is the approach that I take with my personal projects; I firmly believe quickcheck style testing is a huge improvement over manually writing out individual
by DanWaterworth 14y ago
This is the approach that I take with my personal projects; I firmly believe quickcheck style testing is a huge improvement over manually writing out individual test cases. Do you tend to find, as I do, that when you write you code to be testable using randomized testing that it tends to look more functional? (I'm referring to the paradigm rather than the opposite of dysfunctional)
- lukev 14y agoWell, considering the code I'm talking about is mostly in Clojure, yeah, definitely functional. It's really cool to see how all the pieces fit together once you buy into the functional paradigm.
- kernel_sanders 14y agoI 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.
- lukev 14y agoI believe the parent post was referring to QuickCheck (http://en.wikipedia.org/wiki/QuickCheck http://en.wikipedia.org/wiki/QuickCheck) as opposed to "quickly checking" code in the REPL. Tests definitely need to be repeatable.