From the course: Agile Software Development: Dealing with Legacy Code and Technical Debt

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Build out test coverage

Build out test coverage

From the course: Agile Software Development: Dealing with Legacy Code and Technical Debt

Start my 1-month free trial

Build out test coverage

- [Instructor] Test coverage is a measure of how much of your production code is executed when your test is run. There is a healthy debate about how much test coverage is enough. But in general, more is better than less or none. While 100% is going to be impossible to reach for many projects. When you go to clean up a chunk of code, it's very important to have high code coverage for that chunk of code. Even if coverage is low across the rest of the code base. The trouble is, not all code is easy to test, especially using traditional unit testing techniques. That's where employing a different testing technique can be a big help. One solution that works really well, is the Approval Tests testing library. Approval Tests allow you to capture an artifact of the code's current behavior and then compare that artifact against one that you captured earlier and declared was correct. This is sometimes referred to as the…

Contents