Software Testing Unit-4 Notes
Software Testing Unit-4 Notes
Unit: - 4
Dynamic Testing
Dynamic testing refers to analysing code’s dynamic behaviour in the software.
In this type of testing, you have to give input and get output as per the
expectation through executing a test case. You can run the test cases manually
or through an automation process, and the software code must be compiled and
run for this.
The main purpose of dynamic testing is to validate the software and ensure it
works properly without any faults after the installation. In a snapshot, you can
say that dynamic testing assures the overall functionality and performance of
the application. Also, it should be stable and consistent.
Unit Testing: It tests the code’s accuracy and validates every software module
component. It determines that every component or unit can work independently.
Integration Testing: It integrates or combines each component and tests the
data flow between them. It ensures that the components work together and
interact well.
System Testing: It makes to test the entire system. So it’s also known as end-
to-end testing. You should work through all the modules and check the features
so that the product fits the business requirements.
User Acceptance Testing (UAT): Customers perform this test just before
releasing the software in the market to check the system meets the real user’s
conditions and business specifications.
2. Non-Functional Testing:
Performance Testing: In this testing, we have to check how the software can
perform in different conditions. Three types of conditions are most considerable
to do the performance testing. They are-
o Speed Testing: The time requires loading a web page with all components-
texts, images, videos, etc.
o Load Testing: Test the software stability when users increase gradually. That
means, by this test, you can check the system’s performance under variable
loads.
o Stress Testing: It sets a limit on which the system breaks due to a sudden
increase in users’ number.
Security Testing: Security testing reveals the vulnerabilities and threats of a
system. Also, it ensures that the system is protected from unauthorized access,
data leakages, attacks, and other issues. Then fix the issues before deployment.
Usability Testing: This test checks how easily an end user can handle a
software/system/application. Additionally, it will check the app’s flexibility and
capability to reach the user’s requirements.
1. Detects defects early: The dynamic test cases need to prepare in the
early phases of the testing life cycle with inputs and expected outputs.
This way, it will find the defects whenever the test cases are executed
without wasting time.
2. Provides confidence in the system: Dynamic testing covers major
functionalities of a system and component and ensures they are working
correctly. Also, it includes proper communication between several
modules, increasing the quality of the software.
3. Helps in identifying the system’s performance: Non-functional testing
is an essential category of dynamic testing that helps to identify the
system’s performance. This test includes checking an application’s
response, speed, stress, and loading time in real user conditions and
environments.
Disadvantages
Planning:
Defining the scope
Estimating effort and timeframe
Identifying review characteristics
Selecting the people to participate in the review and allocating roles
Defining entry and exit criteria
Initiating the review:
Distributing the work product and related material
Explaining the scope, objectives, process, roles, and work products to the
participants
Answering any questions that participants may have about the review
Individual review:
Reviewing all or part of the work product
Noting potential defects, recommendations, and questions
Test design is a critical part of every software launch, and it plays as a guarantee
that fewer bugs and errors are encountered.
Test Objectives:
Identification of Bugs
The first and foremost goal of software testing is to improve software quality by
identifying bugs in the application. Irrespective of the size or complexity of the
application, tests are conducted on a continuous basis to unearth issues and
build a high-quality product.
Tests that require human intervention (or cannot be automated) are conducted
using manual testing. On the other hand, test automation frameworks (or tools)
are leveraged to run tests in a CI/CD pipeline. Such an approach minimizes the
developer feedback loop and continually improves the software quality at every
stage of application development.
Enhancement of Security
Security tests like penetration tests, compliance tests, network security tests, etc.
can be leveraged to unearth security vulnerabilities in the application. In many
tests, internal testers don the hats of the hacker to identify security loopholes.
Network security testing ensures that any form of data is always encrypted &
secured, whether it is in motion or at rest!
The main reason for such an experience could be unprecedented load on the
website, causing hiccups to the end-users of the website (or application). This is
where load testing can be valuable, as it helps in validating the application’s
behaviour when it is subjected to different kinds of load. Load testing falls in
the category of performance testing, a non-functional type of testing that helps
in improving the scalability, reliability, responsiveness, and speed aspects of the
application.
Load testing
Stress testing
Volume testing
Soak testing
Endurance testing
A highly secure, reliable, and scalable application can have a long-lasting
impact on the end-user experience. Performance testing helps in ensuring that
your application is built for scale, thereby ensuring that there are no outages at
times when there is a high load on the application!
Test Specifications:
Software testing standards are a set of guidelines and principles used to define
and guide the process of software testing. These standards outline the strategies,
procedures, methodologies, and best practices for testing software to ensure its
quality, functionality, and performance. They also provide a foundation for
creating and evaluating software testing processes, techniques, and tools. Some
common software testing standards include ISO/IEC 29119, IEEE 829, and
ISO/IEC 9126. Adhering to these standards can help organizations improve the
effectiveness and efficiency of their software testing processes and ultimately
deliver high-quality software products to customers.
Here is a brief guide to some of the key elements of software testing standards:
Test planning: This is the process of defining the scope, objectives, and
approach to software testing.
Test case development: This is the process of creating test cases that
will be used to test software.
Test execution: This is the process of running test cases against software.
Test analysis: This is the process of reviewing test results and identifying
defects.
Test reporting: This is the process of communicating test results to
stakeholders.
Module Name: Subject or title that defines the functionality of the test.
Test Case Id: A unique identifier assigned to every single condition in a
test case.
Tester Name: The name of the person who would be carrying out the test.
Test scenario: The test scenario provides a brief description to the tester,
as in providing a small overview to know about what needs to be performed
and the small features, and components of the test.
Test Case Description: The condition required to be checked for a given
software. for eg. Check if only numbers validation is working or not for an
age input box.
Test Steps: Steps to be performed for the checking of the condition.
Prerequisite: The conditions required to be fulfilled before the start of the
test process.
Test Priority: As the name suggests gives priority to the test cases that had
to be performed first, or are more important and that could be performed
later.
Test Data: The inputs to be taken while checking for the conditions.
Test Expected Result: The output which should be expected at the end of
the test.
Test parameters: Parameters assigned to a particular test case.
Actual Result: The output that is displayed at the end.
Environment Information: The environment in which the test is being
performed, such as the operating system, security information, the software
name, software version, etc.
Status: The status of tests such as pass, fail, NA, etc.
Comments: Remarks on the test regarding the test for the betterment of the
software.
Functional Testing
Functional testing is defined as a type of testing that verifies that each
function of the software application works in conformance with the
requirement and specification.
This testing is not concerned with the source code of the application. Each
functionality of the software application is tested by providing appropriate
test input, expecting the output, and comparing the actual output with the
expected output.
This testing focuses on checking the user interface, APIs, database,
security, client or server application, and functionality of the Application
Under Test. Functional testing can be manual or automated. It determines
the system’s software functional requirements.
Regression Testing
Regression Testing is the process of testing the modified parts of the code
and the parts that might get affected due to the modifications to ensure that
no new errors have been introduced in the software after the modifications
have been made.
Regression means the return of something and in the software field, it
refers to the return of a bug. It ensures that the newly added code is
compatible with the existing code.
In other words, a new software update has no impact on the functionality of
the software. This is carried out after a system maintenance operation and
upgrades.
Non-functional Testing
Non-functional testing is a software testing technique that checks the non-
functional attributes of the system.
Non-functional testing is defined as a type of software testing to check non-
functional aspects of a software application.
It is designed to test the readiness of a system as per non-functional
parameters which are never addressed by functional testing.
Non-functional testing is as important as functional testing.
Non-functional testing is also known as NFT. This testing is not functional
testing of software. It focuses on the software’s performance, usability, and
scalability.
Advantages of Black Box Testing:
The tester does not need to have more functional knowledge or
programming skills to implement the Black Box Testing.
It is efficient for implementing the tests in the larger system.
Tests are executed from the user’s or client’s point of view.
Test cases are easily reproducible.
It is used to find the ambiguity and contradictions in the functional
specifications.
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 .
1. Statement Coverage
In this technique, the aim is to traverse all statements at least once. Hence,
each line of code is tested. In the case of a flowchart, every node must be
traversed at least once. Since all lines of code are covered, it helps in pointing
out faulty code.
2. Branch Coverage
In this technique, test cases are designed so that each branch from all decision
points is traversed at least once. In a flowchart, all edges must be traversed at
least once.
3. Condition Coverage
In this technique, all individual conditions must be covered as shown in the
following example:
READ X, Y
IF(X == 0 || Y == 0)
PRINT ‘0’
#TC1 – X = 0, Y = 55
#TC2 – X = 5, Y = 0
4. Multiple Condition Coverage
In this technique, all the possible combinations of the possible outcomes of
conditions are tested at least once. Let’s consider the following example:
READ X, Y
IF(X == 0 || Y == 0)
PRINT ‘0’
#TC1: X = 0, Y = 0
#TC2: X = 0, Y = 5
#TC3: X = 55, Y = 0
#TC4: X = 55, Y = 5
In this technique, control flow graphs are made from code or flowchart and
then Cyclomatic complexity is calculated which defines the number of
independent paths so that the minimal number of test cases can be designed for
each independent path. Steps:
Make the corresponding control flow graph
Calculate the cyclomatic complexity
Find the independent paths
Design test cases corresponding to each independent path
V(G) = P + 1, where P is the number of predicate nodes in the flow graph
V(G) = E – N + 2, where E is the number of edges and N is the total
number of nodes
V(G) = Number of non-overlapping regions in the graph
#P1: 1 – 2 – 4 – 7 – 8
#P2: 1 – 2 – 3 – 5 – 7 – 8
#P3: 1 – 2 – 3 – 6 – 7 – 8
#P4: 1 – 2 – 4 – 7 – 1 – . . . – 7 – 8
6. Loop Testing
Loops are widely used and these are fundamental to many algorithms hence,
their testing is very important. Errors often occur at the beginnings and ends of
loops.
Simple loops: For simple loops of size n, test cases are designed that:
1. Skip the loop entirely
2. Only one pass through the loop
3. 2 passes
4. m passes, where m < n
5. n-1 ans n+1 passes
Nested loops: For nested loops, all the loops are set to their minimum
count, and we start from the innermost loop. Simple loop tests are
conducted for the innermost loop and this is worked outwards till all the
loops have been tested.
Concatenated loops: Independent loops, one after another. Simple loop
tests are applied for each. If they’re not independent, treat them like
nesting.
1. 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.
2. 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.
3. 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.
4. Identifying logical errors: White box testing helps to identify logical
errors in the code, such as infinite loops or incorrect conditional statements.
5. 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.
6. 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.
7. 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.
8. 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.
9. Verification of Design: It verifies that the software’s internal design is
implemented in accordance with the designated design documents.
10.Check for Accurate Code: It verifies that the code operates in accordance
with the guidelines and specifications.
11.Determining the Dead Code: It finds and remove any code that isn’t used
when the programme is running normally (dead code).
1. Thorough Testing: White box testing is thorough as the entire code and
structures are tested.
2. Code Optimization: It results in the optimization of code removing errors
and helps in removing extra lines of code.
3. 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.
4. Integration with SDLC: White box testing can be easily started in
Software Development Life Cycle.
5. Detection of Complex Defects: Testers can identify defects that cannot be
detected through other testing techniques.
6. Comprehensive Test Cases: Testers can create more comprehensive and
effective test cases that cover all code paths.
7. Testers can ensure that the code meets coding standards and is optimized
for performance.
Disadvantages of Experience-Based
Testing:
1) Verification Process:
In the IVR system, it is very important to test whether the call is transferred to
the correct agent or not. There are different agents available for different areas
and they are experts in their area only.
It is the most significant method to provide input to the IVR system. DTMF
inputs are given using the digits 0 to 9 and sometimes * and # from the phone
keypad. For every menu and sub-menu, a caller has to provide different DTMF
inputs and it is a tedious task to test every input in each menu and sub-menu.
Many a time it happens that the caller is not able to recognize or does not follow
the message or prompt played by the IVR system. Then the caller becomes
silent as he is not sure about the options being given by the IVR application.
The test Execution technique consists of three different phases which will be
carried out to process the test result and ensure the correctness of the required
results. In each phase, various activities or work will be carried out by various
team members. The three main phases of test execution are the creation of test
cases, test case execution, and validation of test results. Let us discuss each
phase.
1. Creation of Test Cases: The first phase is to create suitable test cases for
each module or function. Here, the tester with good domain knowledge must
be required to create suitable test cases. It is always preferable to create simple
test cases and the creation of test cases should not be delayed else it will cause
excess time to release the product. The created test cases should not be
repeated again. It should cover all the possible scenarios raised in the
application.
2. Test Cases Execution: After test cases have been created, execution of test
cases will take place. Here, the Quality Analyst team will either do automated
or manual testing depending upon the test case scenario. It is always preferable
to do both automated as well as manual testing to have 100% assurance of
correctness. The selection of testing tools is also important to execute the test
cases.
3. Validating Test Results: After executing the test cases, note down the
results of each test case in a separate file or report. Check whether the
executed test cases achieved the expected result and record the time required
to complete each test case i.e., measure the performance of each test case. If
any of the test cases is failed or not satisfied the condition, then report it to the
development team for validating the code.
In the same way, a test incident report allows the team to document and
classify different incidents that affect the behaviour, performance, and
functionality of the software application. Such incidents include
programming errors, compatibility issues, performance bottlenecks, and
security vulnerabilities.
It provides specifics about failed tests, including when they occurred and
supporting evidence.
It prioritizes defects and incidents, saving the team's time, effort, and
resources.
Test logs that demonstrate the execution of various test cases and
procedures.
Expected results/outputs.
Inputs
Actual results of the conducted tests.
Test Item transmittal report: This is the report about the transfer of
tested items from one stage to the next.
Test Log: Log contains the details of the executed tests, the sequence in
which they were executed and also the pass/fail report of tests.
Test Incident report: Key points stating the reason of deviation in actual
and expected results.
Master Test Plan -This describes the overall test plan in detail at various
levels of testing.
Level Test Plan -For each level of test process, its scope, approach and
the schedule needs to be defined for carrying out the testing activities.
The component to be tested, their features, and the risks involved in
implementing each test condition.
Level Test Procedure - Detail regarding how the test cases are to be
executed, including the specified preconditions and steps to be followed.
Anomaly Report - This report is to mark any issues, defect, test incident
or error report. This document is basically to note the failure report, and
solutions for such issues, if any.
Level interim test status report - This document aims to record the
summary of results for each level of test.
2. Planning Tests: The proper planning for software testing involves the
formulation of a test objective, test strategy, and schedule. A plan helps
developers of the software in many ways like analysing the effort required
to validate the quality of the software, fixing a schedule for appropriate
testing of the software, etc. The planning of software testing involves
multiple steps such as:
Product Analysis: To understand the software, for example, the GFG
application, first of all, we need to know everything that is to know
about the application itself after that we need to know about the users
who use the application and what are their expectations from the
application.
Suspension: The suspension criteria tells that if the failure rate of the
testing of a specific software project reaches a particular threshold then
the testing of the software should be stopped temporarily until those errors
are fixed and the test result should be marked as failed.
Exit: The exit criteria tell that if the success rate of the testing of a specific
software project reaches a particular threshold then the testing of the
software should be stopped and the results of the testing should be
marked as passed.
Risk assessment: Identifying the risks associated with the project is also
an important task during planning. The developers do the feasibility
study of the project to find the best approach for developing the software
with the least amount of risk involved.
Selecting the testers: Choosing the right testers for the software is also
important. The skills belonging to the tester must qualify to support the
results produced by him/her during the test.