Professional Documents
Culture Documents
Syllabus
Unit – 1 : Basics of Software Testing
Humans, Errors and Testing, Software Quality; Requirements,
Behavior and Correctness, Correctness Vs Reliability; Testing
and Debugging; Test Metrics; Software and Hardware Testing;
Testing and Verification; Defect Management; Execution
History; Test Generation Strategies; Static Testing; Test
Generation from Predicates.
Unit – 2 : A perspective on testing, Examples
Basic definitions, Test cases, Insights from a Venn diagram,
Identifying test cases, Error and fault taxonomies, Level of
testing, Examples: Generalized pseudocode, The triangle
problem, the NextDate function, The commission problem, The
SATM (Simple Automation Teller Machine) problem, The
currency converter, Saturn windshield wiper.
Syllabus
Unit – 3 : Boundary Value testing, Equivalence
class testing, Decision-table based testing
Boundary value analysis, Robustness testing, Worst-case
testing, special value testing, Examples, Random testing,
Equivalence classes, Equivalence test cases for triangle problem,
NextDate function and commission problem, Guidelines and
observations, Decision tables, Test cases for triangle problem.
Unit – 4 : Path testing, Dataflow testing
DD Paths, Test coverage metrics, Basis path testing,
guidelines and observations, Definition Use testing, Slice based
testing, Guidelines and observations.
Fault-based testing
Assumptions in fault-based testing, Mutation Analysis, Fault-
based Adequacy Criteria; Variations on mutation Analysis; From
Test case specification to Test Cases, Scaffolding, Generic vs
specific Scaffolding, Test Oracles, Self checks as oracles, Capture
and Replay.
Syllabus
Unit– 5 : Planning and Monitoring the
Process, Documenting Analysis and Test
Quality and Process, Test and Analysis strategies and
plans, Risk Planning, Monitoring the Process,
Improving the process, The quality team, Organizing
documents, Test strategy document, Analysis and
test plan, Test design specifications documents, Test
and analysis reports.
Course Outcomes
Test process and continuous quality improvement & Test
generation from requirements
Modelling techniques : UML : FSM and State Charts,
Combinatorial design ; and others
Test generation from models
Test adequacy assessment
Industrial applications
Discussion oriented lectures by the instructor, In-class
group presentations by teams, laboratory exercises using
advanced testing tools, and invited talks by experts from
the industry will be the primary mechanisms for learning
and the dissemination of knowledge
Unit – 1 Outcomes
At the end of this Unit, a student will be able to :
Suppose now that the tester wants to know if the two integers are to
be input to the program on one line followed by a carriage return, or
on two separate lines with a carriage return typed in after each
number. The requirement as stated above fails to provide an answer
to this question.
Requirements : Ambiguity
While providing input to the program, the request character is input first
followed by the sequence of integers to be sorted; the sequence is
terminated with a period.
Based on the above modified requirement, the input domain for sort is a
set of pairs. The first element of the pair is a character. The second element
of the pair is a sequence of zero or more integers ending with a period.
Valid/Invalid Inputs
The modified requirement for sort mentions that the
request characters can be ``A'' and ``D'', but fails to answer
the question ``What if the user types a different character ?’’
Execute sort on at least two input sequences, one with ``A'' and
the other with ``D'' as request characters.
Test Plan (Contd…)
Consider a menu
driven application.
Program Behaviour – Example (Contd…)
Behaviour : Observation and Analysis
The tester finds out whether the program under the test is correct
or not. Divided into two steps as follows
The entity that performs the task of checking the correctness of the
observed behavior is known as an Oracle.
Oracle: Example
38
Human Oracles - Disadvantages
Note :
Human Oracles are the best when compared with
automated oracles
Oracle: Programs
40
Oracle: Construction
41
Oracle construction: Example
42
Test Metrics
Metric is a standard of measurement
There are different types of metrics for testing
Types of Test Metrics
a) Organizational
b) Project
c) Process
d) Product
i) Static
ii) Dynamic
Test Metrics
Organizations
Used in projects
To test products
Test Metrics
Core Areas in the design of metrics
1) Schedule
- Actual completion times of various activities
and comparing with the estimated time to
completion
2) Quality
- Measures the quality of a product or a process
3) Resources
- Measures items like cost in rupees, manpower,
and tests executed
4) Size
- Measures the source code and number of test in a test suite
Test Metrics
1) Organizational metrics
- Metrics that are used in the overall project planning and
management
- Obtained by combining two or three metrics together across
several projects
Examples of Organizational metrics
1) Number of defects before release of the product
2) Number of defects after release of the product
3) Testing costs per LOC
4) Delivery Schedule Slippage
5) Time to complete system testing etc…
Note:
- These metrics need to be computed at regular intervals
Test Metrics
2. Project Metrics
- Metrics used to measure the status of a project
- Could be measured in terms of tester-man-months,
tester-man-years, tester-man-days etc…
- Usually used by the Project Manager
Examples :
- Actual-to-planned system test effort
- Ratio of the number of successful tests to the total
number of tests in the testing phase
Test Metrics
3. Process Metrics
- Evaluating the efficiency and goodness of
processes involved in a project
Examples
- How many defects were present in each testing
phase i.e. unit testing, integration testing, and
system testing etc…
- Metrics taken during the SDLC
Test Metrics
4. Product Metrics : Generic
- Metrics related to a specific software product
Examples
a) “Can this product be released on 10/8/2018”
b) “Has user satisfaction done for this product”
c) Cyclomatic complexity and Halstead Metrics
Cyclomatic Complexity
- Coined by Thomas Mc Cabe
Formula
V(G) = E – N + 2
V(G) = P + 1 where ‘P’ stands for Predicate nodes in a graph
Test Metrics
Metric Meaning Formula
n Halstead’s Volume Vocabulary n1 + n2
N Size N2 + N2
V Volume N * log2 n
E Effort V*D
B Errors V / 3000
Halstead’s Metrics
Test Metrics
If (x>y)
If(x<y)
Print "Hello"
Print "Hello"
Else
Else
Print "Hi"
Print "Hi"
Software and Hardware testing
Test Domain
Domain differs for software and hardware
platforms
Sequential circuits vs Combinatorial circuits
Test Coverage
- Acceptable test coverage should be taken care
- Mutation testing in software
Testing and Verification
Verification
- Showing that the program works for all possible inputs
that satisfy a set of conditions
- Humans make mistake while verifying certain artefacts
For eg: Incorrect assumption of input conditions,
incorrect understanding of the application delivery
etc…
Testing
- Ensuring that a program or an application works error
free during the lifetime of its usage
Software and Hardware testing
Major differences
1) Difficulty in reproducing bugs
2) Cost of bug fixes
3) Need for test cases
4) The cost of testing
5) Testing the durability aspects
6) Hardware and firmware testing
7) Lab requirements
8) Testing environment
9) Agile development
Defect Management
Activities in a Defect Management Process
1) Defect Prevention – Better standards
2) Defect Discovery – Inspecting the system at regular intervals
3) Defect Recording and Reporting – Keeping a record of the
defects and informing the immediate higher-ups, Recorded
defects takes a state “Open”
4) Defect Classification – High severity Vs Low severity
5) Defect Resolution & - Finding a quick permanent solution
6) Defect Prediction – Using advanced statistical techniques to
predict defects in future releases of the software product
Note :
Presence of a number of defect tracking systems like bugzilla,
bugzero, Fogbugz that can be used to measure the complexity of
applications.
Execution History
Execution history is otherwise called as “Execution
trace” is an organized collection of information about
various elements of a program during a given
execution
Execution Slice
- An executable sub-sequence of execution history
Representing an execution history
1) Sequence in which the functions of a program are
executed against a given input
2) Sequence in which program blocks are executed
Execution History
Process
1) Done by people who have not written the code
2) Involvement of a team of individuals
Advantages of static testing
1) Helps in discovering faults in the application
2) Ambiguities and Errors in the requirements
3) Testing other application-related documents at a lower
cost
Static testing
Inspection Roles
1) Moderator
2) Reader
3) Recorder
4) Author
Static testing
c) Use of static code analysis tools in static testing
- Using tools with good GUI capabilities
- Provide control flow and data flow information
(CFG)
- Availability of several tools., Proprietary Vs Open
Source
Eg : Purify, Klockwork (Proprietary)
Lapse (open source) used to analyze java
programs
Static testing
d) Software Complexity and Static testing
- A module that has high complexity after
inspection should be given the highest priority
and vice versa
Note:
Static testing is very important for several software
applications.
Dynamic testing is also very much essential as the
requirements of applications has increased over
time
Test Generation from Predicates
A condition is represented by a predicate
Concept of decision tables
Testing to ensure that there are no errors in the
implementation of predicates is also known as predicate
testing
1. Predicates and Boolean Expressions
a) Relational Expression (Definition)
An expression of the form e1 relop e2 where e1 and e2 are
expressions that assume values from a finite or infinite set S.
b) Condition
A condition can be represented as a simple predicate or a
compound predicate
Test Generation from Predicates
c) Simple Predicate
- A simple predicate is a Boolean variable or a relational
expression, where any one or more variables might be
negated Eg: a Λ b, a - b > c
d) Compound Predicate
- A simple predicate or an expression formed by joining
two or more simple predicates, possibly negated, with a
binary Boolean operator
Eg: (a Λ b) .and. (c Λ d)
e) Boolean expression
- An expression composed of one or more Boolean
variables joined by Boolean operators (p Λ q) V r
Test Generation from Predicates
2. Fault Model for Predicate Testing
Three kinds of faults
a) Boolean Operator fault
– Incorrect Boolean operator
- Missing negation or negation placed incorrectly
- Incorrect parentheses
- Incorrect Boolean variable
b) Relational Operator fault
- Incorrect relational operator is used
c) Arithmetic Expression fault
- Arithmetic errors i.e. placing a “+” in the place of a “-”
Note : Missing or Extra Boolean variable faults
Test Generation from Predicates
3. Predicate Testing Criteria
Objective:
Generating a test set T from a given predicate pr such
that
a) T is minimal
b) T guarantees the detection of any fault in the
implementation of pr
- Define three testing criteria namely BOR-, BRO- and
BRE-
where BOR- means Boolean Operator, BR0- means
Boolean and Relational Operator, and BRE- means
Boolean and Relational Expression.
Test Generation from Predicates
BOR-testing Criteria
A test set T that satisfies the BOR-testing criterion for a compound
predicate pr, guarantees the detection of single or multiple Boolean
operator faults in the implementation of pr . T is referred to as a BOR-
adequate test set and sometimes written as TBOR
BRO-testing Criteria
A test set T that satisfies the BRO-testing criterion for a compound
predicate pr, guarantees the detection of single or multiple Boolean
operator and relational operator faults in the implementation of pr . T
is referred to as a BRO-adequate test set and sometimes written as
TBRO
BRE-testing Criteria
A test set T that satisfies the BOR-testing criterion for a compound
predicate pr, guarantees the detection of single or multiple Boolean
operator, relational expression, and arithmetic expression faults in the
implementation of pr . T is referred to as a BRE-adequate test set and
sometimes written as TBRE
Test Generation from Predicates