Session

Dirty Tests and How To Clean Them

We don’t consider test code as equal to production code. We should give it the same love we do to the “real” code. This session is how to make readable, maintainable tests. What are the smells and what patterns help make tests clean.

We write tests and code for other people. Tests are code too, and both should be clean.

As a clean code fanatic, I see it as a personal mission to go around preaching how powerful clean code is. But unfortunately, it seems that test code is not considered “real code”, and therefore is not considered “dirty”.

In this session, we’ll talk about concrete examples of anti-patterns in tests, and how to clean them up. We’ll see how clean code principles apply directly to tests. And that’s true for all tests - from unit to end-to-end, and regardless of who writes them - developers and testers. We’ll see those in action on APIs. “Clean code looks like it was written by someone who cares,” said Michael Feathers. Test code may even be more important to write cleanly for that reason.