I watched a fantastic talk from J.B. Rainsberger called “Integrated Tests are a Scam.” It was an insightful discussion about the types of tests that we write during software development and the types of tests that actually help you ensure proper code coverage.
Unit testing is a great idea. It provides for code coverage, is a resource for documentation, and, paired with TDD, it provides a vehicle for good design. There are a lot of articles and blogs talking about why unit tests are important; however, it’s hard to know how to write good unit tests. This blog will talk about how to build a suite of robust unit tests that still allow for refactoring.
Here are some tips and tricks that have allowed me to leverage the value of unit tests while still having the flexibility to refactor during the development process.