Property-Based Testing for UI: Capturing Edge Cases via LLM-Generated Property Definitions

Jetpack Compose has popularized a declarative approach to Android UI development, fundamentally changing how we build apps. Yet when we turn to the realm of UI testing, long-standing pain points that pre-date Compose—subtle gaps between preview and on-device behavior, wide-ranging ripple effects from refactors, and bugs emerging from countless state permutations and unexpected input patterns—continue to plague developers. Trying to achieve comprehensive coverage with conventional example-based tests and manual verification alone is notoriously difficult and inefficient in many teams. This session explains how Property-Based Testing (PBT) can tackle these challenges. PBT defines “properties” that must always hold for every input, then automatically searches for counter-examples. While traditionally used for algorithms and business logic, we will show how its principles extend to the UI layer. After reviewing PBT basics in Kotlin (Kotest / jqwik), we discuss how to view not only ViewModel logic but also UI components themselves as subjects that must satisfy well-formed properties. We present concrete techniques for discovering and encoding those properties, demonstrate managing specs in Markdown/YAML, and explore a future workflow where LLMs generate property definitions to surface edge cases swiftly. Attendees will gain new perspectives and practical hints for improving Android app quality through PBT. We plan to cover topics such as: - Re-examining the unique challenges of UI testing - Fundamentals of Property-Based Testing and its applicability to UI - Strategies for discovering and formulating UI “properties” - Managing specs in Markdown/YAML and auto-generating properties with LLMs - Practical limits of PBT in UI testing and complementary mitigation strategies - Debugging workflows and root-cause analysis when PBT uncovers failures (Translated by the DroidKaigi Committee)

  • Tetta Noguchi LINEヤフー株式会社


Summary

  • Dates 2025.09.11 / 15:20 ~ 16:00 (40min)
  • Place Ladybug
  • Language Japanese (English interpretation available)

Intended audience

- Anyone interested in Property-Based Testing - Android developers from beginner to advanced levels - Professionals promoting UI test automation for Android apps

Android is a trademark of Google LLC. The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. Android, Google Play and the Google Play logo are trademarks of Google LLC.

© 2014- DroidKaigi Committee