Chapter 6. Testing Perl Programs

“Run and find out.”

—The Jungle Book, Rikki-Tikki-Tavi by Rudyard Kipling

Hands up everyone who hates testing their code. Yes, we thought so. And who can blame you? The hidden beliefs that make testing so painful run deep:

  • I might find something so wrong that I have to make a radical change.

  • If I find something wrong, I'll have to delay delivery.

  • I'm a code writer, not a code tester.

  • If I find something wrong, I'll lose plausible deniability unless I take the time to fix it.

  • It's really elegant the way it is. I don't want to be bothered with special cases that no one's likely to hit anyway.

  • Users are the best testers. ...

Get Perl Debugged 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.