0% found this document useful (0 votes)
0 views

Module-03

The document covers key concepts in software testing, including strategic approaches, test strategies for conventional software, and different testing methods such as black box and white box testing. It highlights the importance of communication in testing processes, outlines various testing techniques, and discusses the advantages and disadvantages of each testing method. Additionally, it introduces specific testing techniques like boundary value analysis and cyclomatic complexity for evaluating software quality.

Uploaded by

jinu.23bce8495
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Module-03

The document covers key concepts in software testing, including strategic approaches, test strategies for conventional software, and different testing methods such as black box and white box testing. It highlights the importance of communication in testing processes, outlines various testing techniques, and discusses the advantages and disadvantages of each testing method. Additionally, it introduces specific testing techniques like boundary value analysis and cyclomatic complexity for evaluating software quality.

Uploaded by

jinu.23bce8495
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 61

SOFTWARE Engineering

Course Code: CSE-1005


MODULE – 3
(Software Testing)
Agenda

 Strategic Approach to Software Testing,


 Strategic Issues,
 Test Strategies for Conventional Software,
 Fundamentals,
 Black box Testing,
 White box testing.
In SDLC
Tools for Software Testing
Strategic Approach to Software
Testing

When to start test ?


How much testing is enough?
Who performs testing?
How to handle Repeated testing ?

Verification
Validation
Strategic Issues

 Software testing is a process that helps identify defects in software applications. It


is an important step in the software development life cycle.
 However, software testing can be challenging at times.

#1. Communication Issues


One of the challenges in software testing is communication issues.
 Communication problems can occur between the development team and the
testing team. There might be a misunderstanding about the requirements or about
the features that need to be tested. It is important to have clear communication
between the two teams to avoid these issues.
 Another type of communication issue can occur within the testing team itself. The
members of the testing team might not be on the same page when it comes to the
approach or the process of software testing. It is important to have clear and
concise communication within the team to avoid these issues.
Test Strategies for Conventional
Software

 Conventional testing refers to the traditional approach of software


testing that has been widely used for several decades. This approach
involves a series of activities that aim to identify defects or errors in a
software product and ensure that the software meets the specified
requirements and performs as expected.
Black Box Testing

 Black-box testing is a type of software testing in which the tester is


not concerned with the software’s internal knowledge or
implementation details but rather focuses on validating the
functionality based on the provided specifications or requirements.
Types Of Black Box Testing
Functional Testing
The following are the several
categories of black box
Functional testing is defined as a type
testing:
of testing that verifies that each
function of the software application
Regression Testing
works in conformance with the
requirement and specification.
Regression Testing is the process of testing the
This testing is not concerned with the
modified parts of the code and the parts that might
source code of the application. Each
get affected due to the modifications to ensure
functionality of the software application
that no new errors have been introduced in the
is tested by providing appropriate test
software after the modifications have been made.
input, expecting the output, and
Regression means the return of something and in
comparing the actual output with the
the software field, it refers to the return of a bug. It
expected output.
ensures that the newly added code is compatible
This testing focuses on checking the
with the existing code.
user interface, APIs, database, security,
In other words, a new software update has no
client or server application, and
impact on the functionality of the software. This is
functionality of the Application Under
carried out after a system maintenance operation
Test. Functional testing can be manual
and upgrades.
or automated. It determines the
system’s software functional
requirements.
Nonfunctional Testing Advantages of Black Box Testing

• The tester does not need to have more functional


Non-functional testing is a
software testing technique that knowledge or programming skills to implement the Black
checks the non-functional Box Testing.
• It is efficient for implementing the tests in the larger
attributes of the system.
Non-functional testing is system.
• Tests are executed from the user’s or client’s point of view.
defined as a type of software
• Test cases are easily reproducible.
testing to check non-functional
• It is used to find the ambiguity and contradictions in the
aspects of a software
application. functionalofspecifications.
Disadvantages Black Box Testing
It is designed to test the
• There is a possibility of repeating the same tests while
readiness of a system as per
nonfunctional parameters implementing the testing process.
• Without clear functional specifications, test cases are difficult to
which are never addressed by
functional testing. implement.
• It is difficult to execute the test cases because of complex
Non-functional testing is as
important as functional inputs at different stages of testing.
• Sometimes, the reason for the test failure cannot be detected.
testing.
• Some programs in the application are not tested.
Non-functional testing is also
• It does not reveal the errors in the control structure.
known as NFT. This testing is
• Working with a large sample space of inputs can be exhaustive
not functional testing of
software. It focuses on the and consumes a lot of time.
software’s performance,
Features of black box testing
 Independent testing: Black box testing is performed by testers who are not involved in the
development of the application, which helps to ensure that testing is unbiased and impartial.
 Testing from a user’s perspective: Black box testing is conducted from the perspective of an end
user, which helps to ensure that the application meets user requirements and is easy to use.
 No knowledge of internal code: Testers performing black box testing do not have access to the
application’s internal code, which allows them to focus on testing the application’s external behaviour
and functionality.
 Requirements-based testing: Black box testing is typically based on the application’s
requirements, which helps to ensure that the application meets the required specifications.
 Different testing techniques: Black box testing can be performed using various testing techniques,
such as functional testing, usability testing, acceptance testing, and regression testing.
 Easy to automate: Black box testing is easy to automate using various automation tools, which helps
to reduce the overall testing time and effort.
 Scalability: Black box testing can be scaled up or down depending on the size and complexity of the
application being tested.
 Limited knowledge of application: Testers performing black box testing have limited knowledge of
the application being tested, which helps to ensure that testing is more representative of how the end
users will interact with the application.
White Box Testing

 White box testing is a software testing technique that involves testing


the internal structure and workings of a software application . The
tester has access to the source code and uses this knowledge to
design test cases that can verify the correctness of the software at
the code level.
 White box testing is also known as structural testing or code-based testing, and it is used to test
the software’s internal logic, flow, and structure. The tester creates test cases to examine the
code paths and logic flows to ensure they meet the specified requirements.

What Does White Box Testing Focus On?


 White box testing uses detailed knowledge of a software’s inner workings to create very specific
test cases.
 Path Checking: Examines the different routes the program can take when it runs. Ensures that all
decisions made by the program are correct, necessary, and efficient.
 Output Validation: Tests different inputs to see if the function gives the right output each time.
 Security Testing: Uses techniques like static code analysis to find and fix potential security issues
in the software. Ensures the software is developed using secure practices.
 Loop Testing: Checks the loops in the program to make sure they work correctly and efficiently.
Ensures that loops handle variables properly within their scope.
 Data Flow Testing: Follows the path of variables through the program to ensure they are declared,
initialized, used, and manipulated correctly.
Types of White Box Testing

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.

Disadvantages of White Box Testing


 Programming Knowledge and Source Code Access: Testers need to have programming knowledge and access to the source
code to perform tests.
 Overemphasis on Internal Workings: Testers may focus too much on the internal workings of the software and may miss
external issues.
 Bias in Testing: Testers may have a biased view of the software since they are familiar with its internal workings.
 Test Case Overhead: Redesigning code and rewriting code needs test cases to be written again.
 Dependency on Tester Expertise: Testers are required to have in-depth knowledge of the code and programming language
as opposed to black-box testing.
 Inability to Detect Missing Functionalities: Missing functionalities cannot be detected as the code that exists is tested.
 Increased Production Errors: High chances of errors in production.
Problems

 Black Box;

1. Boundary value Analysis


2. Decision Table
3. Equivalence Partitioning

 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?

Steps that should be followed in calculating


cyclomatic complexity and test cases design
are:
• Construction of graph with nodes and edges
from code.
• Identification of independent paths.
• Cyclomatic Complexity Calculation
• Design of Test Cases

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/

You might also like