~/talk

Property-based testing in Android - are we testing like it's 1999?

Talkat droidcon APAC 2020 · 2020-12-14..12-15· [testing, android]
links:none on file
slides:none on file

Argues that property-based testing catches faults value tests miss, demonstrating on a simple myMax function where Kotest (formerly KotlinTest) generators find a counterexample to a bad implementation, and showing ViewModel properties that replace three filter-specific unit tests with one rule that the add-button visibility equals filter==ALL. Uses checkAll/gen/arb/exhaustive generators, mocks and Mockito to capture LiveData emissions, converts JUnit rules to Kotest test listeners, and shows JUnit4 theories plus a custom RandomSupplier so property tests work without new libraries.

AI-written summary · about

  1. 0:00Introduction and modern testing
  2. 1:13History of JVM testing
  3. 6:08Testing stagnation in 2016
  4. 7:11What is property-based testing
  5. 8:15Simple example with myMax function
  6. 10:24Limitations of value-based testing
  7. 11:25Exploring Kotest property checks
  8. 13:56Writing idiomatic property-based tests
  9. 17:31Testing Android ViewModels
  10. 21:48Modeling ViewModel actions
  11. 23:15Property-based ViewModel assertions
  12. 26:09Testing LiveData over time
  13. 28:12Property-based testing in JUnit
  14. 32:08Summary and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.