Skip to content

An Android project in Jetpack Compose to showcase how to level up our unit tests step by step with parameterized tests, property-based test & stateful tests

License

Notifications You must be signed in to change notification settings

sergio-sastre/Multiplying_the_quality_of_unit_tests

Repository files navigation

part of the blog post Top-notch stateful testing in Android

Multiplying the quality of unit tests

An Android project to showcase how to improve our unit tests step by step:

  1. From tests multiple assertions to parameterized example-based tests,
  2. Add extra property-based tests to catch regression bugs that parameterized tests cannot.
  3. Advanced use of property-based tests for stateful testing: verify that the state of our model is correct after performing any action on it.

For 1. & 2, we test the logic behind the strong password validator of a create account screen.

For 3, we test that the state of a text editor (i.e. displayed text & text to display upon undo/redo actions) is correct after editing, undoing and redoing in any random order.

You can find the blog posts on the topic here:

  1. Better unit tests with Parameterized testing

  2. Writing bulletproof code with Property-Based testing

  3. Top-notch stateful testing in Android

And also the video and slides of my tech-talk "Writing bulletproof code with Property-Based testing" at Droidcon Lisbon 2022 (only slides) & Droidcon Berlin 2022

  1. Tech-talk video Droidcon Berlin 2022
  2. Slides Droidcon Lisbon 2022 & Droidcon Berlin 2022

About

An Android project in Jetpack Compose to showcase how to level up our unit tests step by step with parameterized tests, property-based test & stateful tests

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages