Test Refactoring Workshop - Improving the Maintainability of Your Tests
Are you finding writing unit tests to be hard, time-consuming or error-prone? Is the hardest part of making a change in your production code changing all the tests that are affected? Are your tests hard to understand or change? Do you lack trust in your tests' ability to catch errors in your production code? Are all these things keeping you from writing unit tests or doing TDD?
Come see and practice techniques for making your tests easier to read and write by aligning the terminology of the tests with the terminology of the code-under-test's domain. We'll look at test code, discuss the test smells that hint at issues and demonstrate techniques that can be used to make the test code simpler, easier to understand and quicker to write.
If you have some of your own test code that you think is too complex or hard to understand, please bring it along and we can help you improve it.
Outline/Structure of the Workshop
- Look at some test code that is hard to understand
- Discuss the Test Smells that hint at a need to simplify/refactor this test code
- Discuss a couple of refactoring techniques that could be applied
- Apply the refactorings to the test code to see how they help,
- repeat until time is finished
Learn a set of Test Smells to look for that help you realize you need to refactor your tests.
Learn specific Test-Refactorings that will make your code easier to understand.
Learn test writing techniques that will make writing your tests quicker and less error-prone.
Developers / Testers /Architects
Prerequisites for Attendees
You should have written a reasonable number of unit tests so that you are comfortable with the mechanics of using at lest one member of the xUnit family of unit testing frameworks.
Ideally, bring some of your own tests to work on during the session so that some real work gets done in this workshop.