Logging and Other Facilities of Last Resort

There are times when all reasonable seams fail your purpose. You beat your head against a wall. “How can I test this piece of code?” you scream in frustration. You want to test the code. You need to test the code. Your obsession with mastery over the system will not let you quit. Such moments lead to desperate decisions.

First, take a break. Get some fresh air. Go for a walk. Take a nap. Have a smoke, if that is your vice. Check your e-mail. Read a chapter of a good novel. Do whatever you have to do to break the fixation, distract your brain, and get some space. If after all of that you still need to beat the challenge, read on and consider the end of the test-seam rope, but see Figure 12-1.

Figure ...

Get Quality Code: Software Testing Principles, Practices, and Patterns 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.