http://www.perlmonks.org?node_id=402620


in reply to The joys of bad code

At my last job, I was asked to build an automated test harness for a large COBOL system. They wanted me to begin with a particular part of the system.

So I cranked up the debugger with the intention of discovering and building tests for the error conditions the program was capable of generating.

In the code I discovered over 100 instances of this:

GOTO FATAL-OUT

FATAL-OUT was a subroutine that shut down the process with no error messages, no stack dump, no evidence at all that the program had encountered a problem. Then the OS would restart the process automatically.

Apparently some years back this program had routinely overflowed log files and caused performance problems by the sheer number of errors it generated. So the developers simply stopped it from generating errors.

Problem solved!

I didn't work there very long. But I did succeed in building a very nice user-driven system-level automated test harness for a *different* part of the system.