07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11 Evaluat<strong>in</strong>g Coverage Based Test<strong>in</strong>g 317<br />

This follows immediately from the assumption that (d1 − m1 − x ), (d2 − m2 − x ),<br />

di, mi, andx are all non negative.<br />

Lemma 11.13. Let D3 = D1 ∪ D2. Then m3<br />

d3<br />

m1 m2<br />

< (1 − (1 − )(1 − d1 d2 )).<br />

Proof. For any set {D1,...,Dn} of subdoma<strong>in</strong>s, let us note f (D1,...,Dn) =<br />

� k<br />

i=1<br />

(1 − mi<br />

di ).<br />

We want to show that: 1 − f (D3) < 1 − f (D1, D2) orthatf (D3) > f (D1, D2).<br />

We start by show<strong>in</strong>g that for given values d3 and m3, thevalueoff (D1, D2)<br />

is maximized when D1 ∩ D2 conta<strong>in</strong>s as few failure caus<strong>in</strong>g <strong>in</strong>puts as possible.<br />

This is clear <strong>in</strong>tuitively, s<strong>in</strong>ce po<strong>in</strong>ts <strong>in</strong> the <strong>in</strong>tersection are more likely to be<br />

selected. Thus when as many of them as possible are not failure caus<strong>in</strong>g, the<br />

probability to select an <strong>in</strong>put which does not cause a fault is maximal (that is if<br />

f (D1, D2) is maximal).<br />

Formally, let Da = D3 − D2, Db = D3 − D1 and Dc = D1 ∩ D2. Letda, db,<br />

dc and xa, xb, xc be the size and the number of <strong>in</strong>puts which does not cause a<br />

fault of Da, Db and Dc respectively. The follow<strong>in</strong>g equation holds:<br />

xa +xc<br />

f (D1, D2) =( da +dc )( xb +xc<br />

db+dc )<br />

Suppose it is possible to swap one non failure caus<strong>in</strong>g <strong>in</strong>put out of Da with<br />

one failure caus<strong>in</strong>g <strong>in</strong>put of Dc. Let us call D ′ 1 and D ′ 2 the subdoma<strong>in</strong>s obta<strong>in</strong>ed<br />

from D1 and D2 by apply<strong>in</strong>g this operation. Do<strong>in</strong>g so leaves the values da, db,<br />

dc, andxb unchanged but decrements xa and <strong>in</strong>crements xc, yield<strong>in</strong>g<br />

f (D ′ 1 , D ′ 2<br />

)=(xa −1+xc+1<br />

da +dc<br />

)( xb +xc+1<br />

db+dc ) > f (D1, D2).<br />

Similarly, swapp<strong>in</strong>g a non failure caus<strong>in</strong>g <strong>in</strong>put of Db with a failure caus<strong>in</strong>g <strong>in</strong>-<br />

put of Dc leads to two subdoma<strong>in</strong>s D ′′<br />

1<br />

and D ′′<br />

2<br />

such that f (D ′′<br />

1<br />

, D ′′<br />

2 ) > f (D1, D2).<br />

Thus, to prove the lemma, it suffices to consider the follow<strong>in</strong>g two cases.<br />

Case 1: Dc consists entirely of non failure caus<strong>in</strong>g <strong>in</strong>puts. In this case, lett<strong>in</strong>g<br />

x = dc =| D1 ∩ D2 |, the hypotheses of Lemma 11.12 are satisfied, so:<br />

m1+m2<br />

d1+d2−dc<br />

≤ (1 − (1 − m1<br />

d1<br />

m2<br />

)(1 − )) holds.<br />

d2<br />

S<strong>in</strong>ce m3 = m1 + m2 and d3 = d1 + d2 − dc, it gives the desired result.<br />

Case 2: Da and Db consist entirely of failure caus<strong>in</strong>g <strong>in</strong>puts. We want to<br />

show that f (D3) − f (D1, D2) ≥ 0, where<br />

xc<br />

f (D3) = da +db+dc and f (D1,<br />

xc D2) =( da +dc )(<br />

xc<br />

db+dc ).<br />

It suffices to show<br />

0 ≤ xc((da + dc)(db + dc) − xc(da + db + dc))

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!