Chapter 3: Equivalence Class Testing :EC Software Testing

Slides:



Advertisements
Similar presentations
Testing “Multiple Conditions” with Decision Table Technique
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)
Chapter 2: Boundary Value Testing : BVT Software Testing
Decision Table Based Testing
Chapter 4: Decision Table Testing Software Testing
Equivalence Class Testing
Chapter 4: Congruent Triangles Lesson 1: Classifying Triangles.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Sample Problems for Testing For “Program” Level Testing: –Triangle –Next Date –Sales Commission For “System” Level Testing: –ATM system –Currency conversion.
Software Testing and Quality Assurance
Equivalence Class Testing, Decision Table Testing
Chapter 5 Retrospective on Functional Testing Software Testing
Equivalence Class Testing
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
 T RIANGLE : A figure formed by three noncollinear points, connected by segments  Since two of the segments create a vertex, a triangle has three vertices.
Testing techniques, example
Com1040 Systems Design and Testing Part II – Testing (Based on A.J. Cowling’s lecture notes) LN-Test3: Equivalence classes and boundary conditions Marian.
Types of Triangle Chapter 3.6 Objective- name the various types of triangles and their parts.
By Asst.Prof.Dr. Wararat Songpan (Rungworawut) Faculty of Computer Science, Department of Science, Khon Kaen University, Thailand 1 Chapter 3: Equivalence.
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.
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
Triangle A polygon with three sides and three angles. A triangle can be names by its’ side lengths and angles. – Side lengths: isosceles, equilateral,
1 Boundary Value Testing Chapter 5. 2 Introduction Input domain testing is the most commonly taught (and perhaps the most commonly used) software testing.
1841f07subdomains2Aug23 Question u What is the main purpose of software testing?
EXAMPLE 1 Standardized Test Practice SOLUTION Let ( x 1, y 1 ) = ( –3, 5) and ( x 2, y 2 ) = ( 4, – 1 ). = (4 – (–3)) 2 + (– 1 – 5) 2 = = 85 (
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)
Equivalence Class Testing In chapter 5, we saw that all four variations of boundary value testing are vulnerable to –gaps of untested functionality, and.
Exploring Angles in a Triangles Chapter 8 Lesson 4 Image Taken from:
The Distance Formula (and mid point). What is to be learned? How to calculate the distance between two points.
Software testing School of Software Engineering, HUST 1.
1 Software Testing & Quality Assurance Lecture 5 Created by: Paulo Alencar Modified by: Frank Xu.
1 Software Testing. 2 Equivalence Class Testing 3 The use of equivalence class testing has two motivations: –Sense of complete testing –Avoid redundancy.
Equivalence Class Testing Use the mathematical concept of partitioning into equivalence classes to generate test cases for Functional (Black-box) testing.
Boundary Value Testing
Cause & Effect Graph Comparison Testing
Software Testing.
Objectives Classify triangles by their angle measures and side lengths. Use triangle classification to find angle measures and side lengths.
Triangles.
Robustness Testing by- (Group 2-Batch F1).
Subject Name: Software Testing Subject Code: 10CS842 Prepared By:
Paul Ammann & Jeff Offutt
Equivalence partitioning
Equivalence partitioning
Domain Testing Functional testing which tests the application by giving inputs and evaluating its appropriate outputs. system does not accept invalid and.
Input Space Partition Testing CS 4501 / 6501 Software Testing
Chapter 5 Retrospective on Functional Testing Software Testing
Overview Functional Testing Boundary Value Testing (BVT)
Table of Contents Date: 10/17 Topic: Classifying Triangles
Applications of the Distance Formula
Equivalence Class Testing
CSCE 747 Software Testing and Quality Assurance
CSCE 747 Software Testing and Quality Assurance
Classifying Triangles
Objective - To classify triangles.
Overview Functional Testing Boundary Value Testing (BVT)
Types of Triangles Thursday, 11 April 2019.
Types of Triangles Thursday, 11 April 2019.
Chapter 1: Boundary Value Testing
Triangles.
Intro to Triangles.
Overview Functional Testing Boundary Value Testing (BVT)
Classifying Triangles
Classifying Triangles
Classifying Triangles
4-1 Classifying Triangles
Overview Functional Testing Boundary Value Testing (BVT)
Area and Perimeter Triangles.
Presentation transcript:

Chapter 3: Equivalence Class Testing :EC 322235 Software Testing By Asst.Prof.Dr. Wararat Songpan (Rungworawut) Department of Computer Science, Faculty of Science, Khon Kaen University, Thailand

Equivalence Class Testing : EC The next step from Boundary Value Testing is a Functional Testing. Define equivalence classes on the range of input or output for each variables also called partition method. Completeness and greatly reduces redundancy.

Equivalence Class Testing : EC Function F is implemented and a function F, of two variables x1 and x2. x1 and x2 have the following boundaries and intervals within boundaries: a=<x1=<d with intervals [a,b), [b,c), [c,d] e=<x2=<g with intervals [e,f), [f,g] So, invalid value for x1 and x2 as follows, x1 < a and x1>d x2 <e and x2>g Remarks: [ = closed interval, ( = open interval

Equivalence Class Testing : EC There are 4 sub-techniques of Equivalence Class Testing. 1) Weak Normal Testing :WN 2) Strong Normal Testing :SN 3) Weak Robust Testing :WR 4) Strong Robust Testing :SR

1) Weak Normal Testing :WN Valid EC: Ec1 = {x1: a=<x1< b} Ec2= {x1: b=<x1< c} Ec3 = {x1: c <= x1 <= d} Ec4 = {x2: e =<x2 < f} Ec5 = {x2: f =< x2 <=g} x2 g f e x1 a b c d One variable from each equivalence class as “single fault assumption” Values identified in systematic way

For example: Addition x1 and x2 (Simple example) Function: Addition X1 and x2 x1 x2 Results = Ok Cancel

Simple example: WN Test case design Valid EC: Ec1 = {x1: 5=<x1< 10} Ec2= {x1: 10=<x1< 15} Ec3 = {x1: 15 <= x1 <= 20} Ec4 = {x2: 5 =<x2 <10} Ec5 = {x2: 10=< x2 <=20} 20 10 5 x1 5 10 15 20 Test case ID EC ID x1 x2 Expected Results WN1 EC1, EC4 5 6 11 WN2 EC2, EC5 12 15 27 WN3 EC3, EC4 17 7 24

2) Strong Normal Testing : SN x2 g f e x1 a b c d Test cases taken from each element of Cartesian product of the equivalence classes. Cartesian product guarantees notion of completeness. SN is a “multiple fault assumption”

Simple example: SN Test case design Valid EC: Ec1 = {x1: 5=<x1< 10} Ec2= {x1: 10=<x1< 15} Ec3 = {x1: 15 <= x1 <= 20} Ec4 = {x2: 5 =<x2 <10} Ec5 = {x2: 10=< x2 <=20} 20 10 5 x1 5 10 15 20 Test case ID EC ID x1 x2 Expected Results SN1 EC1, EC4 5 6 11 SN2 EC1, EC5 7 12 19 SN3 EC2, EC4 10 15 SN4 EC2, EC5 27 SN5 EC3, EC4 17 24 SN6 EC3, EC5 30

3) Weak Robust Testing (WR) x2 Additional consider in Invalid EC: Ec6 = {x1: x1 < a} Ec7 = {x1: x1 > d} Ec8 = {x2 : x2 < e} Ec9 = {x2 : x2 > g} g f e x1 a b c d Robust - consideration of invalid values and extension to WN. Invalid inputs – each test case has one invalid value, single fault should cause failure as “single fault assumption”. Problems with robust EC Testing specification (expected output for invalid TC?)

Simple example: WR Test case design Test case ID EC ID x1 x2 Expected Results WR1 EC1, EC4 5 6 11 WR2 EC2, EC5 12 15 27 WR3 EC3, EC4 17 7 24 WR4 EC6, EC4 4 8 X1 is out of range WR5 EC7, EC4 23 WR6 EC3, EC8 18 X2 is out of range WR7 EC3, EC9

4) Strong Robust Testing :SR x2 g f e x1 a b c d Robust - consideration of invalid values and extension to SN. Strong – multiple faults assumption. Test cases taken from each element of Cartesian product of the Valid EC and Invalid EC

Triangle Program (Simple) Input 3 integers: a, b, c are side of triangle that have boundaries a, b, c are [1,200]. Output is type of triangle Equilateral Isosceles Scalene Not a Triangle

WN Test case design Triangle Program (Simple) Valid EC EC1: 1<=a<= 200 EC2: 1<=b<=200 EC3: 1<=c<=200 Test Case EC ID a b c Expected Results WN1 EC1,2,3 10 20 30 Scalene

SN Test case design Triangle Program (Simple) Valid EC EC1: 1<=a< 200 EC2: 1<=b<=200 EC3: 1<=c<=200 Test Case EC a b c Expected Results SN1 EC1,2,3 10 20 30 Scalene

Equivalence Class : Triangle Problem (Output) Using output from specification translate into Equivalence Class (EC) 4 possible outputs: Equilateral, Isosceles, Scalene, and Not a Triangle 4 output equivalence classes: Ec1 = {<a,b,c> : the triangle with sides a, b and c is equilateral} Ec2 = {<a,b,c> : the triangle with sides a, b and c is Isosceles} Ec3 = {<a,b,c> : the triangle with sides a, b and c is Scalene) } Ec4 = {<a,b,c> : the triangle with sides a, b and c is Not a Triangle}

Weak Normal(WN)/ Strong Normal(SN) Test Cases: Triangle Program Test Case ID EC a b c Expected Results OWN1 EC1 5 Equilateral OWN2 EC2 2 3 Isosceles OWN3 EC3 4 Scalene OWN4 EC4 1 Not a Triangle

Weak Robust(WR) Test Cases: Triangle Program Consideration Invalid EC with WN EC5: a> 200 EC6: a < 1 EC7: b>200 EC8: b < 1 EC9: c>200 EC10: c<1

Weak Robust(WR) Test Cases: Triangle Program Test Case ID EC a b c Expected Results WN1 …WN4 WR1 EC6 -1 5 a not in range WR2 EC8 b not in range WR3 EC10 c not in range WR4 EC5 201 WR5 EC7 WR6 EC9

Strong Robust(SR) Test Cases: Triangle Program Expected Results WN1 …WN4 SR1 -1 5 a not in range SR2 b not in range SR3 c not in range SR4 a, b not in range SR5 b, c not in range SR6 a, c not in range SR7 a, b, c not in range

Improved EC: Triangle Program Improved EC Input classes for each type of triangle: EC1 = {<a, b, c>: a=b=c} EC2 = {<a, b, c>: a=b, a ≠ c} EC3 = {<a, b, c>: a=c, a ≠ b} EC4 = {<a, b, c>: b=c, a ≠ b} EC5 = {<a, b, c>: a ≠ b, a ≠ c, b ≠ c } Extra design of input classes: Check every side of triangle as not a triangle EC6 = {<a, b, c>: b + c <= a} EC7 = {<a, b, c>: a + c <= b} EC8 = {<a, b, c>: a + b <= c}

Equivalence Classes(EC) : NextDate Problem Valid EC M1 = {month: 1 =< month =<12} D1 = {day: 1 =< day =< 31} Y1 = {year: 1812 =< year =< 2012} Invalid EC M2 = {month: month <1} M3 = {month: month >12} D2 = {day: day <1} D3 = {day: day >31} Y2 = {year: year < 1812} Y3 = {year: year > 2012}

Weak Normal and Strong Normal Test Cases: NextDate Problem Month Day Year Expected Results WN1, SN1 6 15 1912 6/16/1912

Weak Robust Test Cases: The NextDate Problem Test Case ID Month Day Year Expected Results WN1 6 15 1912 6/16/1912 WR1 -1 Month not in range 1…12 WR2 13 WR3 Day not in range 1…31 WR4 32 WR5 1811 Year not in range 1812…2012 WR6 2013

Strong Robust Test Cases: The NextDate Problem Month Day Year Expected Results WN1 6 15 1912 6/16/1912 SR1 -1 month not in range 1…12 SR2 day not in range 1…31 SR3 1811 year not in range 1812…2012 SR4 SR5 SR6 SR7

Improved Input Equivalence Classes: NextDate Problem M1 = {month: month has 30 days} M2 = {month: month has 31 days} M3 = {month: month = February} D1 = {day: 1 =< day =< 28} D2 = {day: day = 29} D3 = {day: day = 30} D4 = {day: day = 31} Y1 = {year: year is leap year} Y2 = {year: year is common year }

Input Equivalence Class: The Commission Problem Valid EC L1 = {lock: 1 =< locks =< 70} S1 = {stocks: 1=< stocks =< 80} B1 = {barrels: 1 =< barrels =< 90} Invalid EC L2 = {locks: locks <1} L3 = {locks: locks > 70} S2 = {stocks: stocks < 1} S3 = {stocks: stocks > 80} B2 = {barrels: barrels <1} B3 = {barrels: barrels >90}

Strong Robust Test Cases: Commission Problem Test Case ID Locks Stocks Barrels Expected Results SR1 5 50 SR2 -1 40 45 Locks not in range 1…70 SR3 35 Stocks not in range 1…80 SR4 Barrels not in range 1…90 SR5 SR6 SR7 SR8

Using output to Equivalence Classes Test Cases: Commission Problem Sales = 45 * locks +30 * stocks + 25 * barrels S1 = {<locks, stocks, barrels>: sales =<1000} S2 = {<locks, stocks, barrels>: 1000 < sales =<1800} S3 = {<locks, stocks, barrels>: sales > 1800 } How to design WN Test Case?? Test Case ID Locks Stocks Barrels Sales Commission (Expected Results) OWN1 5 500 50 OWN2 15 1500 175 OWN3 25 2500 360

Specification of Commission Sales = 45*Locks + 30*Stock + 25*barrels if sales <= 1000 commission = 10% * sales if sales > 1000 commission = 10%*1000 + 15%*(sales – 1000) if sales > 1800 commission = 10%*1000+ 15%*800+ 20%* (sales-1800)

Summary of EC Testing Normal vs Robust Normal (Valid) Robust (Valid +Invalid) Weak Normal Testing Strong Normal Testing Weak Robust Testing Strong Robust Testing Single fault vs Multiple fault assumption Single fault (1 EC) Multiple fault (1 EC+) Weak Normal Testing Weak Robust Testing Strong Normal Testing Strong Robust Testing