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 299<br />

Modified condition decision coverage <strong>in</strong>cludes <strong>in</strong> its def<strong>in</strong>ition both decision<br />

coverage and condition coverage. Furthermore, decision coverage can be deduced<br />

from condition coverage <strong>in</strong> comb<strong>in</strong>ation with the <strong>in</strong>dependently affect property.<br />

Aga<strong>in</strong>, we consider decision D. A test suite with three test cases such that A is<br />

true and B is true, A is true and B is false, andA is false and B is true satisfies<br />

the modified condition decision coverage. Obviously, such a test suite satisfies<br />

the condition decision coverage and also the <strong>in</strong>dependently affect property. From<br />

these two facts, it is easy to see that decision coverage is satisfied. The number<br />

of required test cases ranges between n +1 and 2n which is manageable even<br />

for large values of n. However, there are situations <strong>in</strong> which it is impossible<br />

to vary one condition value while keep<strong>in</strong>g the others unchanged. This is the<br />

case if A is true implies that B is true. To overcome this problem, Vilkomir<br />

et. al. provide an improved formal def<strong>in</strong>ition of the modified condition decision<br />

coverage criterion [VB02]. There it is sufficient to choose any comb<strong>in</strong>ation that<br />

varies both condition and decision even-though other conditions may also vary.<br />

At last, the full predicate coverage criterion requires that each possible<br />

outcome of every condition <strong>in</strong> a decision is produced at least once, where the<br />

value of a decision is directly correlated with the value of a condition. Intuitively,<br />

multiple condition decision coverage is relaxed <strong>in</strong> the sense that it is not required<br />

that conditions <strong>in</strong> a decision <strong>in</strong>dependently affect the decision.<br />

11.3.2 Data Flow Oriented Coverage Criteria<br />

Data flow oriented criteria are based on data flow analysis with respect to compiler<br />

optimization activities. They require test cases that follow <strong>in</strong>struction sequences<br />

from po<strong>in</strong>ts where values are assigned to variables to po<strong>in</strong>ts where those<br />

variables are used. To <strong>in</strong>troduce different criteria, we def<strong>in</strong>e flow graphs associated<br />

to a model. Strictly speak<strong>in</strong>g, we discuss code coverage as used <strong>in</strong> white-box<br />

test<strong>in</strong>g approaches. The relationship between models and code is that behavioral<br />

models can be compiled <strong>in</strong>to code and that described coverage criteria can be<br />

applied to this code. However, there are many possibilities for this relationship;<br />

the way criteria are applied depends on the concrete approach. For example,<br />

us<strong>in</strong>g modified condition decision coverage at level of assembly code does not<br />

make sense.<br />

A flow graph associated to a model is a directed graph that consists of a<br />

set of nodes and a set of edges connect<strong>in</strong>g these nodes. Nodes conta<strong>in</strong> l<strong>in</strong>ear<br />

sequences of computations (i.e., access to external values, variable assignments,<br />

data changes, etc). Edges represent transfer of control between nodes specified <strong>in</strong><br />

the specification. Additionally, each edge is associated with a boolean expression<br />

that is the condition of the correspond<strong>in</strong>g control transfer. A flow graph conta<strong>in</strong>s<br />

an <strong>in</strong>itial node, which denotes the beg<strong>in</strong>n<strong>in</strong>g of an abstract 2 computation, and a<br />

set of term<strong>in</strong>al nodes which denote exit po<strong>in</strong>ts. Depend<strong>in</strong>g on the type of model,<br />

<strong>in</strong>itial and term<strong>in</strong>al nodes have to be chosen or added (for example, extended<br />

f<strong>in</strong>ite state mach<strong>in</strong>e formalisms do not use notions of beg<strong>in</strong>n<strong>in</strong>g and end<strong>in</strong>g of<br />

2 Abstract <strong>in</strong> the sense that models are abstractions of programs.

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

Saved successfully!

Ooh no, something went wrong!