Skip to content

Sample Android chat application demonstrating how to follow Behavior-Driven Development (BDD), by writing unit tests that test the behavior and not the implementation.

License

Notifications You must be signed in to change notification settings

steliosfran/unit-testing-diet

Repository files navigation

The Unit Testing Diet Sample App

How can you effectively unit test an MVVM app at scale?

This is a sample Android chat application that demonstrates how to follow Behavior-Driven Development (BDD), by writing unit tests that test the behavior that a user performs and the outcome that they perceive, without testing implementation details.

The tests are written in the Given-When-Then style and they cover the ViewModel, UseCase, and Repository layers, without using mocks.

For a comprehensive guide on how to follow this methodology, please refer to the "Unit Testing Diet" blog post.

Setup

  1. Clone the repository
  2. Checkout the main branch for Kotlin Flow or rxjava for RxJava
  3. Examine the structure of the tests in the ChatViewModelSpec.kt file.

Libraries Used

Contact

For further queries or feedback, feel free to reach out to me on Twitter: @SteliosFran.

About

Sample Android chat application demonstrating how to follow Behavior-Driven Development (BDD), by writing unit tests that test the behavior and not the implementation.

Topics

Resources

License

Stars

Watchers

Forks

Languages