How to make your tests keep you focused?
Published by Filis Futsarov
on June 24 of 2022
This is a talk that I gave back in June 2022 at esLibre, Vigo (Spain).
It covers Hexagonal Architecture, Contracts (!),and Acceptance Tests. And shows how that can be used to create a fast feedback loop that will help you to keep your focus while you code.
So the answer to How to make your tests keep you focused? is: by having a very fast test suite. Using where you can the previusly proven Fast adapter by your Contract Tests.
You can access the Slides in PDF here (Google Drive)
Description
At the beginning of the talk, I will highlight the importance of having a fast test suite, drawing on what psychology tells us about this, especially how different time scales for obtaining feedback on something we have done affect our brain, with a short feedback-loop being ideal for maintaining momentum and a long feedback-loop being counterproductive to our focus.
The talk will focus on what bad practices we should avoid, and then on how to obtain a healthy test suite, with special emphasis on acceptance tests. To do this, I will introduce the Ports and Adapters architecture and show how to take advantage of it to get the most out of our test suite.
Proposal
We've all seen it: when it comes to software design, everything seems to focus on the production code. Method names that reveal intent, cohesive classes, loose coupling... but little is said about applying best practices and principles to the other ‘big part of the project’: our test suite.
For some reason, when it comes to testing, we seem to relax all those good practices, principles, and the continuous pursuit of optimal performance, which over time leads to low-quality tests (slow feedback loop, flakiness, and fragility).
Unlike production code, no Product Owner will complain that the tests are slow, nor will an alert pop up in Slack to tell us that our tests are slower than they should be.
It is the developers themselves who are most affected by a poorly maintained test suite, the main cause being a slow feedback loop, which worsens our focus on what is important, thus greatly affecting our overall Developer Experience as it is such an important part of our daily work.
For all these reasons, we can say that having a healthy test suite is vitally important for any project. Therefore, in this talk, I want to show:
The importance of having a fast test suite from a psychological point of view Ports and Adapters architecture and its out-of-the-box benefits for testing Differences between Acceptance Testing and Integration Testing
Share thoughts, correct something or simply thank me for writing this post.