26
Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton University, Ottawa Copyright 2006 © IBM Corporation

Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Embed Size (px)

Citation preview

Page 1: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Covering Arrays –Mathematical, Engineering, and Scientific Perspectives

Alan Hartman

May 2006Fields Institute Workshop on Covering Arrays – Carleton University, Ottawa

Copyright 2006 © IBM Corporation

Page 2: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Outline

• Mathematics

• Engineering

• Science

Page 3: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Mathematics

• Definition

• My favorite constructions

Page 4: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Covering Array - Definition

• A covering array of strength t for k parameters over domains of size n with R test cases is:

• An Rxk matrix with entries in {0,1,…n-1}

• Every Rxt submatrix contains every ordered t-tuple over {0,1,…n-1} in at least one of its rows

• is the minimum R such that there exists a covering suite of R test cases with parameters t, k, n

• Equivalent to finding the maximum k such that there exists a covering suite of R test cases with parameters t, k, n

),,( nktCA

Page 5: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Combinatorial Constructions RkCA )2,,2(

Let be the smallest integer such thatR

2/

1

R

Rk

K 2-3 4 5-10 11-15 16-35 36-56 57-126

R 4 5 6 7 8 9 10

First row all 0

Subsequent columns are incidence vectors of

subsets of an set 2/R 1R

Page 6: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Combinatorial Constructions RkCA )2,,2(

2/

1

R

Rk

First row all 0

Subsequent columns are incidence vectors of

subsets of an set

00 in first row

11 since any pair of subsets intersect

01 and 10 since the subsets are the same size

Best possible by Sperner’s Lemma and

Erdös-Ko-Rado Theorem

2/R 1R

2/R

Page 7: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Recursion for t>2

Let - the Turan number - be the maximum

number of edges over all graphs with vertices

having no clique of size

),,()),(1(),,( 2 nktCAntTnktCA

Uses perfect covering suites (OAs) of strength 2

to square the number of columns

),( ntT

1nt

Page 8: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Example: t=3, n=2

The maximum number of edges over all graphs

with 3 vertices having no clique of size 3 is 2.

)2,,3(3)2,,3( 2 kCAkCA

A A A AA ...

kA1 kA2 kAkkA3 ...

A ...A 2A k-1A

Page 9: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

The general construction

A1 A

2 A

3 … A

k

N

k

T(t,n)+1

k2

T(t,n)+1

B[i,j]

C[i , j]=AB[j,i]

k2

),,()),(1(),,( 2 nktCAntTnktCA

Page 10: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Engineering Aspects• Motivation

• Applications

• Input Coverage

• FSM Reduction

• Military

• Ease of Use

• Effectiveness

Page 11: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Applications

•Software input coverage test suites

•Software and hardware FSM model reduction

•Blind disoriented robots on a line

Page 12: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Testing - Motivation

• Testing is important

• Testing is expensive

• Poor testing is even more expensive

Page 13: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Downtime Hourly Cost• Brokerage operations $6,450,000

• Credit card authorization $2,600,000

• Ebay (1 outage 22 hours) $225,000

• Amazon.com $180,000

• Package shipping services $150,000

• Home shopping channel $113,000

• Catalog sales center $90,000

• Airline reservation center $89,000

• Cellular service activation $41,000

• On-line network fees $25,000

• ATM service fees $14,000

Page 14: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

A Testing Problem

• Test an internet site:– Operating system: Win, Linux, Solaris

– Browser: Explorer, Netscape

– Printer: Epsom, HP, IBM

– Protocol: Token Ring, Ethernet

36 combinations (OS, Br, Prt, Pcl)

1 tester

3 days

Page 15: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

A Covering Array Solution

OS Browser Printer Protocol

Windows Explorer Epsom TR

Windows Netscape HP Enet

Windows Explorer IBM Enet

Linux Netscape Epsom TR

Linux Explorer HP Enet

Linux Netscape IBM TR

Solaris Explorer Epsom Enet

Solaris Netscape HP TR

Solaris Explorer IBM Enet

Page 16: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Model Based Testing with FSMs

• An abstract model of SW

• Nodes are labeled by tuples of state variables

• Arcs are labeled by possible inputs to the SW

• Test cases are generated by judicious choices of paths through the state space

• Problem: State and Arc explosion

• Solution: Covering Arrays to sample the arcs at each state

Page 17: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Blind disoriented synchronized robots

•k robots start at points 1,2,…k on a line

•They cannot see each other

•They have no common sense of direction

•They all move at speed 1

•They have to rendezvous in a minimum number of steps

Page 18: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Blind disoriented synchronized robots•Stage 1: Identify the extreme robots

•Stage 2: Extreme robots proceed towards the centre.

•Optimize stage 1 by giving each robot a column in a binary covering suite with t=2

•Interpret 0 as a move ½ left then ½ right

•Interpret 1 as a move ½ right then ½ left

•After steps the extreme robots are known

)2,,2( kCA

Page 19: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Usability and Extensibility

• The Pairwise Website (www.pairwise.org) lists 20 tools for constructing covering arrays

•Key factors for usability:

•NO MATH

•Constraints! – but how

•Distinction between legal and illegal inputs

Page 20: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

• 1. CATS (Constrained Array Test System) *) [Sherwood] Bell Labs.

• 2. OATS (Orthogonal Array Test System) *) [Phadke] AT&T

• 3. AETG Telecordia Web-based, commercial

• 4. IPO (PairTest) *) [Tai/Lei]

• 5. TConfig [Williams] Java-applet

• 6. TCG (Test Case Generator) *) NASA

• 7. AllPairs Satisfice Perl script, free, GPL

• 8. Pro-Test SigmaZone GUI, commercial

• 9. CTS (Combinatorial Test Services) IBM Free for non-commercial use

• 10. Jenny [Jenkins] Command-line, free, public-domain

• 11. ReduceArray2 STSC, U.S. Air Force Spreadsheet-based, free

• 12. TestCover Testcover.com Web-based, commercial

• 13. DDA *) [Colburn/Cohen/Turban]

• 14. Test Vector Generator GUI, free

• 15. OA1 k sharp technology

• 16. CTE-XL Daimler Chrystler GUI, free

• 17. AllPairs [McDowell] Command-line, free

• 18. Intelligent Test Case Handler (replaces CTS) IBM Free for non-commercial use

• 19. CaseMaker Díaz & Hilterscheid GUI, commercial

• 20. PICT Microsoft Command-line, free

Page 21: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

WHITCH

•WHITCH is open and extensible

• 62 downloads – since January

• You get a free Covering Array GUI

• Why not use it to liven up your next grant application?

•www.alphaworks.ibm.com/tech/whitch

Page 22: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

WHITCH – Interface

• GUI panel for defining Types

• GUI panel for defining Columns

• GUI panels for choosing algorithms, variations etc.

• Java interfaces for plugging in new ideas, algorithms, panels

Page 23: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Science

• Empirical Software Engineering

• What are the issues

Page 24: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

But is it all worth the trouble?

• Schroeder, Bolaki, Gopu, 2004 pointed out that random test suites of the same size are equally as effective as covering arrays in detecting injected SW defects

• James Bach has been trumpeting the news in all the engineering forums

• Do we have an answer?

Page 25: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

SBG Arguments

• Previous papers compared pairwise to “conventional testing”

• Correlated code coverage with fault detection

• Small applications (6-8 KLOC)

• Artificially seeded bugs

Page 26: Covering Arrays – Mathematical, Engineering, and Scientific Perspectives Alan Hartman May 2006 Fields Institute Workshop on Covering Arrays – Carleton

Empirical SW Testing

• Need further experiments to determine if and when covering arrays do help:

• Real software

• Real faults

• Real software testers