# Math underpinnings of software testing?

In my software engineering course, we recently (briefly) covered testing.

Over the course of the discussion some topics came up that made me wonder about the math underlying software testing (such as finer vs. coarser test sets, using equivalence classes to partition infinite input spaces into "testable" sets, etc).

Are there any resources available exploring the math behind software testing?

-

## migrated from stackoverflow.comMay 24 '11 at 3:07

This question came from our site for professional and enthusiast programmers.

Since they are more concerned with theoretical questions, I wonder you would get a better answer at cstheory.stackexchange.com. –  rajah9 May 23 '11 at 19:32
@rajah there's not enough big words in this question for the cstheory site –  Steven A. Lowe May 24 '11 at 4:11
@Steven A. Lowe But I see that he has gotten infinitely more responses than SO. –  rajah9 May 24 '11 at 15:54
Software testing is very valuable (e.g. putting unit testing into practice) but its theory will always have some holes. Consider this classical example: `double pihole(double value) { return (value - Math.PI) / (value - Math.PI); }` which I learned from my math teacher. This code has exactly one hole, which can't be discovered automatically from black-box testing alone. In Math there is no such hole. In calculus you're allowed to close the hole if the one-sided limits are equal. –  rwong May 25 '11 at 4:29

For a book exploring the math behind software testing ... the seminal book to get is The Art of Computer Systems Performance Analysis: Techniques for Experimental Design, Measurement, Simulation, and Modeling

While it was first published in 1991 it is still popular today because it's an applied mathematics book that focuses solely on performance analysis, simulation and measurements.

-
Great, thanks! I'll take a look. –  dckrooney May 25 '11 at 17:08

One mathematically-based approach is all pairs testing. The idea is that most bugs are activated by a single configuration option choice, and most of the remainder are activated by a certain pair of options taken simultaneously. Thus most can be caught by testing "all pairs". A mathematical explanation (with generalizations) is here:

The AETG system: an approach to testing based on combinatorial design

(there are many more such references)

-

Maybe "specification-based testing" also kind of answers your question. Check these Testing Modules (which I haven't used yet). They require you to write a mathy expression to specify sets of test values, rather than writing a unit test using selected single data values.

Test::Lectrotest