We write automated tests quickly, just to make them pass. But when we go back to them, we spend a lot of time understanding what they do and what we were thinking.

Writing clean automated tests eliminates the “getting back in” time. When we read the tests, they would be easier to fix if necessary, and the next person looking at them (even if it’s us) will be thankful.

Clean tests workshop is more than “how to write readable tests”. Tests can be so much valuable if they tell the story of how to use the system. And it’s not rocket science, it’s knowing the principles.

In this 1-day workshop, we’ll talk how to clean up tests. From readable naming, coding and reuse patterns, refactoring methods, test organization, code smells and how to fix them. All in the context of automated tests of different kinds. We’ll also discuss how testability issues in the tested code impacts test code, and how to fix those issues for better code and tests.

“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. In fact, it’s the professional thing to do.

The workshop is intended for: Testers, test automation engineers, developers and their team leaders.

Workshop length: 1 day.

Workshop goals

Following the workshop, attendees will be able to:

  • Identify and refactor code smells in code and tests
  • Fix test smells to improve readability and maintainability
  • Refactor different types of tests effectively
  • Modify tested code for better tests
  • Apply the SOLID design principles in tests
  • Use test-first for clean tests

Workshop agenda

  • What is clean code
  • Clean code patterns (comments, modularity, etc.) that apply to tests
  • Code smells and test smells
  • Refactoring smells into better code
  • SOLID principles and their test application
  • Refactoring principles for different types of tests (unit, integration, API)
  • Testability features of frameworks (Spring, .net core) that improve the tests
  • Testability principles for tested code that create cleaner tests
  • Test-first and clean tests

Prerequisites

  • Attendees need to have their own laptops ready and download the exercises beforehand.
  • The training materials are targeted for Java (Spring knowledge preferred), C# (.Net core knowledge preferred) or Javascript developers.
  • Familiarity with unit testing is required.

Get in Touch!