Testing Unit4 SE
Testing Unit4 SE
Testing Unit4 SE
Validation refers to the set of activities that ensure that the software built
is traceable tocustomer requirements.
( Ex: Are we building the right product ? )
Test Strategies for Conventional Software:
Example
Input consists of 1 to 10
Then classes are n<1,1<=n<=10,n>10
Choose one valid class with value within the allowed range and two invalid
classes where values are greater than maximum value and smaller than
minimum value.
3)Boundary Value analysis
Select input from equivalence classes such that the input lies at the
edge of the equivalence classes. Set of data lies on the edge or
boundary of a class of input data or generates the data that lies at the
boundary of a class of output data. Test cases exercise boundary
values to uncover errors at the boundaries of the input domain.
Example
If 0.0<=x<=1.0
Then test cases are (0.0,1.0) for valid input and (-0.1 and 1.1) for
invalid input
4) Orthogonal arrayTesting
This method is applied to problems in which input domain isrelatively
small but too large for exhaustive testing
Example
Three inputs A,B,C each having three values will require 27 test cases.
Orthogonal testing will reduce the number of test case to 9 as shown
below
White Box testing
• White Box testing also called glass box testing. It uses the control structure to
derive test cases.
• It exercises all independent paths, Involves knowing the internal working of a
program, Guarantees that all independent paths will be exercised at least once
• Exercises all logical decisions on their true and false sides, Executes all
loops,Exercises all data structures for their validity.
• White box testing techniques
1. Basis path testing
2.Control structure testing.
3. Loop testing
1. Basis Path Testing:
• It defines a minimal set of execution paths based on the logical
complexity of a procedural design. This method ensures that every
statement in the program is executed at least once.
• Steps for Basis Path Testing:
1.Draw the flow graph from the program's flow chart.
2.Calculate the cyclomatic complexity of the flow graph.
3.Prepare test cases to cover each unique path identified.
• Two methods to compute Cyclomatic complexity number
1. V(G)=E-N+2 where E is number of edges, N is number of nodes
2. V(G)=Number of regions
2. Control Structure testing:
This broadens testing coverage and improves quality oftesting. It uses the
following methods:
• Condition testing, also known as condition coverage or predicate
coverage, is a software testing technique that aims to ensure that all
logical conditions in a program's decision points (such as if statements
and loops) are evaluated to both true and false outcomes during testing.
• Data Flow Testing is a software testing technique that focuses on the
flow of data within a program during its execution. Unlike some other
testing methods that primarily check the execution paths or logical
conditions, data flow testing aims to uncover errors related to the usage
and flow of data variables within the program.
3. Loop Testing focuses on verifying the correctness and reliability of
loops within a program by testing them under various conditions to
detect potential errors like infinite loops or incorrect loop termination
conditions
1.Simple loops
2.Nested loops
3.Concatenated loopss
4.Unstructured loops
The Art of Debugging
Debugging is the process of identifying, analyzing, and fixing errors or bugs
within a software application. It is an essential part of the software
development lifecycle aimed at ensuring that the program functions correctly
and meets its intended requirements.
Debugging Strategies:
The objective of debugging is to find and correct the cause of a software
error. Three strategies are proposed:
1)Brute Force Method.
2)Back Tracking.
3)Cause Elimination.
1. Product Metrics for the Analysis Model These metrics are used to
measure the functionality that a software delivers to its users.
FP=Count total×[0.65+0.01×Σ(Fi)]
Where:
• Count Total is the sum of all the parameters.
• Fi refers to complexity factors (like performance, data
communications, etc.).
2. Product Metrics for the Design Model
These values help you calculate the overall program length and
complexity.
4. Metrics for Testing
Testing metrics are used to measure the effectiveness and efficiency of
the testing process.
Program Level (PL) and Effort (E) can be calculated based on the number
of operators and operands used during the testing phase.
These metrics help measure how much effort is required to test the
program.
5. Metrics for Maintenance
Maintenance metrics assess how well the software can be updated or
modified over time.
1. Size-Oriented Metrics:
These focus on measuring the size of the software (e.g., Lines of Code
(LOC)).These metrics include effort, defects, people involved, and errors.