Chapter 33. Restructuring the System for Testing

Chapter 30 introduced the motivation for changes to the application to accommodate testability. Chapter 32 showed one way to begin testing without such changes, by testing through the user interface. Such tests can then support the process of changing the application itself, helping to ensure that bugs are not introduced in the process.

In this chapter, we introduce the ways and means of test infecting an application. Surprisingly, the changes we need to make to enable direct testing also have huge benefits in other respects. Michael Feathers [Fea04] provides considerable help in working with legacy, or non-test-infected, code.

Sometimes, quite drastic changes are needed, and this can be off-putting ...

Get Fit for Developing Software: Framework for Integrated Tests 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.