Skip to Main Content
Lightning Talk Intermediate MIT License

Property-based testing for UIs

Proposal status is Approved
pjay
pjay
Session Description

How do you catch bugs that only show up when a user taps frantically, or when async data loads in an unexpected order? Standard UI tests miss this subtle stuff, even though it happens constantly in real, stateful applications.

In this talk we explore how to apply generative testing to the messy world of user interfaces. Property-based testing (PBT) autonomously explores an app using an actions generator and validates correctness properties at every step, which surfaces harder bugs earlier.

This talk answers:

  1. Why property-based testing
  2. How it works specifically for UIs
  3. A case study: catching a real race condition that only fires when a user taps a button twice before the first tap finishes
  4. How to adopt property testing on your project using simple properties without knowing any formal models

I'll share how I built Sanderling, an open-source PBT framework for mobile and web apps. Testers define behavioral properties of the app in a simple TypeScript spec, then run the app against that spec in CI for hours to find property violations.


Why Now?

The number of things we ship is skyrocketing due to AI, and bugs too. Unit tests don't test user behavior, and integration tests mostly cover the happy path.

The state space of actions a user can execute in an app is huge and largely unexplored by example-based tests. If we test behavioral properties instead of specific business logic, an actions generator can drive the app through far more of that space than any example tests.

Overall, Compute is cheaper than ever. We need a system that runs for hours and tells us the app has a race condition when a user taps a button twice.

Key Takeaways
  1. How property-based testing finds unexpected UI bugs that example-based tests can't
  2. A case study of writing behavioral properties for an app and running them in a live environment
  3. You don't need to be a formal-methods expert to get value from this. Simple properties uncover deep bugs, like ensuring a loading spinner eventually disappears, or that the screen never goes blank.

References

Session Categories

Introducing a FOSS project or a new version of a popular project
Engineering practice - productivity, debugging
Talk License: MIT License

Which track are you applying for?

Main track

Speakers

Priyanshu Jain
Priyanshu Jain Principal Engineer | OkCredit
pjay is a software engineer with about 10 years in the industry. He co-founded a fintech company(Spotlight), spent a long time building distributed systems and payment infrastructure at scale, and has published research on matching algorithms and code retrieval techniques for coding agents. Currently experimenting with autonomous property based testing for UI applications.