Module-03
Module-03
Verification
Validation
Strategic Issues
Unit Testing
• Checks if each part or function of the application
works correctly.
• Ensures the application meets design
requirements during development.
Integration Testing
• Examines how different parts of the application
work together.
• Done after unit testing to make sure
components work well both alone and together.
Regression Testing
• Verifies that changes or updates don’t break
existing functionality.
• Ensures the application still passes all existing
tests after updates.
Features of White box Testing
Code coverage analysis: White box testing helps to analyze the code coverage of an application, which helps to identify the areas
of the code that are not being tested.
Access to the source code: White box testing requires access to the application’s source code, which makes it possible to test
individual functions, methods, and modules.
Knowledge of programming languages: Testers performing white box testing must have knowledge of programming languages
like Java, C++, Python, and PHP to understand the code structure and write tests.
Identifying logical errors: White box testing helps to identify logical errors in the code, such as infinite loops or incorrect
conditional statements.
Integration testing: White box testing is useful for integration testing, as it allows testers to verify that the different components
of an application are working together as expected.
Unit testing: White box testing is also used for unit testing, which involves testing individual units of code to ensure that they are
working correctly.
Optimization of code: White box testing can help to optimize the code by identifying any performance issues, redundant code, or
other areas that can be improved.
Security testing: White box testing can also be used for security testing, as it allows testers to identify any vulnerabilities in the
application’s code.
Verification of Design: It verifies that the software’s internal design is implemented in accordance with the designated design
documents.
Check for Accurate Code: It verifies that the code operates in accordance with the guidelines and specifications.
Identifying Coding Mistakes: It finds and fix programming flaws in your code, including syntactic and logical errors.
Path Examination: It ensures that each possible path of code execution is explored and test various iterations of the code.
Determining the Dead Code: It finds and remove any code that isn’t used when the programme is running normally (dead code).
Advantages of White Box Testing
Thorough Testing : White box testing is thorough as the entire code and structures are tested.
Code Optimization: It results in the optimization of code removing errors and helps in removing extra lines of code.
Early Detection of Defects: It can start at an earlier stage as it doesn’t require any interface as in the case of black box
testing.
Integration with SDLC: White box testing can be easily started in Software Development Life Cycle.
Detection of Complex Defects: Testers can identify defects that cannot be detected through other testing techniques.
Comprehensive Test Cases: Testers can create more comprehensive and effective test cases that cover all code paths.
Testers can ensure that the code meets coding standards and is optimized for performance.
Black Box;
White Box;
1. Cyclometric Complexity
Boundary value Analysis
Boundary value analysis is one of the widely used case design technique for black box
testing. It is used to test boundary values because the input values near the boundary have
higher chances of error.
Whenever we do the testing by boundary value analysis, the tester focuses on, while entering
boundary value whether the software is producing correct output or not.
Boundary values are those that contain the upper and lower limit of a variable. Assume that,
age is a variable of any function, and its minimum value is 18 and the maximum value is 30,
both 18 and 30 will be considered as boundary values.
The basic assumption of boundary value analysis is, the test cases that are created using
boundary values are most likely to cause an error.
Equivalence Partitioning Method
It is also known as Equivalence class partitioning (ECP). It is a software
testing technique or black-box testing that divides input domain into
classes of data, and with the help of these classes of data, test cases can
be derived. An ideal test case identifies class of error that might require
many arbitrary test cases to be executed before general error is
observed.
In equivalence partitioning, equivalence classes are evaluated for given
input conditions. Whenever any input is given, then type of input
condition is checked, then for this input conditions, Equivalence class
represents or describes set of valid or invalid states.
Guidelines for Equivalence Partitioning :
If the range condition is given as an input, then one valid and two
invalid equivalence classes are defined.
If a specific value is given as input, then one valid and two invalid
equivalence classes are defined.
If a member of set is given as an input, then one valid and one invalid
equivalence class is defined.
If Boolean no. is given as an input condition, then one valid and one
invalid equivalence class is defined.
Cyclometric Complexity:
Cyclomatic complexity is a software metric used to measure the complexity of a program. Thomas
J. McCabe developed this metric in 1976.McCabe interprets a computer program as a set of a
strongly connected directed graph. Nodes represent parts of the source code having no branches
and arcs represent possible control flow transfers during program execution. The notion of program
graph has been used for this measure, and it is used to measure and control the number of paths
through a program. The complexity of a computer program can be correlated with the topological
complexity of a graph.
McCabe proposed the cyclomatic number, V (G) of graph theory as an indicator of software
complexity. The cyclomatic number is equal to the number of linearly independent paths through a
program in its graphs representation. For a program control graph G, cyclomatic number, V (G), is
given as:
V (G) = E - N + 2 * P
E = The number of edges in graphs G
N = The number of nodes in graphs G
P = The number of connected components in graph G.
How to Calculate Cyclomatic Complexity?
The cyclomatic complexity calculated for the above code will be from the control
flow graph.
The graph shows seven shapes(nodes), and seven lines(edges), hence cyclomatic
Try these
Visit the below for your reference;
https://linearb.io/blog/cyclomatic-complexity
https://www.geeksforgeeks.org/equivalence-partitioning-method/