Decision Testing and Decision Coverage. ISTQB Whitebox techniques with TestCompetence
-
Upload
radoslaw-smilgin -
Category
Education
-
view
10.173 -
download
7
description
Transcript of Decision Testing and Decision Coverage. ISTQB Whitebox techniques with TestCompetence
Decision Testing and Decision Coverage with
Prepare yourself for the ISTQB exam
Dictionary
branch: A basic block that can be selected for execution based on a program construct in which one of two or more alternative program paths is available, e.g. case, jump, go to, if-then- else. branch coverage: The percentage of branches that have been exercised by a test suite. 100% branch coverage implies both 100% decision coverage and 100% statement coverage. branch testing: A white box test design technique in which test cases are designed to execute branches.
From „Standard glossary of terms used in Software Testing”
Copyright © 2013
Dictionary
decision: A program point at which the control flow has two or more alternative routes. A node with two or more links to separate branches. decision coverage: The percentage of decision outcomes that have been exercised by a test suite. 100% decision coverage implies both 100% branch coverage and 100% statement coverage. decision testing: A white box test design technique in which test cases are designed to execute decision outcomes. decision outcome: The result of a decision (which therefore determines the branches to be taken).
From „Standard glossary of terms used in Software Testing”
Copyright © 2013
What is…?
Decision coverage, related to branch testing, is the assessment of the percentage of decision outcomes (e.g. the True and False options of an IF statement) that have been exercised by a test case suite. Decision testing derives test cases to execute specific decision outcomes, normally to increase decision coverage.
Decision testing is a form of control flow testing as it generates a specific flow of control through the decision points. Decision coverage is stronger than statement coverage: 100% decision coverage guarantees 100% statement coverage, but not vice versa.
From „Certified Tester Foundation Level Syllabus (version 2011)”
Copyright © 2013
Rules!
100% branch coverage implies 100% decision coverage. Branch testing = arc testing = algorithm testing
From „Certified Tester Foundation Level Syllabus (version 2011)”
Copyright © 2013
sep = az * wn;
csc = dvz + isc + d;
Copyright © 2013
Examples with sequential code
There are no decisions to take.
IF (vz)
{
fuf = azh - e;
}
ic = pcg + icn / n;
Copyright © 2013
Examples with IF
In order to cover all decisions and branches,
you need 2 test cases.
IF (lfn)
{
j = ag + vy - f;
}
ELSE
{
l = ar * hkh;
}
vgd = i * qla / p;
Copyright © 2013
Examples with IF ELSE
In order to cover all decisions and branches,
you need 2 test cases.
SWITCH (i)
{
CASE 0:
krg = z - kz;
break;
CASE 1:
tob = zrc * cxd;
break;
}
rl = gs / dl * s;
Copyright © 2013
Examples with SWITCH
In order to cover all decisions and branches,
you need 2 test cases.
uyn = -9;
WHILE (bo || uyn < -3)
{
qx = q - ba / i;
uyn++;
}
moa = 4;
WHILE (ei || moa > -3)
{
h = udi * cj;
moa--;
}
Copyright © 2013
Examples with WHILE
In order to cover all decisions and branches,
you need 1 test case.
FOR (a = 5; a > -5; a--)
{
b = c + 1;
}
Copyright © 2013
Examples with FOR
In order to cover all decisions and branches,
you need 1 test case.
IF (u)
{
IF (s)
{
l = el * n * iq;
}
ELSE
{
fz = ga / ca + vd;
}
}
ELSE
{
IF (upd)
{
w = tvo / x + y;
}
ELSE
{
grm = neq + ads;
}
}
e = lcu + b;
Copyright © 2013
More examples
In order to cover all decisions and branches,
you need 4 test cases.
h = -4;
WHILE (ww || h < 6)
{
zx = 1;
WHILE (iya || zx > -9)
{
hm = am * x;
zx--;
}
h++;
}
ye = 7;
WHILE (iob || ye > 2)
{
boi = nk - u + ijy;
ye--;
}
Copyright © 2013
More examples
In order to cover all decisions and branches,
you need 1 test cases.
vc = 8;
WHILE (xa || vc > -2)
{
FOR (i = 0; i < 2; i++)
{
FOR (qgn = 1; qgn > -2; qgn--)
{
p = u * ufi;
}
}
vc--;
}
FOR (ij = -2; ij > -12; ij--)
{
pqr = n + fdq / jx;
}
Copyright © 2012
More examples
In order to cover all decisions and branches,
you need 1 test cases.
More examples with…
TestCompetence allows you to generate sample pseudocode to pracitse whitebox
techniques including statement coverage…
Copyright © 2013
More examples with…
TestCompetence allows you to generate sample pseudocode to pracitse whitebox
techniques including decision coverage…
Copyright © 2013
Choose the level of nested
statements.
Choose the maximum number of instructions per level.
Choose the type of
coverage from:
statement, decision, codition, multiple
condition, and modified
condition.
Choose the type of
statement.
GENERATE your exercise.
More examples with…
You get pseudocode and sample answers just like during a regular ISTQB exam.
Choose the right answer.
Copyright © 2013
Choose an answer.
Pseudocode
More examples with…
You get pseudocode and sample answers just like during a regular ISTQB exam.
Choose the right answer.
Copyright © 2013
Pseudocode
Your answer
Right answer
How to get it…
Visit TestCompetence.com and get one for only…
Copyright © 2013
EURO / USD
Unlimited number of exercises during 24 hours!
Check also examples for…
• Statement testing and coverage >> • Condition testing and coverage >> • Multiple condition testing and
coverage >>
• Modified condition decision combination (MC/CD) coverage >>
Copyright © 2013