Black-Box Testing Techniques II Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 5.

Slides:



Advertisements
Similar presentations
TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Advertisements

Logic & Critical Reasoning
Overview Functional Testing Boundary Value Testing (BVT)
Software Testing Logic Coverage. Introduction to Software Testing (Ch 3) © Ammann & Offutt 2 Logic Coverage Four Structures for Modeling Software Graphs.
14004 L5 - © D. Deugo, Lecture 5 Combinational Models (Binder chapter 6)
Logic ChAPTER 3 1. Truth Tables and Validity of Arguments
Test Case Design: Strategies, Techniques & Models Robin Brennan, Senior Consultant Quality Assurance Institute.
Axiomatic Verification I Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 17.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Testing an individual module
Chapter 18 Testing Conventional Applications
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Introduction to Software Testing Chapter 8.2
CPSC 322, Lecture 24Slide 1 Reasoning under Uncertainty: Intro to Probability Computer Science cpsc322, Lecture 24 (Textbook Chpt 6.1, 6.1.1) March, 15,
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Equivalence Class Testing
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 9 Functional Testing
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
Logic Gates & Boolean Algebra Chin-Sung Lin Eleanor Roosevelt High School.
Exam 1 Review Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 15.
Black-Box Testing Techniques I Software Testing Lecture 4.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
Ch6: Software Verification. 1 Decision table based testing  Applicability:  Spec. is described by a decision table.  Tables describe:  How combinations.
MATH 102 Contemporary Math S. Rook
Agenda Introduction Overview of White-box testing Basis path testing
Black-Box Testing Techniques I
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
Black-box Testing.
CS 217 Software Verification and Validation Week 7, Summer 2014 Instructor: Dong Si
Case Study: Black-Box Testing Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 6.1.
CS1022 Computer Programming & Principles Lecture 1 Logic and Proof.
How do I show that two compound propositions are logically equivalent?
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Introductory Logic PHI 120 Presentation: "Truth Tables – Validity vs. Soundness" This PowerPoint Presentation contains a large number of slides, a good.
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
Notes - Truth Tables fun, fun, and more fun!!!!. A compound statement is created by combining two or more statements, p and q.
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
Theory and Practice of Software Testing
Quality Assurance in the Presence of Variability Kim Lauenroth, Andreas Metzger, Klaus Pohl Institute for Computer Science and Business Information Systems.
Software Testing Prepared by Stephen M. Thebaut, Ph.D. University of Florida CEN 5035 Software Engineering.
1 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Requirements-based Test Generation for Functional Testing W. Eric Wong Department of.
1 Software Testing. 2 Equivalence Class Testing 3 The use of equivalence class testing has two motivations: –Sense of complete testing –Avoid redundancy.
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
White-Box Testing Techniques I Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 7.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Introduction to Software Testing Chapter 8.2
Domain Testing Functional testing which tests the application by giving inputs and evaluating its appropriate outputs. system does not accept invalid and.
G&W Chapter 22: Test Cases Software Specification Lecture 29
Black-Box Testing Techniques I
Case Study: Black-Box Testing
Prepared by Stephen M. Thebaut, Ph.D. University of Florida
White-Box Testing Techniques II
Boolean logic Taken from notes by Dr. Neil Moore
UNIT-4 BLACKBOX AND WHITEBOX TESTING
White-Box Testing Techniques III
White-Box Testing Techniques II
Black-Box Testing Techniques III
White-Box Testing Techniques III
White-Box Testing Techniques I
Axiomatic Verification I
Black-Box Testing Techniques III
Boolean logic Taken from notes by Dr. Neil Moore
Black-Box Testing Techniques II
Prepared by Stephen M. Thebaut, Ph.D. University of Florida
Black-Box Testing Techniques II
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Black-Box Testing Techniques II Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 5

Cause-Effect Analysis Cause-Effect Analysis is a combinatorial approach that can be viewed as a logical extension of partition testing. It extends the idea of partitioning a multi-dimensional input space by providing a systematic means for generating test case templates to cover different combinations of input “Causes” resulting in output “Effects.”

Causes and Effects A CAUSE may be thought of as a distinct input condition, or an “equivalence class” of input conditions. An EFFECT may be thought of as a distinct output condition or change in program state.

Causes and Effects Causes and Effects are represented as Boolean variables. The logical relationships among them CAN (but need not) be represented as one or more Boolean graphs. Л  V  CausesEffects

C-E Analysis Process Steps 1.Identify Causes and Effects –The most critical and usually the most difficult step –Choose an appropriate level of abstraction. –Divide and conquer as necessary. –Effects may or may not be mutually exclusive.

C-E Analysis Process Steps (cont’d) 2.Deduce Logical Relationships and Constraints –Relationships take the form of conditionals and utilize the logical operators AND, OR, and NOT. –Constraints describe relationships among Causes that allow for the identification of impossible combinations.

C-E Analysis Process Steps (cont’d) 2.Deduce Logical Relationships and Constraints (cont’d) –Boolean graphs provide a convenient and economical way to visualize relationships and constraints.

C-E Analysis Process Steps (cont’d) 3.Identify an appropriate Test Case Selection Strategy –Determines the number and nature of Cause-combinations to be considered. –Strategies can be designed to meet a variety of coverage requirements/ cost constraints.

C-E Analysis Process Steps (cont’d) 4.Construct a Test Case Coverage Matrix –Typically involves tracing through the Cause-Effect relationships to identify combinations of Causes resulting in each Effect according to the selection strategy chosen. –This can be extremely tedious...

Question… To what extent do you think CASE support might be applicable to each step in the process? For which steps do you think it might be most important?

Illustration of Step 1 (Identify Causes and Effects) The first input is a yes/no response to the question “Do you reside within the city?” The second input is gross pay for the year in question. A non-resident will pay 1% of the gross pay in city tax. Residents pay on the following scale: - If gross pay is no more than $30,000, the tax is 1%. - If gross pay is more than $30,000, but no more than $50,000, the tax is 5%. - If gross pay is more than $50,000, the tax is 15%.

Guidelines for identifying Causes and Effects Underline words or phrases in the specification that correspond to input/output conditions or changes in state. List each Cause and Effect. Assign a unique number to each (use different number ranges to differentiate Causes from Effects).

Guidelines for identifying Causes and Effects (cont’d) The first input is a yes/no response to the question “Do you reside within the city?” The second input is gross pay for the year in question. A non-resident will pay 1% of the gross pay in city tax. Residents pay on the following scale: - If gross pay is no more than $30,000, the tax is 1%. - If gross pay is more than $30,000, but no more than $50,000, the tax is 5%. - If gross pay is more than $50,000, the tax is 15%.

Illustration of Step 1 (cont’d) Ignoring, again, the unspecified responses to “invalid” inputs, we have: Causes: Effects: (1) Non-Resident (11) 1% tax (2) Resident (12) 5% tax (3) $0  Gross Pay  $30K (13) 15% tax (4) $30K  Gross Pay  $50K (5) Gross Pay  $50K

Illustration of Step 2 (Deduce Logical Relationships and Constraints) The first input is a yes/no response to the question “Do you reside within the city?” The second input is gross pay for the year in question. A non-resident will pay 1% of the gross pay in city tax. Residents pay on the following scale: - If gross pay is no more than $30,000, the tax is 1%. - If gross pay is more than $30,000, but no more than $50,000, the tax is 5%. - If gross pay is more than $50,000, the tax is 15%.

What are the constraints? Causes: Effects: (1) Non-Resident (11) 1% tax (2) Resident (12) 5% tax (3) $0  Gross Pay  $30K (13) 15% tax (4) $30K  Gross Pay  $50K (5) Gross Pay  $50K

Constraints deducible from spec, problem domain knowledge, etc. A. [(1) Л ¬(2)] V [¬(1) Л (2)] (i.e., one, and only one of (1) and (2) must be true.) B. [(3) Л ¬(4) Л ¬(5)] V [¬(3) Л (4) Л ¬(5)] V [¬(3) Л ¬(4) Л (5)] C. [(11) Л ¬(12) Л ¬(13)] V [¬(11) Л (12) Л ¬(13)] V [¬(11) Л ¬(12) Л (13)]

What are the logical relationships? The first input is a yes/no response to the question “Do you reside within the city?” The second input is gross pay for the year in question. A non-resident will pay 1% of the gross pay in city tax. Residents pay on the following scale: - If gross pay is no more than $30,000, the tax is 1%. - If gross pay is more than $30,000, but no more than $50,000, the tax is 5%. - If gross pay is more than $50,000, the tax is 15%.

Conditionals deducible from specification and constraints From the specification we have: (1) => (11) [(2) Л (3)] => (11) [(2) Л (4)] => (12) [(2) Л (5)] => (13)

Conditionals deducible from specification and constraints (cont’d) Which, in light of the identified constraints, simplify to: [(1) V (3) => (11) [(2) Л (4)] => (12) [(2) Л (5)] => (13)

Boolean Graph Representation Non-Res (1) (11) 1% tax [0,30K] (3) (30K,50K] (4) (12) 5% tax Res (2) (13) 15% tax >50K (5) Л  V  O O O

Cause/Effect Constraints E O I ExclusiveInclusive One & Only OneRequires A B “at most one” “at least one” A => B “one and only one”

Illustration of Step 3 (Identify Test Case Selection Strategy) Simple (but extreme) strategies: –“All Feasible Combinations of Cause Values” (AFCCV) –“All Effects” (AE) For the relationships depicted in our graph, how many test cases would be required to achieve AFCCV coverage? AE coverage?

AFCCV and AE Coverage Non-Res (1) (11) 1% tax [0,30K] (3) (30K,50K] (4) (12) 5% tax Res (2) (13) 15% tax >50K (5) Л  V  O O O

AFCCV and AE Coverage (cont’d) AFCCV: –There are 2 5 = 32 possible value combinations for all 5 Causes. –For Causes (1) and (2), there are 2 feasible value combination pairs (due to the “one and only one” constraint): TF and FT. (cont’d)

AFCCV and AE Coverage (cont’d) AFCCV: (cont’d) –Similarly, for Causes (3), (4), and (5), there are 3 feasible value combination triples: TFF, FTF, and FFT. –Thus, there are 2 X 3 = 6 feasible combinations of values for all 5 Causes, requiring a total of 6 test cases.

AFCCV and AE Coverage (cont’d) AE: –There are 3 mutually exclusive Effects. –Thus, a different combination of Cause values is required for each Effect to evaluate to True. –Therefore, 3 test cases are required. (cont’d)

AFCCV and AE Coverage (cont’d) AE: (cont’d) –In general, when there are N Effects, N or fewer test cases are required for AE Coverage. –When the N Effects are mutually exclusive, all N test cases are required.

AFCCV and AE Coverage (cont’d) Note that AE is analogous to partitioning an input space based solely on the specified outputs. AFCCV is analogous to associating a separate equivalence class with every (feasible) combination of the individual input classes (i.e., the “brute-force” approach). Question: do these strategies depend on the Cause-Effect relationships?

Another Test Case Selection Strategy… REPEAT Select the next (initially, the first) Effect. Tracing back through the graph (right to left), find all feasible combinations of connected Cause values that result in the Effect being True. For each new such combination found: Determine values of all other Effects, and Enter values for each Cause and Effect in a new column of the test case coverage matrix. UNTIL each Effect has been selected.

What Should We Call this Strategy? How about: All Feasible Combinations of Connected Cause Values that Result in Each Effect being True (AFCCCVREET)?

Applying Strategy #3 Non-Res (1) (11) 1% tax [0,30K] (3) (30K,50K] (4) (12) 5% tax Res (2) (13) 15% tax >50K (5) Л  V  O O O

Applying Strategy #3 Cause Value Combinations for Effect 11: (1) V (3)  1, 3 or 1, 3 or 1, 3 Cause Value Combinations for Effect 12: Cause Value Combinations for Effect 13:

Coverage Matrix TEST CASES CAUSES Non-Resident (1)TTF Resident (2)FFT $0  Gross Pay  $30K (3) TFT $30K  Gross Pay  $50 (4) F  F Gross Pay  $50K (5) F  F EFFECTS 1% tax (11)TTT 5% tax (12)FFF 15% tax (13)FFF  don’t care, subject to Cause constraint B

Applying Strategy #3 Non-Res (1) (11) 1% tax [0,30K] (3) (30K,50K] (4) (12) 5% tax Res (2) (13) 15% tax >50K (5) Л  V  O O O

Applying Strategy #3 Cause Value Combinations for Effect 11: (1) V (3)  1, 3 or 1,  3 or  1, 3 Cause Value Combinations for Effect 12: (4) Л (2)  2, 4 Cause Value Combinations for Effect 13:

Coverage Matrix (cont’d) TEST CASES CAUSES Non-Resident (1)TTFF Resident (2)FFTT $0  Gross Pay  $30K (3) TFTF $30K  Gross Pay  $50K (4) F  FT Gross Pay  $50K (5) F  FF EFFECTS 1% tax (11)TTTF 5% tax (12)FFFT 15% tax (13)FFFF  don’t care, subject to Cause constraint B

Applying Strategy #3 Non-Res (1) (11) 1% tax [0,30K] (3) (30K,50K] (4) (12) 5% tax Res (2) (13) 15% tax >50K (5) Л  V  O O O

Applying Strategy #3 Cause Value Combinations for Effect 11: (1) V (3)  1, 3 or 1,  3 or  1, 3 Cause Value Combinations for Effect 12: (4) Л (2)  2, 4 Cause Value Combinations for Effect 13: (5) Л (2)  2, 5

Coverage Matrix (cont’d) TEST CASES CAUSES Non-Resident (1)TTFFF Resident (2)FFTTT $0  Gross Pay  $30K (3) TFTFF $30K  Gross Pay  $50K (4) F  FTF Gross Pay  $50K (5) F  FFT EFFECTS 1% tax (11)TTTFF 5% tax (12)FFFTF 15% tax (13)FFFFT  don’t care, subject to Cause constraint B

Complete Coverage Matrix TEST CASES CAUSES Non-Resident (1)TTFFF Resident (2)FFTTT $0  Gross Pay  $30K (3) TFTFF $30K  Gross Pay  $50K (4) F  FTF Gross Pay  $50K (5) F  FFT EFFECTS 1% tax (11)TTTFF 5% tax (12)FFFTF 15% tax (13)FFFFT  don’t care, subject to Cause constraint B

Comparing Strategy #3 to AFCCV and AE How does Strategy #3 differ from AFCCV? –For each Effect, only the connected Causes are considered. –It is less conservative: Does not ensure that every feasible combination of Cause values will be covered. And thus does not ensure that every feasible combination of Effect values will be covered. (Relevant when Effects are not mutually exclusive.)

Comparing Strategy #3 to AFCCV and AE How does it differ from AE? –It is more conservative (ALL feasible combinations of connected Cause values must be covered for each Effect).

Coming up in “Black-Box Testing Techniques III”… We step-through another (somewhat more complex) example of Cause-Effect Analysis. Describe a test case design technique for exploring boundary conditions. Consider a test case design strategy based on intuition and experience.

Black-Box Testing Techniques II Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 5