Saturday 2:35 p.m.–3:05 p.m.
Unit Testing Makes Your Code Better
Greg Ward
- Audience level:
- Novice
- Category:
- Best Practices & Patterns
Description
Abstract
Automated testing by developers has been de rigeur for more than a decade now -- or has it? Unfortunately, there are still too many organizations and too many developers that do not use automated testing in a rigorous, disciplined way. It's no surprise that writing tests makes your code more correct. I'm going to focus in particular on the lowest level of automated testing, unit testing, with the aim of explaining one of its unexected benefits: unit testing improves the design of your code. Cleaner code isn't just an intellectual exercise: it's code that is easier to understand, easier to modify, easier to extend, and easier to reuse. Regular use of unit tests will not merely help you to write more correct code; it will make you a better programmer.