Equivalence Class Testing Use the mathematical concept of partitioning into equivalence classes to generate test cases for Functional (Black-box) testing.

Slides:



Advertisements
Similar presentations
Equivalence Relations
Advertisements

Forms of Equivalence Class Testing Normal • only equivalence classes are valid and invalid input values • emphasis is on "single failures" • works.
Overview Functional Testing Boundary Value Testing (BVT)
Further Pure 1 Matrices Introduction. Definitions A matrix is just a rectangle of numbers. It’s a bit like a two-way table. You meet this concept in D1.
Decision Table Based Testing
Domain Restriction on Relation domain restriction operator,, restricts a relation to only those members whose domain is in a specified set. domain restriction.
Testing and Test Case Development A “primitive” method of testing, with NO test preparation, may include the following steps : – Initiate the system –
Equivalence Class Testing
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
The Engineering Design of Systems: Models and Methods
Boundary Value Testing A type of “Black box” functional testing –The program is viewed as a mathematical “function” –The program takes inputs and maps.
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.
Linear Transformations
1/55 EF 507 QUANTITATIVE METHODS FOR ECONOMICS AND FINANCE FALL 2008 Chapter 10 Hypothesis Testing.
Software Testing and Quality Assurance
Chapter 5 Retrospective on Functional Testing Software Testing
Path testing Path testing is a “design structural testing” in that it is based on detailed design & the source code of the program to be tested. The methodology.
Equivalence Class 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.
Com1040 Systems Design and Testing Part II – Testing (Based on A.J. Cowling’s lecture notes) LN-Test3: Equivalence classes and boundary conditions Marian.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Black-Box Testing Techniques I Software Testing Lecture 4.
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
By Asst.Prof.Dr. Wararat Songpan (Rungworawut) Faculty of Computer Science, Department of Science, Khon Kaen University, Thailand 1 Chapter 3: Equivalence.
A General Discussion on Functional (Black-box) Testing What are some of the concerns of testers ? –Have we got enough time to test (effort & schedule)?
Black-Box Testing Techniques I
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Sample Problems for Testing
1 Equivalence Class Testing Chapter 6. 2 Introduction Boundary Value Testing derives test cases with Massive redundancy Serious gaps Equivalence Class.
Summarizing “Structural” Testing Now that we have learned to create test cases through both: – a) Functional (blackbox)and – b) Structural (whitebox) testing.
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
Software testing techniques Spring 2009 Csci565: Theory and Practice of Software Testing1.
1 Input Space Partitioning(2). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 4  Section 4.1  Section
Overview Functional Testing Boundary Value Testing (BVT)
GUI testing There are two major sets of GUI testing 1.“Usability” of the GUI Looks (aesthetic, visual appeal) artistic characteristic –Color –Shapes.
Equivalence Class Testing In chapter 5, we saw that all four variations of boundary value testing are vulnerable to –gaps of untested functionality, and.
Data Analysis for Testing In order to test a program or system, it usually requires : –Starting the system (program) –Inputting some data –Let it execute.
1 Software Testing & Quality Assurance Lecture 5 Created by: Paulo Alencar Modified by: Frank Xu.
Theory and Practice of Software Testing Chapter 14 Presman Software Testing Tactics BLACK BOX TESTING.
1 Equivalence relations Binary relations: –Let S1 and S2 be two sets, and R be a (binary relation) from S1 to S2 –Not every x in S1 and y in S2 have such.
Boundary Value Testing 1.A type of “Black box” functional testing –The program is viewed as a mathematical “function” –The program takes inputs and maps.
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.
Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and B = {a,b} {( 0, a), (
Boundary Value Testing
Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation is a relation on.
Functional testing, Equivalence class testing
Chapter 3: Equivalence Class Testing :EC Software Testing
Subject Name: Software Testing Subject Code: 10CS842 Prepared By:
Software Testing Structural testing 1.
Properties of Triangles
Decision Table Testing
Input Space Partition Testing CS 4501 / 6501 Software Testing
RELATION KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS )
Chapter 5 Retrospective on Functional Testing Software Testing
Overview Functional Testing Boundary Value Testing (BVT)
Identify type of triangle
Equivalence Class Testing
Equivalence Relations
CSCE 747 Software Testing and Quality Assurance
CSCE 747 Software Testing and Quality Assurance
Review To check an argument with a tree:.
Mathematical Background 1
Mathematical Background 1
Overview Functional Testing Boundary Value Testing (BVT)
Equivalence Relations
Triangles.
Overview Functional Testing Boundary Value Testing (BVT)
Presentation transcript:

Equivalence Class Testing Use the mathematical concept of partitioning into equivalence classes to generate test cases for Functional (Black-box) testing The key goals for equivalence class testing are similar to partitioning: 1. completeness of test coverage 2. lessen duplication of test coverage

Partitioning Recall a partitioning of a set, A, is to divide the set A into ( a1, a2, , an ) subsets such that: – a1 U a2 U U an = A (completeness) – for any i and j, ai ∩ aj = Ø (no duplication) Partitioning of a Set A of rocks with no relational meaning Partitioning of a Set A of rocks with relational meaning ( with respect to “size”) Size > 10” Size ≤ 10”

Equivalence Classes Equivalence Relation, R, is a relation defined on the set A such that it is reflexive, transitive, and symmetric: let € to mean an “element of” –Reflexive: z€A, then (z,z) € R –Symmetric: (a,b) € R then (b,a) € R, for all a,b in A –Transitive : (p,q) € R and (q,r) € R, then (p,r) € R for all p,q,r in A Equivalence class testing is the partitioning of the (often times, but not always) input variable’s value set into classes (subsets) using some equivalence relation. Try the above conditions with R defined as “=“

Equivalence Class Test Cases Consider a numerical input variable, i, whose values may range from -200 through Then a possible partitioning of testing input variable, i, by 4 partitions may be: – -200 to -100 – -101 to 0 – 1 to 100 – 101 to 200 Define “same sign” as the equivalence relation, R, defined over the input variable’s value set, i = { ,0, - -, +200}. Then one partitioning will be: – -200 to -1 (negative sign) – 0 (no sign) – 1 to 200 (positive sign) Let’s check if “same sign” relation, SS, is an equivalence relation: (let ‘ε’ be “element of”) – reflexive : -2 ε Input Variable then (-2, -2) ε SS – symmetric : (3, 5) ε SS, then (5, 3) ε SS – transitive: (-5, -7) ε SS and (-7, -200) ε SS, then (-5, -200) ε SS A sample equivalence test case “set” from the above “same sign” relation would be { -5; 0; 8 } where -5 is negative sign, 0 is no sign, 8 is positive sign

Weak Normal Equivalence testing 1.Assumes the ‘single fault’ or “independence of input variables.” –e.g. If there are 2 input variables, these input variables are independent of each other. 2.Partition the test cases of each input variable separately into one of the different equivalent classes. 3.Choose the test case from each of the equivalence classes for each input variable independently of the other input variable

Example of : Weak Normal Equivalence testing Assume the equivalence partitioning of input X is: 1 to 10; 11 to 20, 21 to 30 and the equivalence partitioning of input Y is: 1 to 5; 6 to 10; 11 to15; and 16 to 20 X Y We have covered everyone of the 3 equivalence classes for input X. We have covered each of the 4 equivalence classes for input Y. General rule for # of test cases? What do you think? # of partitions of the largest set? For ( x, y ) we have: (24, 2) (15, 8 ) ( 4, 13) (23, 17)

Strong Normal Equivalence testing This is the same as the weak normal equivalence testing except for “multiple fault assumption” or “dependence among the inputs” All the combinations of equivalence classes of the variables must be included.

Example of : Strong Normal Equivalence testing Assume the equivalence partitioning of input X is: 1 to 10; 11 to 20, 21 to 30 and the equivalence partitioning of input Y is: 1 to 5; 6 to 10; 11;15; and 16 to 20 X Y We have covered everyone of the 3 x 4 Cartesian product of equivalence classes General rule for # of test cases? What do you think?

Weak Robust Equivalence testing Up to now we have only considered partitioning the valid input space. “Weak robust” is similar to “weak normal” equivalence test except that the invalid input variables are now considered. A note about considering invalid input is that there may not be any definition “specified” for the various, different invalid inputs making definition of the output for these invalid inputs a bit difficult at times. (but fertile ground for testing)

Example of : Weak Robust Equivalence testing Assume the equivalence partitioning of input X is 1 to 10; 11 to 20, 21 to 30 and the equivalence partitioning of input Y is 1 to 5; 6 to 10; 11;15; and 16 to 20 X Y We have covered everyone of the 5 equivalence classes for input X. We have covered each of the 6 equivalence classes for input Y.

Strong Robust Equivalence testing Does not assume “single fault” assumes dependency of input variables “Strong robust” is similar to “strong normal” equivalence test except that the invalid input variables are now considered.

Example of : Strong Robust Equivalence testing Assume the equivalence partitioning of input X is: 1 to 10; 11 to 20, 21 to 30 and the equivalence partitioning of input Y is: 1 to 5; 6 to 10; 11;15; and 16 to 20 X Y We have covered everyone of the 5 x 6 Cartesian product of equivalence classes (including invalid inputs)

Equivalence class Definition Note that the examples so far focused on defining input variables without considering the output variables. For the earlier “triangle problem,” we are interested in 4 questions: –Is it a triangle? –Is it an isosceles? –Is it a scalene? –Is it an equilateral? We may define the input test data by defining the equivalence class through “viewing” the 4 output groups: –input sides do not form a triangle –input sides form an isosceles triangle –input sides form a scalene triangle –input sides form an equilateral triangle

Consider: Weak Normal Equivalence Test Cases to cover “Triangle” Problem Output “valid” inputs: 1<= a <= 200 1<= b <= 200 1<= c <= 200 and for triangle: a < b + c b < a + c c < b + a output Not triangle Equilateral Isosceles Scalene inputs a bc Not Triangle Equilateral Scalene Isosceles Valid Inputs to get:

Strong Normal Equivalence Test Cases for Triangle Problem Since there is no further sub-intervals inside the valid inputs for the 3 sides a, b, and c, and the 4 outputs are “independent,” Strong Normal Equivalence is the same as the Weak Normal Equivalence for covering the outputs because the outputs are “independent” –You may want to look at Equilateral as the super set of Isosceles. But for this discussion, let’s consider them separate sets.

Weak Robust Equivalence Test Cases for Triangle Problem Not Triangle Equilateral Scalene Isosceles Valid outputs Now, on top of the earlier 4 normal test cases, include the “invalid” inputs Include 6 invalid test case in addition to Weak Normal above: below:

Strong Robust Equivalence Test Cases for Triangle Problem Similar to Weak robust, but all combinations of “invalid” inputs must be included for the Strong Robust. Look at the “cube” figure and consider the corners (two diagonal ones) a) Consider one of the corners : there are a total of 2 3 combinatoric of valid-invalid but only (2 3 – 1) = 7 cases of “invalids” (50, 50, 50) valid b) There will be 7 more “invalids” when we consider the other corner, :

Next Day Program example Here we have 3 input variables and may choose to have the sets defined as (without partitioning of days, month, or year): –Day : 1 through 31 days –Month: 1 through 12 –Year: 0001 through 3000 In this case, for weak normal equivalence testing only needs 1 test case from each input: – (year; month; day) : (2001, 9, 23) Clearly, this “non-partitioning” of the input gives very limited test case!

Next Day Program example (cont.) A more useful situation is to partition the 3 inputs. As an example: –Day: 1 through 28 –Day :29 –Day: 30 –Day: 31 –Month: those that have 31 days or {1,3,5,7,8,10,12} –Month: those that have 30 days or {4,6,9,11} –Month: that has less than 30 days or {2} –Year: leap years between 0001 and 3000 –Year: non-leap years between 0001 and partitions of days 3 partitions of months 2 partitions of years

Next Day Problem example (cont.) Weak Normal equivalence Test Cases: Number of test cases is driven by the # of partitions of the largest set, which in this case is the Days – has 4 partitions: (year, month, day): –(leap year, 10, 8) –(leap year, 4, 30) –(non-leap year, 2, 31) –(non-leap year, 7, 29) How good is this set of test cases ?? How valuable is the “generic” Weak Normal test Cases? --- Not Much! Without considering any relationship among the inputs and just mechanically following the rule

Next Day Problem example (cont.) What about the Strong Normal case where we consider all the permutations of the previously partitioned 3 inputs? – We should have (2 years x 3 months x 4 days) = 24 test cases (leap year, 10, 5) (non-leap year, 10, 5) (leap year, 10, 30) (non-leap year, 10, 30) (leap year, 10, 31) (non-leap year, 10, 31) (leap year, 10, 29) (non-leap year, 10, 29) (leap year, 6, 5) (non-leap year, 6, 5) (leap year, 6, 30) (non-leap year, 6, 30) (leap year, 6, 31) (non-leap year, 6, 31) (leap year, 6,29) (non-leap year, 6, 29) (leap year, 2, 5) (non-leap year, 2, 5) (leap year, 2, 30) (non-leap year, 2, 30) (leap year, 2, 31) (non-leap year, 2, 31) (leap year, 2, 29) (non-leap year, 2, 29) A little better than previous?

Next Day Problem example (cont.) What if we also consider the invalids, Weak Robust? – 31 < days; days < 1 – 12 < months; months < 1 – 3000 < year ; year < 0001 Then we need to include the following to the Weak Normal : ( valid year, 5, 45) ( valid year, 5, -5) ( valid year, 22, 30) combine ( 3500, 22, 45) ( valid year, 0, 15) into ( 0000, 0, -5) ( 3500, 7, 20 ) ( 0000, 7, 15) Would you combine or leave them separately? Why?

Next Day Problem example (cont.) For Strong Robust, we need to consider and include all the permutations of the invalids to the Strong Normal: 3 inputs, so there are 2 3 – 1=7 invalids each for high and for low, making a total of 14 more. high low – ( 3025, 45, 80) ( 0000, -2, 0) – ( 3025, 45, 25) ( 0000, -2, 15) – ( 3025, 7, 80) ( 0000, 4, 0) – ( 3025, 7, 25) ( 0000, 4, 10) – ( 2000, 45, 80) ( 2000, -2, 0) – ( 2000, 45, 25) ( 2000, -2, 10) – ( 2000, 7, 80) ( 2000, 4, 0)