WBF AcademyWBF Academy
TDD for Android with Kotlin
Intermediate Programming Languages

TDD for Android with Kotlin

Ship Android features you can change without fear. This intermediate course teaches test-driven development the way it works on a real Android codebase: write a failing test, make it pass with the simplest thing that could work, then refactor while the suite stays green. You will get fluent in the toolkit that actually matters, JUnit 5, assertion libraries, parameterized tests, and MockK for test doubles, and then go where Android gets hard. You will learn to keep the Android framework out of your unit tests so they run on the JVM in milliseconds, to test a ViewModel properly, to control coroutines with runTest and an injected TestDispatcher instead of sleeping, and to assert on Flow emissions with Turbine. You will learn why the Android community increasingly prefers hand-written fakes over mocks, where Robolectric and instrumented tests genuinely belong, and how to tame a legacy Activity with characterization tests. Assumes you already write Kotlin comfortably. By the end, tests will be how you design Android code, not a chore bolted on at the end.

5 modules 15 lessons 6 h 350 questions

Course content

1 TDD Foundations with Kotlin 3 lessons · 1 practice 0 of 4
Lesson 1 · 7:45Red, Green, Refactor in Kotlin
7:45
Red, Green, Refactor in Kotlin
Video · 7:45
Watch lesson ▶
Lesson 2 · 7:13Tests That Read Like Specifications
7:13
Tests That Read Like Specifications
Video · 7:13
Watch lesson ▶
Lesson 3 · 7:23Fake It, Triangulate, Refactor
7:23
Fake It, Triangulate, Refactor
Video · 7:23
Watch lesson ▶
Practice · 0 of 35 questionsModule practice
Module practice 0 of 35 for the certificate
Answer 35 questions
This module has 70 questions; 35 count toward the certificate.
Practice →
2 The Kotlin Testing Toolkit 3 lessons · 1 practice 0 of 4
Lesson 1 · 7:58JUnit 5 Essentials for Kotlin Developers
7:58
JUnit 5 Essentials for Kotlin Developers
Video · 7:58
Watch lesson ▶
Lesson 2 · 7:34Parameterized Tests and Better Test Data
7:34
Parameterized Tests and Better Test Data
Video · 7:34
Watch lesson ▶
Lesson 3 · 7:55Test Doubles with MockK
7:55
Test Doubles with MockK
Video · 7:55
Watch lesson ▶
Practice · 0 of 35 questionsModule practice
Module practice 0 of 35 for the certificate
Answer 35 questions
This module has 70 questions; 35 count toward the certificate.
Practice →
3 Designing Testable Android Code 3 lessons · 1 practice 0 of 4
Lesson 1 · 8:03Keeping Android Out of Your Unit Tests
8:03
Keeping Android Out of Your Unit Tests
Video · 8:03
Watch lesson ▶
Lesson 2 · 7:56TDD for ViewModels and Repositories
7:56
TDD for ViewModels and Repositories
Video · 7:56
Watch lesson ▶
Lesson 3 · 7:01Choosing the Right Test Level
7:01
Choosing the Right Test Level
Video · 7:01
Watch lesson ▶
Practice · 0 of 35 questionsModule practice
Module practice 0 of 35 for the certificate
Answer 35 questions
This module has 70 questions; 35 count toward the certificate.
Practice →
4 Coroutines, Flow & Test Doubles 3 lessons · 1 practice 0 of 4
Lesson 1 · 7:17Testing Coroutines with runTest
7:17
Testing Coroutines with runTest
Video · 7:17
Watch lesson ▶
Lesson 2 · 7:50Taking Control of Dispatchers
7:50
Taking Control of Dispatchers
Video · 7:50
Watch lesson ▶
Lesson 3 · 7:25Testing Flows with Turbine
7:25
Testing Flows with Turbine
Video · 7:25
Watch lesson ▶
Practice · 0 of 35 questionsModule practice
Module practice 0 of 35 for the certificate
Answer 35 questions
This module has 70 questions; 35 count toward the certificate.
Practice →
5 Refactoring, Legacy Android & Suite Health 3 lessons · 1 practice 0 of 4
Lesson 1 · 6:35Characterization Tests for Legacy Code
6:35
Characterization Tests for Legacy Code
Video · 6:35
Watch lesson ▶
Lesson 2 · 7:19Finding Seams in a 2000-Line Activity
7:19
Finding Seams in a 2000-Line Activity
Video · 7:19
Watch lesson ▶
Lesson 3 · 7:18Killing Flaky Tests and Measuring What Matters
7:18
Killing Flaky Tests and Measuring What Matters
Video · 7:18
Watch lesson ▶
Practice · 0 of 35 questionsModule practice
Module practice 0 of 35 for the certificate
Answer 35 questions
This module has 70 questions; 35 count toward the certificate.
Practice →

Tips

See all