20
Condition Testing and Condition Coverage with Prepare yourself for the ISTQB exam

Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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

Page 1: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

Condition Testing and Condition Coverage with

Prepare yourself for the ISTQB exam

Page 2: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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

Page 3: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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

Page 4: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

Rules!

branch condition = condition branch condition coverage = condition coverage

From „Certified Tester Foundation Level Syllabus (version 2011)”

Copyright © 2013

Page 5: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

hiz = xs + pkl;

gff = sy - dr / nxa;

Copyright © 2013

Examples with sequential code

No condition to cover.

Page 6: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

IF (iuc && fow)

{

t = jcc + iky - hhs;

}

Copyright © 2013

Examples with IF

In order to cover all conditions, you need

2 test cases.

Page 7: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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.

Page 8: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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.

Page 9: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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.

Page 10: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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.

Page 11: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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.

Page 12: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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.

Page 13: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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.

Page 14: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

More examples with…

TestCompetence allows you to generate sample pseudocode to pracitse whitebox

techniques including condition coverage…

Copyright © 2013

Page 15: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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.

Page 16: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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.

Page 17: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

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

Page 18: Condition Testing and Condition Coverage. ISTQB White-Box Techniques with TestCompetence

How to get it…

Visit TestCompetence.com and get one for only…

Copyright © 2013

EURO / USD

Unlimited number of exercises during 24 hours!