~/talk

KotlinFixt-your tests

Talkat droidcon Americas 2020 · 2020-11-16..11-17· [testing, kotlin]
links:none on file
slides:none on file

Generates real Kotlin objects with random but constrained values using KotlinFixture and the pattern called constrained nondeterminism, replacing hundreds of hardcoded lines in a real codebase. Defaults produce collections of size repeatCount=5 unless overridden; tests set repeatCount to 0, 1, or a range (0..10) and pin a rating to 4.5001..5.0 to force five stars. Library handles nullable types, default params, abstract subclasses, Java Faker, and is used to find serialization and flaky-test failures by repeating runs.

AI-written summary · about

  1. 0:00Introduction to test data
  2. 1:18Problem with hardcoded test data
  3. 3:07Demo of movie test setup
  4. 8:44Factory functions for test objects
  5. 12:26Introducing KotlinFixture
  6. 13:53Using KotlinFixture in tests
  7. 16:26Repeat count for test coverage
  8. 18:57Testing star rating logic
  9. 20:46Handling nullable types
  10. 21:28Support for abstract classes
  11. 22:32Best practices with constraints
  12. 24:46Sharing fixture configuration
  13. 26:47Simplifying real-world test data
  14. 30:52Testing parcelable objects
  15. 32:58Advanced KotlinFixture features
  16. 34:36Q&A on randomized fixtures
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.