Searching for an Understanding

Learn to refactor tests to maximize understanding and minimize maintenance costs.

Our tests represent a significant investment.

  • They’ll pay off by minimizing defects and by allowing us to keep our production system clean through refactoring.
  • They also represent a continual cost. We need to continually revisit our tests as our system changes.
  • At times we’ll want to make sweeping changes and might end up having to fix numerous broken tests as a result.

Scenario: Code understanding

Say we’re tasked with making some enhancements to the search capabilities of our application. We know we’ll be changing the util.Search class, but none of our team is familiar with exactly what the Search class does. So we turn to the tests, or more accurately, tests. What in the world can we prove with only one test?

Get hands-on with 1200+ tech skills courses.