SlideShare a Scribd company logo
Software Engineering Principles
Ajit K Nayak, Ph.D.
ajitnayak@soauniversity.ac.in
Software Testing
Acknowledgements
• Slides of Prof. Rajib Mall, IIT, KGP
Unit Testing
• Black-Box Testing
– Two main approaches to design black box test
cases:
– Equivalence class partitioning
– Boundary value analysis
• White-Box Texting
– Designing white-box test cases:
– requires knowledge about the internal structure of
software.
– white-box testing is also called structural testing.
Equivalence Partitioning
• The input domain data is divided into different equivalence
data classes.
– used to reduce the total number of test cases to a finite set of
testable test cases, still covering maximum requirements.
• Example: an input box accepting numbers from 1 to 1000 then
there is no use in writing thousand test cases for all 1000 valid
input numbers plus other test cases for invalid data.
• test cases can be divided into three sets of input data called as
classes.
– 1) One input data class with all valid inputs. Pick a single value
from range 1 to 1000 as a valid test case. If you select other
values between 1 and 1000 then result is going to be same. So
one test case for valid input data should be sufficient.
– 2) Input data class with all values below lower limit. I.e. any
value below 1, as a invalid input data test case.
– 3) Input data with any value greater than 1000 to represent
third invalid input class.
Boundary Value Analysis
• Complements equivalence partitioning (typically
combined)
• In practice, more errors found at boundaries of
equivalence classes than within the classes
• Divide input domain into equivalence classes
• Also divide output domain into equivalence classes
• Need to determine inputs to cover each output
equivalence class
• Again one test case per equivalence class
White-box testing : Statement coverage
• Design test cases so that every statement in a
program is executed at least once.
• Statement coverage criterion
– An error in a program can not be discovered unless
the part of the program containing the error is
executed.
– Observing that a statement behaves properly for
one input value does not guarantee that it will
behave correctly for all input values.
Example: Euclid's GCD Algorithm
int f1(int x, int y){
1 while (x != y){
2 if (x>y) then
3 x=x-y;
4 else
5 y=y-x;
5 }
6 return x;
}
• By choosing the
test set
• {(x=3,y=3),
• (x=4,y=3),
• (x=3,y=4)}
• all statements are
executed at least
once.
White-box testing : Branch Coverage
• Test cases are designed such that:
– different branch conditions given true and false
values in turn.
• Branch testing guarantees statement coverage:
– A stronger testing compared to the statement
coverage-based testing.
– i.e. Test cases are a superset of a weaker testing:
• discovers at least as many errors as a weaker testing
• contains at least as many significant test cases as a
weaker test.
Example: Euclid's GCD Algorithm
int f1(int x, int y){
1 while (x != y){
2 if (x>y) then
3 x=x-y;
4 else
5 y=y-x;
5 }
6 return x;
}
• Test cases for
branch coverage
can be:
• {(x=3,y=3),
• (x=3,y=2),
• (x=4,y=3),
• (x=3,y=4)}
White-box Testing: Condition Coverage
• Test cases are designed such that:
– each component of a composite conditional
expression
– given both true and false values.
• Consider the conditional expression
– ((c1.and.c2).or.c3):
– Each of c1, c2, and c3 are exercised at least
once, i.e. given true and false values.
• It require 2n (the number of component conditions)
test cases.
– practical only if n is small
White-box testing : Path Coverage
• Design test cases such that:
– all linearly independent paths in the program are
executed at least once.
• Defined in terms of control flow graph (CFG) of a
program.
• A control flow graph (CFG) describes:
– the sequence in which different instructions of a
program get executed.
– the way control flows through the program.
Drawing a CFG - I
• Number all the statements of a program.
– Numbered statements represent nodes of the
control flow graph.
• An edge from one node to another node exists:
– if execution of the statement representing the first
node can result in transfer of control to the other
node.
• Sequence:
– 1 a=5;
– 2 b=a*b-1;
1
2
Drawing a CFG - II
• Selection:
1. if(a>b) then
2. c=3;
3. else
4. c=5;
5. c=c*c;
• Iteration:
• 1 while(a>b){
• 2 b=b*a;
• 3 b=b-1;}
• 4 c=b+d;
1
2 3
4
1
2
3
4
Example
int f1(int x, int y){
1 while (x != y){
2 if (x>y) then
3 x=x-y;
4 else
5 y=y-x;
5 }
6 return x;
}
1
2
3 4
5
6
Path
• A path through a program:
– a node and edge sequence from the starting node
to a terminal node of the control flow graph.
• There may be several terminal nodes for program.
• Any path through the program:
• introducing at least one new node that is not included
in any other independent paths.
• McCabe's cyclomatic metric is an upper bound:
– for the number of linearly independent paths of a
program
• Provides a practical way of determining the maximum
number of linearly independent paths in a program.
Cyclomatic Complexity - I
• Given a control flow graph G, cyclomatic complexity
V(G) = E-N+2
– N is the number of nodes in G
– E is the number of edges in G
• Cyclomatic complexity = 7-6+2 = 3. 1
2
3 4
5
6
• Another way of computing
cyclomatic complexity:
• determine number of bounded
areas in the graph
• V(G) = Total number of bounded
areas + 1
• Example: the number of bounded
areas is 2.
• Cyclomatic complexity = 2+1=3.
Cyclomatic Complexity - II
• The cyclomatic complexity of a program provides a
lower bound on the number of test cases to be
designed
– to guarantee coverage of all linearly independent
paths.
– does not make it any easier to derive the test cases,
– only gives an indication of the minimum number of
test cases required.
Path Testing
• Draw control flow graph.
• Determine V(G).
• Determine the set of linearly
independent paths.
• Prepare test cases:
• to force execution along each
path.
• Number of independent paths: 3
• 1,6 test case (x=1, y=1)
• 1,2,3,5,1,6 test case(x=1, y=2)
• 1,2,4,5,1,6 test case(x=2, y=1)
1
2
3 4
5
6
Cyclomatic Complexity - III
• Relationship exists between
– McCabe's metric & the number of errors existing in
the code,
– the time required to find and correct the errors.
• also indicates the psychological complexity of a
program.
• i.e. difficulty level of understanding the program.
• Therefore, limit cyclomatic complexity of modules to
some reasonable value. (10 or so)
Automated Testing Tools
• Mercury Interactive
• Quick Test Professional: Regression testing
• WinRunner: UI testing
• IBM Rational
• Rational Robot
• Functional Tester
• Borland
• Silk Test
• Compuware
• QA Run
• AutomatedQA
• TestComplete
Thank You

More Related Content

What's hot

Np completeness
Np completenessNp completeness
Np completeness
Rajendran
 
Types of software testing
Types of software testingTypes of software testing
Types of software testing
Prachi Sasankar
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
Devan Thakur
 
Operating system deign and implementation
Operating system deign and implementationOperating system deign and implementation
Operating system deign and implementation
sangrampatil81
 
White box testing
White box testingWhite box testing
White box testing
Neethu Tressa
 
Software Reliability
Software ReliabilitySoftware Reliability
Software Reliability
Gurkamal Rakhra
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
niharika5412
 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack Problem
Madhu Bala
 
Principles of Software testing
Principles of Software testingPrinciples of Software testing
Principles of Software testing
Md Mamunur Rashid
 
A presentation on software crisis
A presentation on software crisisA presentation on software crisis
A presentation on software crisis
chandan sharma
 
Software testing ppt
Software testing pptSoftware testing ppt
Software testing ppt
Savyasachi14
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
SHREEHARI WADAWADAGI
 
Software development life cycle
Software development life cycleSoftware development life cycle
Software development life cycleGurban Daniel
 
Delphi cost estimation model
Delphi cost estimation modelDelphi cost estimation model
Delphi cost estimation modelShashwat Shriparv
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation Techniques
Santhi thi
 
Validation testing
Validation testingValidation testing
Validation testingSlideshare
 
Equivalence class testing
Equivalence  class testingEquivalence  class testing
Equivalence class testing
Mani Kanth
 
Chapter 2 Time boxing & agile models
Chapter 2   Time boxing & agile modelsChapter 2   Time boxing & agile models
Chapter 2 Time boxing & agile models
Golda Margret Sheeba J
 
software cost factor
software cost factorsoftware cost factor
software cost factor
Abinaya B
 
Unit 5 testing -software quality assurance
Unit 5  testing -software quality assuranceUnit 5  testing -software quality assurance
Unit 5 testing -software quality assurancegopal10scs185
 

What's hot (20)

Np completeness
Np completenessNp completeness
Np completeness
 
Types of software testing
Types of software testingTypes of software testing
Types of software testing
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Operating system deign and implementation
Operating system deign and implementationOperating system deign and implementation
Operating system deign and implementation
 
White box testing
White box testingWhite box testing
White box testing
 
Software Reliability
Software ReliabilitySoftware Reliability
Software Reliability
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack Problem
 
Principles of Software testing
Principles of Software testingPrinciples of Software testing
Principles of Software testing
 
A presentation on software crisis
A presentation on software crisisA presentation on software crisis
A presentation on software crisis
 
Software testing ppt
Software testing pptSoftware testing ppt
Software testing ppt
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
 
Software development life cycle
Software development life cycleSoftware development life cycle
Software development life cycle
 
Delphi cost estimation model
Delphi cost estimation modelDelphi cost estimation model
Delphi cost estimation model
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation Techniques
 
Validation testing
Validation testingValidation testing
Validation testing
 
Equivalence class testing
Equivalence  class testingEquivalence  class testing
Equivalence class testing
 
Chapter 2 Time boxing & agile models
Chapter 2   Time boxing & agile modelsChapter 2   Time boxing & agile models
Chapter 2 Time boxing & agile models
 
software cost factor
software cost factorsoftware cost factor
software cost factor
 
Unit 5 testing -software quality assurance
Unit 5  testing -software quality assuranceUnit 5  testing -software quality assurance
Unit 5 testing -software quality assurance
 

Viewers also liked

Software Engineering : OOAD using UML
Software Engineering : OOAD using UMLSoftware Engineering : OOAD using UML
Software Engineering : OOAD using UML
Ajit Nayak
 
Software Engineering :Behavioral Modelling - II State diagram
Software Engineering :Behavioral Modelling - II State diagramSoftware Engineering :Behavioral Modelling - II State diagram
Software Engineering :Behavioral Modelling - II State diagram
Ajit Nayak
 
Software Engineering :Behavioral Modelling - I Sequence diagram
Software Engineering :Behavioral Modelling - I Sequence diagram Software Engineering :Behavioral Modelling - I Sequence diagram
Software Engineering :Behavioral Modelling - I Sequence diagram
Ajit Nayak
 
Software Engineering :UML class diagrams
Software Engineering :UML class diagramsSoftware Engineering :UML class diagrams
Software Engineering :UML class diagrams
Ajit Nayak
 
Software Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & SpecificationSoftware Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & Specification
Ajit Nayak
 
How to Present Data in PowerPoint
How to Present Data in PowerPointHow to Present Data in PowerPoint
How to Present Data in PowerPoint
Matt Hunter
 
Regression analysis
Regression analysisRegression analysis
Regression analysisRavi shankar
 
Multiple regression presentation
Multiple regression presentationMultiple regression presentation
Multiple regression presentationCarlo Magno
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regression
James Neill
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis pptElkana Rorio
 
Uml Omg Fundamental Certification 1
Uml Omg Fundamental Certification 1Uml Omg Fundamental Certification 1
Uml Omg Fundamental Certification 1Ricardo Quintero
 
Computer Networks Module II
Computer Networks Module IIComputer Networks Module II
Computer Networks Module II
Ajit Nayak
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
Ajit Nayak
 
Introduction to database-ER Model
Introduction to database-ER ModelIntroduction to database-ER Model
Introduction to database-ER Model
Ajit Nayak
 
Software Engineering : Process Models
Software Engineering : Process ModelsSoftware Engineering : Process Models
Software Engineering : Process Models
Ajit Nayak
 
Computer Fundamentals & Intro to C Programming module i
Computer Fundamentals & Intro to C Programming module iComputer Fundamentals & Intro to C Programming module i
Computer Fundamentals & Intro to C Programming module i
Ajit Nayak
 
I BELIEVE I CAN FLY ( version française)
I BELIEVE I CAN FLY ( version française)I BELIEVE I CAN FLY ( version française)
I BELIEVE I CAN FLY ( version française)
Sebastien Juras
 
Uml Omg Fundamental Certification 5
Uml Omg Fundamental Certification 5Uml Omg Fundamental Certification 5
Uml Omg Fundamental Certification 5Ricardo Quintero
 
I BELIEVE I CAN FLY
I BELIEVE I CAN FLYI BELIEVE I CAN FLY
I BELIEVE I CAN FLY
Sebastien Juras
 
The badguy summary
The badguy   summaryThe badguy   summary
The badguy summary
Sebastien Juras
 

Viewers also liked (20)

Software Engineering : OOAD using UML
Software Engineering : OOAD using UMLSoftware Engineering : OOAD using UML
Software Engineering : OOAD using UML
 
Software Engineering :Behavioral Modelling - II State diagram
Software Engineering :Behavioral Modelling - II State diagramSoftware Engineering :Behavioral Modelling - II State diagram
Software Engineering :Behavioral Modelling - II State diagram
 
Software Engineering :Behavioral Modelling - I Sequence diagram
Software Engineering :Behavioral Modelling - I Sequence diagram Software Engineering :Behavioral Modelling - I Sequence diagram
Software Engineering :Behavioral Modelling - I Sequence diagram
 
Software Engineering :UML class diagrams
Software Engineering :UML class diagramsSoftware Engineering :UML class diagrams
Software Engineering :UML class diagrams
 
Software Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & SpecificationSoftware Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & Specification
 
How to Present Data in PowerPoint
How to Present Data in PowerPointHow to Present Data in PowerPoint
How to Present Data in PowerPoint
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Multiple regression presentation
Multiple regression presentationMultiple regression presentation
Multiple regression presentation
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regression
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis ppt
 
Uml Omg Fundamental Certification 1
Uml Omg Fundamental Certification 1Uml Omg Fundamental Certification 1
Uml Omg Fundamental Certification 1
 
Computer Networks Module II
Computer Networks Module IIComputer Networks Module II
Computer Networks Module II
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
 
Introduction to database-ER Model
Introduction to database-ER ModelIntroduction to database-ER Model
Introduction to database-ER Model
 
Software Engineering : Process Models
Software Engineering : Process ModelsSoftware Engineering : Process Models
Software Engineering : Process Models
 
Computer Fundamentals & Intro to C Programming module i
Computer Fundamentals & Intro to C Programming module iComputer Fundamentals & Intro to C Programming module i
Computer Fundamentals & Intro to C Programming module i
 
I BELIEVE I CAN FLY ( version française)
I BELIEVE I CAN FLY ( version française)I BELIEVE I CAN FLY ( version française)
I BELIEVE I CAN FLY ( version française)
 
Uml Omg Fundamental Certification 5
Uml Omg Fundamental Certification 5Uml Omg Fundamental Certification 5
Uml Omg Fundamental Certification 5
 
I BELIEVE I CAN FLY
I BELIEVE I CAN FLYI BELIEVE I CAN FLY
I BELIEVE I CAN FLY
 
The badguy summary
The badguy   summaryThe badguy   summary
The badguy summary
 

Similar to Software Engineering : Software testing

11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
asifusman1998
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
ShudipPal
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
ShudipPal
 
Seii unit6 software-testing-techniques
Seii unit6 software-testing-techniquesSeii unit6 software-testing-techniques
Seii unit6 software-testing-techniques
Ahmad sohail Kakar
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniquesFincy V.J
 
Testing part 2 bb
Testing part 2 bbTesting part 2 bb
Testing part 2 bb
Ravi Prakash
 
Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01
Mr. Jhon
 
Testing Technique (Part 2)
Testing Technique (Part 2)Testing Technique (Part 2)
Testing Technique (Part 2)
Ajeng Savitri
 
Chapter 14 software testing techniques
Chapter 14 software testing techniquesChapter 14 software testing techniques
Chapter 14 software testing techniques
SHREEHARI WADAWADAGI
 
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
Pankaj Thakur
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
CHANDUKAYALA
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
Rohit846825
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
PrashanthJanakiraman
 
Se unit 4
Se unit 4Se unit 4
Se unit 4
abdulsubhan44
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
Jimi Patel
 
Class9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdfClass9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdf
FarjanaParvin5
 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
Neha Singh
 
Unit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptUnit 2 Unit level testing.ppt
Unit 2 Unit level testing.ppt
PerfectMe2
 
Software Testing Foundations Part 5 - White Box Testing
Software Testing Foundations Part 5 - White Box TestingSoftware Testing Foundations Part 5 - White Box Testing
Software Testing Foundations Part 5 - White Box TestingNikita Knysh
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
Kiran Kumar
 

Similar to Software Engineering : Software testing (20)

11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Seii unit6 software-testing-techniques
Seii unit6 software-testing-techniquesSeii unit6 software-testing-techniques
Seii unit6 software-testing-techniques
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniques
 
Testing part 2 bb
Testing part 2 bbTesting part 2 bb
Testing part 2 bb
 
Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01Newsoftware testing-techniques-141114004511-conversion-gate01
Newsoftware testing-techniques-141114004511-conversion-gate01
 
Testing Technique (Part 2)
Testing Technique (Part 2)Testing Technique (Part 2)
Testing Technique (Part 2)
 
Chapter 14 software testing techniques
Chapter 14 software testing techniquesChapter 14 software testing techniques
Chapter 14 software testing 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
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
Se unit 4
Se unit 4Se unit 4
Se unit 4
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
 
Class9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdfClass9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdf
 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
 
Unit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptUnit 2 Unit level testing.ppt
Unit 2 Unit level testing.ppt
 
Software Testing Foundations Part 5 - White Box Testing
Software Testing Foundations Part 5 - White Box TestingSoftware Testing Foundations Part 5 - White Box Testing
Software Testing Foundations Part 5 - White Box Testing
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
 

More from Ajit Nayak

Software Engineering an Introduction
Software Engineering an IntroductionSoftware Engineering an Introduction
Software Engineering an Introduction
Ajit Nayak
 
Database Programming using SQL
Database Programming using SQLDatabase Programming using SQL
Database Programming using SQL
Ajit Nayak
 
Ns2: Introduction - Part I
Ns2: Introduction - Part INs2: Introduction - Part I
Ns2: Introduction - Part I
Ajit Nayak
 
Ns2: OTCL - PArt II
Ns2: OTCL - PArt IINs2: OTCL - PArt II
Ns2: OTCL - PArt II
Ajit Nayak
 
NS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt IIINS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt III
Ajit Nayak
 
Socket programming using C
Socket programming using CSocket programming using C
Socket programming using C
Ajit Nayak
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
Ajit Nayak
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
Ajit Nayak
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
Ajit Nayak
 
Operating Systems Part I-Basics
Operating Systems Part I-BasicsOperating Systems Part I-Basics
Operating Systems Part I-Basics
Ajit Nayak
 
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & DeadlockOperating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Ajit Nayak
 
Introduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and RecoveryIntroduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and Recovery
Ajit Nayak
 
Introduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculusIntroduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculus
Ajit Nayak
 
Computer Networks Module III
Computer Networks Module IIIComputer Networks Module III
Computer Networks Module III
Ajit Nayak
 
Computer Networks Module I
Computer Networks Module IComputer Networks Module I
Computer Networks Module I
Ajit Nayak
 
Object Oriented Programming using C++ Part III
Object Oriented Programming using C++ Part IIIObject Oriented Programming using C++ Part III
Object Oriented Programming using C++ Part III
Ajit Nayak
 
Object Oriented Programming using C++ Part I
Object Oriented Programming using C++ Part IObject Oriented Programming using C++ Part I
Object Oriented Programming using C++ Part I
Ajit Nayak
 
Object Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part IIObject Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part II
Ajit Nayak
 

More from Ajit Nayak (18)

Software Engineering an Introduction
Software Engineering an IntroductionSoftware Engineering an Introduction
Software Engineering an Introduction
 
Database Programming using SQL
Database Programming using SQLDatabase Programming using SQL
Database Programming using SQL
 
Ns2: Introduction - Part I
Ns2: Introduction - Part INs2: Introduction - Part I
Ns2: Introduction - Part I
 
Ns2: OTCL - PArt II
Ns2: OTCL - PArt IINs2: OTCL - PArt II
Ns2: OTCL - PArt II
 
NS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt IIINS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt III
 
Socket programming using C
Socket programming using CSocket programming using C
Socket programming using C
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
 
Operating Systems Part I-Basics
Operating Systems Part I-BasicsOperating Systems Part I-Basics
Operating Systems Part I-Basics
 
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & DeadlockOperating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
 
Introduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and RecoveryIntroduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and Recovery
 
Introduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculusIntroduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculus
 
Computer Networks Module III
Computer Networks Module IIIComputer Networks Module III
Computer Networks Module III
 
Computer Networks Module I
Computer Networks Module IComputer Networks Module I
Computer Networks Module I
 
Object Oriented Programming using C++ Part III
Object Oriented Programming using C++ Part IIIObject Oriented Programming using C++ Part III
Object Oriented Programming using C++ Part III
 
Object Oriented Programming using C++ Part I
Object Oriented Programming using C++ Part IObject Oriented Programming using C++ Part I
Object Oriented Programming using C++ Part I
 
Object Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part IIObject Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part II
 

Recently uploaded

English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 

Recently uploaded (20)

English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 

Software Engineering : Software testing

  • 1. Software Engineering Principles Ajit K Nayak, Ph.D. ajitnayak@soauniversity.ac.in Software Testing
  • 2. Acknowledgements • Slides of Prof. Rajib Mall, IIT, KGP
  • 3. Unit Testing • Black-Box Testing – Two main approaches to design black box test cases: – Equivalence class partitioning – Boundary value analysis • White-Box Texting – Designing white-box test cases: – requires knowledge about the internal structure of software. – white-box testing is also called structural testing.
  • 4. Equivalence Partitioning • The input domain data is divided into different equivalence data classes. – used to reduce the total number of test cases to a finite set of testable test cases, still covering maximum requirements. • Example: an input box accepting numbers from 1 to 1000 then there is no use in writing thousand test cases for all 1000 valid input numbers plus other test cases for invalid data. • test cases can be divided into three sets of input data called as classes. – 1) One input data class with all valid inputs. Pick a single value from range 1 to 1000 as a valid test case. If you select other values between 1 and 1000 then result is going to be same. So one test case for valid input data should be sufficient. – 2) Input data class with all values below lower limit. I.e. any value below 1, as a invalid input data test case. – 3) Input data with any value greater than 1000 to represent third invalid input class.
  • 5. Boundary Value Analysis • Complements equivalence partitioning (typically combined) • In practice, more errors found at boundaries of equivalence classes than within the classes • Divide input domain into equivalence classes • Also divide output domain into equivalence classes • Need to determine inputs to cover each output equivalence class • Again one test case per equivalence class
  • 6. White-box testing : Statement coverage • Design test cases so that every statement in a program is executed at least once. • Statement coverage criterion – An error in a program can not be discovered unless the part of the program containing the error is executed. – Observing that a statement behaves properly for one input value does not guarantee that it will behave correctly for all input values.
  • 7. Example: Euclid's GCD Algorithm int f1(int x, int y){ 1 while (x != y){ 2 if (x>y) then 3 x=x-y; 4 else 5 y=y-x; 5 } 6 return x; } • By choosing the test set • {(x=3,y=3), • (x=4,y=3), • (x=3,y=4)} • all statements are executed at least once.
  • 8. White-box testing : Branch Coverage • Test cases are designed such that: – different branch conditions given true and false values in turn. • Branch testing guarantees statement coverage: – A stronger testing compared to the statement coverage-based testing. – i.e. Test cases are a superset of a weaker testing: • discovers at least as many errors as a weaker testing • contains at least as many significant test cases as a weaker test.
  • 9. Example: Euclid's GCD Algorithm int f1(int x, int y){ 1 while (x != y){ 2 if (x>y) then 3 x=x-y; 4 else 5 y=y-x; 5 } 6 return x; } • Test cases for branch coverage can be: • {(x=3,y=3), • (x=3,y=2), • (x=4,y=3), • (x=3,y=4)}
  • 10. White-box Testing: Condition Coverage • Test cases are designed such that: – each component of a composite conditional expression – given both true and false values. • Consider the conditional expression – ((c1.and.c2).or.c3): – Each of c1, c2, and c3 are exercised at least once, i.e. given true and false values. • It require 2n (the number of component conditions) test cases. – practical only if n is small
  • 11. White-box testing : Path Coverage • Design test cases such that: – all linearly independent paths in the program are executed at least once. • Defined in terms of control flow graph (CFG) of a program. • A control flow graph (CFG) describes: – the sequence in which different instructions of a program get executed. – the way control flows through the program.
  • 12. Drawing a CFG - I • Number all the statements of a program. – Numbered statements represent nodes of the control flow graph. • An edge from one node to another node exists: – if execution of the statement representing the first node can result in transfer of control to the other node. • Sequence: – 1 a=5; – 2 b=a*b-1; 1 2
  • 13. Drawing a CFG - II • Selection: 1. if(a>b) then 2. c=3; 3. else 4. c=5; 5. c=c*c; • Iteration: • 1 while(a>b){ • 2 b=b*a; • 3 b=b-1;} • 4 c=b+d; 1 2 3 4 1 2 3 4
  • 14. Example int f1(int x, int y){ 1 while (x != y){ 2 if (x>y) then 3 x=x-y; 4 else 5 y=y-x; 5 } 6 return x; } 1 2 3 4 5 6
  • 15. Path • A path through a program: – a node and edge sequence from the starting node to a terminal node of the control flow graph. • There may be several terminal nodes for program. • Any path through the program: • introducing at least one new node that is not included in any other independent paths. • McCabe's cyclomatic metric is an upper bound: – for the number of linearly independent paths of a program • Provides a practical way of determining the maximum number of linearly independent paths in a program.
  • 16. Cyclomatic Complexity - I • Given a control flow graph G, cyclomatic complexity V(G) = E-N+2 – N is the number of nodes in G – E is the number of edges in G • Cyclomatic complexity = 7-6+2 = 3. 1 2 3 4 5 6 • Another way of computing cyclomatic complexity: • determine number of bounded areas in the graph • V(G) = Total number of bounded areas + 1 • Example: the number of bounded areas is 2. • Cyclomatic complexity = 2+1=3.
  • 17. Cyclomatic Complexity - II • The cyclomatic complexity of a program provides a lower bound on the number of test cases to be designed – to guarantee coverage of all linearly independent paths. – does not make it any easier to derive the test cases, – only gives an indication of the minimum number of test cases required.
  • 18. Path Testing • Draw control flow graph. • Determine V(G). • Determine the set of linearly independent paths. • Prepare test cases: • to force execution along each path. • Number of independent paths: 3 • 1,6 test case (x=1, y=1) • 1,2,3,5,1,6 test case(x=1, y=2) • 1,2,4,5,1,6 test case(x=2, y=1) 1 2 3 4 5 6
  • 19. Cyclomatic Complexity - III • Relationship exists between – McCabe's metric & the number of errors existing in the code, – the time required to find and correct the errors. • also indicates the psychological complexity of a program. • i.e. difficulty level of understanding the program. • Therefore, limit cyclomatic complexity of modules to some reasonable value. (10 or so)
  • 20. Automated Testing Tools • Mercury Interactive • Quick Test Professional: Regression testing • WinRunner: UI testing • IBM Rational • Rational Robot • Functional Tester • Borland • Silk Test • Compuware • QA Run • AutomatedQA • TestComplete