Swift Driven Development
summary
Argues that Swift’s type system and runtime playgrounds let TDD go further: uses a snakes-and-ladders kata to show concrete gains, building a Board, Game, a configurable “cheating die,” and a mini test runner called Swordfish. Develops in Swift Playgrounds, then moves tests into Xcode/AppCode, fixes bugs exposed by a ~2000-round run and later ~40-round simulations, and leverages synthesized Equatable (Swift 4.1) plus enums and pattern matching to simplify code; demos compile, run, and turn red/green as expected.
AI-written summary · about
chapters (16)
- 0:00Introduction to Swift TDD
- 1:47TDD principles and benefits
- 10:20Challenges of TDD
- 12:31Coding Kata introduction
- 17:53Modeling the board in Swift
- 20:04Implementing board logic
- 27:54Refining the board implementation
- 33:10Handling edge cases
- 38:13Testing in playgrounds
- 40:33Moving to Xcode and AppCode
- 41:35Testing game object
- 45:30Player turn logic
- 47:21Testing game actions
- 51:06Customizing dice behavior
- 54:47Game simulation demo
- 58:59Swift Driven Development summary
related talks
12mThe Skills You Need for Test-Driven Development: A Hands-On Workshop in Swift
50mWriting Swift code with great testability
37mManaging Side Effects with Swift
55mEmerging Best Practices
39mSwift and You
34mSwift: New Paradigms for iOS Development
53mSwift: New Paradigms for iOS Development
18mScientific Swift
