SlideShare a Scribd company logo
1 of 20
UNIT 4
STRUCTURAL TESTING
Testing can reveal a fault only when execution of the faulty element causes a failure
Control flow testing criteria are defined for particular classes of elements by requiring the execution of all such
elements of the program
Control flow elements include statements, branches, conditions and paths.
A set of correct program executions in which all control flow elements are exercised does not guarantee the
absence of faults
Execution of a faulty statement may not always result in a failure
Control flow testing complements functional testing by including cases that may not be identified from
specifications alone
Test suites satisfying control flow adequacy criteria would fail in revealing faults that can be caught with
functional criteria
Example – missing path faults
Control flow testing criteria are used to evaluate the thoroughness of test suites derived from functional
testing criteria by identifying elements of the programs6/10/2017 1Abhimanyu Mishra(CSE)
6/10/2017 2Abhimanyu Mishra(CSE)
The C function cgi decode, which translates a cgi-encoded string to a plain ASCII string (reversing the
encoding applied by the common gateway interface of most web servers).
6/10/2017 3Abhimanyu Mishra(CSE)
STATEMENT TESTING
•Statements are nothing but the nodes of the control flow graph.
•Statement adequacy criterion:
Let T be a test suite for a program P. T satisfies the statement adequacy criterion for P, if, for each statement S of
P, there exists at least one test case in T that causes the execution of S.
This is equivalent to stating that every node in the control flow graph model of the program 1 is visited by some
execution path exercised by a test case in T.
•Statement coverage:
The statement coverage C statement of T for P is the fraction of statements of program P executed by at least one
test case in T
6/10/2017 4Abhimanyu Mishra(CSE)
T satisfies the statements adequacy criterion if C statement = 1
•Basic block coverage:
•Nodes in a control flow graph often represent basic blocks rather than individual statements, and so some
standards refers to basic coverage or node coverage
6/10/2017 5Abhimanyu Mishra(CSE)
6/10/2017 6Abhimanyu Mishra(CSE)
BRANCH TESTING
•A test suite can achieve complete statement coverage without executing all the possible branches in a program.
· Consider, for example, a faulty program obtained from program by removing line 41.
· The control flow graph of program .
•In the new program there are no statements following the false branch exiting node
6/10/2017 7Abhimanyu Mishra(CSE)
CONDITION TESTING
•Branch coverage is useful for exercising faults in the way a computation has been decomposed into cases.
Condition coverage considers this decomposition in more detail, forcing exploration not only of both possible
results of a boolean expression controlling a branch, but also of different combinations of the individual
conditions in a compound boolean expression.
•Condition adequacy criteria overcome this problem by requiring different basic conditions of the decisions
to be separately exercised.
•Basic condition adequacy criterion:
• requires each basic condition to be covered
A test suite T for a program P covers all basic conditions of P, i.e. it satisfies the basic condition adequacy
criterion, if each basic condition in P has a true outcome in at least one test case in T and a false outcome in at
least one test in T
6/10/2017 8Abhimanyu Mishra(CSE)
Branch and condition adequacy criterion:
A test suite satisfies the branch and condition adequacy criterion if it satisfies both the branch adequacy criterion and
the condition adequacy criterion.
A more complete extension that includes both the basic condition and the branch adequacy criteria is the compound
condition adequacy criterion, which requires a test for each possible combination of basic conditions
6/10/2017 9Abhimanyu Mishra(CSE)
6/10/2017 10Abhimanyu Mishra(CSE)
Consider the number of cases required for compound condition coverage of the following two Boolean
expressions, each with five basic conditions. For the expression a && b && c && d && e, compound
condition coverage requires:
6/10/2017 11Abhimanyu Mishra(CSE)
PATH TESTING
•Path adequacy criterion:
A test suite T for a program P satisfies the path adequacy criterion if, for each path p of P there exists at least one
test case in T that causes the execution of p.
This is equivalent to stating that every path in the CFG model of prog p is exercised by a test case in T
•Path coverage:
The path coverage ℎ of T for P is the fraction of path of program P executed by at least one test case in T
Practical path coverage criteria
.
6/10/2017 12Abhimanyu Mishra(CSE)
The no. of paths in a program with loops is unbounded, so the previously defined criterion cannot be
satisfied for these programs. For program with loops, the denominator in the computation of path
coverage is infinite, thus the path coverage becomes zero
To obtain a practical criterion, it is necessary to partition the infinite set of path into a finite number of
classes and require only that representatives from each class be explored.
Useful criteria can be obtained by
Limiting the no. of paths to be covered i.e.(no. of traversals of loops)
Limiting the length of the paths to be traversed
Limiting the dependencies among selected paths
Boundary interior criterion groups together paths that differ only in the sub-path they follow when repeating the
body of a loop.
Fig below shows deriving a tree from CFG to derive sub-paths for boundary/interior testing
Is the CFG of come C function
Is a tree derived from (a) by following each path in the CFG up to the first repeated node. The set of paths
from the root of the tree to each leaf is the required set of sub-paths for boundary/interior coverage
6/10/2017 13Abhimanyu Mishra(CSE)
6/10/2017 14Abhimanyu Mishra(CSE)
Limitations of boundary interior adequacy
If (a) {
The sub-path through this control flow can include or
S1;
exclude each of the statements
}
If (b) {
Si, so that in total N branches result in 2 paths that must be
S2;
traversed
}
If (c) {
S3;
choosing input data to force execution of one particular path
}
may be very difficult, or even impossible if the condition
are not independent
If (X){
6/10/2017 15Abhimanyu Mishra(CSE)
•Loop boundary adequacy criterion: it is a variant of boundary/interior criterion that treats loop boundaries
similarly but is less stringent w.r.t. other differences among paths
A test suite T for a program P satisfies the loop boundary adequacy criterion, if, for each loop l in P.
In at least one execution, control reaches the loop, and then the loop control condition evaluated to False at
the first time it is evaluated.
In at least one execution, control reaches the loop, and then the body of the loop is executed exactly once
before control leaves the loop.
In at least one execution, the body of the loop is repeated more than once.
•Linear code sequence and a jump(LCSAJ) adequacy
LCSAJ is defined as a body of code through which the flow of control may proceed sequentially terminated
by a jump in the control flow.
statement coverage
branch coverage
coverage of n consecutive LCSAJs
6/10/2017 16Abhimanyu Mishra(CSE)
•Cyclomatic testing:
Cyclomatic number is the number of independent paths in the CFG
•A path is representable as a bit vector, where each component of the vector represents an edge.
“Dependence” is ordinary linear dependence b/w (bit) vectors
If e=number of edges,
n=number of nodes,
c=number of connected components of a graph, then,
cyclomatic number = e – n + c for any arbitrary graph e – n + 2 for a CFG
Cyclomatic testing does not require that any particular basis set is covered. Rather it counts the
number of independent paths that have actually been covered, and the coverage criterion is
satisfied when this count reaches the cyclomatic complexity of the code under test.
6/10/2017 17Abhimanyu Mishra(CSE)
6/10/2017 18Abhimanyu Mishra(CSE)
6/10/2017 19Abhimanyu Mishra(CSE)
PROCEDURE CALL TESTING
The criteria considered to this point measure coverage of control flow within individual procedures.
They are not well suited to integration testing or system testing.
Moreover, if unit testing has been effective, then faults that remain to be found in integration testing will be
primarily interface faults, and testing effort should focus on interfaces between units rather than their internal
details.
In some programming languages (FORTRAN, for example), a single procedure may have multiple entry
points, and one would want to test invocation through each of the entry points.
More common are procedures with multiple exit points.
Exercising all the entry points of a procedure is not the same as exercising all the calls
Commonly available testing tools can measure coverage of entry and exit points.
Coverage of calls requires exercising each statement in which the parser and scanner access the symbol table,
but this would almost certainly be satisfied by a set of test cases exercising each production in the grammar
accepted by the parser.
In object-oriented programming, local state is manipulated by procedures called methods, and systematic
testing necessarily concerns sequences of method calls on the same object.
6/10/2017 20Abhimanyu Mishra(CSE)
COMPARING STRUCTURAL TESTING CRITERIA

More Related Content

What's hot

Control Flow Testing
Control Flow TestingControl Flow Testing
Control Flow TestingHirra Sultan
 
Test case techniques
Test case techniquesTest case techniques
Test case techniquesPina Parmar
 
Dynamic analysis in Software Testing
Dynamic analysis in Software TestingDynamic analysis in Software Testing
Dynamic analysis in Software TestingSagar Pednekar
 
ISTQB Advanced Study Guide - 5
ISTQB Advanced Study Guide - 5ISTQB Advanced Study Guide - 5
ISTQB Advanced Study Guide - 5Yogindernath Gupta
 
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 ChandigarhPankaj Thakur
 
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]Khizra Sammad
 
Fundamental Test Design Techniques
Fundamental Test Design TechniquesFundamental Test Design Techniques
Fundamental Test Design TechniquesTechWell
 
Test design techniques
Test design techniquesTest design techniques
Test design techniquesOksana
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitAmr E. Mohamed
 
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 techniquesYogindernath Gupta
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing TechniquesKiran Kumar
 
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 techniquesKhuong Nguyen
 
Software testing
Software testingSoftware testing
Software testingBala Ganesh
 
Ijarcet vol-2-issue-4-1291-1297
Ijarcet vol-2-issue-4-1291-1297Ijarcet vol-2-issue-4-1291-1297
Ijarcet vol-2-issue-4-1291-1297Editor IJARCET
 

What's hot (20)

Control Flow Testing
Control Flow TestingControl Flow Testing
Control Flow Testing
 
10 software testing_technique
10 software testing_technique10 software testing_technique
10 software testing_technique
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
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
 
50120140502017
5012014050201750120140502017
50120140502017
 
Unit 2 unit testing
Unit 2   unit testingUnit 2   unit testing
Unit 2 unit testing
 
ISTQB Advanced Study Guide - 5
ISTQB Advanced Study Guide - 5ISTQB Advanced Study Guide - 5
ISTQB Advanced Study Guide - 5
 
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
 
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]
 
Fundamental Test Design Techniques
Fundamental Test Design TechniquesFundamental Test Design Techniques
Fundamental Test Design Techniques
 
Black & White Box testing
Black & White Box testingBlack & White Box testing
Black & White Box testing
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and Junit
 
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
 
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
 
Software testing
Software testingSoftware testing
Software testing
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Ijarcet vol-2-issue-4-1291-1297
Ijarcet vol-2-issue-4-1291-1297Ijarcet vol-2-issue-4-1291-1297
Ijarcet vol-2-issue-4-1291-1297
 

Similar to Sta unit 4(abimanyu)

White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingAnkit Mulani
 
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...Lionel Briand
 
Code coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspectiveCode coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspectiveEngineering Software Lab
 
Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective   Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective Engineering Software Lab
 
SE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxSE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxPraneethBhai1
 
Software Verification, Validation and Testing
Software Verification, Validation and TestingSoftware Verification, Validation and Testing
Software Verification, Validation and TestingDr Sukhpal Singh Gill
 
Test Case Design
Test Case DesignTest Case Design
Test Case DesignVidya-QA
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and TechniqueFayis-QA
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and TechniqueANKUR-BA
 
Test Case Design & Technique
Test Case Design & TechniqueTest Case Design & Technique
Test Case Design & TechniqueRajesh-QA
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and TechniqueSachin-QA
 
Automating The Process For Building Reliable Software
Automating The Process For Building Reliable SoftwareAutomating The Process For Building Reliable Software
Automating The Process For Building Reliable Softwareguest8861ff
 
Configuration Navigation Analysis Model for Regression Test Case Prioritization
Configuration Navigation Analysis Model for Regression Test Case PrioritizationConfiguration Navigation Analysis Model for Regression Test Case Prioritization
Configuration Navigation Analysis Model for Regression Test Case Prioritizationijsrd.com
 
ScioTalks | Coverage Based Testing
ScioTalks | Coverage Based TestingScioTalks | Coverage Based Testing
ScioTalks | Coverage Based TestingScio Consulting
 
Product Quality: Metrics, Verification, Validation, Testing
Product Quality: Metrics, Verification, Validation, TestingProduct Quality: Metrics, Verification, Validation, Testing
Product Quality: Metrics, Verification, Validation, TestingReem Alattas
 

Similar to Sta unit 4(abimanyu) (20)

White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop Testing
 
Testing
TestingTesting
Testing
 
Ch4-ControlFlowTesting.ppt
Ch4-ControlFlowTesting.pptCh4-ControlFlowTesting.ppt
Ch4-ControlFlowTesting.ppt
 
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
 
Code coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspectiveCode coverage in theory and in practice form the do178 b perspective
Code coverage in theory and in practice form the do178 b perspective
 
Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective   Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective
 
Sta unit 3(abimanyu)
Sta unit 3(abimanyu)Sta unit 3(abimanyu)
Sta unit 3(abimanyu)
 
SE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptxSE UNIT 5 part 2 (1).pptx
SE UNIT 5 part 2 (1).pptx
 
Software Verification, Validation and Testing
Software Verification, Validation and TestingSoftware Verification, Validation and Testing
Software Verification, Validation and Testing
 
Testing
TestingTesting
Testing
 
Test Case Design
Test Case DesignTest Case Design
Test Case Design
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Case Design & Technique
Test Case Design & TechniqueTest Case Design & Technique
Test Case Design & Technique
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Automating The Process For Building Reliable Software
Automating The Process For Building Reliable SoftwareAutomating The Process For Building Reliable Software
Automating The Process For Building Reliable Software
 
Configuration Navigation Analysis Model for Regression Test Case Prioritization
Configuration Navigation Analysis Model for Regression Test Case PrioritizationConfiguration Navigation Analysis Model for Regression Test Case Prioritization
Configuration Navigation Analysis Model for Regression Test Case Prioritization
 
Whitebox
WhiteboxWhitebox
Whitebox
 
ScioTalks | Coverage Based Testing
ScioTalks | Coverage Based TestingScioTalks | Coverage Based Testing
ScioTalks | Coverage Based Testing
 
Product Quality: Metrics, Verification, Validation, Testing
Product Quality: Metrics, Verification, Validation, TestingProduct Quality: Metrics, Verification, Validation, Testing
Product Quality: Metrics, Verification, Validation, Testing
 

More from Abhimanyu Mishra

Software Engineering unit 5
Software Engineering unit 5Software Engineering unit 5
Software Engineering unit 5Abhimanyu Mishra
 
Software Engineering unit 4
Software Engineering unit 4Software Engineering unit 4
Software Engineering unit 4Abhimanyu Mishra
 
Software Engineering unit 3
Software Engineering unit 3Software Engineering unit 3
Software Engineering unit 3Abhimanyu Mishra
 
Software Engineering unit 2
Software Engineering unit 2Software Engineering unit 2
Software Engineering unit 2Abhimanyu Mishra
 
Software Engineering Unit 1
Software Engineering Unit 1Software Engineering Unit 1
Software Engineering Unit 1Abhimanyu Mishra
 
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 5Abhimanyu Mishra
 
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 4Abhimanyu Mishra
 
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 3Abhimanyu Mishra
 
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 2Abhimanyu Mishra
 
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 1Abhimanyu 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

Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 

Recently uploaded (20)

Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 

Sta unit 4(abimanyu)

  • 1. UNIT 4 STRUCTURAL TESTING Testing can reveal a fault only when execution of the faulty element causes a failure Control flow testing criteria are defined for particular classes of elements by requiring the execution of all such elements of the program Control flow elements include statements, branches, conditions and paths. A set of correct program executions in which all control flow elements are exercised does not guarantee the absence of faults Execution of a faulty statement may not always result in a failure Control flow testing complements functional testing by including cases that may not be identified from specifications alone Test suites satisfying control flow adequacy criteria would fail in revealing faults that can be caught with functional criteria Example – missing path faults Control flow testing criteria are used to evaluate the thoroughness of test suites derived from functional testing criteria by identifying elements of the programs6/10/2017 1Abhimanyu Mishra(CSE)
  • 2. 6/10/2017 2Abhimanyu Mishra(CSE) The C function cgi decode, which translates a cgi-encoded string to a plain ASCII string (reversing the encoding applied by the common gateway interface of most web servers).
  • 3. 6/10/2017 3Abhimanyu Mishra(CSE) STATEMENT TESTING •Statements are nothing but the nodes of the control flow graph. •Statement adequacy criterion: Let T be a test suite for a program P. T satisfies the statement adequacy criterion for P, if, for each statement S of P, there exists at least one test case in T that causes the execution of S. This is equivalent to stating that every node in the control flow graph model of the program 1 is visited by some execution path exercised by a test case in T. •Statement coverage: The statement coverage C statement of T for P is the fraction of statements of program P executed by at least one test case in T
  • 4. 6/10/2017 4Abhimanyu Mishra(CSE) T satisfies the statements adequacy criterion if C statement = 1 •Basic block coverage: •Nodes in a control flow graph often represent basic blocks rather than individual statements, and so some standards refers to basic coverage or node coverage
  • 6. 6/10/2017 6Abhimanyu Mishra(CSE) BRANCH TESTING •A test suite can achieve complete statement coverage without executing all the possible branches in a program. · Consider, for example, a faulty program obtained from program by removing line 41. · The control flow graph of program . •In the new program there are no statements following the false branch exiting node
  • 7. 6/10/2017 7Abhimanyu Mishra(CSE) CONDITION TESTING •Branch coverage is useful for exercising faults in the way a computation has been decomposed into cases. Condition coverage considers this decomposition in more detail, forcing exploration not only of both possible results of a boolean expression controlling a branch, but also of different combinations of the individual conditions in a compound boolean expression. •Condition adequacy criteria overcome this problem by requiring different basic conditions of the decisions to be separately exercised. •Basic condition adequacy criterion: • requires each basic condition to be covered A test suite T for a program P covers all basic conditions of P, i.e. it satisfies the basic condition adequacy criterion, if each basic condition in P has a true outcome in at least one test case in T and a false outcome in at least one test in T
  • 8. 6/10/2017 8Abhimanyu Mishra(CSE) Branch and condition adequacy criterion: A test suite satisfies the branch and condition adequacy criterion if it satisfies both the branch adequacy criterion and the condition adequacy criterion. A more complete extension that includes both the basic condition and the branch adequacy criteria is the compound condition adequacy criterion, which requires a test for each possible combination of basic conditions
  • 10. 6/10/2017 10Abhimanyu Mishra(CSE) Consider the number of cases required for compound condition coverage of the following two Boolean expressions, each with five basic conditions. For the expression a && b && c && d && e, compound condition coverage requires:
  • 11. 6/10/2017 11Abhimanyu Mishra(CSE) PATH TESTING •Path adequacy criterion: A test suite T for a program P satisfies the path adequacy criterion if, for each path p of P there exists at least one test case in T that causes the execution of p. This is equivalent to stating that every path in the CFG model of prog p is exercised by a test case in T •Path coverage: The path coverage ℎ of T for P is the fraction of path of program P executed by at least one test case in T Practical path coverage criteria .
  • 12. 6/10/2017 12Abhimanyu Mishra(CSE) The no. of paths in a program with loops is unbounded, so the previously defined criterion cannot be satisfied for these programs. For program with loops, the denominator in the computation of path coverage is infinite, thus the path coverage becomes zero To obtain a practical criterion, it is necessary to partition the infinite set of path into a finite number of classes and require only that representatives from each class be explored. Useful criteria can be obtained by Limiting the no. of paths to be covered i.e.(no. of traversals of loops) Limiting the length of the paths to be traversed Limiting the dependencies among selected paths Boundary interior criterion groups together paths that differ only in the sub-path they follow when repeating the body of a loop. Fig below shows deriving a tree from CFG to derive sub-paths for boundary/interior testing Is the CFG of come C function Is a tree derived from (a) by following each path in the CFG up to the first repeated node. The set of paths from the root of the tree to each leaf is the required set of sub-paths for boundary/interior coverage
  • 14. 6/10/2017 14Abhimanyu Mishra(CSE) Limitations of boundary interior adequacy If (a) { The sub-path through this control flow can include or S1; exclude each of the statements } If (b) { Si, so that in total N branches result in 2 paths that must be S2; traversed } If (c) { S3; choosing input data to force execution of one particular path } may be very difficult, or even impossible if the condition are not independent If (X){
  • 15. 6/10/2017 15Abhimanyu Mishra(CSE) •Loop boundary adequacy criterion: it is a variant of boundary/interior criterion that treats loop boundaries similarly but is less stringent w.r.t. other differences among paths A test suite T for a program P satisfies the loop boundary adequacy criterion, if, for each loop l in P. In at least one execution, control reaches the loop, and then the loop control condition evaluated to False at the first time it is evaluated. In at least one execution, control reaches the loop, and then the body of the loop is executed exactly once before control leaves the loop. In at least one execution, the body of the loop is repeated more than once. •Linear code sequence and a jump(LCSAJ) adequacy LCSAJ is defined as a body of code through which the flow of control may proceed sequentially terminated by a jump in the control flow. statement coverage branch coverage coverage of n consecutive LCSAJs
  • 16. 6/10/2017 16Abhimanyu Mishra(CSE) •Cyclomatic testing: Cyclomatic number is the number of independent paths in the CFG •A path is representable as a bit vector, where each component of the vector represents an edge. “Dependence” is ordinary linear dependence b/w (bit) vectors If e=number of edges, n=number of nodes, c=number of connected components of a graph, then, cyclomatic number = e – n + c for any arbitrary graph e – n + 2 for a CFG Cyclomatic testing does not require that any particular basis set is covered. Rather it counts the number of independent paths that have actually been covered, and the coverage criterion is satisfied when this count reaches the cyclomatic complexity of the code under test.
  • 19. 6/10/2017 19Abhimanyu Mishra(CSE) PROCEDURE CALL TESTING The criteria considered to this point measure coverage of control flow within individual procedures. They are not well suited to integration testing or system testing. Moreover, if unit testing has been effective, then faults that remain to be found in integration testing will be primarily interface faults, and testing effort should focus on interfaces between units rather than their internal details. In some programming languages (FORTRAN, for example), a single procedure may have multiple entry points, and one would want to test invocation through each of the entry points. More common are procedures with multiple exit points. Exercising all the entry points of a procedure is not the same as exercising all the calls Commonly available testing tools can measure coverage of entry and exit points. Coverage of calls requires exercising each statement in which the parser and scanner access the symbol table, but this would almost certainly be satisfied by a set of test cases exercising each production in the grammar accepted by the parser. In object-oriented programming, local state is manipulated by procedures called methods, and systematic testing necessarily concerns sequences of method calls on the same object.
  • 20. 6/10/2017 20Abhimanyu Mishra(CSE) COMPARING STRUCTURAL TESTING CRITERIA