Download presentation
Presentation is loading. Please wait.
1
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Apply this lesson to the structure on the left (c) Dr.Wolfgang J. Schneider
2
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Case # 1 will cover this part (c) Dr.Wolfgang J. Schneider
3
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Case # 2 will cover this part I have dropped the redundant branches (c) Dr.Wolfgang J. Schneider
4
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Case # 3 will cover this part I have dropped the redundant branches (c) Dr.Wolfgang J. Schneider
5
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK For a system with a moderate risk this is a fairly good coverage (c) Dr.Wolfgang J. Schneider
6
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK We have 100% Code Coverage We have missed only one Branch And we have missed one single condition (c) Dr.Wolfgang J. Schneider
7
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK It’s already getting obvious that we will need a more systematic approach for a structure like this. First, we will set up a table for the conditions (c) Dr.Wolfgang J. Schneider
8
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK VAR CASE cond-1 cond-2 cond-3 cond-4 01 TRUE 02 FALSE 03 04 05 06 07 08 09 10 11 12 13 14 15 16 (c) Dr.Wolfgang J. Schneider
9
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Now, we will insert our 3 cases into the table. Case 1: Condition 1: TRUE Condition 2: TRUE OOPS Condition 3: (c) Dr.Wolfgang J. Schneider
10
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Conditions 3 and 4 will not change the outcome of test case # 1 (c) Dr.Wolfgang J. Schneider
11
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK VAR CASE cond-1 cond-2 cond-3 cond-4 01 1.1 TRUE 02 1.2 FALSE 03 1.3 04 1.4 05 06 07 08 09 10 11 12 13 14 15 16 (c) Dr.Wolfgang J. Schneider
12
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Let’s continue with case 2 Condition 1: FALSE Condition 2: Aha !! Condition 3: TRUE Condition 4: TRUE (c) Dr.Wolfgang J. Schneider
13
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Condition 2 does not matter I have dropped the redundant branches (c) Dr.Wolfgang J. Schneider
14
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK VAR CASE cond-1 cond-2 cond-3 cond-4 01 1.1 TRUE 02 1.2 FALSE 03 1.3 04 1.4 05 06 07 08 09 2.1 10 11 12 13 2.2 14 15 16 (c) Dr.Wolfgang J. Schneider
15
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Case 3: FALSE Irrelevant (c) Dr.Wolfgang J. Schneider
16
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK VAR CASE cond-1 cond-2 cond-3 cond-4 01 1.1 TRUE 02 1.2 FALSE 03 1.3 04 1.4 05 06 07 08 09 2.1 10 11 12 3.1 13 2.2 14 15 16 3.2 (c) Dr.Wolfgang J. Schneider
17
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Let’s add a case to cover this branch and the FALSE value for condition 2 It’s obvious that condition 3 won’t matter (c) Dr.Wolfgang J. Schneider
18
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK I will use TRUE FALSE Irrelevant (because this case Has more power than the FALSE value) (c) Dr.Wolfgang J. Schneider
19
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK More Power ? I am triggering this procedure (c) Dr.Wolfgang J. Schneider
20
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK VAR CASE cond-1 cond-2 cond-3 cond-4 01 1.1 - red TRUE 02 1.2 - red FALSE 03 1.3 - red 04 1.4 - red 05 4.1 - yellow 06 07 4.2 - yellow 08 09 2.1 - blue 10 11 12 3.1 - green 13 2.2 - blue 14 15 16 3.2 - green (c) Dr.Wolfgang J. Schneider
21
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Before we continue, we should complete the path lines. We did not need them for branch and condition coverage. (c) Dr.Wolfgang J. Schneider
22
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK I added the “weaker” path we talked about. You can see that the drawing is getting pretty overloaded. We cannot be sure if we covered all the paths just by looking at the graphic. (c) Dr.Wolfgang J. Schneider
23
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Of course, some things are obvious: The red path is pretty isolated There is an undefined path supposed to switch over from GREEN to YELLOW/BLUE (c) Dr.Wolfgang J. Schneider
24
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK VAR CASE cond-1 cond-2 cond-3 cond-4 01 1.1 - red TRUE 02 1.2 - red FALSE 03 1.3 - red 04 1.4 - red 05 4.1 - yellow 06 5.1 - mauve 07 4.2 - yellow 08 5.2 - mauve 09 2.1 - blue 10 11 12 3.1 - green 13 2.2 - blue 14 15 16 3.2 - green There is an undefined path supposed to switch over from GREEN to YELLOW/BLUE The red path is pretty isolated (c) Dr.Wolfgang J. Schneider
25
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK VAR CASE cond-1 cond-2 cond-3 cond-4 01 1.1 - red TRUE 02 1.2 - red FALSE 03 1.3 - red 04 1.4 - red 05 4.1 - yellow 06 5.1 - mauve 07 4.2 - yellow 08 5.2 - mauve 09 2.1 - blue 10 11 6.1 - orange 12 3.1 - green 13 2.2 - blue 14 15 6.2 orange 16 3.2 - green Let’s call it #6 and paint it in orange (c) Dr.Wolfgang J. Schneider
26
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Voilà (c) Dr.Wolfgang J. Schneider
27
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK VAR CASE cond-1 cond-2 cond-3 cond-4 01 1.1 - red TRUE 02 1.2 - red FALSE 03 1.3 - red 04 1.4 - red 05 4.1 - yellow 06 5.1 - mauve 07 4.2 - yellow 08 5.2 - mauve 09 2.1 - blue 10 11 6.1 - orange 12 3.1 - green 13 2.2 - blue 14 15 6.2 orange 16 3.2 - green Something is still missing (c) Dr.Wolfgang J. Schneider
28
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Cond-1 is FALSE We can exclude this part Cond-2 is irrelevant Cond-3 is TRUE We missed the fact that there is no switch-over from BLUE to GREEN because MAUVE is running along most of this path (c) Dr.Wolfgang J. Schneider
29
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK BLACK follows BLUE Now we join MAUVE Now BLUE leaves us (c) Dr.Wolfgang J. Schneider
30
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK VAR CASE cond-1 cond-2 cond-3 cond-4 01 1.1 - red TRUE 02 1.2 - red FALSE 03 1.3 - red 04 1.4 - red 05 4.1 - yellow 06 5.1 - mauve 07 4.2 - yellow 08 5.2 - mauve 09 2.1 - blue 10 7.1 - black 11 6.1 - orange 12 3.1 - green 13 2.2 - blue 14 7.2 - black 15 6.2 orange 16 3.2 - green (c) Dr.Wolfgang J. Schneider
31
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK We needed 3 cases to obtain Statement Coverage (Anweisungsüberdeckung) We had to add 1 case to obtain Branch Coverage (Zweigüberdeckung) Branch Coverage is stronger than (c) Dr.Wolfgang J. Schneider
32
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK We needed 3 cases to obtain Statement Coverage (Anweisungsüberdeckung) We had to add 1 case to obtain Branch Coverage (Zweigüberdeckung) Branch Coverage is stronger than (c) Dr.Wolfgang J. Schneider
33
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK The additional case we introduced for Branch Coverage also gave us SIMPLE CONDITION COVERAGE (Einfache Bedingungsüberdeckung) We introduced BRANCH CONDITION TESTING Branch Coverage goes with Condition Coverage (c) Dr.Wolfgang J. Schneider
34
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK The additional case we introduced for Branch Coverage also gave us SIMPLE CONDITION COVERAGE (Einfache Bedingungsüberdeckung) We introduced BRANCH CONDITION TESTING Branch Coverage goes with Condition Coverage (c) Dr.Wolfgang J. Schneider
35
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK We need another 3 cases to obtain Path Coverage (Pfadüberdeckung) Path Coverage is stronger than Branch Coverage (c) Dr.Wolfgang J. Schneider
36
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK We need another 3 cases to obtain Path Coverage (Pfadüberdeckung) Path Coverage is stronger than Branch Coverage (c) Dr.Wolfgang J. Schneider
37
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK We needed only 7 out of 16 possible condition combinations to obtain Path Coverage You will always get full Path Coverage out of the Condition Matrix (c) Dr.Wolfgang J. Schneider
38
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK We needed only 7 out of 16 possible condition combinations to obtain Path Coverage You will always get full Path Coverage out of the Condition Matrix (c) Dr.Wolfgang J. Schneider
39
(c) Dr.Wolfgang J. Schneider 2003 - 2008 - www.drschneider.at
COVERAGE – HOMEWORK Your Test Manager will rip your head off if you run those 16 cases when you were supposed to obtain 100% Statement Coverage (c) Dr.Wolfgang J. Schneider
40
Dr. Wolfgang J. Schneider - Start
DR. WOLFGANG J. SCHNEIDER GMBH International Information Technology Consultants Professional Testing Solutions Telecommunications and Utility Billing Systems Euro Preparation for Companies in New EU Member Countries EDIFACT – DATANORM – ELDANORM – ETIM Interfaces Data Exchange with Banks and Credit Card Companies Total Quality Management – Good Manufacturing Practices IT Service Management - IT Infrastructure Library (ITIL) Knowledge Management Solutions IT Fitness for GAAP – IAS – FASB Balanced Scorecard Dr. Wolfgang J. Schneider - Start (c) Dr.Wolfgang J. Schneider Take Advantage of 30+ Years of IT Experience !
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.