Upload
radoslaw-smilgin
View
5.855
Download
1
Embed Size (px)
DESCRIPTION
Whitebox techniques - Condition Testing and Condition Coverage - prepare yourself for the ISTQB advanced exam for Technical Test Analyst and Test Analyst.
Citation preview
Condition Testing and Condition Coverage with
Prepare yourself for the ISTQB exam
Dictionary
condition: A logical expression that can be evaluated as True or False, e.g. A>B. See also test condition. condition outcome: The evaluation of a condition to True or False. condition testing: A white box test design technique in which test cases are designed to execute condition outcomes. compound condition: Two or more single conditions joined by means of a logical operator (AND, OR or XOR), e.g. ‘A>B AND C>1000’.
condition coverage: The percentage of condition outcomes that have been exercised by a test suite. 100% condition coverage requires each single condition in every decision statement to be tested as True and False.
From „Standard glossary of terms used in Software Testing”
Copyright © 2013
What is…?
Condition coverage, there are stronger levels of structural coverage beyond decision coverage, for example, condition coverage.
From „Certified Tester Foundation Level Syllabus (version 2011)”
Copyright © 2013
Rules!
branch condition = condition branch condition coverage = condition coverage
From „Certified Tester Foundation Level Syllabus (version 2011)”
Copyright © 2013
hiz = xs + pkl;
gff = sy - dr / nxa;
Copyright © 2013
Examples with sequential code
No condition to cover.
IF (iuc && fow)
{
t = jcc + iky - hhs;
}
Copyright © 2013
Examples with IF
In order to cover all conditions, you need
2 test cases.
IF (r && ha)
{
f = utx + g;
}
ELSE
{
mq = nxc * bff * cb;
}
Copyright © 2013
Examples with IF ELSE
In order to cover all conditions, you need
2 test cases.
SWITCH (ck)
{
CASE 0:
jm = c - h;
break;
CASE 1:
si = pkb * t;
break;
CASE 2:
vh = ocd * fq;
break;
}
Copyright © 2013
Examples with SWITCH
In order to cover all conditions, you need
3 test cases.
au = -6;
WHILE (ojc && ar || au < 8)
{
ys = dsk - mfg;
au++;
}
Copyright © 2013
Examples with WHILE
In order to cover all conditions, you need
2 test cases.
FOR (kv = 8; kv > -2; kv--)
{
pl = gvp * ge;
}
Copyright © 2013
Examples with FOR
In order to cover all conditions, you need
1 test case.
IF (e || u)
{
IF (bp || oxq || i)
{
IF (gzy || f)
{
n = yo / ocx - uf;
}
}
}
IF (mt && vdi)
{
IF (oye || cos || yxi)
{
IF (uc || nm || mlk)
{
duz = x - pae - tct;
}
}
}
Copyright © 2013
More examples
In order to cover all conditions, you need
3 test cases.
IF (zw || uzq && ppv)
{
e = vqg / obq + qrb;
}
ELSE
{
IF (fl || z)
{
j = qki / on - fbj;
}
ELSE
{
ab = wy * jb;
}
}
ixr = ms + d;
Copyright © 2013
More examples
In order to cover all conditions, you need
2 test cases.
l = jcy * ykj - dp;
FOR (qyt = 1; qyt < 8; qyt++)
{
ew = 15;
WHILE (d || jw || ew > 2)
{
FOR (zw = 9; zw < 16; zw++)
{
syg = v + ha / cls;
}
ew--;
}
}
mmb = wte * il;
Copyright © 2012
More examples
In order to cover all conditions, you need
2 test cases.
More examples with…
TestCompetence allows you to generate sample pseudocode to pracitse whitebox
techniques including condition coverage…
Copyright © 2013
More examples with…
TestCompetence allows you to generate sample pseudocode to pracitse whitebox
techniques including condition 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
Pseudocode
Choose an answer.
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 >>
• Decision testing and coverage >> • Multiple condition testing and
coverage >>
• Modified condition decision combination (MC/CD) coverage >>
Copyright © 2013