StateFlow – A Library for Compositional Integration Testing


StateFlow ( is an integration testing framework that provides a compositional way to implement integration tests. The main advantage of this approach is to reduce coupling between test steps and allow for more reusability and composability of test flows.

To achieve that, it relies on the state monad abstraction from the clojure cats library. It currently supports clojure.test and midje and also takes advantage of Matcher Combinators (, another Nubank open source library that allows better comparison of nested data structures and test failure messages.

It has been adopted for writing integration tests across several microservices at Nubank.

In this talk I am going to present the library, focusing less on the implementation details and more on how to use the library for writing composable integration tests.


Eric Velten de Melo (Nubank)
I’m a Nubank engineer for 2 and a half year and functional programming enthusiast.