SlideShare a Scribd company logo
UNIT 3
INTRODUCTION
A requirement specification can be informal, rigorous, formal, or a mix of these three
approaches.
The more formal the specification, the higher are the chances of automating the test
generation process.
The following figure shows variety of test generation techniques
6/10/2017 1Abhimanyu Mishra(CSE)
6/10/2017 2Abhimanyu Mishra(CSE)
6/10/2017 3Abhimanyu Mishra(CSE)
Often, high level designs are also considered as a part of specification
Requirements serve as a source for the identification of a input domain of the application to be
developed
A variety of test generation techniques are available to select a subset of the input domain to serve as
test set against which the application will be tested
6/10/2017 4Abhimanyu Mishra(CSE)
THE TEST SELECTION PROBLEM
Let D denote the input domain of program p, the test selection problem is to select a subset of tests such
that execution of p against each element of T will reveal all errors in p.
In general, there does not exist any algorithm, to construct such a test. However, there are heuristics and
model based methods that can be used to generate tests that will reveal certain type of faults.
The challenge is to construct a test set T subset of D that will reveal as many errors in p as possible.
Test selection is primarily difficult because of the size and complexity of the input domain of p.
In most practical problems, the input domain is large, that it has many elements, and often complex, that
is the elements are of different types such as integers, strings, real, Boolean and structure
The large size of the input domain prevents testers from exhaustively testing the program under test
against all possible inputs
The complexity makes it harder to select individual tests
6/10/2017 5Abhimanyu Mishra(CSE)
EQUIVALENCE PARTITIONING
Test selection using equivalence partitioning allows a tester to subdivide the input domain into relatively
small number of sub-domains, say N>1 refer fig(a) , which are disjoint, each subset is known as an
equivalence class.
.
6/10/2017 6Abhimanyu Mishra(CSE)
The equivalence classes are created assuming that the program under test exhibits the same
behavior on all elements that is tests, within a class.
One test is selected from each equivalence class
When the equivalence classes created by two tester’s are identical, tests generated are different.
Fault targeted
The entire set of inputs can be divided into at least two subsets
One containing all expected(E) or legal inputs
Other containing all unexpected(u) or illegal inputs
E and u are further divided into subsets
6/10/2017 7Abhimanyu Mishra(CSE)
Example:
Consider an application A that takes an integer denoted by ‘age’ as input, legal values of ‘age’
are in the range [1,
2, 3 ,.........., 120]
Set of input vales is now divided into E and u. E=[1, 2,....., 120] u= the rest.
Furthermore, E is subdivided into [1, 2, ....., 61] and [162, 163, ......,120]
According to
According to
requirement R1
requirement R2
Invalid inputs below 1 and above 120 are to be treated differently leading to subdivision of u
into two categories.
Test selected using equivalence partitioning technique aims at targeting faults in A w.r.t inputs
in any of the four regions.
.
6/10/2017 8Abhimanyu Mishra(CSE)
Relations And Equivalence Partitioning
A relation is a set of n-ary-tuples
Example: a method add List that returns the sum of elements in a list of integers defines a
binary relation.
Each pair in the relation consists of a list and an integer that denotes the sum of all elements
in the list. Example: ((1,5), 6) and ((-3,14,3), 14)
The relation computed by add List is defined as follows:
Add List: LZ
where, L is a set of all lists of integers and Z is set of integers.
Suppose hat add List has an error (empty list) then, add List: L U{error}
Relations that help a tester partition the input domain of a program are usually of the kind=
R:IàI , where input domain
Below example shows a few ways to define equivalence classes based on the knowledge of
requirements and the program text.
Example: the word count method takes a word w and a filename f as input and returns the
number of occurrences of w in the text contained in the file name f.
If no file with name ‘f’ exists, an exception is raised.
6/10/2017 9Abhimanyu Mishra(CSE)
begin
string w, f;
input (w, f);
if(!exists(f))[raise exception; return(0)};
if (length(w)==0){return(0)};
return(getcount(w, f));
end
using the partitioning method, we obtain the following eg:classes
E1: consists of pairs(w, f) where w is a string and f denotes a file that exists.
E2: consists of pairs (w, f) where w is a string and f denotes a file that does not exists.
6/10/2017 10Abhimanyu Mishra(CSE)
Eq.class w f
E1 non-null Exists, non empty
E2 non-null Does not exist
E3 non-null Exists, empty
E4 null Exists, non empty
E5 null Does not exist
E6 null Exists, empty
6/10/2017 11Abhimanyu Mishra(CSE)
So we note that the number of eq. Classes without any knowledge of program code is 2, whereas that
with the knowledge of partial code is 6.
Equivalence classes based on program output Quest 1: does the program ever generate a 0?
Quest 2: what are the max and min possible values of the output? These two questions lead to
following eq. Classes
E1: output value v is 0
E2: output value v is, the max. Possible E3: output value v is, the min. Possible E4: All other output
values
6/10/2017 12Abhimanyu Mishra(CSE)
Equivalence Classes For Variables
Table (a) and (b) offer guidelines for partitioning variables into equivalence classes based on
their type.
6/10/2017 13Abhimanyu Mishra(CSE)
Compound data types – any input data value that has more than one independent
attribute is a compound type. While generating equivalence classes for such inputs,
one must consider legal and illegal values for each component of the structure.
Unidimensional versus Multi-Dimensional Partitioning
Unidimensional partitioning (commonly used)
•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
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
6/10/2017 14Abhimanyu Mishra(CSE)
GUI Design And Equivalence Classes
While designing equivalence classes for programs that obtain input exclusively from a
keyboard, one must account for the possibility of errors in data entry.
For example, the requirement for an application. The application places a constraint on an
input variable X such that it can assume integral values in the range 0..4. However, testing
must account for the possibility that a user may inadvertently enter a value for X that is out of
range.
Suppose that all data entry to the application is via a GUI front end. Suppose also that the
GUI offers exactly five correct choices to the user for X. In such a situation it is impossible to
test the application with a value of X that is out of range. Hence only the correct values of X
will be input.
begins with a review plan agreed upon by all members of the team.
Advantages:
6/10/2017 15Abhimanyu Mishra(CSE)
6/10/2017 16Abhimanyu Mishra(CSE)
BOUNDARY VALUE ANALYSIS
•BVA is a test selection technique that targets faults in applications at the boundaries of equivalence
classes.
•While equivalence partitioning selects tests from within equivalence classes, boundary-value analysis
focuses on tests at and near the boundaries of equivalence classes.
•Certainly, tests derived using either of the two techniques may overlap.
•Once the input domain has been identified, test selection using boundary value analysis proceeds as
follows:
Partition the input domain using one-dimensional partitioning:
This leads to as many partitions as there are input variables. Alternately, a single partition of an input
domain can be created using multidimensional partitioning.
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
6/10/2017 17Abhimanyu Mishra(CSE)
CATEGORY PARTITION METHOD
•Category partition method is a systematic approach to the generation of tests from requirements.
•The method consists of mix of manual and automated steps.
•Below fig shows the steps in the generation of tests using the category-partition method.
•Tasks in solid boxes are performed manually and generally difficult to automate.
•Dashed boxes indicate tasks that can be automated.
6/10/2017 18Abhimanyu Mishra(CSE)
6/10/2017 19Abhimanyu Mishra(CSE)
Step 1: analyze specification
Here the tester identifies each functional unit that can be tested separately.
Step 2: identify categories
For each testable unit, the given specification is analysed and the inputs isolated.
Next e determine characteristics (or a category )of each parameter and environmental object.
Step 3: partition categories
For each category, the tester determine different cases against which the functional unit must be
tested. àEach case is also referred to as a choice.
6/10/2017 20Abhimanyu Mishra(CSE)
Step 4: identify constraints
A constraint is specified using a property list and selector expression. Property lit has the following form:
[property p1,p2....]
where, property is the keyword and p1, p2... names of individual properties. A selector expression take one
of the following forms.
[if p]
[if p and p2 and...]
Ex for special properties- [error] , [single]
Step 5: (Re) write test specification
Tester now writes a complete test specification.
The specification is written in a test specification language (TSL) conforming to a precise syntax.
Step 6: process specification
TSL specification written in step 5 is processed by an automatic test-frame generator. This results in a
number of test frames.

More Related Content

What's hot

Test design techniques
Test design techniquesTest design techniques
Test design techniques
Oksana
 
Introduction to specification based test design techniques
Introduction to specification based test design techniquesIntroduction to specification based test design techniques
Introduction to specification based test design techniques
Yogindernath Gupta
 

What's hot (20)

Control Flow Testing
Control Flow TestingControl Flow Testing
Control Flow Testing
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
 
50120140502017
5012014050201750120140502017
50120140502017
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
10 software testing_technique
10 software testing_technique10 software testing_technique
10 software testing_technique
 
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
A PRACTITIONER'S GUIDE TO SOFTWARE TEST DESIGN [Summary]
 
Test case techniques
Test case techniquesTest case techniques
Test case techniques
 
Dynamic analysis in Software Testing
Dynamic analysis in Software TestingDynamic analysis in Software Testing
Dynamic analysis in Software Testing
 
Unit 2 unit testing
Unit 2   unit testingUnit 2   unit testing
Unit 2 unit testing
 
Fundamental Test Design Techniques
Fundamental Test Design TechniquesFundamental Test Design Techniques
Fundamental Test Design Techniques
 
White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR Chandigarh
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Black & White Box testing
Black & White Box testingBlack & White Box testing
Black & White Box testing
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and Junit
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
ISTQB Advanced Study Guide - 5
ISTQB Advanced Study Guide - 5ISTQB Advanced Study Guide - 5
ISTQB Advanced Study Guide - 5
 
Boundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioningBoundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioning
 
Test design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniquesTest design techniques: Structured and Experienced-based techniques
Test design techniques: Structured and Experienced-based techniques
 
Introduction to specification based test design techniques
Introduction to specification based test design techniquesIntroduction to specification based test design techniques
Introduction to specification based test design techniques
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
 

Similar to Sta unit 3(abimanyu)

Unit testing
Unit testingUnit testing
Unit testing
medsherb
 
12 functional-system-testing
12 functional-system-testing12 functional-system-testing
12 functional-system-testing
nickynicks76
 
Aco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suiteAco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suite
IAEME Publication
 
Aco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suiteAco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suite
IAEME Publication
 
Aco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suiteAco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suite
IAEME Publication
 
Software testing
Software testingSoftware testing
Software testing
Bala Ganesh
 
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESSTHE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
VESIT/University of Mumbai
 

Similar to Sta unit 3(abimanyu) (20)

Coding and testing In Software Engineering
Coding and testing In Software EngineeringCoding and testing In Software Engineering
Coding and testing In Software Engineering
 
SWE-6 TESTING.pptx
SWE-6 TESTING.pptxSWE-6 TESTING.pptx
SWE-6 TESTING.pptx
 
Unit testing
Unit testingUnit testing
Unit testing
 
12 functional-system-testing
12 functional-system-testing12 functional-system-testing
12 functional-system-testing
 
Testers Desk Presentation
Testers Desk PresentationTesters Desk Presentation
Testers Desk Presentation
 
SE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptxSE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptx
 
Software testing strategy
Software testing strategySoftware testing strategy
Software testing strategy
 
Aco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suiteAco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suite
 
Aco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suiteAco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suite
 
Aco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suiteAco based solution for tsp model for evaluation of software test suite
Aco based solution for tsp model for evaluation of software test suite
 
Paper 06
Paper 06Paper 06
Paper 06
 
Pesttt testing
Pesttt testingPesttt testing
Pesttt testing
 
EXPERIMENTAL EVALUATION AND RESULT DISCUSSION OF METAMORPHIC TESTING AUTOMATI...
EXPERIMENTAL EVALUATION AND RESULT DISCUSSION OF METAMORPHIC TESTING AUTOMATI...EXPERIMENTAL EVALUATION AND RESULT DISCUSSION OF METAMORPHIC TESTING AUTOMATI...
EXPERIMENTAL EVALUATION AND RESULT DISCUSSION OF METAMORPHIC TESTING AUTOMATI...
 
ANALYSING QUALITY OF ENGLISH-HINDI MACHINE TRANSLATION ENGINE OUTPUTS USING B...
ANALYSING QUALITY OF ENGLISH-HINDI MACHINE TRANSLATION ENGINE OUTPUTS USING B...ANALYSING QUALITY OF ENGLISH-HINDI MACHINE TRANSLATION ENGINE OUTPUTS USING B...
ANALYSING QUALITY OF ENGLISH-HINDI MACHINE TRANSLATION ENGINE OUTPUTS USING B...
 
Software testing
Software testingSoftware testing
Software testing
 
DEFECT PREDICTION USING ORDER STATISTICS
DEFECT PREDICTION USING ORDER STATISTICSDEFECT PREDICTION USING ORDER STATISTICS
DEFECT PREDICTION USING ORDER STATISTICS
 
AN ENVIRONMENT FOR NON-DUPLICATE TEST GENERATION FOR WEB BASED APPLICATION
AN ENVIRONMENT FOR NON-DUPLICATE TEST GENERATION FOR WEB BASED APPLICATIONAN ENVIRONMENT FOR NON-DUPLICATE TEST GENERATION FOR WEB BASED APPLICATION
AN ENVIRONMENT FOR NON-DUPLICATE TEST GENERATION FOR WEB BASED APPLICATION
 
AUTOCODECOVERGEN: PROTOTYPE OF DATA DRIVEN UNIT TEST GENRATION TOOL THAT GUAR...
AUTOCODECOVERGEN: PROTOTYPE OF DATA DRIVEN UNIT TEST GENRATION TOOL THAT GUAR...AUTOCODECOVERGEN: PROTOTYPE OF DATA DRIVEN UNIT TEST GENRATION TOOL THAT GUAR...
AUTOCODECOVERGEN: PROTOTYPE OF DATA DRIVEN UNIT TEST GENRATION TOOL THAT GUAR...
 
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESSTHE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
THE APPLICATION OF CAUSE EFFECT GRAPH FOR THE COLLEGE PLACEMENT PROCESS
 
Da35573574
Da35573574Da35573574
Da35573574
 

More from Abhimanyu Mishra

More from Abhimanyu Mishra (17)

Cd unit i
Cd unit iCd unit i
Cd unit i
 
Presentation1(JIT gnomio)
Presentation1(JIT gnomio)Presentation1(JIT gnomio)
Presentation1(JIT gnomio)
 
Daa unit 5
Daa unit 5Daa unit 5
Daa unit 5
 
Daa unit 4
Daa unit 4Daa unit 4
Daa unit 4
 
Daa unit 3
Daa unit 3Daa unit 3
Daa unit 3
 
Daa unit 2
Daa unit 2Daa unit 2
Daa unit 2
 
Daa unit 1
Daa unit 1Daa unit 1
Daa unit 1
 
Software Engineering unit 5
Software Engineering unit 5Software Engineering unit 5
Software Engineering unit 5
 
Software Engineering unit 4
Software Engineering unit 4Software Engineering unit 4
Software Engineering unit 4
 
Software Engineering unit 3
Software Engineering unit 3Software Engineering unit 3
Software Engineering unit 3
 
Software Engineering unit 2
Software Engineering unit 2Software Engineering unit 2
Software Engineering unit 2
 
Software Engineering Unit 1
Software Engineering Unit 1Software Engineering Unit 1
Software Engineering Unit 1
 
Theory of Automata and formal languages Unit 5
Theory of Automata and formal languages Unit 5Theory of Automata and formal languages Unit 5
Theory of Automata and formal languages Unit 5
 
Theory of automata and formal languages Unit 4
Theory of automata and formal languages Unit 4Theory of automata and formal languages Unit 4
Theory of automata and formal languages Unit 4
 
Theory of Automata and formal languages Unit 3
Theory of Automata and formal languages Unit 3Theory of Automata and formal languages Unit 3
Theory of Automata and formal languages Unit 3
 
Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2
 
Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1
 

Recently uploaded

Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
Kamal Acharya
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
AbrahamGadissa
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
Antenna efficency lecture course chapter 3.pdf
Antenna  efficency lecture course chapter 3.pdfAntenna  efficency lecture course chapter 3.pdf
Antenna efficency lecture course chapter 3.pdf
AbrahamGadissa
 

Recently uploaded (20)

Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientist
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
Antenna efficency lecture course chapter 3.pdf
Antenna  efficency lecture course chapter 3.pdfAntenna  efficency lecture course chapter 3.pdf
Antenna efficency lecture course chapter 3.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptxCloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
Cloud-Computing_CSE311_Computer-Networking CSE GUB BD - Shahidul.pptx
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Kraków
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturing
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
 

Sta unit 3(abimanyu)

  • 1. UNIT 3 INTRODUCTION A requirement specification can be informal, rigorous, formal, or a mix of these three approaches. The more formal the specification, the higher are the chances of automating the test generation process. The following figure shows variety of test generation techniques 6/10/2017 1Abhimanyu Mishra(CSE)
  • 3. 6/10/2017 3Abhimanyu Mishra(CSE) Often, high level designs are also considered as a part of specification Requirements serve as a source for the identification of a input domain of the application to be developed A variety of test generation techniques are available to select a subset of the input domain to serve as test set against which the application will be tested
  • 4. 6/10/2017 4Abhimanyu Mishra(CSE) THE TEST SELECTION PROBLEM Let D denote the input domain of program p, the test selection problem is to select a subset of tests such that execution of p against each element of T will reveal all errors in p. In general, there does not exist any algorithm, to construct such a test. However, there are heuristics and model based methods that can be used to generate tests that will reveal certain type of faults. The challenge is to construct a test set T subset of D that will reveal as many errors in p as possible. Test selection is primarily difficult because of the size and complexity of the input domain of p. In most practical problems, the input domain is large, that it has many elements, and often complex, that is the elements are of different types such as integers, strings, real, Boolean and structure The large size of the input domain prevents testers from exhaustively testing the program under test against all possible inputs The complexity makes it harder to select individual tests
  • 5. 6/10/2017 5Abhimanyu Mishra(CSE) EQUIVALENCE PARTITIONING Test selection using equivalence partitioning allows a tester to subdivide the input domain into relatively small number of sub-domains, say N>1 refer fig(a) , which are disjoint, each subset is known as an equivalence class. .
  • 6. 6/10/2017 6Abhimanyu Mishra(CSE) The equivalence classes are created assuming that the program under test exhibits the same behavior on all elements that is tests, within a class. One test is selected from each equivalence class When the equivalence classes created by two tester’s are identical, tests generated are different. Fault targeted The entire set of inputs can be divided into at least two subsets One containing all expected(E) or legal inputs Other containing all unexpected(u) or illegal inputs E and u are further divided into subsets
  • 7. 6/10/2017 7Abhimanyu Mishra(CSE) Example: Consider an application A that takes an integer denoted by ‘age’ as input, legal values of ‘age’ are in the range [1, 2, 3 ,.........., 120] Set of input vales is now divided into E and u. E=[1, 2,....., 120] u= the rest. Furthermore, E is subdivided into [1, 2, ....., 61] and [162, 163, ......,120] According to According to requirement R1 requirement R2 Invalid inputs below 1 and above 120 are to be treated differently leading to subdivision of u into two categories. Test selected using equivalence partitioning technique aims at targeting faults in A w.r.t inputs in any of the four regions. .
  • 8. 6/10/2017 8Abhimanyu Mishra(CSE) Relations And Equivalence Partitioning A relation is a set of n-ary-tuples Example: a method add List that returns the sum of elements in a list of integers defines a binary relation. Each pair in the relation consists of a list and an integer that denotes the sum of all elements in the list. Example: ((1,5), 6) and ((-3,14,3), 14) The relation computed by add List is defined as follows: Add List: LZ where, L is a set of all lists of integers and Z is set of integers. Suppose hat add List has an error (empty list) then, add List: L U{error} Relations that help a tester partition the input domain of a program are usually of the kind= R:IàI , where input domain Below example shows a few ways to define equivalence classes based on the knowledge of requirements and the program text. Example: the word count method takes a word w and a filename f as input and returns the number of occurrences of w in the text contained in the file name f. If no file with name ‘f’ exists, an exception is raised.
  • 9. 6/10/2017 9Abhimanyu Mishra(CSE) begin string w, f; input (w, f); if(!exists(f))[raise exception; return(0)}; if (length(w)==0){return(0)}; return(getcount(w, f)); end using the partitioning method, we obtain the following eg:classes E1: consists of pairs(w, f) where w is a string and f denotes a file that exists. E2: consists of pairs (w, f) where w is a string and f denotes a file that does not exists.
  • 10. 6/10/2017 10Abhimanyu Mishra(CSE) Eq.class w f E1 non-null Exists, non empty E2 non-null Does not exist E3 non-null Exists, empty E4 null Exists, non empty E5 null Does not exist E6 null Exists, empty
  • 11. 6/10/2017 11Abhimanyu Mishra(CSE) So we note that the number of eq. Classes without any knowledge of program code is 2, whereas that with the knowledge of partial code is 6. Equivalence classes based on program output Quest 1: does the program ever generate a 0? Quest 2: what are the max and min possible values of the output? These two questions lead to following eq. Classes E1: output value v is 0 E2: output value v is, the max. Possible E3: output value v is, the min. Possible E4: All other output values
  • 12. 6/10/2017 12Abhimanyu Mishra(CSE) Equivalence Classes For Variables Table (a) and (b) offer guidelines for partitioning variables into equivalence classes based on their type.
  • 13. 6/10/2017 13Abhimanyu Mishra(CSE) Compound data types – any input data value that has more than one independent attribute is a compound type. While generating equivalence classes for such inputs, one must consider legal and illegal values for each component of the structure. Unidimensional versus Multi-Dimensional Partitioning Unidimensional partitioning (commonly used) •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 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
  • 14. 6/10/2017 14Abhimanyu Mishra(CSE) GUI Design And Equivalence Classes While designing equivalence classes for programs that obtain input exclusively from a keyboard, one must account for the possibility of errors in data entry. For example, the requirement for an application. The application places a constraint on an input variable X such that it can assume integral values in the range 0..4. However, testing must account for the possibility that a user may inadvertently enter a value for X that is out of range. Suppose that all data entry to the application is via a GUI front end. Suppose also that the GUI offers exactly five correct choices to the user for X. In such a situation it is impossible to test the application with a value of X that is out of range. Hence only the correct values of X will be input. begins with a review plan agreed upon by all members of the team. Advantages:
  • 16. 6/10/2017 16Abhimanyu Mishra(CSE) BOUNDARY VALUE ANALYSIS •BVA is a test selection technique that targets faults in applications at the boundaries of equivalence classes. •While equivalence partitioning selects tests from within equivalence classes, boundary-value analysis focuses on tests at and near the boundaries of equivalence classes. •Certainly, tests derived using either of the two techniques may overlap. •Once the input domain has been identified, test selection using boundary value analysis proceeds as follows: Partition the input domain using one-dimensional partitioning: This leads to as many partitions as there are input variables. Alternately, a single partition of an input domain can be created using multidimensional partitioning. 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
  • 17. 6/10/2017 17Abhimanyu Mishra(CSE) CATEGORY PARTITION METHOD •Category partition method is a systematic approach to the generation of tests from requirements. •The method consists of mix of manual and automated steps. •Below fig shows the steps in the generation of tests using the category-partition method. •Tasks in solid boxes are performed manually and generally difficult to automate. •Dashed boxes indicate tasks that can be automated.
  • 19. 6/10/2017 19Abhimanyu Mishra(CSE) Step 1: analyze specification Here the tester identifies each functional unit that can be tested separately. Step 2: identify categories For each testable unit, the given specification is analysed and the inputs isolated. Next e determine characteristics (or a category )of each parameter and environmental object. Step 3: partition categories For each category, the tester determine different cases against which the functional unit must be tested. àEach case is also referred to as a choice.
  • 20. 6/10/2017 20Abhimanyu Mishra(CSE) Step 4: identify constraints A constraint is specified using a property list and selector expression. Property lit has the following form: [property p1,p2....] where, property is the keyword and p1, p2... names of individual properties. A selector expression take one of the following forms. [if p] [if p and p2 and...] Ex for special properties- [error] , [single] Step 5: (Re) write test specification Tester now writes a complete test specification. The specification is written in a test specification language (TSL) conforming to a precise syntax. Step 6: process specification TSL specification written in step 5 is processed by an automatic test-frame generator. This results in a number of test frames.