I have a question to the functional gurus out there:
Do you use unit testing in a functional programming context?
The reason I ask is that programming with a REPL fundamentally changes how you typically write programs - the bottom-up mentality. You don't even write a test-first, you test first! The tested program is then assembled into a unit. I feel there's much less incentive to write a test, if you use a statically typed language and use a REPL as it is meant to. Am I wrong in my thinking?
I've been doing some programming in lisp/arc, which isn't exactly functional but I try to stay as side-effect-free as possible. And I've been having a lot of fun doing TDD. See, for example, http://github.com/akkartik/wart which has about as many LoC in tests as in code.
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).
Do you use unit testing in a functional programming context?
The reason I ask is that programming with a REPL fundamentally changes how you typically write programs - the bottom-up mentality. You don't even write a test-first, you test first! The tested program is then assembled into a unit. I feel there's much less incentive to write a test, if you use a statically typed language and use a REPL as it is meant to. Am I wrong in my thinking?