1 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Requirements-based Test Generation for Functional Testing W. Eric Wong Department of.

Slides:



Advertisements
Similar presentations
Test Case Design Methodologies (Black-box methods)
Advertisements

Overview Functional Testing Boundary Value Testing (BVT)
1 EE5900 Advanced Embedded System For Smart Infrastructure Advanced Theory.
Foundations of Software Testing Chapter 2: Test Generation: Requirements Last update: September 3, 2007 These slides are copyrighted. They are for use.
Ossi Taipale, Lappeenranta University of Technology
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Copyright © Cengage Learning. All rights reserved.
Black box testing  Black box tests focus on the input/output behavior of the component  Black-box tests do not deal with the internal aspects of the.
Informatics 43 – May 5, Restatement of goals Want to verify software’s correctness  Need to test  Need to decide on test cases  No set of test.
Software Testing and Quality Assurance
Chapter 18 Testing Conventional Applications
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Chapter 13 & 14 Software Testing Strategies and Techniques
Equivalence Class Testing
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 9 Functional Testing
Black Box Software Testing
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Domain testing Tor Stålhane. Domain testing revisited We have earlier looked at domain testing as a simple strategy for selecting test cases. We will.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Black-Box Testing Techniques I Software Testing Lecture 4.
Chapter 13: Implementation Phase 13.3 Good Programming Practice 13.6 Module Test Case Selection 13.7 Black-Box Module-Testing Techniques 13.8 Glass-Box.
Course Outline Traditional Static Program Analysis –Theory –Classic analysis and applications Points-to analysis, CHA, RTA –The Soot analysis framework.
Ch6: Software Verification. 1 Decision table based testing  Applicability:  Spec. is described by a decision table.  Tables describe:  How combinations.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Requirements-based Test Generation for Functional Testing (© 2012 Professor W. Eric Wong, The University of Texas at Dallas) 1 W. Eric Wong Department.
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
Black-Box Testing Techniques I
Software testing techniques Software testing techniques Equivalence partitioning Presentation on the seminar Kaunas University of Technology.
CS451 – Software Testing Technologies Blackbox Testing Equivalence Partitioning.
INF 111 / CSE 121: Software Tools and Methods Lecture Notes for Fall Quarter, 2007 Michele Rousseau Set 12 (Some slides adapted from Sommerville 2000 &
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Software Testing and validation SQA - SWE 434
Test Drivers and Stubs More Unit Testing Test Drivers and Stubs CEN 5076 Class 11 – 11/14.
Black-box Testing.
White Box-based Coverage Testing (© 2012 Professor W. Eric Wong, The University of Texas at Dallas) 111 W. Eric Wong Department of Computer Science The.
Software Testing Input Space Partition Testing. 2 Input Space Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Use cases.
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
Copyright © Cengage Learning. All rights reserved.
Mutation Testing G. Rothermel. Fault-Based Testing White-box and black-box testing techniques use coverage of code or requirements as a “proxy” for designing.
1.1 Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises.
Equivalence Class Testing In chapter 5, we saw that all four variations of boundary value testing are vulnerable to –gaps of untested functionality, and.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
Testing Data Structures Tao Xie Visiting Professor, Peking University Associate Professor, North Carolina State University
Condition Testing. Condition testing is a test case design method that exercises the logical conditions contained in a program module. A simple condition.
Theory and Practice of Software Testing Chapter 14 Presman Software Testing Tactics BLACK BOX TESTING.
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
1 Software Testing. 2 Equivalence Class Testing 3 The use of equivalence class testing has two motivations: –Sense of complete testing –Avoid redundancy.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Black Box Testing Software Quality Engineering.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
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.
Dynamic Black-Box Testing Part 1 What is dynamic black-box testing? How to reduce the number of test cases using: Equivalence partitioning Boundary value.
Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
1 Sections 7.2 – 7.7 Nested Control Statements Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Testing Data Structures
Functional testing, Equivalence class testing
Equivalence partitioning
Equivalence partitioning
Input Space Partition Testing CS 4501 / 6501 Software Testing
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 10 – Software Testing
Sudipto Ghosh CS 406 Fall 99 November 16, 1999
Laboratory of Advanced Research on Software Technology
Institute of Computing Tech.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

1 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Requirements-based Test Generation for Functional Testing W. Eric Wong Department of Computer Science University of Texas at Dallas

2 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Functional Testing  Testing a program/sub-program to determine whether it functions as planned  A black-box based testing against the operational (i.e., functional) requirements.  Testing the advertised features for correct operation  Verifying a program for its conformance to all functional specifications  Entailing the following tasks –Test generation –Test execution –Test assessment

3 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Two Techniques for Test Generation  Equivalence Class partitioning  Boundary value analysis Essential black-box techniques for generating tests for functional testing.

4 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Equivalence Class Partitioning

5 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Example I  Consider an application that takes an integer as input.  Let us suppose that the only legal values are in the range [1..100].  Which input value(s) will you use to test this application?

6 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Example I (cont’d)  The set of input values can be divided into –A set of expected, or legal, inputs (E) containing all integers in the range [1..100] –A set of unexpected, or illegal, inputs U containing the remaining integers All integers E: [1..100] U: Other integers

7 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Example I (cont’d)  Assume that the application is required to process all values in the range [1..50] in accordance with requirement R 1 and those in the range [ ] according to requirement R 2. –E is divided into two regions depending on the expected behavior.  Also assume that all invalid inputs less than 1 are to be treated in one way while all greater than 100 are to be treated differently. –This leads to a subdivision of U into two categories. All integers [ ] [1..50] <1 >100

8 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Example I (cont’d)  How many input values should we use for testing the application ?

9 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Equivalence Partitioning  Test selection using equivalence partitioning allows a tester to divide the input domain into a relatively small number of sub- domains as shown in (a).  The sub-domains are disjoint.  Each subset is known as an equivalence class.  The four subsets shown in (a) constitute a partition of the input domain while the subsets in (b) are not.

10 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Quiz  What if there is more than one input variable ?

11 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Unidimensional Partitioning  One way to partition the input domain is to consider one input variable at a time. Thus each input variable leads to a partition of the input domain.  We refer to this style of partitioning as unidimensional equivalence partitioning or simply unidimensional partitioning.  This type of partitioning is commonly used.

12 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Multidimensional Partitioning  Another way is to consider the input domain I as the set product of the input variables and define a relation on I. This procedure creates one partition consisting of several equivalence classes.  We refer to this method as multidimensional equivalence partitioning or simply multidimensional partitioning.

13 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Example II  Consider an application that requires two integer inputs x and y. Each of these inputs is expected to lie in the following ranges: 3  x  7 and 5  y  9.  How many pairs of (x, y) should we use to test this application ?

14 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Example II (cont’d)  Using Unidimensional Partitioning y ignored. E1: x<3 E2: 3  x  7 E3: x>7 E4: y<5 E5: 5  y  9 E6: y>9 x ignored.

15 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Example II (cont’d)  Using Multidimensional Partitioning E1: x<3, y<5 E2: x<3, 5  y  9 E3: x 9 E4: 3  x  7, y<5 E5: 3  x  7, 5  y  9 E6: 3  x  7, y>9 E7: x>7, y<5 E8: x>7, 5  y  9 E9: x>7, y>9

16 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Program Behavior and Equivalence Classes  The equivalence classes are created assuming that the program behaves the same on all elements (i.e., tests) within a class.  This assumption allows the tester to select exactly one test case from each equivalence class to test the program.  Is this assumption correct ?  If yes, Why ?  If no, how to improve the test set ?

17 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Boundary Value Analysis

18 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Errors at the Boundaries  Experience indicates that programmers make mistakes in processing values at and near the boundaries of equivalence classes.  For example, suppose that method M is required to compute a function f 1 when x  0 is true and function f 2 otherwise. Also assume that f 1 (0) ≠ f 2 (0)  However, M has an error due to which it computes f 1 for x <0 and f 2 otherwise.  Obviously, this fault can be revealed when M is tested against x = 0, but not if the input test set is, for example, {-4, 7} derived using equivalence partitioning.  In this example, the value x=0, lies at the boundary of the equivalence classes x  0 and x>0.

19 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Equivalence Partitioning & Boundary Value Analysis  While equivalence partitioning selects tests from within equivalence classes, boundary value analysis focuses on tests at and near the boundaries of equivalence classes. –Boundary value analysis is a test selection technique that targets faults in applications at the boundaries of equivalence classes.  Certainly, tests derived using either of the two techniques may overlap.

20 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Boundary Value Analysis (BVA): Procedures  Partition the input domain using unidimensional partitioning. Alternately, a single partition of an input domain can be created using multidimensional partitioning. We will generate several sub- domains in this step.  Identify the boundaries for each partition. Boundaries may also be identified using special relationships among the inputs.  Select test data such that each boundary value occurs in at least one test input.

21 © 2011 Professor W. Eric Wong, The University of Texas at Dallas BVA Example: Step 1 – Create Equivalence Classes  Assuming that a program takes two variables as input: code must be in the range and quantity in the range –Equivalence classes for code  E1: values less than 99  E2: values in the range  E3: values greater than 999 –Equivalence classes for quantity  E4: values less than 1  E5: values in the range  E6: values greater than 100

22 © 2011 Professor W. Eric Wong, The University of Texas at Dallas BVA Example: Step 2 – Identify Boundaries  Boundaries are indicated with an x. E E1 E3 x x ** * * E E4 E6 x x *** *

23 © 2011 Professor W. Eric Wong, The University of Texas at Dallas BVA Example: Step 3 – Construct Test Set  Test selection based on the boundary value analysis technique requires that tests must include, for each variable, values at and around the boundary.  Quiz: unidimensional partitioning versus multidimensional partitioning T={ t 1 : (code=98, quantity=0), t 2 : (code=99, quantity=1), t 3 : (code=100, quantity=2), t 4 : (code=998, quantity=99), t 5 : (code=999, quantity=100), t 6 : (code=1000, quantity=101) } Illegal values of code and quantity included

24 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Equivalence Class Partitioning versus Statement Coverage

25 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Example: Identify the Type of a Triangle (1)  A program P takes an input of three integers a, b and c, and returns the type of the triangle corresponding to three sides of length a, b, and c, respectively.  Quiz: –How to generate a test set based on Equivalence Class Partitioning to achieve the highest statement coverage possible?

26 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Example: Identify the Type of a Triangle (2) Question: What is the statement coverage of your test set?

27 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Boundary Value Analysis Versus Decision Coverage

28 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Complement between BVA and Decision Coverage  Test cases generated based on Boundary Value Analysis improve decision coverage.  Similarly, test cases that achieve high decision coverage also cover some boundary values.  Examples –If (x ≤ 0) {…..}  BVA: {x 1 = 0; x 2 = 1; x 3 = –1}  Together, x 1, x 2 and x 3 give 100% decision coverage. –If (y = 3) {…..}  {y 1 = 3 and y 2 = a value different from 3} gives 100% decision coverage.  At least one of the boundary value (y = 3) is covered.

29 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Contact Information  Professor Eric Wong – –Phone:  Mr. Vidroha Debroy – –Phone: 

30 © 2011 Professor W. Eric Wong, The University of Texas at Dallas

31 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Questions ?