Unit Test Craftsmanship
Automated unit testing is commonly considered an essential part of writing reliable, bug-free software. But writing automated tests introduces a number of challenges of its own. Naively-written tests are complex, brittle and hard to understand. This increases their cost-of-ownership and reduces the value they provide.
In this talk, Gerard Meszaros examines some of the key pitfalls and shows us how to improve the quality of our automated tests. He shows us how we can make our tests shorter, clearer and cheaper to prepare by refactoring a long, complex test into a short easy-to-understand test. Then he goes on to show how we can apply the same concepts to writing new tests quickly and cheaply.
Outline/structure of the Session
- Why do we need automated unit tests?
- What makes unit tests effective?
- Intro to Test Smells and Patterns
- Case Study: Refactoring a Smelly Test
- Case Study: Writing New Tests Avoiding Smells
- Recap & Summary
- Become aware of smells in automated tests
- Learn how to use test smells to drive refactoring of tests
- Learn how to write shorter, clearer tests by avoiding smell test code
Developers and Test Automaters