3 ms·
No one is reinventing functional programming, as another commenter said, purity is just one aspect of functional programming and unit testing is used heavily in
by Ixiaus 13y ago
No one is reinventing functional programming, as another commenter said, purity is just one aspect of functional programming and unit testing is used heavily in functional programming projects. In languages like Haskell where the type system can do most of the heavy lifting for you (ala QuickCheck - Erlang has a version of it too if you use spec definitions piously) unit testing is less repetitive and much easier to maintain.
What unit testing is in languages that don't have a stronger type system is simply working around warts in language design. Just as ORM systems are a "work around" for the warts in interfacing relational data with an object model.
[EDIT] I didn't write out my thought well enough: unit testing in "other languages" isn't necessarily working around the warts in language design but working around the warts in programmer thinking and process. Strongly typed languages don't solve those problems but they do improve the situation dramatically with their type guarantees and advanced testing systems (QuickCheck) therefore reducing the amount of cognitive overhead and code maintenance involved in writing tests. With languages like Haskell you only write Unit Tests for things that are difficult or complex to test using QuickCheck.