The program reads three integer values from the console. The three values represent the lengths of the sides of a triangle. The program prints a message that states if the triangle is equilateral (all sides the same length), isosceles (two sides the same length), or scalene (all sides have different lengths).
Write down a set of test cases (i.e., specific sets of data) that you feel would thoroughly test such a program.
This program turns out harder than it looks, and over the years many versions have been written (no doubt by students who were given this program as an assignment!) and tested. A list of common errors, nearly all of which have occurred in one version of the program or another, have been compiled. Before looking at the list below, try to come up with your own list.
Don't peek!
A study showed that highly experienced professional programmers, on the average, only score about 56%!
This shows that testing even a trivial program is not an easy task. Now imagine you need to write test cases for a 100,000 line program, say an air-traffic-control system, or a payroll program.
Note this doesn't say that testing is pointless. Rather it is a very valuable tool! This just shows the difficulty of thoroughly testing any complex program. 100% coverage isn't a realistic goal of testing.