The Composable Architecture — The confusion between unit test and integration test

Testing in the Composable Architecture (TCA) is very simple and convenient because this framework simply does almost everything. However, sometimes this convenience makes developers easy to confuse between the unit tests and integration tests. In this article, I am going to shed some light on what this problem exactly is, why it occurs, and the logical thinking when writing tests.

Image credit: @jupp

Types of tests in TCA

If you’ve ever used TCA, you will find that in this architecture, there are two main concerns:
- Business logic in the reducer
- View states

Image Credit: Duy Bui
Image Credit: Duy Bui
Image Credit: Duy Bui
Image Credit: Duy Bui

The confusion in practices

Although I have learned a bit of experience and thoroughly analyzed it myself, I still sometimes get confused between unit tests and integration tests. Why is this happening? This comes from the nature of the testing framework that TCA offers. Whether you are in unit tests or integration tests, individual test cases, or combine scopes, screens together, you must need to start from the starting point.

Conclusion

Maybe after reading this article, you will feel everything clear and easy to understand. Me too, but before that, it took me many refactors to realize these. So I want to write this down to help you save more time when you first start using TCA (and for me).

Product Management + Technical Architecture + Explore new technologies.