TDD in Android with Spek
summary
Shows how to set up Spek DSL on Android (requires JUnit 5 and a dev Maven for Spek 2.1.0), then practices TDD by writing unit tests first for an ArticleRepository interface with getArticles and fetchAndSync methods. Uses RX Java and fake data stores (success, empty, error, save) to assert behaviours: local emits first, remote merges later, empty local is ignored, and a custom empty result set exception signals total failure. Tests fail, implementation is added, and tests pass; warns Spek 2.1.0 is flaky on Android.
AI-written summary · about
chapters (15)
- 0:00Introduction and speaker
- 1:14Why Spek for testing
- 2:17Setting up Spek framework
- 3:41Writing tests with Spek
- 5:27Test types and pyramid
- 8:19TDD workflow explained
- 9:44Interface design for TDD
- 11:49Blank implementation
- 12:30Preparing test fakes
- 14:36Testing fetch and sync
- 18:11Testing get articles
- 21:02Running and failing tests
- 21:22Implementing repository
- 23:50Reviewing TDD steps
- 26:00Resources and contact








