This is a compilation of some video presentations and opinions about testing software in Clojure.
"We say, "I can make a change because I have tests." Who does that? Who drives their car around banging against the guard rails?" - Rich Hickey
You are the expert, figure it out!
why you are writing tests?
why did you release this garbage?
Don’t write tests!
Allows quick iteration with stubbing functionality
Light-weight and ideal for testing pure logic
Can get cluttered
Should be used to test core logic and guide one through incremental code dev
The idea of example-based tests are very error prone and might be able to get very few bugs
Great for checking invariants
Stateful systems that can be modeled as state machines
Don’t write tests! Generate them!
The idea of modeling the state of the system is very good. We can use some sort of State machine in order to model how the state of the application should change.
QuickCheck: A lightweight tool for random testing of Haskell Programs
This library was already ported to Clojure. [org.clojure/test.check]
Usefulness: be critical about what/how you test
Low Cost: a layer of abstraction, and stick to it
Specificity: Use clear language: target all "interesting" behaviors
Sometimes we really don’t need tests
Design should come first. Good designs are generally easy to test
Tests can help:
Enumerating and describing behaviors encourages more thought
Pain usually indicates tight coupling or other poor design elements
Real input/output contracts can go beyond type systems in providing that things are "connected together" correctly.