"Writing Testable Elm"
summary
Argues that tests become practical when code is rewritten to expose only the data needed, not entire models; demonstrates changing secondsActive from taking the whole model to taking explicit time/user values, writing unit tests that first fail, flipping the subtraction to fix the bug, and adding a branch test. Uses elm-program-test for fast integration tests, uses fuzz testing for property checks, and generates/verifies JSON with RailsEdgeTest so decoders are exercised.
AI-written summary · about
chapters (10)
- 0:00The challenge of testing
- 2:02Analyzing existing tests
- 4:35Unit testing limitations
- 6:56Refining test strategies
- 10:23Restructuring for testability
- 14:17Designing for simple testing
- 17:52Fuzz testing and properties
- 20:26Integration testing tools
- 22:36Managing JSON at the edge
- 24:36Summary of key ideas
related talks
42mElm in Production: Type/Test Driven Development
36mUsing Tests as a Tool to Wrangle Legacy Projects
01h 00mTesting Heresies
53mAdventures in Elm: Events, Reproducibility, and Kindness
28mDeveloping an Ember Test Strategy
16mTest as if you're in someone else's shoes
37mClean Test Code
39mStop Testing, Start Storytelling
