M1-RL-Introduction To Software Testing Techniques
M1-RL-Introduction To Software Testing Techniques
Methodologies
BITS Pilani Prashant Joshi
Module 1: Agenda
Testing is a process of
executing a program with
the intent of finding errors
Messaging Multimedia
Embedded Systems
Software Space
Hardware Networking You Name it!
Security Travel
Database Learning
Telecommunications
Automobile
Analysis
Home Medicine
Infotainment
7 Software Testing Methodologies
What world are we talking of?
Messaging Multimedia
Embedded Systems
Software Space
Hardware
Software is (nearly)
Networking You Name it!
everywhere. Thus we are
Security Travel
talking about that Learning
Database
“everything”.
Automobile
Telecommunications
Analysis
Home Medicine
Infotainment
8 Software Testing Methodologies
Building Blocks
Test Test
Design Specification Product Technology
Psychology of test
– Attitude to break the system
– Constructively destructive
– How come it works!
The Medical Lab
– Reports normal Cannot detect the problem
– A failure would trigger the way to treat
Steps to success
– Increase probability of success
– Bring generality and consistency
– Measure: What you cannot measure you cannot
control!
– Continuously improve
IEEE Definition
• Software Engineering: (1) The application of a systematic,
disciplined, quantifiable approach to the development, operation and
maintenance of Software; that is the application of engineering to
software (2) The study of approaches as in (1).
• Cost Overruns
• Late delivery
• Lack of reliability
• Inefficient Systems
• Performance problems
• Lack of usability
The aim was to overcome the above issues and much more…
What
Why How
When
Which Where
25 Software Testing Methodologies
Our Course Structure
• Modules
• Course is divided into Modules
• Topics
• Each module is divided into Topics
Topic x.1
Topic x.3
2 Mathematics and Formal Provide a base to the software testing techniques in form of mathematics and
Methods formal methods. Review topics of permutation/combination, discrete
mathematics and graph theory. Focus is on the relevance to software testing.
3 Specification Based Testing Bring an approach to look at the system from specification perspective. Learn
the relevant techniques for testing specifications – Equivalence Class, Boundary
Value Analysis, Combinatorial, Decision Tables and Domain Testing
4 Code Based Testing Take a code level approach to testing and assuring quality. Learn the relevant
techniques for testing code – Path Based Testing and Data Flow Testing
5 Model Based Testing Introduce Model Based Testing. Various Model for Software testing, their
choice and techniques. Learn Finite State Machine, Petri Nets and State Charts.
Learn to use these to derive testing cases
6 Object Oriented Testing Understand the issues in OO Software Testing. Learn techniques and sublets
of Unit, Integration and Systems Testing of OO Software. GUI Testing for OO
Software
7 Integration & System Testing Overview and need for Integration and Systems Testing of Software. Learn
the techniques of Integration and Systems Testing
8 Life-Cycle Based Testing Provide an overview from a life-cycle perspective of Software and Software
Products. Agile Testing and Agile Model-Driven Development. Role of Test
engineers in life-cycle-based testing
9 Test Adequacy & Learn the need for test adequacy and need for enhancement of test cases.
Enhancement Various techniques and criteria for measuring of test adequacy (data and
control flow). Using the criteria to enhance test cases.
10 Test Case Minimization, Explore and understand the need for minimization and prioritization. Review
Prioritization and the regression test problem. Selection of test cases for regression.
Optimization
Input Output
Software Program
X Y
Testing methods
Based on the source of information used for testing
•No information is used
•Specification (Example: Requirements specification)
•Design or LLD or Source Code (Internals of a program)
35 Software Testing Methodologies
A Simple Example
#include <iostream> int main() { int a, b, c; // initialize the
three number to zero a=b=c=0; int max=0; // Indicate the
program purpose std::cout << "Program computes max of three
integers" << std::endl; // Ask for input of numbers std::cout
<< "Enter the values for a, b, & c one on each line" <<
std::endl; std::cin >> a; std::cin >> b; std::cin >> c; //
Start with a as max max=a; //Logic to find the max. Compare
with other two. if(a<b) { max = b; } if(max<c) { max=c; } //
Output the result of the computation std::cout << "Max of three
is " << max << std::endl; } // End of program
int
main()
{
int a, b, c;
// initialize the three number to zero
a=b=c=0;
int max=0;
} // End of program
Modular
• Structure chart based
• Broken down into various modules and has call relationships
i.e. (set of modules + call relationships)
• Executes in a sequence
• Uses a modular design pattern
Implementation
• Choice of programming language
• Coding
• Low level algorithms
• Low level data structures
• Specific code constructs
Error
• An error is a mistake. Errors propagate. A requirements error may
(will) get magnified as design and still amplified in later phases
Fault
• A fault is a result of an error. Fault aka. Defect, is an expression of
error, where representation is a mode of expression ex: narrative
text, dataflow diagrams etc
• Faults of omission: Occurs when something is missed out
• Faults of commission: Occurs when some representation is incorrect
Failure
• A failures occurs when a fault executes.
• How do we relate this to faults of commission and omission?
Incident
• An incident occurs when a failure occurs. An incident is the symptom
associated with a failure that alerts the user the occurrence of a failure
Test
• Testing is concerned with errors, faults, failures and incidents. A test is
an act of exercising testing cases with two goals,
• to find failures
• to demonstrate correct execution
Test Case
• A test case has an identity and is associated with a program behaviour.
A test case also has a set of inputs and a list of expected outputs
• A unique ID
• An input
• Precondition: Circumstances that hold prior to execution of the test case
• Actual inputs: The actual inputs for a particular test case/method
• Expected Output
• Postconditions: Circumstances that hold after the execution of the test
• Actual outputs: The actual outputs
• Verdict: A final PASS/FAIL/INDETERMINATE
statement for the test activity
Cost of fixing
• Software Testing
500
(exhaustive) is a very
time consuming
450
400
350
300
250 activity
• Software testing can
200
150
100
be most expensive
50
0
activity in Software
development and
maintenance