Stelios Frantzeskakis

Staff Engineer @ PSS

Talk Title

Put Your Tests on a Diet: Testing the Behavior and Not the Implementation

Room

Hamilton

Date

26.10.2023

Time

16:50 > 40 min

Share

on Twitter

How do you write tests? How much time do you spend writing tests? And how much time do you spend fixing them when refactoring?

A few short years ago, we would test a class in JUnit by stacking one test after the other, mocking each one of its dependencies. But for large apps, writing tests in this way without any consideration of architecture can easily become a bottleneck.

For a task that takes so much of our time every day as developers, there is surprisingly little discussion online about optimal test design. At Perry Street Software, publisher of two of the world's most popular LGBTQ+ dating apps, after struggling writing and maintaining our unit tests in the past, we have spent much time developing what we like to call the Unit Testing Diet.

Our Unit Testing Diet provides a healthy way to test and refactor an app at scale, by testing the behavior that a user performs and the outcome that they will perceive, without testing implementation details.

Join this talk to learn how to:

1. Test your ViewModels, UseCases, and Repositories in a Given-When-Then style, without using mocks
2. Test the behavior and not the implementation details
3. Refactor your code without breaking your tests

Speaker Bio

Stelios is a Staff Engineer at Perry Street Software, publisher of the LGBTQ+ dating apps SCRUFF and Jack’d, serving a community of more than 30 million members worldwide.

He has been professionally working with Android for more than 10 years, since the release of Android Gingerbread. He’s passionate about Clean Architecture, Domain-Driven Design, Test-Driven Development and Behavior-Driven Development.

Menu