CHAPTER 9

image

Completing the Picture

In his highly-acclaimed book, Working Effectively with Legacy Code (Prentice Hall, 2004), Michael Feathers states:

Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don’t know if our code is getting better or worse.

He demonstrates how what he calls the “Cover [with tests] and Modify” approach is more efficient than the “Edit and Pray [because there are no automated tests]” approach. And although most of us know this, ...

Get ASP.NET Web API 2: Building a REST Service from Start to Finish now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.