3 ms·
Yes, you should use unit tests in FP. Traditionally you build larger functions on top of small ones, and you might change the later. Unit tests guarantee that
by alcidesfonseca 16y ago
Yes, you should use unit tests in FP.
Traditionally you build larger functions on top of small ones, and you might change the later. Unit tests guarantee that the larger functions still work after those changes.
Also, in Haskell, I prefer to do property-based testing instead of unit testing. Google for quickCheck for more details. (There's an Erlang version as well).