Horace's Horror


As a public service, I have a little treatise (read - "excuse") to help answer a question that has caused untold hours of debate...

"...just why is it so hard to test software?"

There are probably only three people in existence who have not, at one time or another, been involved in the debate over the relative importance and priority of design vs testing during the software development process. Still however, I occasionally run across folks who tell me that software should be exhaustively (or nearly exhaustively) tested - regardless of the investment in design. And, while I wouldn't necessarily accuse them of believing in "proof by example," their arguments usually run something along the lines of...
"...Heck! We've got these nice automated testing programs that can be setup, started and left alone to run. ... even if it takes a week to finish! ..."
Ok - so what would it take to exhaustively test a piece of software?

Well, consider the following flow chart - a relatively simple program that we will euphemistically refer to as "Horace's Horror " (... just because). In order to exhaustively test this program, we must test every path from A to B - right? In fact, we should test every path several times in order to test boundary conditions of variables, etc. (... and we won't EEEven talk about issues of multi-threading and the like :-))) ... Still, let's be optimistic and keep it simple - let's start by counting each path just once. Okee dokee?


So the question becomes, "just how many paths are there from A to B - and how long would it take to exhaustively test?"

Well ... let's see... 1 ... 2 ... 3 ...

JUST KIDDING!!

I meeean! - coooomeon! - for this program, there are approximately 1.6 * 1025 paths from A to B.

So, if you could test 100 million paths every second, it would take a bit over 5 billion years to test every path just once - not considering leap years of course - or Y2k :-) ... (As a note of interest, that's about how long some folks claim the earth has existed...)


But HEY! - I know - Let's run the tests in parallel! ... I mean - Heck! We've got all these PCs sitting around ... and a lot of them are Pentium II's :-)))

hav - '95