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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.