TDD, Like in Type Driven Development
summary
Shows how encoding errors in Scala's type system (using Option, Validation, Either and precise Scala collection types) and writing polymorphic signatures leads to provably constrained implementations and fewer runtime exceptions. Demonstrates using ScalaCheck property testing to shrink and replace many unit tests, with examples (map/filter fusion) where property tests find counterexamples and the approach reduces runtime surprises.
AI-written summary · about
chapters (25)
- 0:00Type-driven programming intro
- 1:28Avoidable errors without types
- 3:42Encapsulating errors in types
- 5:34Options for missing cases
- 7:04Data validation with types
- 8:31Benefits of typed structures
- 9:54Correctness proofs by construction
- 11:24Types and logic propositions
- 13:11Parametricity and constrained behavior
- 15:00Polymorphism indeterminacy example
- 16:23Composable functions math guarantees
- 17:51Avoiding errors with strict types
- 19:39Dangers of exceptions and reflection
- 21:26Full commitment to types
- 22:54Types impact on quality
- 24:46Implementation via type signatures
- 27:35Communication via types
- 29:28Practical signature-based search
- 31:51Types as universal language
- 33:20Strict types limits and alternatives
- 34:49Property vs unit tests
- 36:59Development pyramid with types
- 39:16Key steps in type-driven dev
- 41:03Bug fixing with property tests
- 42:30Q&A
related talks
24mLet the Scala compiler work for you
48mTDD - It's About More Than Just the Tests
45mTDD makes you a better everyday developer
48mTDD: so your code is testable and tested!
38mDeliver Better Code Faster With TDD
14mTypeless Writing in a Strong Typed World
39mA few tips on modelling things in Scala
33mducktape - Holding Scala's Productivity Together
