EUnit and Common Test
- EUnit. EUnit runs unit tests in modules: assertions as macros, close to the code they pin.
- Common Test. Common Test runs system suites: distributed cases, setup per suite, results as reports.
- Test the tree. OTP tests start real supervisors: behaviour proven inside the structure it ships in.
Property-Based Testing Concepts
- Properties. Property tests state laws: encode then decode is identity: checked against generated cases.
- Generators. Generators build random terms of the right shape: thousands of cases you did not have to imagine.
- Shrinking. On failure the framework shrinks to the minimal counterexample: the bug at its smallest.
Testing Concurrent Systems
- Determinism by design. Concurrent tests avoid sleeps: they wait on messages and monitors, deterministic by construction.
- Failure injection. Tests kill processes mid-flow and assert recovery: supervision as tested behaviour.
- Race hunting. Concurrency properties run many schedules: interleavings explored, not hoped away.
Before and after this level
- Before: Level 13: Debugging & Observability: Tracing, Observer and Runtime Inspection, Diagnosing Live Systems.
- Next: Level 15: BEAM Performance: Scheduler Behaviour, Process and Memory Performance, Profiling Large Erlang Systems.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Erlang Level 14: Testing cover?
EUnit and Common Test, Property-Based Testing Concepts, Testing Concurrent Systems: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 13: Debugging & Observability, which covers Tracing, Observer and Runtime Inspection, Diagnosing Live Systems.