Introduction to Software Testing Concepts
Introduction to Software Testing Concepts
Overview of Software Testing-Definition, objectives, and importance of software testing, Software Development
Life Cycle (SDLC) and Testing-Role of testing in different SDLC phases, Testing Levels and Types-Unit testing,
integration testing, system testing, acceptance testing.
Software Testing:
Definition 1- "Software testing is a process, to evaluate the functionality of a software application with an intent
to find whether the developed software met the specified requirements or not and to identify the defects to ensure
that the product is defect-free in order to produce the quality product."
Definition 2- “Software testing is the processes of identifying the completeness, Correctness, Quality of the
developed software product. In software testing process the Software is tested in both positive and negative
condition.”
Objectives of Software Testing:
1. Identify Defects:
- The primary objective of software testing is to identify and document defects in the software. Defects can
include bugs, errors, and any other issues that may affect the functionality or performance of the software. By
finding these defects early, testers can ensure they are addressed before the software is released to users.
2. Ensure Quality:
- Software testing aims to verify that the software meets the required standards and specifications. This
involves checking that the software functions as intended and meets the quality criteria set by stakeholders.
Ensuring quality helps in delivering a reliable and robust product.
3. Validate Functionality:
- Testing involves validating that the software behaves as expected under various conditions. This includes
checking if the software performs correctly according to the defined requirements and use cases. Functional
validation ensures that all features work as intended and that the software provides the expected results.
4. Improve Performance:
- Performance testing is an essential part of software testing, aimed at ensuring the software performs
efficiently. This includes testing for speed, scalability, and optimal use of resources. Performance testing helps
identify bottlenecks and areas where the software can be optimized for better performance.
5. Enhance Security:
- Security testing is critical to identify vulnerabilities and ensure the software is secure against potential
threats. This involves testing for issues such as data breaches, unauthorized access, and other security risks.
Enhancing security through testing helps protect sensitive information and maintain user trust.
6. Ensure Usability:
- Usability testing focuses on verifying that the software is user-friendly and provides a good user experience.
This involves testing the interface, navigation, and overall ease of use. Ensuring usability is crucial for user
satisfaction and adoption of the software.
7. Compliance Verification:
- Compliance testing ensures that the software adheres to relevant laws, regulations, and industry standards.
This is particularly important for software in regulated industries, such as healthcare or finance. Compliance
verification helps avoid legal issues and ensures that the software meets all necessary regulatory requirements.
1
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
8. Reliability Assurance:
- Reliability testing aims to confirm that the software can operate consistently over time without failures. This
includes testing the software under different conditions and over extended periods. Ensuring reliability is
important for maintaining the software's stability and dependability.
9. Facilitate Maintenance:
- Effective software testing includes documenting tests and results to facilitate future maintenance. Well-
documented testing processes and outcomes make it easier to understand the software's behavior and implement
updates or fixes. This helps in maintaining the software over its lifecycle.
10. Risk Reduction:
- Testing helps minimize the risks associated with software failure in production. By thoroughly testing the
software, potential issues can be identified and mitigated before the software is deployed. Risk reduction is
essential for preventing costly failures and ensuring smooth operation of the software in the real world.
2
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Software Validation
Validation is process of examining whether or not the software satisfies the user requirements. It is
carried out at the end of the SDLC. If the software matches requirements for which it was made, it is
validated.
Validation ensures the product under development is as per the user requirements.
Validation answers the question – "Are we developing the product which attempts all that user needs
from this software ?".
Validation emphasizes on user requirements.
Software Verification
Verification is the process of confirming if the software is meeting the business requirements, and is
developed adhering to the proper specifications and methodologies.
Errors - These are actual coding mistakes made by developers. In addition, there is a difference in
output of software and desired output, is considered as an error.
Fault - When error exists fault occurs. A fault, also known as a bug, is a result of an error which can
cause system to fail.
Failure - failure is said to be the inability of the system to perform the desired task. Failure occurs when
fault exists in the system.
Manual - This testing is performed without taking help of automated testing tools. The software tester
prepares test cases for different sections and levels of the code, executes the tests and reports the result to
the manager.
Manual testing is time and resource consuming. The tester needs to confirm whether or not right test
cases are used. Major portion of testing involves manual testing.
Automated This testing is a testing procedure done with aid of automated testing tools. The limitations
with manual testing can be overcome using automated test tools.
3
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
A test needs to check if a webpage can be opened in Internet Explorer. This can be easily done with
manual testing. But to check if the web-server can take the load of 1 million users, it is quite impossible
to test manually.
There are software and hardware tools which helps tester in conducting load testing, stress testing,
regression testing.
Testing Approaches
Functionality testing
Implementation testing
When functionality is being tested without taking the actual implementation in concern it is known as
black-box testing. The other side is known as white-box testing where not only functionality is tested but
the way it is implemented is also analyzed.
Exhaustive tests are the best-desired method for a perfect testing. Every single possible value in the
range of the input and output values is tested. It is not possible to test each and every value in real world
scenario if the range of values is large.
Black-box testing
It is carried out to test functionality of the program. It is also called ‘Behavioral’ testing. The tester in
this case, has a set of input values and respective desired results. On providing input, if the output
matches with the desired results, the program is tested ‘ok’, and problematic otherwise.
In this testing method, the design and structure of the code are not known to the tester, and testing
engineers and end users conduct this test on the software.
Equivalence class - The input is divided into similar classes. If one element of a class passes the test, it
is assumed that all the class is passed.
Boundary values - The input is divided into higher and lower end values. If these values pass the test, it
is assumed that all values in between may pass too.
Cause-effect graphing - In both previous methods, only one input value at a time is tested. Cause (input)
– Effect (output) is a testing technique where combinations of input values are tested in a systematic way.
4
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Pair-wise Testing - The behavior of software depends on multiple parameters. In pairwise testing, the
multiple parameters are tested pair-wise for their different values.
State-based testing - The system changes state on provision of input. These systems are tested based on
their states and input.
White-box testing
It is conducted to test program and its implementation, in order to improve code efficiency or structure.
It is also known as ‘Structural’ testing.
In this testing method, the design and structure of the code are known to the tester. Programmers of the
code conduct this test on the code.
Control-flow testing - The purpose of the control-flow testing to set up test cases which covers all
statements and branch conditions. The branch conditions are tested for both being true and false, so that
all statements can be covered.
Data-flow testing - This testing technique emphasis to cover all the data variables included in the
program. It tests where the variables were declared and defined and where they were used or changed.
Testing Levels
Testing itself may be defined at various levels of SDLC. The testing process runs parallel to software
development. Before jumping on the next stage, a stage is tested, validated and verified.
Testing separately is done just to make sure that there are no hidden bugs or issues left in the software.
Software is tested on various levels -
Unit Testing
While coding, the programmer performs some tests on that unit of program to know if it is error free.
Testing is performed under white-box testing approach. Unit testing helps developers decide that
individual units of the program are working as per requirement and are error free.
Integration Testing
5
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Even if the units of software are working fine individually, there is a need to find out if the units if
integrated together would also work without errors. For example, argument passing and data updation
etc.
System Testing
The software is compiled as product and then it is tested as a whole. This can be accomplished using one
or more of the following tests:
Functionality testing - Tests all functionalities of the software against the requirement.
Performance testing - This test proves how efficient the software is. It tests the effectiveness and
average time taken by the software to do desired task. Performance testing is done by means of load
testing and stress testing where the software is put under high user and data load under various
environment conditions.
Security & Portability - These tests are done when the software is meant to work on various platforms
and accessed by number of persons.
Acceptance Testing
When the software is ready to hand over to the customer it has to go through last phase of testing where
it is tested for user-interaction and response. This is important because even if the software matches all
user requirements and if user does not like the way it appears or works, it may be rejected.
Alpha testing - The team of developer themselves perform alpha testing by using the system as if it is
being used in work environment. They try to find out how user would react to some action in software
and how the system should respond to inputs.
Beta testing - After the software is tested internally, it is handed over to the users to use it under their
production environment only for testing purpose. This is not as yet the delivered product. Developers
expect that users at this stage will bring minute problems, which were skipped to attend.
Regression Testing
Whenever a software product is updated with new code, feature or functionality, it is tested thoroughly
to detect if there is any negative impact of the added code. This is known as regression testing.
Testing Documentation
Before Testing
Testing starts with test cases generation. Following documents are needed for reference –
6
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Test Policy document - This describes how far testing should take place before releasing the product.
Test Strategy document - This mentions detail aspects of test team, responsibility matrix and
rights/responsibility of test manager and test engineer.
Traceability Matrix document - This is SDLC document, which is related to requirement gathering
process. As new requirements come, they are added to this matrix. These matrices help testers know the
source of requirement. They can be traced forward and backward.
The following documents may be required while testing is started and is being done:
Test Case document - This document contains list of tests required to be conducted. It includes Unit test
plan, Integration test plan, System test plan and Acceptance test plan.
Test description - This document is a detailed description of all test cases and procedures to execute
them.
Test case report - This document contains test case report as a result of the test.
Test logs - This document contains test logs for every test case report.
After Testing
Test summary - This test summary is collective analysis of all test reports and logs. It summarizes and
concludes if the software is ready to be launched. The software is released under version control system
if it is ready to launch.
We need to understand that software testing is different from software quality assurance, software
quality control and software auditing.
Software quality assurance - These are software development process monitoring means, by which it is
assured that all the measures are taken as per the standards of organization. This monitoring is done to
make sure that proper software development methods were followed.
Software quality control - This is a system to maintain the quality of software product. It may include
functional and non-functional aspects of software product, which enhance the goodwill of the
organization. This system makes sure that the customer is receiving quality product for their requirement
and the product certified as ‘fit for use’.
Software audit - This is a review of procedure used by the organization to develop the software. A team
of auditors, independent of development team examines the software process, procedure, requirements
and other aspects of SDLC. The purpose of software audit is to check that software and its development
process, both conform standards, rules and regulations.
7
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Software Development Life Cycle, SDLC for short, is a well-defined, structured sequence of stages in
software engineering to develop the intended software product.
SDLC Activities
SDLC provides a series of steps to be followed to design and develop a software product efficiently.
SDLC framework includes the following steps:
Communication
This is the first step where the user initiates the request for a desired software product. He contacts the
service provider and tries to negotiate the terms. He submits his request to the service providing
organization in writing.
Requirement Gathering
This step onwards the software development team works to carry on the project. The team holds
discussions with various stakeholders from problem domain and tries to bring out as much information
as possible on their requirements. The requirements are contemplated and segregated into user
requirements, system requirements and functional requirements. The requirements are collected using a
number of practices as given -
8
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Feasibility Study
After requirement gathering, the team comes up with a rough plan of software process. At this step the
team analyzes if a software can be made to fulfill all requirements of the user and if there is any
possibility of software being no more useful. It is found out, if the project is financially, practically and
technologically feasible for the organization to take up. There are many algorithms available, which help
the developers to conclude the feasibility of a software project.
System Analysis
At this step the developers decide a roadmap of their plan and try to bring up the best software model
suitable for the project. System analysis includes Understanding of software product limitations, learning
system related problems or changes to be done in existing systems beforehand, identifying and
addressing the impact of project on organization and personnel etc. The project team analyzes the scope
of the project and plans the schedule and resources accordingly.
Software Design
Next step is to bring down whole knowledge of requirements and analysis on the desk and design the
software product. The inputs from users and information gathered in requirement gathering phase are the
inputs of this step. The output of this step comes in the form of two designs; logical design and physical
design. Engineers produce meta-data and data dictionaries, logical diagrams, data-flow diagrams and in
some cases pseudo codes.
Coding
This step is also known as programming phase. The implementation of software design starts in terms of
writing program code in the suitable programming language and developing error-free executable
programs efficiently.
Testing
An estimate says that 50% of whole software development process should be tested. Errors may ruin the
software from critical level to its own removal. Software testing is done while coding by the developers
and thorough testing is conducted by testing experts at various levels of code such as module testing,
program testing, product testing, in-house testing and testing the product at user’s end. Early discovery
of errors and their remedy is the key to reliable software.
Integration
Software may need to be integrated with the libraries, databases and other program(s). This stage of
SDLC is involved in the integration of software with outer world entities.
9
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Implementation
This means installing the software on user machines. At times, software needs post-installation
configurations at user end. Software is tested for portability and adaptability and integration related
issues are solved during implementation.
This phase confirms the software operation in terms of more efficiency and less errors. If required, the
users are trained on, or aided with the documentation on how to operate the software and how to keep
the software operational. The software is maintained timely by updating the code according to the
changes taking place in user end environment or technology. This phase may face challenges from
hidden bugs and real-world unidentified problems.
Disposition
As time elapses, the software may decline on the performance front. It may go completely obsolete or
may need intense upgradation. Hence a pressing need to eliminate a major portion of the system arises.
This phase includes archiving data and required software components, closing down the system,
planning disposition activity and terminating system at appropriate end-of-system time.
The software development paradigm helps developer to select a strategy to develop the software. A
software development paradigm has its own set of tools, methods and procedures, which are expressed
clearly and defines software development life cycle. A few of software development paradigms or
process models are defined as follows:
Waterfall Model
Waterfall model is the simplest model of software development paradigm. It says the all the phases of
SDLC will function one after another in linear manner. That is, when the first phase is finished then only
the second phase will start and so on.
10
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
This model assumes that everything is carried out and taken place perfectly as planned in the previous
stage and there is no need to think about the past issues that may arise in the next phase. This model does
not work smoothly if there are some issues left at the previous step. The sequential nature of model does
not allow us go back and undo or redo our actions.
This model is best suited when developers already have designed and developed similar software in the
past and are aware of all its domains.
Iterative Model
This model leads the software development process in iterations. It projects the process of development
in cyclic manner repeating every step after every cycle of SDLC process.
The software is first developed on very small scale and all the steps are followed which are taken into
consideration. Then, on every next iteration, more features and modules are designed, coded, tested and
added to the software. Every cycle produces a software, which is complete in itself and has more features
and capabilities than that of the previous one.
After each iteration, the management team can do work on risk management and prepare for the next
iteration. Because a cycle includes small portion of whole software process, it is easier to manage the
development process but it consumes more resources.
Spiral Model
Spiral model is a combination of both, iterative model and one of the SDLC model. It can be seen as if
you choose one SDLC model and combine it with cyclic process (iterative model).
11
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
This model considers risk, which often goes un-noticed by most other models. The model starts with
determining objectives and constraints of the software at the start of one iteration. Next phase is of
prototyping the software. This includes risk analysis. Then one standard SDLC model is used to build
the software. In the fourth phase of the plan of next iteration is prepared.
V – model
The major drawback of waterfall model is we move to the next stage only when the previous one is
finished and there was no chance to go back if something is found wrong in later stages. V-Model
provides means of testing of software at each stage in reverse manner.
12
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
At every stage, test plans and test cases are created to verify and validate the product according to the
requirement of that stage. For example, in requirement gathering stage the test team prepares all the test
cases in correspondence to the requirements. Later, when the product is developed and is ready for
testing, test cases of this stage verify the software against its validity towards requirements at this stage.
This makes both verification and validation go in parallel. This model is also known as verification and
validation model.
This model is the simplest model in its form. It requires little planning, lots of programming and lots of
funds. This model is conceptualized around the big bang of universe. As scientists say that after big bang
lots of galaxies, planets and stars evolved just as an event. Likewise, if we put together lots of
programming and funds, you may achieve the best software product.
13
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
For this model, very small amount of planning is required. It does not follow any process, or at times the
customer is not sure about the requirements and future needs. So the input requirements are arbitrary.
This model is not suitable for large software projects but good one for learning and experimenting.
The role of testing in the Software Development Life Cycle (SDLC) is to ensure that the final product
meets the user's expectations. Testing is a crucial phase that can help reduce costs, improve quality, and
increase user satisfaction.
Here are some ways testing is important in different phases of the SDLC:
Early testing: Testing early in the SDLC can help minimize the cost of fixing bugs.
Quality assurance: Testing is a way to ensure that the product meets quality standards.
User satisfaction: Proper testing can lead to more customer engagement and improved
productivity.
Cost savings: Testing can reduce the overall cost of product development and maintenance.
Bug prevention: Designing tests well can help prevent bugs before they are coded.
Security: Security testing can help identify flaws that could expose users' personal data or make the
software susceptible to malware.
During the testing phase, developers use a test plan to identify and investigate any issues. The test
plan includes the types of testing to be performed, who will be testing, and how the software will be
tested. Some types of testing include:
Unit testing
Integration testing
System testing
Acceptance testing
Quality assurance testing (QA)
User acceptance testing (UAT)
Software Testing Life Cycle (STLC) is a process used to test software and ensure that quality
standards are met. Tests are carried out systematically over several phases. During product
development, phases of the STLC may be performed multiple times until a product is deemed
suitable for release.
14
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
1. Requirement Analysis
2. Test Planning
3. Test case development
4. Test Environment setup
5. Test Execution
6. Test Cycle closure
Each of these stages has a definite Entry and Exit criteria, Activities & Deliverables associated
with it.
During this phase, feature requirements collected in the SDLC process are evaluated to identify
testable aspects. If necessary, testing teams may need to consult with stakeholders to clarify
requirements. These requirements can either be functional or non-functional, defining what a
feature can do or it’s characteristics respectively. The ability to automate testing is also evaluated
during this phase.
Deliverables
RTM
Automation feasibility report
During this phase, the test strategy is outlined in a test plan document. This strategy includes
tools needed, testing steps, and roles and responsibilities. Part of determining this strategy is a risk
and cost analysis and an estimated timeline for testing.
Deliverables
During this phase, test cases are created. Each case defines test inputs, procedures, execution
conditions, and anticipated results. Test cases should be transparent, efficient, and adaptable. Once
all test cases are created, test coverage should be 100%. Any necessary automation scripts are also
created during this phase.
Deliverables
Test
cases/scripts
Test data
16
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
During this phase, testing environments are configured and deployed. This phase may include a
variety of testing tools, including TestComplete, Selenium, Appium, or Katalon Studio. Sometimes,
this phase also includes setting up test servers. Once environments are deployed, smoke tests are
performed to ensure that environments are working as expected with all intended functionality.
Deliverables
During this phase, features are tested in the deployed environment, using the established test
cases. Expected test results are compared to actual and results are gathered to report back to
development teams.
Deliverables
This is the last phase of the STLC, during which a test result report is prepared. This report
should summarize the entire testing process and provide comparisons between expected results and
actual. These comparisons include objectives met, time taken, total costs, test coverage, and any
defects found.
17
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Evaluate cycle completion criteria based on Time, Test coverage, Cost, Software,
Critical Business Objectives, Quality
Prepare test metrics
Prepare Test closure report
Qualitative and quantitative reporting of quality of the work product to the customer.
Test result analysis
Deliverables
Test Closure
report
Test metrics
The V-model of SDLC carries out its execution in a sequential manner. This model is also
popularly termed as a Verification and Validation model. Each phase has to be finished before
beginning the next phase. A sequential design progression is followed like that of the waterfall
model.
18
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Verification: In the concept of verification in the V-Model, static analysis technique is carried out
without executing the code. This evaluation procedure is carried out at the time of development to
check whether specific requirements will meet or not.
Validation: This concept of V-Model comprises of dynamic analysis practice (both functional as
well as non-functional), and testing is done by code execution. The validation of a product is done
once the development is complete for determining if the software meets up the customer hope
needs.
So both verification and validation are combined and work in parallel to make the V- Model fully
functional.
Design Phase
➢ Requirement Analysis: In this stage of SDLC, a detailed conversation with the customer is
made to understand their requirements as well as anticipation. Requirement gathering is
another name of this phase.
➢ System Design or High-level Design: In this phase of SDLC, the system is designed with
the entire hardware & the setup is constructed for product development.
➢ Architectural Design: The breakdown of system design to a more detailed version, i.e.,
into modules which creates different functionalities. Transferring of data and connection
between internal and external modules (i.e., the outside world) is evidently identified.
➢ Low-level design or Module Design: This particular phase breaks down the entire product
development into tiny modules where each intended module is specified. So it is also
termed as Low-Level Design (LLD).
Testing Phase
➢ Unit Testing: During the development of module design, unit testing is carried out. This
plan is executed for eliminating bugs that are found in code at the development of your
software.
➢ Integration Testing: Once the unit testing is done, the integration testing is carried out
where the integration of modules in the system is hardened. This testing is done in the
architecture design phase.
➢ System Testing: This ultimate test is done when the entire product is completed in
conjunction with the functionality, internal dependency requirement and merging of
different modules into a single unit.
➢ User Acceptance Testing: This type of testing is carried out in front of the user or in a user
environment where the product will ultimately set up. The UAT particularly test whether
the product is capable enough to launch in the market or ready to work in the real world.
19
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
The reasons for program correctness and verification and some of them are as follows
➢ The focus of software testing is to run the program on selected input data and check
whether the program behaves correctly with respect to its specification. The behavior of the
program can be analyzed only if we know what is a correct behavior; hence the study of
correctness is an integral part of software testing.
➢ The study of program correctness leads to analyze candidate programs at arbitrary levels of
granularity; in particular, it leads to make assumptions on the behavior of the program at
specific stages in its execution and to verify (or disprove) these assumptions; the same
assumptions can be checked at run-time during testing, giving us valuable information as
we try to diagnose the program or establish its correctness. Hence to prove program
correctness enable us to be better/more effective testers.
Unit Testing
Unit Testing is a type of software testing where individual units or components of a
software are tested. The purpose is to validate that each unit of the software code
performs as expected.
Unit Testing is done during the development (coding phase) of an application by the
developers.
Unit Tests isolate a section of code and verify its correctness.
A unit may be an individual function, method, procedure, module, or object.
20
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Unit tests help to fix bugs early in the development cycle and save costs.
It helps the developers to understand the testing code base and enables them to
make changes quickly
Good unit tests serve as project documentation
Unit tests help with code re-use. Migrate both your code and your tests to your new
project. Tweak the code until the tests run again.
The workflow of Unit Testing is 1) Create Test Cases 2) Review/Rework 3) Baseline 4) Execute
Test Cases.
21
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Integration Testing
Integration testing is known as the second level of the software testing process,
following unit testing. Integration testing involves checking individual components or
units of a software project to expose defects and problems to verify that they work
together as designed.
The main function or goal of this testing is to test the interfaces between the
units/modules.
The individual modules are first tested in isolation. Once the modules are unit tested,
they are integrated one by one, till all the modules are integrated, to check the
combinational behavior, and validate whether the requirements are implemented
correctly or not.
22
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Test
Case Test Case Objective Test Case Expected Result
ID Description
1 Check the interface link Enter login To be directed to the Mail
between the Login and credentials and click on Box
Mailbox module the Login button
2 Check the interface link From Mailbox select the Selected email should
between the Mailbox and email and click a appear in the
Delete Mails Module delete button Deleted/Trash folder
Types of Integration Testing
Software Engineering defines variety of strategies to execute Integration testing, viz.
Incremental Testing
In the Incremental Testing approach, testing is done by integrating two or more
modules that are logically related to each other and then tested for proper functioning
of the application. Then the other related modules are integrated incrementally and the
process continues until all the logically related modules are integrated and tested
successfully.
Incremental Approach, in turn, is carried out by two different Methods:
Bottom Up
Top Down
23
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Stubs Driver
Used in Top down approach Used in Bottom up approach
Top most module is tested first Lowest modules are tested first.
Stimulates the lower level of Stimulates the higher level of
components components
Dummy program of lower Dummy program for Higher level
level components component
24
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
Advantages:
Fault localization is easier.
No time is wasted waiting for all modules to be developed unlike Big- bang
approach
Disadvantages:
Critical modules (at the top level of software architecture) which control the flow of
application are tested last and may be prone to defects.
An early prototype is not possible
Advantages:
Fault Localization is easier.
Possibility to obtain an early prototype.
Critical Modules are tested on priority; major design flaws could be found and
fixed first.
Disadvantages:
Needs many Stubs.
Modules at a lower level are tested inadequately.
Sandwich Testing
Sandwich Testing is a strategy in which top level modules are tested with lower
level modules at the same time lower modules are integrated with top modules and
tested as a system.
It is a combination of Top-down and Bottom-up approaches therefore it is called
Hybrid Integration Testing. It makes use of both stubs as well as drivers.
25
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
System Testing
System testing, also referred to as system-level testing or system
integration testing, is the process in which a quality assurance (QA)
team evaluates how the various components of an application interact
together in the full, integrated system or application.
System testing verifies that an application performs tasks as designed.
It's a type of black box testing that focuses on the functionality of an
application rather than the inner workings of a system, which white
box testing is concerned with.
26
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
27
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
28
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
29
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
30
Course Code/Title: CS2602/SOFTWARE TESTING Unit: I
31
Course Code/Title:CS2602/Software Testing Unit: II
Testing Levels
1. Unit Testing
o Tests individual modules of the source code to ensure they work properly.
2. Integration Testing
o Tests the interfaces and interactions between integrated units or modules.
3. System Testing
o Validates the complete and fully integrated software application.
4. Acceptance Testing
1
Course Code/Title:CS2602/Software Testing Unit: II
o Ensures the software meets business requirements and is ready for customer sign-off.
o Types of Acceptance Testing: Alpha Testing, Beta Testing, Gamma Testing.
Black box testing involves testing a system with no prior knowledge of its internal workings.
A tester provides an input, and observes the output generated by the system under test. This makes
it possible to identify how the system responds to expected and unexpected user actions, its
response time, usability issues and reliability issues.
Black box testing is a powerful testing technique because it exercises a system end-to-end.
Black box testing checks that the system as a whole is working as expected.
2
Course Code/Title:CS2602/Software Testing Unit: II
1. Equivalence Partitioning:
The word Equivalence means the condition of being equal or equivalent in value, worth, function, etc. The
synonyms for the word are equal, same, identical etc. Equivalence Partitioning is a black box technique to
identify test cases systematically and is often the first technique to be applied when designing test cases.
Equivalence Partitioning is based on the idea that it in many cases the inputs/outputs to a program can be
chunked into groups or classes which have the same behaviour. Eg. Alphabets, Numbers, range of numbers etc
Example: Let us consider a program that separates integers into positive or negative. And accepts any number
between -5 and + 5.
The range of input integers can be split into the following partitions :
-5 -1 0 1 5 >5 < -5
Each of these is known as an ‘equivalence partition’ because every value inside the partition is exactly
equivalent to any other value as far as the program is concerned. So -3 is exactly the same as -2, -1, -4, -5 and
1 is the same as 2,3,4,5. And testing with any one of these values is representative of the entire partition. Thus
equivalence partitioning takes advantage of the properties of equivalence partitions to reduce the number of test
cases. Each equivalence partition covers a large set of other tests.
The first three partitions are called Valid partitions because they are within the range accepted by the
program. The last two are called Invalid partitions because they are outside the range. We can add more to
the invalid partitions: decimal number partitions, alphabets etc.
The above are all examples of Input partitions because the partitions are based on the inputs to the program.
Output partitions:
Just as the inputs to a program can be partitioned, the outputs of a program could be partitioned.
Let us consider a bank account program that offers 0.5 percent interest for the first $1000 savings, 1 percent for
the next $1000 and 1.5 percent for the rest.
The outputs can be identified as: 0.5 % , 1 %, 1.5 %
3
Course Code/Title:CS2602/Software Testing Unit: II
Though the program mentions three partitions, we have identified four, 3 valid and one invalid condition. The
Invalid partition will be used to test for proper error messages.
By identifying the partitions with cents eg 1000 .01, the test cases add to the clarity of the program.
Steps to identify the test cases:
1. Identify the inputs/outputs from the specification eg. input fields in a form, inputs to command line programs,
outputs-messages, calculations etc.
2. Identify the equivalence partitions or classes for the inputs/outputs identified
For a boundary value – 1 valid equivalence partition (within the boundary) and one 1 invalid equivalence
partition (outside the boundary).
For a Boolean, 1 valid equivalence partition (true) and 1 invalid equivalence partition (false)
For a range, 1 valid equivalence partition (within the range) and two invalid equivalence partitions(one
outside each end of the range)
If the input is a set of valid values, 1 valid equivalence partition (from within the set) and 1
invalid equivalence partition (outside the set)
For a mandatory input, empty(invalid) and valid inputs.
3. Write test cases for the valid partitions followed by invalid partitions. There could be an overlap sometimes
and new partitions identified as the test case design progresses.
4
Course Code/Title:CS2602/Software Testing Unit: II
2. Identify the boundaries for each of the partitions and write test cases for the boundaries identified using
BVA.
Example
Assume, we have to test a field which accepts Age 18 – 56
That's why it is also known as a cause-effect table. This technique is used to pick the test cases in a systematic
manner; it saves the testing time and gives good coverage to the testing area of the software application.
Decision table technique is appropriate for the functions that have a logical relationship between two and more than
two inputs.
This technique is related to the correct combination of inputs and determines the result of various combinations of
input. To design the test cases by decision table technique, we need to consider conditions as input and actions as
output.
5
Course Code/Title:CS2602/Software Testing Unit: II
Example:If both email and password are correctly matched, the user will be directed to the email account's
homepage; otherwise, it will come back to the login page with an error message specified with "Incorrect Email" or
"Incorrect Password."
Now, let's see how a decision table is created for the login function in which we can log in by using email and
password. Both the email and the password are the conditions, and the expected result is action.
In the table, there are four conditions or test cases to test the login function. In the first condition if both email and
password are correct, then the user should be directed to account's Homepage.
In the second condition if the email is correct, but the password is incorrect then the function should display
Incorrect Password. In the third condition if the email is incorrect, but the password is correct, then it should
display Incorrect Email.
Now, in fourth and last condition both email and password are incorrect then the function should display Incorrect
Email.
In this example, all possible conditions or test cases have been included, and in the same way, the testing team also
includes all possible test cases so that upcoming bugs can be cured at testing level.
In order to find the number of all possible conditions, tester uses 2n formula where n denotes the number of inputs;
in the example there is the number of inputs is 2 (one is true and second is false).
While using the decision table technique, a tester determines the expected output, if the function produces expected
output, then it is passed in testing, and if not then it is failed. Failed software is sent back to the development team
to fix the defect.
Example: In ATMs, when we withdraw money from it, it displays account details at last. Now we again do another
transaction, then it again displays account details, but the details displayed after the second transaction are different
from the first transaction, but both details are displayed by using the same function of the ATM. So the same
function was used here but each time the output was different, this is called state transition. In the case of testing of
a software application, this method tests whether the function is following state transition specifications on entering
different inputs.
6
Course Code/Title:CS2602/Software Testing Unit: II
This applies to those types of applications that provide the specific number of attempts to access the application
such as the login function of an application which gets locked after the specified number of incorrect attempts. Let's
see in detail, in the login function we use email and password, it gives a specific number of attempts to access the
application, after crossing the maximum number of attempts it gets locked with an error message.
There is a login function of an application which provides a maximum three number of attempts, and after
exceeding three attempts, it will be directed to an error page.
S4 Home Page
S5 Error Page
In the above state transition table, we see that state S1 denotes first login attempt. When the first attempt is invalid,
the user will be directed to the second attempt (state S2). If the second attempt is also invalid, then the user will be
directed to the third attempt (state S3). Now if the third and last attempt is invalid, then the user will be directed to
the error page (state S5).
But if the third attempt is valid, then it will be directed to the homepage (state S4).
7
Course Code/Title:CS2602/Software Testing Unit: II
S4 Home Page
S5 Error Page
By using the above state transition table we can perform testing of any software application. We can make a state
transition table by determining desired output, and then exercise the software system to examine whether it is
giving desired output or not.
[Link] Guessing:
This technique involves testing for common mistakes developers make when building similar
systems.
For example, testers can check if the developer handled null values in a field, text in a numeric
field or numbers in a text-only field, and sanitization of inputs—whether it is possible to submit
user inputs that contain executable code, which has security significance.
A specific type of error guessing is testing for known software vulnerabilities
that can affect the system under test.
[Link]-pairs Testing:
All-pairs testing technique is also known as pairwise testing. It is used to test all the possible discrete combinations
of values. This combinational method is used for testing the application that uses checkbox input, radio button input
(radio button is used when you have to select only one option for example when you select gender male or female,
you can select only one option), list box, text box, etc.
Suppose, you have a function of a software application for testing, in which there are 10 fields to input the data, so
the total number of discrete combinations is 10 ^ 10 (100 billion), but testing of all combinations is complicated
because it will take a lot of time.
Assume that there is a function with a list box that contains 10 elements, text box that can accept 1 to 100
characters, radio button, checkbox and OK button.
The input values are given below that can be accepted by the fields of the given function.
. Check Box = 2
. List Box = 10
. Radio Button = 2
. Text Box = 100
8
Course Code/Title:CS2602/Software Testing Unit: II
Testing of 4000 positive and negative test cases, is a very long and time-consuming process. Therefore, the task of
the testing team is to reduce the number of test cases, to do this, the testing team considers the list box values in
such a way that the first value is 0, and the other value can be any numeric number, neither positive nor negative.
Ten values are now converted into 2 values.
Values of checkbox and radio button cannot be reduced because each has a combination of only 2 values. At last,
the value of the text box is divided into three input categories valid integer, invalid integer, and alpha-special
character.
2*2*2*3 = 24
Now, the task is to make combinations for all pair technique, into which each column should have an equal number
of values, and the total value should be equal to 24.
In order to make text box column, put the most common input on the first place that is a valid integer, on the
second place put the second most common input that is an invalid integer, and at the last place put the least
common input that is an Alpha Special Character.
Then start filling the table, the first column is a text box with three values, the next column is a list box that has 2
values, the third column is a checkbox that has 2 values, and the last one is a radio button that also has 2 values.
AlphaSpecialCharacter 0 Check ON
9
Course Code/Title:CS2602/Software Testing Unit: II
White box testing is an approach that allows testers to inspect and verify the inner workings of a
software system—its code, infrastructure, and integrations with external systems.
White box testing provides inputs and examines outputs, considering the inner workings of the
code.
White box testing can uncover structural problems, hidden errors and problems with specific components.
Statement coverage will include those statements that are executed at least once during the
execution of the program.
10
Course Code/Title:CS2602/Software Testing Unit: II
Branch coverage will include the outcome for every code module
(statement or loop).
Conditional coverage is used to test the variables used in different types of conditional statements
like IF / ELSE, SWITCH etc.
Decision coverage will include reports for each boolean expression present in the source code. An
expression is said to be boolean if it evaluates to either TRUE or FALSE.
TestingTechniques
Code Coverage
One of the main goals of white box testing is to cover the source code as comprehensively as
possible. Code coverage is a metric that shows how much of an application’s code has unit tests
checking its functionality.
Within code coverage, it is possible to verify how much of an application’s logic is actually
executed and tested by the unit test suite, using concepts like statement coverage, branch coverage,
and path coverage. These concepts are discussed in more detail below.
1. Statement Coverage
Statement coverage is a white box testing technique that ensures all executable statements in the
code are run and tested at least once.
For example, if there are several conditions in a block of code, each of which is used for a certain
range of inputs, the test should execute each and every range of inputs, to ensure all lines of code
are actually executed.
Example:
11
Course Code/Title:CS2602/Software Testing Unit: II
Path Coverage
Path coverage is concerned with linearly independent paths through the code.
Control flow diagram used to design tests in a path coverage approach.
Testers draw a control flow diagram of the code, such as the example below.
In this example, there are several possible paths through the code:
1, 2
12
Course Code/Title:CS2602/Software Testing Unit: II
1, 3, 4, 5, 6, 8
1, 3, 4, 7, 6, 8 ,….etc.
In a path coverage approach, the tester writers unit tests to execute as many as possible of the paths through
the program’s control flow. The objective is to identify paths that are broken, redundant, or inefficient
13
Course Code/Title:CS2602/Software Testing Unit: II
14
Course Code/Title:CS2602/Software Testing Unit: II
15
Course Code/Title:CS2602/Software Testing Unit: II
16
Course Code/Title:CS2602/Software Testing Unit: II
Example:
17
Course Code/Title:CS2602/Software Testing Unit: II
18
Course Code/Title:CS2602/Software Testing Unit: II
Pros Cons
Matrix Testing
This testing technique comes under Grey Box testing. It defines all the used variables of a particular program. In
any program, variable are the elements through which values can travel inside the program. It should be as per
requirement otherwise, it will reduce the readability of the program and speed of the software. Matrix technique is a
method to remove unused and uninitialized variables by identifying used variables from the program.
Regression Testing
Regression testing is used to verify that modification in any part of software has not caused any adverse or
unintended side effect in any other part of the software. During confirmation testing, any defect got fixed, and that
part of software started working as intended, but there might be a possibility that fixed defect may have introduced
a different defect somewhere else in the software. So, regression testing takes care of these type of defects by
testing strategies like retest risky use cases, retest within a firewall, retest all, etc.
19
Course Code/Title:CS2602/Software Testing Unit: II
The purpose of this testing is to cover maximum code with minimum test cases. Test cases are designed in a way
that can cover maximum code as well as GUI functions with a smaller number of test cases.
Pattern Testing
Pattern testing is applicable to such type of software that is developed by following the same pattern of previous
software. In these type of software possibility to occur the same type of defects. Pattern testing determines reasons
of the failure so they can be fixed in the next software.
Usually, automated software testing tools are used in Greybox methodology to conduct the test process. Stubs and
module drivers provided to a tester to relieve from manually code generation.
Test Planning:
The goals of Test Planning
Test Plan is needed for designing test cases and test documentation. To reach the purpose of 100%
correct code, both black box and white box testing techniques will be conducted.
Using such techniques will enable to design test cases that validate the correctness of the
System/Module with respect to the requirements specification.
Test Plan helps us determine the effort needed to validate the quality of the application under test.
The test plan serves as a blueprint to conduct software testing activities as a defined process,
which is monitored and controlled by the test manager.
Test Plan
A Test Plan is a detailed document that catalogs the test strategies, objectives, schedule, estimations,
deadlines, and resources required to complete that project. Think of it as a blueprint for running the
tests needed to ensure the software is working correctly – controlled by test managers.
A well-crafted test plan is a dynamic document that changes according to progressions in the
project and stays current at all times.
It is the point of reference based on which testing activities are executed and coordinated
among a QA team.
The test plan is also shared with Business Analysts, Project Managers, Dev teams, and anyone
associated with the project. This mainly offers transparency into QA activities so that all
stakeholders know how the software will be tested.
Scope: Details the objectives of the particular project. Also, it details user scenarios to be used in
tests. The scope can specify scenarios or issues the project will not cover if necessary.
Schedule: Details start dates and deadlines for testers to deliver results.
Resource Allocation: Details which tester will work on which test.
Environment: Details the test environment‘s nature, configuration, and
availability.
Tools: Details what tools will be used for testing, bug reporting, and other relevant activities.
Defect Management: Details how bugs will be reported, to whom, and what each bug report
needs to be accompanied by. For example, should bugs be reported with screenshots, text logs, or
videos of their occurrence in the code?
Risk Management: Details what risks may occur during software testing and what risks the
software itself may suffer if released without sufficient testing.
Exit Parameters: Details when testing activities must stop. This part describes the expected
results from the QA operations, giving testers a benchmark to compare actual results.
21
Course Code/Title:CS2602/Software Testing Unit: II
that will be performed, the tools and resources that will be used, and the personnel responsible for
executing the tests.
2. Scope of testing:
This defines the boundaries of the testing effort and what will be included and excluded from the
testing process. It also identifies the various levels of testing (such as unit, integration, system, and
acceptance testing) that will be performed.
3. Test deliverables & estimates:
This defines the documents and artifacts that will be produced as part of the testing effort, such as test
cases, test plans, test scripts, and test reports. Parallely, cost estimates is also crucial for planning and
budgeting, and thus provides a basis for measuring progress and identifying potential issues.
4. Test environment:
This defines the hardware and software environment in which the testing will be performed, including
the operating system, hardware, and software configurations. It also includes information on the test
data that will be used and the test tools that will be employed.
5. Roles and Responsibilities:
This defines the roles and responsibilities of the team members involved in the testing effort,
including who will be responsible for creating test cases, executing tests, and reporting defects. It also
outlines the communication channels that will be used to keep stakeholders informed about the testing
progress.
Steps to create a Test Plan
Creating an effective Test Plan involves the following steps:
Product Analysis
Designing Test Strategy
Defining Objectives
Establish Test Criteria
Planning Resource Allocation
Planning Setup of Test Environment
Determine test schedule and estimation
Establish Test Deliverables
1. Product Analysis
Start with learning more about the product being tested, the client, and the end- users of similar
products.
Ideally, this phase should focus on answering the following questions:
Who will use the product?
What is the primary purpose of this product?
How does the product work?
What are the software and hardware specifications?
22
Course Code/Title:CS2602/Software Testing Unit: II
Project objectives
a an d h ow t o achieve them.
The amount of effort and cost required for testing.
[Link] Objectives
This phase defines the goals and expected results of test execution. Since all
testing intends to identify as many defects as possible, the objects must
include:
A list of all software features – functionality, GUI, performance standards-
must be tested.
The ideal result or benchmark for every aspect of the software that needs
testing. This is the benchmark to which all actual results will be compared.
Suspension Criteria: Defines the benchmarks for suspending all tests. For
example, if QA team members find that 50% of all test cases have failed,
then all testing is suspended until the developers resolve all of the bugs that
have been identified so far.
Exit Criteria: Defines the benchmarks that signify the successful
completion of a test phase or project. The exit criteria are the expected
results of tests and must be met before moving on to the next stage of
development. For example, 80% of all test cases must be marked successful
before a feature or portion of the software can be considered suitable for
public use.
23
Course Code/Title:CS2602/Software Testing Unit: II
This phase creates a detailed breakdown of all resources required for project
completion. Resources include human effort, equipment, and all
infrastructure needed for accurate and comprehensive testing.
This part of test planning decides the project’s required measure of
resources (number of testers and equipment). This also helps test managers
formulate a correctly calculated schedule and estimation for the project.
[Link] Setup of Test Environment
The test environment refers to the software and hardware setup on which
QAs run their tests.
Ideally, test environments should be real devices so testers can monitor
software behavior in real user conditions.
Whether it is manual testing or automation testing, nothing beats real
devices, installed with real browsers and operating systems are non-
negotiable as test environments.
[Link] Test Schedule and Estimation
For test estimation, break down the project into smaller tasks and allocate
the time and effort required for each.
Then, create a schedule to complete these tasks in the designated time with a
specific amount of effort.
Creating the schedule, however, does require input from multiple perspectiv
Employee availability, number of working days, project deadlines,
and daily resource availability.
Risks associated with the project which has been evaluated in
an earlier stage.
[Link] Test Deliverables
Test Deliverables refer to a list of documents, tools, and other equipment
that must be created, provided, and maintained to support testing activities
in a project.
A different set of deliverables is required before, during, and after testing.
Deliverables required before testing
Documentation on
Test Plan
Test Design
Deliverables required during testing
Document
ation on
Test
Scripts
Simulators or Emulators (in early stages)
Test Data
Error and execution logs
Deliverables required after testing
Documentation on
Test Results
Defect Reports
24
Course Code/Title:CS2602/Software Testing Unit: II
Release Notes
Test Strategy
Test Approach
Define the testing process, level of testing, roles, and responsibilities of
every team member.
Also, define the change management process. This includes defining change
request submissions, templates to be used, and processes to handle the
request.
It defines parameters like
Process of testing
Testing levels
25
Course Code/Title:CS2602/Software Testing Unit: II
Test Environment
The test environment setup should outline information about the number of
environments and the required setup for each environment.
Define the number of users supported in each environment, access roles for
each user, software and hardware requirements like operating system,
memory, free disk space, number of systems, etc.
Define test data backup and restore strategy that who will take backups,
when to take a backup, what to include in backup, when to restore the
database, who will restore it.
It defines parameters like
Define the number of requirement and setup required for each
environment
Define backup of test data and restore strategy
Testing Tools
Define test management and automation tools required for test execution.
For performance, load and security testing, describe the test approach and
tools required.
Mention whether it is an open source or commercial tool and how many
users are supported on it and plan accordingly.
It defines parameters like
Automation and Test management tools needed for test execution
Figure out a number of open-source as well as commercial tools
required, and determine how many users are supported on it and plan
accordingly
Release Control
Release Control is a crucial component of the test strategy document. It’s
used to make sure that test execution and release management strategies
are established in a systematic way.
The release management plan with proper version history will ensure test
execution of all modifications in that release.
It specifies the following information-
Different software versions in test and UAT(User Acceptance test)
environments can occur from unplanned release cycles.
All adjustments in that release will be tested using the release
management strategy, which includes a proper version history.
26
Course Code/Title:CS2602/Software Testing Unit: II
Risk Analysis
List all the risks that you envision. Provide a clear plan to mitigate
these risks along with a contingency plan in case you see these risks in
reality.
It defines parameters like
List all risks that you can estimate
Give a clear plan to mitigate the risks also a contingency plan
Test Plan is used at the project level. Test Strategy is used at the
organization level.
Test Plan has the primary goal of how Test Strategy has the primary goal of
to test, when to test and who will verify. what technique to follow and which module to
check.
Test Plan can be changed. Test Strategy can’t change.
Test Plan is carried out by the test The Test Strategy is carried out by the
manager. project manager.
Focused on Detailed test objectives, Focused on Testing approach, test
levels, types, and techniques
test cases, test data, and expected
results.
Specific phase, feature, or component Entire testing effort across the project
of the software.
Highly detailed, specifying test Less detailed and more abstract
scenarios, cases, scripts, and data
The test plan is performed by a lead or A test strategy is performed by the
testing manager. project manager.
27
Course Code/Title:CS2602/Software Testing Unit: II
It describes when to test, who will test, It says which module to test and what
how to test, and what to test. kind of method to follow.
The test plan is mainly derived from Test strategy is derived from BRS (business
requirement specification).
SRS (software requirement
specification).
Test Phases
Software Testing Life Cycle consists of 6 phases, each with defined
entry and exit criteria and associated activities and deliverables.
Entry and exit criteria define when a phase can start and when it can end.
Activities and deliverables define what actions are performed and what the
expected result is.
6 Key Phases of Testing
1. Requirement Analysis
2. Test Planning
3. Test case development
4. Test Environment setup
5. Test Execution
6. Test Cycle closure
Requirement Analysis
During this phase, feature requirements collected in the SDLC process are
evaluated to identify testable aspects. If necessary, testing teams may need to
consult with stake holders to clarify requirements. These requirements can
either be functional or non-functional, defining what a feature can do or it’s
characteristics respectively. The ability to automate testing is also evaluated
during this phase.
Activities involved
Identify types of tests to be performed.
Gather details about testing priorities and focus.
Prepare Requirement Traceability Matrix (RTM).
Test Planning
During this phase, the test strategy is outlined in a test plan document. This
strategy includes tools needed, testing steps, and roles and responsibilities. Part
of determining this strategy is a risk and cost analysis and an estimated timeline
for testing.
Activities involved
Preparation of test plan/strategy
Test tool selection
Test effort estimation
28
Course Code/Title:CS2602/Software Testing Unit: II
Test Execution
During this phase, features are tested in the deployed environment, using the
established test cases. Expected test results are compared to actual and results
are gathered to report back to development teams.
Activities
Execute tests as per plan
Document test results, and log defects for failed cases
Map defects to test cases in RTM
Retest the Defect fixes
Track the defects to closure
29
Course Code/Title:CS2602/Software Testing Unit: II
Activities
Evaluate cycle completion criteria based on Time, Test
coverage, Cost, Software, Critical Business Objectives, Quality
Prepare test metrics
Prepare Test closure report
Qualitative and quantitative reporting of quality of the work product to
the customer.
Test result analysis
Human Resource: The following table represents various members in your project
team
30
Course Code/Title:CS2602/Software Testing Unit: II
3. Developer in Implement the test cases, test program, test suite etc.
Test
4. Test Administrator Builds up and ensures test environment and assets are managed and
maintained Support Tester to use the test environment for test execution
5. SQA Take in charge of quality assurance Check to confirm whether the testing
process is meeting specified requirements
members
System Resource: For testing, a web application, you should plan the resources
as following tables:
1. Server Install the web application under test This includes a separate web server,
database server, and application server if applicable
2. Test tool The testing tool is to automate the testing, simulate the user operation,
generate the test results There are tons of test tools you can use for this
project such as Selenium, QTP…etc.
3. Network A Network include LAN and Internet to simulate the real business and
user environment
4. Computer The PC which users often use to connect the web server
31
Course Code/Title:CS2602/Software Testing Unit: II
ANALYSIS
REPORT COMMUNICATION
EVALUATION
Analysis
The metrics must be recognized.
Define the QA metrics that have been identified.
Communicate
Stakeholders and the testing team should be informed about the
requirement for metrics.
Educate the testing team on the data points that must be collected in order
to process the metrics.
Evaluation
Data should be captured and verified.
Using the data collected to calculate the value of the metrics
Report
Create a strong conclusion for the paper.
Distribute the report to the appropriate stakeholder and representatives.
Gather input from stakeholder representatives.
Percentage test cases executed = (No of test cases executed / Total no of test
cases written) x 100
Similarly, it is possible to calculate for other parameters also such as test cases
that were not executed, test cases that were passed, test cases that were failed,
test cases that were blocked, and so on. Below are some of the formulas:
32
Course Code/Title:CS2602/Software Testing Unit: II
2. Passed Test Cases Percentage: Test Cases that Passed Coverage is a metric
that indicates the percentage of test cases that pass.
Passed Test Cases Percentage = (Total number of tests ran / Total number of
tests executed) x 100
5. Fixed Defects Percentage: Using this measure, the team may determine the
percentage of defects that have been fixed.
Fixed Defects Percentage = (Total number of flaws fixed / Number of defects
reported) x 100
Test Effectiveness
Test effectiveness finds a solution to “how good are the tests?” It evaluates the bug-finding
quality and ability of a test set. Test effectiveness measures generally express the difference
between the total number of defects reported by the QA team and the overall defects found in
terms of percentage.
33
Course Code/Title:CS2602/Software Testing Unit: II
Test Schedule
A test schedule includes the testing steps or tasks, the target start and end dates,
and responsibilities. It should also describe how the test will be reviewed,
tracked, and approved.
For the particular activity such as Writing test case, Execution process, there
will be a starting date and ending date; for each testing to a specific build,
f
there will be the specified date.
Test Schedule is created to complete these tasks.
Making schedule is a common term in software project management. By
u
creating a solid schedule in the Test Planning, the Test Man ger cana use it as
tool for monitoringeth project progress, control the cost overruns.
To create the project schedule, the Test Manager needs several types of input as
below:
Employee and project deadline: The working days, the project deadline,
34
Course Code/Title:CS2602/Software Testing Unit: II
35
Course Code/Title:CS2602/Software Testing Unit: II
What Do We Monitor?
The following metrics will be monitored during the testing process,
Cost
Schedule
Resources
Quality
Cost
It is crucial to monitor and control project costs. You have to estimate and keep track of the
costs involved. Making sure the project stays within its budget is crucial and requires getting
the estimations right from the start.
As the project progresses, it’s vital to watch these expenses closely. To handle all these tasks
effectively, you need to oversee and manage the project budget. Keeping an eye on the budget
is a must for successfully finishing a project on target.
Schedules
Maintaining proper schedules is also vital. Think of it like driving a car without knowing how
long the trip will be. Just like you need a plan to know when you’ll reach your destination,
projects need schedules too. No matter how big or small the project is, having a schedule is
crucial.
Planned schedules will help you tell the following,
36
Course Code/Title:CS2602/Software Testing Unit: II
Resources
Resources for a project include everything that is required to do the tasks. They can be people
or tools, depending on the job. Resources can slow down a project. Sometimes, plans change
– people quit, or money gets less. If you find out about these problems early, you can fix
them.
Quality
Monitoring Quality means checking specific work items to see if they meet the expected
standards. If they don’t meet the standards, you have to come up with possible ways to fix the
issues.
Similar to any other process in testing, start with creating a test monitoring plan. Your
objective should be to clearly define the goals of test monitoring along with the necessary
points it should capture. Decide what metrics to capture, when to record them, and how to
assess them. For instance, cost, time, and resources used could be metrics important to your
test monitoring plan. You can collect these data bi-weekly and use them to formulate better
decisions to improve the quality and delivery of testing.
Next up is to keep the report updated with changing scenarios. You have jotted down the
points to capture in the plan. Then, you would just need to keep updating the test control data
and make adjustments to the testing process to get optimum output.
As mentioned, after updating the records regularly, use the newly added data. Compare the
original or old data with the new data to analyze. It will help you to understand if the progress
is in the positive direction or the negative direction. For example, you can see how much time
37
Course Code/Title:CS2602/Software Testing Unit: II
you initially spent on individual tasks and what resources were spent on it. Then, compare it
to the updated information to assess the testing project direction.
Lastly, make it understandable for stakeholders and other team members to read the report
and make informed decisions in their projects (if any).
Test Control
Test Control occurs based on the results of Test Monitoring. It refers to taking corrective
action based on test monitoring reports to improve quality and efficiency. Some examples of
test control activities would be:
Prioritize testing efforts in a different way.
Reorganize test schedules and deadlines.
Restructure the test environment.
Reprioritize the test cases and conditions.
Test Control is essentially modifying the testing process so that it becomes better suited for
meeting the defined objectives. This may require adding extra resources, reducing the scope
of release, or splitting the release into multiple releases, etc. The specific test control activities
implemented depend on various factors, including stakeholders’ opinions, budget, project
complexity, and tester availability.
Test Control goes hand-in-hand with Test Monitoring. Once Monitoring identifies any
bottlenecks that may prevent a test cycle from meeting its goals, Control activities come into
play to ensure objectives are met.
What is Test Control?
While test monitoring gives a clear perspective on the ongoing testing tasks, test control helps
teams to take corrective measures based on the observations gained from test monitoring. In
simple words, it is the practice of actively managing and regulating the testing process to
ensure that it aligns with project goals, is effective, and delivers reliable results.
Test control is a crucial aspect of software testing that involves managing and regulating
the testing process to ensure it is effective and efficient.
It involves making decisions based on the information gained from the test monitoring
process. Here, the tests will be prioritized, the test schedules will be revised, changes will be
made to the test environment, and other refinements related to testing activities might be done
to enhance the efficiency and quality of the future testing process.
Why do you Need Test Control?
If you are a tester, project manager, or a developer, you would know how the testing (or even
developing) process can easily go astray if not managed properly. For such reasons, having a
test control in place for software testing is a necessity not a want.
38
Course Code/Title:CS2602/Software Testing Unit: II
Some problems you can expect to encounter revolve around product functionality,
performance, UI, and usability. The challenges can become an issue for timely release of the
product and customer satisfaction.
Test control helps in identifying these roadblocks and effectively managing the software
quality.
Executing Test Control Activities
These steps are critical for test control activities:
Monitor the process: Monitor the progress of testing activities against the predefined
plan and objectives. Use testing metrics and progress reports to track the execution of
test cases, defect discovery, and resolution.
Identify the deviations: Discover any deviations from the planned testing activities,
quality standards, or project objectives.
Assess the risks: Evaluate the impact of identified deviations on project timelines,
budget, quality objectives, and overall testing goals.
Prioritize the issues: Consider the severity and potential consequences of deviations
on the project’s success criteria to prioritize deviations’ impact on project goals, and
urgency for resolution.
Take corrective actions: Determine the root causes of issues to develop specific
corrective actions required to address each identified deviation effectively.
Monitor progress: Continuously monitor the progress of implementing corrective
actions and resolving identified issues. Track key performance indicators (KPIs) to
assess the effectiveness of corrective measures and their impact on the testing process.
Prioritize the testing efforts: Based on issue criticality and area of application,
choose which tests to perform before another.
Review the testing schedules: If you are behind schedule due to whatever reason, it
is time to review and revise the timeline to keep on track.
Manage the resource allocation: Not every testing activity will require the same
amount of resources, be it workers or tools. You will have to identify how much
resources different testing processes require to do the allocation accordingly.
Change the testing scope: Lastly, take a different route if test coverage is inadequate
or if updates/modifications are introduced in the testing process.
39
Course Code/Title:CS2602/Software Testing Unit:III
Unit III: TEST CASE DESIGN 9
Test Case Specification- Writing effective test cases, Traceability matrix, Test Data Generation- Generating test
data for different scenarios.
Test Case Specification:
Test Case
“A test case has components that describe input, action, and an expected response, in order to
determine if a feature of an application works correctly.”
Once the test cases are created from the requirements, it is the job of the testers to execute those
test cases.
The testers read all the details in the test case, perform the test steps, and then based on the
expected and actual result, mark the test case as Pass or Fail.
Prerequisite or A set of prerequisites that must be followed before executing the test
Pre-condition steps.
Example: While testing the functionality of the application
after login, we can have the pre-requisite field as “User should be logged in to
the application”.
1
Course Code/Title:CS2602/Software Testing Unit:III
Expected result The expected result in order to pass the test.
Example: The user should successfully login and navigated to home page.
Actual result The actual result after executing the test steps.
This field is filled during test execution only. The actual result observed
during the test case execution.
Test Result Pass/Fail status of the test execution.
Based on the expected result and the actual result, the test case is marked as
passed or Failed.
Apart from Pass/Fail, the other values are
Deferred, when the test case is marked to be executed later, for some reason.
Blocked, when the test case execution is blocked due to
some other issue in the application).
Module 1: Registration
Test Test Pre- condition Test Data Expected Actual Pass/
CaseId Result Result Fail
Description/
Objectives
TD01 Register new User need to Email-ID: All the New User Pass
user provide valid xyz@gma Required registration
details. [Link] fields need completed.
to be filled
Ph no : with Valid
Eg: Email ID,
01234567 inputs.
Ph no
89
TD02 Register new User need to Email-ID: Email ID Not Registered Fail
user provide valid xyz@gma & Ph no.
details. [Link] are incorrect.
Invalid
Ph no : inputs
Eg: Email ID,
01234567
Ph no 891
Module 2: Login
Test Test Description/ Pre- condition Test Data Expected Actual Pass/
CaseId Objectives Result Result Fail
TD02 Verify user Enter Invalid Email-ID: Email ID & Logi Fail
login with Email-ID xyz@gma Ph no. Are n
Invalid Inputs and [Link] incorrect. Faile
Password. d.
Password:
123456 Redirected
to
3
Course Code/Title:CS2602/Software Testing Unit:III
Log
in Page.
Objectives
TD01 User should User ItemName: Item added to As Expected, Pass
select the item Should AB123 cart.
and add to the Logged ItemId:#01
cart. in. ItemCost: 100 Increment the
Amount and
Count
of item
4
Course Code/Title:CS2602/Software Testing Unit:III
Proceed to
Order.
TD03 Remove item Atleast one ItemName: Item removed As Expected, Pass
from item AB123 from cart.
the cart must be
present in the ItemId:#01 Decrement the
cart. Amount and
Count
Click on of item
remove from
cart.
Address.
5
Course Code/Title:CS2602/Software Testing Unit:III
A large detailed document that covers Specific and precise document for a
management aspects and particular testing feature that covers only testing
testing aspects in the entire testing aspects.
project.
Testers, test leaders, managers, Only testing teams and test leaders.
stakeholders, and other departments need
to be updated about the testing
process.
Both testing and project managing Only testing aspects such as test steps, test data, test
aspects like schedule, scope, potential environment, intended test results, real test results, test
risks, staff responsibilities, bugs status,
reporting, and more. etc.
The duration of the test plan is until The duration of test case is until the
the end of the whole testing project. end of the particular testing process.
An up-to-date document used till the end Ensures testers are equipped with all required step-by-
of the project. step processes and details to test the intended
functionality.
Control whole testing process. Allows identifying unexpected bugs.
The various types of test case design techniques are listed below −
It is also known as the black box testing technique that validates the features of the software without considering its
Boundary Value Analysis − In this methodology, the verification is done around the boundary values of the valid
and invalid data sets. The behavior of the software at the edge of the equivalence partitions has a higher
probability of finding errors.
Equivalence Partitioning − This methodology allows the testers to segregate input data into groups. It reduces
the total count of tests without compromising the test coverage.
Decision Table − This methodology allows building of test cases from the decision tables created using
various combinations of input data and their outcomes which originate from different situations and use cases.
State Transition Diagram − This methodology is used to test the change in the states of a software using different
inputs. If the conditions under which the input are updated, then there are changes to the states of the software.
Use Case Testing − This methodology is focussed on verifying the test scenarios involving the entire software.
It is also known as the white box testing technique that validates the internal working of the software by the developers.
Statement Coverage Testing − This methodology validates every executable line in the program source code at least
once.
Decision Coverage Testing − This methodology tests all decision outcomes in the program.
Condition Coverage Testing − This methodology primarily verifies all the conditions in the program source code.
Multiple Condition Testing − This methodology is used to verify different circumstances to get a very
good test coverage. It relies on multiple test scripts, hence requires more time for completion.
Path Testing - This methodology uses the control flow graph to calculate a group of linearly independent paths.
Moreover, the cyclomatic complexity of the code is calculated to obtain the number of the linearly independent paths,
and finally the test cases are built from those paths.
Error Guessing − This methodology is an informal testing where the testers use their knowledge, experience,
expertise, and domain understanding to identify potential defects in the software. Those defects may not have been
found by the formal test cases or by simply analyzing the requirements.
Exploratory Testing − This methodology is an informal testing technique practiced on the software to determine bugs.
It is an unsystematic approach.
Traceability Matrix
Traceability matrix is a table type document that is used in the development of software
Course Code/Title:CS2602/Software Testing Unit:III
application to trace requirements. It can be used for both forward (from Requirements to Design or Coding)
and backward (from Coding to Requirements) tracing. It is also known as Requirement Traceability
Matrix (RTM) or Cross Reference Matrix (CRM).
It is prepared before the test execution process to make sure that every requirement is covered in the form
of a Test case so that we don't miss out any testing. In the RTM document, we map all the
requirements and corresponding test cases to ensure that we have written all the test cases for each
condition.
The test engineer will prepare RTM for their respective assign modules, and then it will be sent to the Test
Lead. The Test Lead will go repository to check whether the Test Case is there or not and finally Test Lead
consolidate and prepare one necessary RTM document.
This document is designed to make sure that each requirement has a test case, and the test case is written
based on business needs, which are given by the client. It will be performed with the help of the test cases if
any requirement is missing, which means that the test case is not written for a
particular need, and that specific requirement is not tested because it may have some bugs. The traceability
Course Code/Title:CS2602/Software Testing Unit:III
We can observe in the below image that the requirement number 2 and 4 test case names are not mentioned
that's why we highlighted them, so that we can easily understand that we have to write the test case for
them.
Generally, this is like a worksheet document, which contains a table, but there are also many user- defined
templates for the traceability matrix. Each requirement in the traceability matrix is connected with its
respective test case so that tests can be carried out sequentially according to specific requirements.
Note:
We go for RTM after approval and before execution so that we don't miss out on any Test Case for any
requirement.
We don't write RTM while writing the testing because it can be incomplete, and after writing the test case,
we don't go here because the test case can be rejected.
RTM document ensures that at least there is one test case written in each requirement, whereas it does not
Course Code/Title:CS2602/Software Testing Unit:III
talk about all possible test cases written for the particular requirement.
RTM Template
It helps in tracing the documents that are developed during various phases of SDLC. It
ensures that the software completely meets the customer's requirements.
It helps in detecting the root cause of any bug.
The traceability matrix can be classified into three different types which are as follows:
Course Code/Title:CS2602/Software Testing Unit:III
1. Forward traceability
3. Bi-directional traceability
Forward traceability
The forward traceability test matrix is used to ensure that every business's needs or requirements are
executed correctly in the application and also tested rigorously. The main objective of this is to
verify whether the product developments are going in the right direction. In this, the requirements are
mapped into the forward direction to the test cases.
The reverse or backward traceability is used to check that we are not increasing the space of the product by
enhancing the design elements, code, test other things which are not mentioned in the business needs. And
the main objective of this that the existing project remains in the correct direction. In this, the requirements
are mapped into the backward direction to the test cases.
Course Code/Title:CS2602/Software Testing Unit:III
Bi-directional traceability
It is a combination of forwarding and backward traceability matrix, which is used to make sure that all the
business needs are executed in the test cases. It also evaluates the modification in the requirement which is
occurring due to the bugs in the application.
Advantage of RTM
With the help of the RTM document, we can display the complete test execution and bugs status based
on requirements.
It is used to show the missing requirements or conflicts in documents.
In this, we can ensure the complete test coverage, which means all the modules are tested.
It will also consider the efforts of the testing teamwork towards reworking or reconsidering on the test
cases.
Test Data Generation is the process of collecting and managing a large volume of data from various resources to
implement test cases and ensure the functional soundness of the system under test. These generated datasets act as input
for the test cases, allowing the behavior of the system to be verified. Test datasets are designed for both positive testing
and negative testing.
Generating rational and relevant datasets can be a complex task because poorly framed datasets might leave
significant test cases unchecked. The commonly used techniques for generating datasets are outlined below:
In this technique, all datasets are manually created by the tester based on experience and the specific requirements of
the test cases.
Course Code/Title:CS2602/Software Testing Unit:III
Pros:
Cons:
This technique leverages automated tools to quickly generate datasets by analyzing large volumes of data in a short
time.
Pros:
Cons:
This method uses SQL queries to inject relevant data directly into the database. Testers write queries to populate the requir ed
datasets, which can generate large amounts of data efficiently.
Pros:
Time-efficient technique.
Requires less expertise compared to automated tools; writing correct queries is the primary skill needed.
Cons:
Incorrect or invalid queries may generate illogical datasets or cause database failures.
Requires careful attention to detail when injecting queries.
4) Third-Party Tools
Third-party tools available in the market can generate datasets tailored to business needs. These tools analyze the system and
produce datasets based on the requirements.
Pros:
Course Code/Title:CS2602/Software Testing Unit:III
Highly accurate as the tools first analyze the system and then generate datasets accordingly.
Customizable to suit specific business needs.
Cons:
1. Login Module
Test Expected
User Action Input Actual Output Remark
case Output
Id
Redirect to same Redirect to same
Invalid Login Wrong User
1 page with error page with error Pass
Credential Id/Password
message message
Clicked Login Redirect to same page Redirect to same page
2 with Blank Form None with error message with error message Pass
2. Registration Module
Test
case User Action Input Expected Actual Remark
Id Output Output
Click ‘Register’
Click Redirect to same Redirect to
button with out
1 entering journey REGISTE R page with error same page Pass
Information Button message with error
message
Should display
Clicked Pay Now Should display
Clicked PAY the error
1 without filling all the error message Pass
NOW button message ‘Fill all
required fields ‘Fill all Fields’
Fields’
Clicked Pay Now Payment Receipt Payment
Clicked PAY
2 with filling all Should be Receipt Should Pass
NOW button
required fields Generate be Generate
Course Code/Title:CS2602/Software Testing Unit:III
16
Course Code/Title:CS2602/Software Testing Unit:IV
Below are some of the differences between manual testing and automated testing:
Regression There is a possibility that the test When there are changes in the
testing cases executed the first time will not code, regression testing is done
be able to catch the regression bugs to catch the bugs due to changes
in the code.
due to the frequently changing
requirements.
Automation testing serves several important purposes in the software development lifecycle. Let's explore some key
reasons why organizations embrace automation testing:
1. Increased Test Coverage: Automation testing enables a broader scope of test coverage. Organizations can leverage a
test automation platform and use it to design test scripts to cover various scenarios and test cases, ensuring thorough
validation of software functionality. With automated tests, organizations can achieve higher levels of test coverage,
resulting in improved software reliability.
2. Consistency and Reusability: Automation testing ensures consistent test execution by removing the element of
human error. Using test automation platform to automate testing, you can reuse test scripts across multiple test cycles and
different software versions. This reusability not only saves time but also promotes consistency in testing, enabling
accurate comparison of results over time.
Early Detection of Defects: Automation testing enables early detection issues. By running automated tests at different
stages, such as during integration or regression testing, potential bugs can be identified and addressed promptly. Early
defect detection helps in reducing the costs.
While testing an application/software, testers cannot automate all processes involved in the testing cycle. Some tests
need human supervision and involvement to get better results. Using test automation platforms to automate testing is
not an alternative to manual testing but helps and supports the entire testing team by reducing the workload.
In order to determine whether a test is suitable for automation, testers can check if it fits the following criteria:
1
Course Code/Title:CS2602/Software Testing Unit:IV
• The tests should be highly repetitive and take a long period of time to perform if it is done manually
• The testing path must be predictable, as it has been verified earlier through manual testing
• The tests that involve the testing of frequently used features that introduce high-risk conditions
• The tests that require multiple datasets and run on several different hardware or software platforms and
configurations
• Tests that are not possible for human manual testing, e.g., thousands of concurrent users trying to log in at the same
time
If a test meets all these criteria mentioned above, you can consider leveraging test automation platforms for automation.
2. Smoke Testing:
Smoke testing is usually done on a build software received from the development team. The focus of the smoke tests is
to check whether the build software is stable or not. If the software passes this test, then testers can proceed with
further testing.
3. Integration Testing:
Integration testing is the testing process that is performed after unit testing. This test ensures that units or individual
components of the software are tested in a group and work well as a whole. This test is used to detect defects at the
time of interaction between integrated components or units.
4. Regression Testing
Regression testing is both functional and non-functional type of testing. It verifies the code changes that do not impact
the software's existing functionality. This testing ensures that the software works fine with new functionality, bug fixes,
or code changes in the existing feature. With HeadSpin’s test automation platform, testing teams can perform
regression automation testing for their apps/websites. HeadSpin's Regression Intelligence is a powerful comparison
tool for analyzing degradation across new app builds, OS releases, feature additions, locations, and more. Using the test
automation platform, testers can also compare build over build, location over location, network over network, and
device over device performance of their apps/websites.
5. API Testing
The application programming interface (API) is the connection between all the other systems that software needs to
function. This testing verifies all APIs. API testing is mainly used to test the programming interfaces ' functionality,
reliability, performance, and [Link] executing API testing with the HeadSpin Platform, the API usage
monitoring feature will help testers keep track of how their APIs are being used by applications or track the impact of
3rd party APIs on application performance.
6. Security Testing
Security testing is also functional and non-functional in nature. It detects the weaknesses and threats in the software. This
testing can block the attacks from hackers and ensure the security of the software.
7. Performance Testing
Performance testing records the system performance of the software in terms of responsiveness and stability under a
specific workload. The main parameters checked under this testing include the software's speed, robustness, an d
reliability.
8. Acceptance Testing
Acceptance testing is used to check how end users will respond to the final software product. Usually, this is the last type
of testing used before a software/application is released.
9. UI Testing
UI testing checks and verifies visual elements of apps/web pages to validate proper functionality and expected
performance. This testing is done after the complete development of the application/software.
With global device infrastructure and quality of experience (QoE) insights, HeadSpin enables organizations to deliver
flawless UI experiences. Organizations can use the HeadSpin Platform to perform UI testing on real devices and record test
sessions. This feature will give them real- time insights into the performance of their applications.
2
Course Code/Title:CS2602/Software Testing Unit:IV
Selenium - A staple in the automated testing tool arsenal, Selenium supports multiple languages and browsers, focusing
on web application testing. It allows for creating complex test scripts that can mimic a wide range of user actions.
TestComplete - Offering a comprehensive testing solution, TestComplete supports desktop, mobile, and web
applications. It's known for its robust record and playback feature, making it accessible to testers without extensive
scripting knowledge.
JUnit - A fixture in the Java ecosystem, JUnit facilitates unit testing with simplicity and ease of use. Its annotations and
assertions make it a go-to for developers looking to implement test- driven development (TDD).
Cypress - A modern web testing tool designed to work exclusively with web applications. Cypress offers a unique
testing experience by running tests in the same run-loop as the application, leading to faster and more reliable tests.
Appium - Focused on mobile application testing, Appium supports automation on iOS and Android platforms. It works
well for applications written in any framework, making it a versatile choice for mobile testing.
Robot Framework - An open-source, keyword-driven test automation framework, Robot Framework is designed for
acceptance testing and acceptance test-driven development (ATDD). It's easy to use for those new to automated testing
while still powerful enough for complex test scenarios.
Postman - While primarily known as an API development tool, Postman also offers automated testing capabilities for
RESTful APIs. Its user-friendly interface allows for easy creation, management, and execution of API tests.
Define Scope of Automation: This includes a few basic points such as the Framework should support Automation Scripts,
Less Maintenance must be there, High Return on Investment, Not many complex Test Cases.
Planning, Design, and Development: For this, we need to Install particular frameworks or libraries, and start designing
and developing the test cases such as NUnit, JUnit, QUnit,or required Software Automation Tools
Test Execution: Final Execution of test cases will take place in this phase and it depends on Language to Language for
.NET, we’ll be using NUnit, for Java, we’ll be using JUnit, for JavaScript, we’ll be using QUnit or Jasmine, etc.
Maintenance: Creation of Reports generated after Tests and that should be documented to refer to that in the future for
the next iterations.
Reduced cost: Automated tests can help to reduce the cost of software testing by freeing up manual testers
to focus on other tasks.
Improved quality: Automated tests can help to improve the quality of software by catching bugs that
would otherwise be missed.
Increased confidence: Automated tests can help to increase confidence in the quality of software by
providing evidence that the software has been thoroughly tested.
Maintenance: Automated: tests need to be maintained and updated as the software changes.
Complexity: Automated testing can be a complex process and it can be difficult to get right.
Definition:
Involves writing code (often in a scripting language like Python or Java) to automate test execution. This approach offers
flexibility and control over testing scenarios.
3
Course Code/Title:CS2602/Software Testing Unit:IV
Popular Tools:
Selenium: A widely used open-source tool for web application testing, offering support for multiple browsers and languages.
Appium: Primarily focused on testing native and mobile applications on Android and iOS.
Cypress: An end-to-end testing framework for web applications with a focus on speed and ease of use.
Playwright: A cross-browser testing framework designed to automate web applications and mobile apps.
Advantages:
Flexibility: Allows for highly customized and complex test scenarios.
Automation: Automates repetitive tasks, such as UI interactions, reducing the need for manual testing.
Integration: Can be easily integrated with other tools and frameworks, enabling seamless testing workflows.
Reusability: Test scripts can be reused across different parts of the application, improving test efficiency.
2. GUI-Based Testing:
Definition: Uses a visual interface to automate tests, reducing the need for extensive coding. These tools often rely on record-
and-playback features or visual scripting.
Popular Tools:
TestComplete: A comprehensive tool that supports testing web, desktop, and mobile applications with a user -friendly GUI.
Ranorex: A commercial tool focused on automating GUI testing for various platforms, including web, desktop, and mobile
applications.
AutoIt: A free and open-source tool specifically designed for automating Windows GUI applications.
Squish: A cross-platform tool designed for testing GUIs on various platforms and devices, including web applications, mobile,
and desktop applications.
Advantages:
Simplicity: Requires less coding knowledge, making them accessible to non-programmers.
Ease of Use: Visual scripting and record-and-playback features simplify test creation.
Rapid Prototyping: Enables quick creation of automated tests for various scenarios.
Cost-Effectiveness: Can reduce development time and cost of automated testing by reducing the need for expert
programmers.
3. Framework Approach:
In the test automation process, testing frameworks play a crucial role. These frameworks include guidelines for
testers/developers in coding standards, repository management, and handling of test data. The main focus of these
frameworks is to reduce maintenance costs and testing efforts and achieve a high return on investment for the testing
teams.
Let's look at the different types of automated software testing frameworks that many organizations use to achieve a
good testing environment.
3. Data-driven Framework
In the data-driven framework, the test data are separated from script logic, and testers can store all the data externally.
With this framework, whenever testers need to test application/software multiple times with different data sets, they can
use the data stored in external data sources. The main external data sources used in this framework are Excel
Spreadsheets, Text Files, CSV files, SQL Tables, or ODBC repositories.
4. Keyword-driven Framework
While using the keyword-driven framework for automated testing, all functions of the application/software
undergoing the test are written out in the table with specific instructions in the order of the test that needs to be
performed. In this framework also, test data are separated from script logic. Keywords are also stored in the external
4
Course Code/Title:CS2602/Software Testing Unit:IV
data table. These keywords represent the various actions that are being performed to test the GUI of an application.
This framework requires a shared object repository to navigate the objects to their associated actions.
Advantages:
Disadvantages:
Test Maintenance in selenium can become cumbersome and even expensive sometimes.
Selenium requires coding skills, if not exceptional but above average, though.
It is only supported for web applications, though.
Technical support and its reliability can cause problems, though.
Flaky tests can be a big problem as they generate false negatives and false positives or vice versa.
1. Selenium WebDriver
Selenium WebDriver is the successor of Selenium RC (Remote Control), which has been officially deprecated.
Selenium WebDriver accepts commands using the JSON-Wire protocol (also called Client API) and sends them to a
browser launched by the specific driver class (such as ChromeDriver, FirefoxDriver, or IEDriver). This is implemented
through a browser- specific browser driver. It works with the following sequence:
5
Course Code/Title:CS2602/Software Testing Unit:IV
Selenium Grid enables us to execute tests in parallel on multiple machines by managing different types of browsers,
their versions, and operating system configurations centrally.
3. Selenium IDE
Selenium IDE is a Firefox add-on that allows users to record, edit, debug, and play back tests captured in the Selenese
format, which was introduced in the Selenium Core version. It also provides us with the ability to convert these tests into
the Selenium RC or Selenium WebDriver format. We can use Selenium IDE to do the following:
Create quick and simple scripts using record and replay, or use them in exploratory testing
Create scripts to aid in automation-aided exploratory testing
Create macros to perform repetitive tasks on Web pages
Web Elements
A web page is composed of many different types of HTML elements, such as links, textboxes, dropdown buttons, a body,
labels, and forms. These are called WebElements in the context of WebDriver. Together, these elements on a web page
will achieve the user functionality. For example, let's look at the HTML code of the login page of a website:
<html>
<body>
<form id="loginForm">
<input type="submit"/>
</form>
</body>
</html>
6
Course Code/Title:CS2602/Software Testing Unit:IV
In the preceding HTML code, there are different types of WebElements, such as <html>,
<body>, <form>, <label>, <input>, and <a>, which together make a web page provide the Login feature for the user.
Let's analyze the following WebElement:
Here, <label> is the start tag of the WebElement label. Enter Username: is the text present on the label element.
Finally, </label> is the end tag, which indicates the end of a WebElement. Similarly, take another WebElement:
In the preceding code, type and name are the attributes of the WebElement input with the text and Username values,
respectively.
UI-automation using Selenium is mostly about locating these WebElements on a web page and executing user
actions on them.
import [Link];
import [Link];
import [Link];
[Link]("[Link]","C:\\selenium webdriver\\chromedriver-
win64\\[Link]");
[Link]();
//[Link]([Link]("nav-search-submit-button")).click();
//[Link]([Link]("nav-input")).click();
[Link]([Link]("Get It Today")).click(); [Link](4000);
[Link]().to("[Link] [Link](4000);
[Link]().back();
//[Link]([Link]());
//[Link]([Link]());
[Link](4000); [Link]();
As you can see, there are three new things that are highlighted, as follows:
7
Course Code/Title:CS2602/Software Testing Unit:IV
element. Actions, such as click and type, are performed on a returned WebElement using the methods declared in the
WebElement interface.
In UI automation, locating an element is the first step before executing any user actions on it. WebDriver's
findElement() method is a convenient way to locate an element on the web page. According to WebDriver's Javadoc, the
method declaration is as follows:
So, the input parameter for the findElement() method is the By instance. The By instance is a WebElement-locating
mechanism.
The return type of the findElement() method is the WebElement instance that represents the actual HTML
element or component of the web page. The method returns the first WebElement that the driver comes across that
satisfies the locating-mechanism condition. This WebElement instance will act as a handle to that component from then
on.
Appropriate actions can be taken on that component by the test-script developer using this returned WebElement
instance. If WebDriver doesn't find the element, it throws a runtime exception named NoSuchElementException, which
the invoking class or method should handle.
For finding multiple elements matching the same locator criteria on a web page, the findElements() method can be used.
It returns a list of WebElements found for a given locating mechanism. The method declaration of the findElements()
method is as follows:
The input parameter is the same as the findElement() method, which is an instance of the By class. The difference lies in
the return type. Here, if no element is found, an empty list is returned and if there are multiple WebElements present that
satisfy the locating mechanism, all of them are returned to the caller in a list.
By is the locating mechanism passed to the findElement() method or the findElements() method to fetch the
respective WebElement(s) on a web page. There are eight different locating mechanisms; that is, eight different ways
to identify an HTML element on a web page. They are located by ID, Name, ClassName, TagName, LinkText,
PartialLinkText,
In the preceding code, the id attribute value of the search box is search. WebElement searchBox =
[Link]([Link]("search"));
In preceding code, we used the [Link]() method and the search box's id attribute value to find the element.
border-radius: 50%;
margin: 0% 2%;
Now, this style can be applied to the button element in a web page as follows:
8
Course Code/Title:CS2602/Software Testing Unit:IV
[Link]([Link]("My Account"));
So, we need to pass the XPath expression to the [Link] locating mechanism to make it identify our target element.
Now, let's see the code example and how WebDriver uses this XPath to identify the element: WebElement searchBox =
[Link]([Link]("//*[@id='search']")); [Link]("Bags");
[Link]();
To identify an element using the div element with the #flrs ID, we use the #flrs syntax
To identify the child anchor element, we use the #flrs > a syntax, which will return the link element
To identify the anchor element with its attribute, we use the #flrs >
a[a[href="/intl/en/[Link]"]] syntax
Let's try to modify the previous code, which uses the XPath locating mechanism to use the cssSelector mechanism:
So, though all the actions are listed in one WebElement interface, it is the test script developer's responsibility to
use the actions that are supported by the target element. In case we try to execute the wrong action on a WebElement, we
don't see any exception or error thrown and we don't see any action get executed; WebDriver ignores such actions
silently.
9
Course Code/Title:CS2602/Software Testing Unit:IV
The getAttribute method can be executed on all the WebElements. The HTML attributes are modifiers of HTML
elements. They are generally key-value pairs that appear in the start tag of an element. For example:
In the preceding code, name and id are the attributes or attribute keys and Username and uname are the attribute values.
In the preceding code, the input parameter is String, which is the name of the attribute. The return type is again Str ing,
which is the value of the attribute.
Now let's see how we can get all the attributes of a WebElement using WebDriver. Here, we will make use of the
Search box from the example application. This is what the element looks like:
We will list all the attributes of this WebElement using WebDriver. The code for that is as follows:
In the preceding code, the last four lines of code use the getAttribute() method to fetch the attribute values of the name,
id, class, and placeholder attributes of the WebElement search box. The output of the preceding code will be following:
Class of the box is: input-text required-entry Placeholder of the box is: Search
entire store here...
Going back to the [Link]() method of the previous section, if the search by a locating mechanism,
[Link], results in more than one result, you can use the getAttribute() method to further filter the results and get
to your exact intended element.
[Link] getText()
There is no input parameter for the preceding method, but it returns the visible innerText string of the
WebElement if anything is available, otherwise it will return an empty string. The following is the code to get the text
present on the Site notice element present on the example application Homepage:
The preceding code uses the getText() method to fetch the text present on the Site notice element, which
returns the following:
Complete text is: This is a demo store. Any orders placed through this store will not be honored or fulfilled.
[Link]("Font of the box is: " + [Link]("font-family")); The preceding code uses the
getCssValue() method to find font-family of the text visible in the Search box. The output of the method is shown
here:
Font of the box is: Raleway, "Helvetica Neue", Verdana, Arial, sans-serif
10
Course Code/Title:CS2602/Software Testing Unit:IV
of which the (x, y) coordinates are assumed to be (0, 0). This method will be of use if your test script tries to validate
the layout of your web page.
The output for the preceding code is the (x, y) location of the Search box, as shown in the following screenshot:
The output for the preceding code is the width and height of the Search box, as shown in the following screenshot:
<button id="gbqfba" class="gbqfba" name="btnK" aria-label="Google Search"> In the preceding code, the
button is the tag name of the HTML element.
The preceding code uses the getTagName() method to get the tag name of the Search button element. The output of the
code is as expected:
void sendKeys([Link]...keysToSend)
The input parameter for the preceding method is CharSequence of text that has to be entered into the element. This
method doesn't return anything. Now, let's see a code example of how to type a search text into the Search box using the
sendKeys() method:
[Link]();
In the preceding code, the sendKeys() method is used to type the required text in the textbox element of the web page.
This is how we deal with normal keys, but if you want to type in some special keys, such as Backspace, Enter, Tab, or
Shift, we need to use a special enum class of WebDriver, named Keys. Using the Keys enumeration, you can simulate
many special keys while typing into a WebElement.
Now let's see some code example, which uses the Shift key to type the text in uppercase in the Search Box:
[Link]([Link]([Link],"phones"));
In the preceding code, the chord() method from the Keys enum is used to type the key, while the text specified is being
given as an input to be the textbox.
11
Course Code/Title:CS2602/Software Testing Unit:IV
We have used the WebElement's clear() method to clear the text after typing phones into the Search box.
[Link]();
The preceding method returns a Boolean value specifying whether the target element is displayed on the web
page. The following is the code to verify whether the Search box is
The preceding code uses the isDisplayed() method to determine whether the element is displayed on a web page. The
preceding code returns true for the Search box:
boolean isEnabled()
1. Firefox Driver
The new driver for Firefox is called Geckodriver. The Geckodriver provides the HTTP API described by the
W3C WebDriver Protocol to communicate with Gecko browsers, such as Firefox. It translates calls into the Firefox
Remote Protocol (Marionette) by acting as a proxy between the local and remote ends.
Using GeckoDriver:
Provide the path of the Geckodriver binary in the [Link] property, and instantiate the
FirefoxDriver class:
.exe");
12
Course Code/Title:CS2602/Software Testing Unit:IV
[Link]("[Link]
Headless mode is a very useful way to run Firefox for automated testing with Selenium WebDriver. In headless mode,
Firefox runs as normal only you don't see the UI components. This makes Firefox faster and tests run more efficiently,
especially in the CI (Continuous Integration) environment.
We can run Selenium tests in headless mode by configuring the FirefoxOptions class, as shown in the following code
snippet:
WebDriver driver;
During the execution, you will not see the Firefox window on the screen but the test will be executed in headless mode.
2. Chrome Driver
The ChromeDriver works similar to the Geckodriver and implements the W3C WebDriver protocol. First of all,
we need to download the chrome driver executable from [Link] Download the
appropriate version of chromedriver based on the Chrome version installed on computer as well as the operating system.
Copy the executable file into the /src/test/resources/drivers folder.
Provide the path of the chromedriver binary in the [Link] property, and instantiate the
ChromeDriver class: [Link]("[Link]","C:\\seleniumwebdriver\\chromedrive r-in64
\\[Link]");
Similar to Firefox, we can run tests in headless mode with ChromeDriver. This makes Chrome tests run faster and tests run
more efficiently, especially in the CI (Continuous Integration) environment.
We can run Selenium tests in headless mode by configuring the ChromeOptions class as shown in the following code
snippet:
In the preceding code, we first created an instance of the ChromeOptions class, called the setHeadless() method, that
passes the value as true to launch the Chrome browser in headless mode. During the execution, you will not see the
Chrome window on the screen but the test will be executed in headless mode.
The IEDriver server then uses its IEThreadExplorer class, which is written in C++, to drive the IE browser using the
Component Object Model framework. The following is the code that instantiates InternetExplorerDriver:
4. Edge Driver
Microsoft Edge is the latest web browser launched with Microsoft Windows 10. Microsoft Edge was one of the first
browsers to implement the W3C WebDriver standard and provides built-in support for Selenium WebDriver.
Similar to Internet Explorer, in order to execute test scripts on the Microsoft Edge browser, we need to use the
EdgeDriver class and a standalone Microsoft WebDriver Server executable. The Microsoft WebDriver Server is
13
Course Code/Title:CS2602/Software Testing Unit:IV
maintained by the Microsoft Edge development team. You can find more information at
[Link] gb/microsoft-edge/webdrive.
[Link]("[Link]
5. Safari Driver
With Selenium 3.0 and WebDriver becoming the W3C standard, Apple now provides SafariDriver built into the
browser. We do not have to download it separately. However, in order to work it with Selenium WebDriver, we have to
set a Develop | Allow Remote Automation option from Safari's main menu. This is as straight forward. The following
is the test script using the Safari Driver:
WebDriver driver;
[Link]("[Link]
JUNIT:
What is JUnit ?
JUnit is a unit testing framework for Java programming language. It plays a crucial role test-driven development,
and is a family of unit testing frameworks collectively known as xUnit.
JUnit promotes the idea of "first testing then coding", which emphasizes on setting up the test data for a piece of
code that can be tested first and then implemented. It increases the productivity of the programmer and the
stability of program code, which in turn reduces the stress on the programmer and the time spent on debugging.
Features of JUnit
JUnit is an open source framework, which is used for writing and running tests.
JUnit tests allow you to write codes faster, which increases quality.
JUnit tests can be run automatically and they check their own results and provide immediate feedback. There's no need to
manually comb through a report of test results.
JUnit tests can be organized into test suites containing test cases and even other test suites.
JUnit shows test progress in a bar that is green if the test is running smoothly, and it turns red when a test fails.
JUnit is a framework for Java, so the very first requirement is to have JDK installed in your machine.
System Requirement
14
Course Code/Title:CS2602/Software Testing Unit:IV
First of all, open the console and execute a java command based on the operating system you are working on.
OS Task Command
OS Output
If you do not have Java installed on your system, then download the Java Software Development Kit (SDK) from the following
link [Link] We are assuming Java 1.8.0_101 as the installed version for this tutorial.
Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified expert to boost your
career.
Set the JAVA_HOME environment variable to point to the base directory location where Java is installed on your machine. For
example.
OS Output
OS Output
15
Course Code/Title:CS2602/Software Testing Unit:IV
Verify Java installation using the command java -version as explained above.
Download the latest version of JUnit jar file from [Link] At the time of writing this tutorial, we have downloaded
[Link] and copied it into C:\>JUnit folder.
OS Archive name
Windows [Link]
Linux [Link]
Mac [Link]
Set the JUNIT_HOME environment variable to point to the base directory location where JUNIT jar is stored on your machine.
Let’s assuming we've stored [Link] in the JUNIT folder.
Windows
1
Set the environment variable JUNIT_HOME to C:\JUNIT
2 Linux
export JUNIT_HOME = /usr/local/JUNIT
Mac
3
export JUNIT_HOME = /Library/JUNIT
Set the CLASSPATH environment variable to point to the JUNIT jar location.
Windows
1
Set the environment variable CLASSPATH to %CLASSPATH%;%JUNIT_HOME%\[Link];.;
Linux
2
export CLASSPATH = $CLASSPATH:$JUNIT_HOME/[Link]:.
3 Mac
export CLASSPATH = $CLASSPATH:$JUNIT_HOME/[Link]:.
16
Course Code/Title:CS2602/Software Testing Unit:IV
Create a java class file name TestRunner in C:\>JUNIT_WORKSPACE to execute test case(s).
[Link]([Link]());
}}
C:\JUNIT_WORKSPACE>java TestRunner
True
1. Fixtures
2. Test suites
3. Test runners
4. JUnit classes
Fixtures:
Fixtures is a fixed state of a set of objects used as a baseline for running tests. The purpose of a test fixture is to ensure that th ere
is a well-known and fixed environment in which tests are run so that results are repeatable. It includes −
setUp() method, which runs before every test invocation.
tearDown() method, which runs after every test method.
import [Link].*;
public class JavaTest extends TestCase {
protected int value1, value2;
Test Suites
A test suite bundles a few unit test cases and runs them together. In JUnit, both @RunWith and @Suite annotation are used to
run the suite test. Given below is an example that uses TestJunit1 & TestJunit2 test classes.
17
Course Code/Title:CS2602/Software Testing Unit:IV
@Test
public void testPrintMessage() {
[Link]("Inside testPrintMessage()");
assertEquals(message, [Link]());
}}
import [Link];import [Link];import static [Link];
public class TestJunit2 {
@Test
public void testSalutationMessage() {
[Link]("Inside testSalutationMessage()");
message = "Hi!" + "Robert";
assertEquals(message,[Link]());
}}
Test Runners
Test runner is used for executing the test cases. Here is an example that assumes the test class TestJunit already exists.
[Link]([Link]());
}}
JUnit Classes
JUnit classes are important classes, used in writing and testing JUnits. Some of the important classes are −
TestCase − Contains a test case that defines the fixture to run multiple tests.
18
Course Code/Title:CS2602/Software Testing Unit:IV
JUNIT ANNOTATIONS
19
Course Code/Title:CS2602/Software Testing Unit:IV
JUNIT ASSERTIONS:
20
Course Code/Title:CS2602/Software Testing Unit:IV
21
Course Code/Title:CS2602/Software Testing Unit:IV
[Link]
22
Course Code/Title:CS2602/Software Testing Unit:IV
23
Course Code/Title:CS2602/Software Testing Unit:IV
24
Course Code/Title:CS2602 / Software Testing Unit: V
Performance Testing Concepts-Load testing, stress testing, scalability testing, Performance Testing
Tools-JMeter, LoadRunner, etc. Introduction to Security Testing-Common security vulnerabilities,
Security Testing Tools-OWASP ZAP, Burp Suite, etc.
Load testing: It checks the product’s ability to perform under anticipated user loads. The objective is
to identify performance congestion before the software product is launched in the market.
Stress testing: It involves testing a product under extreme workloads to see whether it handles high
traffic or not. The objective is to identify the breaking point of a software product.
Spike testing: It is a type of load testing that tests the system’s ability to handle sudden spikes in
traffic. It helps identify any issues that may occur when the system is suddenly hit with a high number
of requests.
Soak testing: Soak testing is a type of load testing that tests the system’s ability to handle a sustained
load over a prolonged period. It helps identify any issues that may occur after prolonged usage of the
system.
Endurance testing: This type of testing is similar to soak testing, but it focuses on the long- term
behaviour of the system under a constant load.
Volume testing: In volume testing, large number of data is saved in a database and the overall
software system’s behaviour is observed. The objective is to check the product’s performance under
varying database volumes.
LOAD TESTING
Load testing determines the behavior of the application when multiple users use it at the same
time. It is the response of the system measured under varying load conditions.
• The load testing is carried out for normal and extreme load conditions.
1
Course Code/Title:CS2602 / Software Testing Unit: V
• Load testing is a type of performance testing that simulates a real-world load on a system or
application to see how it performs under stress.
• The goal of load testing is to identify bottlenecks and determine the maximum number of
users or transactions the system can handle.
• It is an important aspect of software testing as it helps ensure that the system can handle the
expected usage levels and identify any potential issues before the system is deployed to
production.
During load testing, various scenarios are simulated to test the system’s behavior under different
load conditions. This can include simulating a high number of concurrent users, simulating numerous
requests, and simulating heavy network traffic. The system’s performance is then measured and
analyzed to identify any bottlenecks or issues that may occur.
Stress testing: Testing the system’s ability to handle a high load above normal usage levels.
Spike testing: Testing the system’s ability to handle sudden spikes in traffic.
Soak testing: Testing the system’s ability to handle a sustained load over a prolonged period of time.
Tools for Performance Testing: Make use of specialized load testing tools like Locust, Gatling,
JMeter, LoadRunner, and Apache Benchmark. These tools assist in gathering performance
measurements and simulating a large number of users.
Specify the Test Objectives: Clearly state what your load test’s goals are. Recognize the required
response times, transaction volumes and expected user behavior.
Determine Crucial Situations: Determine the essential user scenarios that correspond to common
usage patterns. A variety of actions, including user logins, searches, form submissions and other
significant interactions, should be covered by these scenarios.
Objectives of Load Testing:
Evaluation of Scalability: Assess the system’s ability to handle growing user and transaction
demands. Find the point at which the system begins to function badly.
Planning for Capacity: Describe the system’s ability to accommodate anticipated future increases in
the number of users, transactions and volume of data. Making well-informed decisions regarding
infrastructure upgrades is made easier by this.
Determine bottlenecks: Identify and localize bottlenecks in the application or infrastructure’s
performance. Finding the places where the system’s performance can suffer under load is part of this.
Analysis of Response Time: For crucial transactions and user interactions, track and evaluate
response times. Make that the system responds to changes in load with reasonable response times.
Finding Memory Leaks: Find and fix memory leaks that may eventually cause a decline in
performance. Make sure the programme doesn’t use up too many resources when it’s running.
Load Testing Process:
1. Test Environment Setup: Firstly create a dedicated test environment setup for performing
the load testing. It ensures that testing would be done in a proper way.
2. Load Test Scenario: In second step load test scenarios are created. Then load testing
transactions are determined for an application and data is prepared for each transaction.
3. Test Scenario Execution: Load test scenarios that were created in previous step are now
executed. Different measurements and metrices are gathered to collect the information.
4. Test Result Analysis: Results of the testing performed is analyzed and various
recommendations are made.
5. Re-test: If the test is failed then the test is performed again in order to get the result in
correct way.
2
Course Code/Title:CS2602 / Software Testing Unit: V
Metrics are used in knowing the performance of load testing under different circumstances.
It tells how accurately the load testing is working under different test cases. It is usually carried out
after the preparation of load test scripts/cases. There are many metrics to evaluate the load testing.
Some of them are listed below.
2. Error Rate
The Error Rate is mentioned in terms of percentage denotes the number of errors occurred
during the requests to the total number of requests. These errors are usually raised when the
application is no longer handling the request at the given time or for some other technical problems.
It makes the application less efficient when the error rate keeps on increasing.
3. Throughput
This metric is used in knowing the range of bandwidth consumed during the load scripts or tests and
it is also used in knowing the amount of data which is being used for checking the request that flows
between the user server and application main server. It is measured in kilobytes per second.
5. Concurrent Users
This metric is used to take the count of the users who are actively present at the particular time or at
any time. It just keeps track of count those who are visiting the application at any time without
raising any request in the application. From this, we can easily know that at which time the high
number of users are visiting the application or website.
3
Course Code/Title:CS2602 / Software Testing Unit: V
STRESS TESTING
Stress Testing is a software testing technique that determines the robustness of software by
testing beyond the limits of normal operation. Stress testing is particularly important for critical
software but is used for all types of software. Stress testing emphasizes robustness, availability, and
error handling under a heavy load rather than what is correct behavior under normal situations.
Stress testing is defined as a type of software testing that verifies the stability and reliability
of the system. This test particularly determines the system on its robustness and error handling under
extremely heavy load conditions. It even tests beyond the normal operating point and analyses how
the system works under extreme conditions. Stress testing is performed to ensure that the system would
not crash under crunch situations. Stress testing is also known as Torture Testing.
1. Identification of Risk: Stress testing’s main objective is to locate and evaluate a system’s
possible hazards and weaknesses.
2. Quantitative and Qualitative Analysis: While numerical data are crucial, it’s also critical
to comprehend the qualitative characteristics of the system’s response and potential weak
points
3. Variable Parameters: Stress testing include changing variables including interest rates,
market conditions, transaction volumes and outside influences that could have an impact on
the system.
4. Cross-Functional Involvement: Many departments within an organization must work
together and participate in stress testing. This cross-functional strategy makes sure that the
stress testing procedure benefits from a variety of viewpoints and specialties.
5. Open and Honest Communication: Stress testing necessitates open and honest
communication regarding the goal, approach, and outcomes of the testing procedure.
Need for Stress Testing:
• Analyze the behavior of the application after failure: The purpose of stress testing is to
analyze the behavior of the application after failure and the software should display the
appropriate error messages while it is under extreme conditions.
• System recovers after failure: Stress testing aims to make sure that there are plans for
recovering the system to the working state so that the system recovers after failure.
• Uncover Hardware issues: Stress testing helps to uncover hardware issues and data
corruption issues.
• Uncover Security Weakness: Stress testing helps to uncover the security vulnerabilities
that may enter into the system during the constant peak load and compromise the system.
4
Course Code/Title:CS2602 / Software Testing Unit: V
• Ensures data integrity: Stress testing helps to determine the application’s data integrity
throughout the extreme load, which means that the data should be in a dependable state even
after a failure.
Stress Testing Process:
1. Planning the stress test: This step involves gathering the system data, analyzing the system,
and defining the stress test goals.
2. Create Automation Scripts: This step involves creating the stress testing automation
scripts and generating the test data for the stress test scenarios.
3. Script Execution: This step involves running the stress test automation scripts and storing
the stress test results.
4. Result Analysis: This phase involves analyzing stress test results and identifying the
bottlenecks.
5. Tweaking and Optimization: This step involves fine-tuning the system and
optimizing the code with the goal meet the desired benchmarks.
1. Server-client Stress Testing: Server-client stress testing also known as distributed stress
testing is carried out across all clients from the server.
2. Product Stress Testing: Product stress testing concentrates on discovering defects related to
data locking and blocking, network issues, and performance congestion in a software
product.
3. Transactional Stress Testing: Transaction stress testing is performed on one or more
transactions between two or more applications. It is carried out for fine-tuning and
optimizing the system.
4. Systematic Stress Testing: Systematic stress testing is integrated testing that is used to
perform tests across multiple systems running on the same server. It is used to discover
defects where one application data blocks another application.
5. Analytical Stress Testing: Analytical or exploratory stress testing is performed to test the
system with abnormal parameters or conditions that are unlikely to happen in a real scenario.
It is carried out to find defects in unusual scenarios like a large number of users logged at
the same time or a database going offline when it is accessed from a website.
6. Application Stress Testing: Application stress testing also known as product stress testing
is focused on identifying the performance bottleneck, and network issues in a software
product.
1. Jmeter: Apache JMeter is a stress testing tool is an open-source, pure Java-based software
that is used to stress test websites. It is an Apache project and can be used for load testing for
analyzing and measuring the performance of a variety of services.
5
Course Code/Title:CS2602 / Software Testing Unit: V
2. LoadNinja: LoadNinja is a stress testing tool developed by SmartBear that enables users to
develop codeless load tests, substitutes load emulators with actual browsers, and helps to
achieve high speed and efficiency with browser-based metrics.
3. WebLoad: WebLoad is a stress testing tool that combines performance, stability, and
integrity as a single process for the verification of mobile and web applications.
4. Neoload: Neoload is a powerful performance testing tool that simulates large numbers of
users and analyzes the server’s behavior. It is designed for both mobile and web applications.
Neoload supports API testing and integrates with different CI/ CD applications.
5. SmartMeter: SmartMeter is a user-friendly tool that helps to create simple tests without
coding. It has a graphical user interface and has no necessary plugins. This tool automatically
generates advanced test reports with complete and detailed test results.
Metrics of Stress Testing:
Metrics are used to evaluate the performance of the stress and it is usually carried out at the end of the
stress scripts or tests. Some of the metrics are given below.
1. Pages Per Second: Number of pages requested per second and number of pages loaded per
second.
2. Pages Retrieved: Average time is taken to retrieve all information from a particular page.
3. Byte Retrieved: Average time is taken to retrieve the first byte of information from the page.
4. Transaction Response Time: Average time is taken to load or perform transactions
between the applications.
5. Transactions per Second: It takes count of the number of transactions loaded per
second successfully and it also counts the number of failures that occurred.
6. Failure of Connection: It takes count of the number of times that the client faced
connection failure in their system.
7. Failure of System Attempts: It takes count of the number of failed attempts in the system.
8. Rounds: It takes count of the number of test or script conditions executed by the clients
successfully and it keeps track of the number of rounds failed.
Scalability Testing:
Scalability Testing is a type of non-functional testing in which the performance of a software
application, system, network or process is tested in terms of its capability to scale up or scale down
the number of user request load or other such performance attributes. It can be carried out at a
hardware, software or database level. Scalability Testing is defined as the ability of a network,
system, application, product or a process to perform the function correctly when changes are made in
the size or volume of the system to meet a growing need. It ensures that a software product can
manage the scheduled increase in user traffic, data volume, transaction counts frequency and many
other things. It tests the system, processes or database’s ability to meet a growing need.
Scalability Testing is to measure at what point the software product or the system stops scaling and
identify the reason behind it. The parameters used for this testing differs from one application to
another. For example, scalability testing of a web page depends on the number of users, CPU usage,
network usage while scalability testing of a web server depends on the number of requests processed.
Objective of Scalability Testing:
The objective of scalability testing is:
To determine how the application scales with increasing workload.
To determine the user limit for the software product.
To determine client-side degradation and end user experience under load.
To assess the system’s performance under various network circumstances, such as latency and
bandwidth fluctuations, in order to guarantee dependable operation in a range of settings.
To determine whether the system is capable of withstanding scenarios of high usage, making
sure that unexpected spikes in traffic can be accommodated without causing performance issues.
To guarantee that the system’s scalability prevents performance decline and maintains
acceptable response times, both of which improve user experience.
To determine server-side robustness and degradation.
6
Course Code/Title:CS2602 / Software Testing Unit: V
To help developers improve the system design or code by pointing out locations that could
become bottlenecks when the load grows.
To evaluate the effective use of system resources, including CPU, memory and network
bandwidth, in relation to the system’s increasing load, in order to guarantee resource
management.
To make that the system satisfies performance criteria and offers a satisfying user experience,
assess the system’s response time under various loads.
7
Course Code/Title:CS2602 / Software Testing Unit: V
Scalability testing is a type of software testing that verifies a system’s ability to scale up or down as
the workload increases or decreases. This testing is important for ensuring that the system can handle
increasing amounts of traffic, data, or users without degrading performance or stability.
Some tools that can be used for scalability testing include Apache Meter, HP Roadrunner, and
Gatling. These tools can simulate different levels of traffic and workload and measure the system’s
performance metrics.
JMeter also known as 'Apache JMeter' is an open source, 100% java based
application with a graphical interface. It is designed to analyse and measure the
performance and load functional behaviour of web application and variety of
services.
JMeter is mainly used for testing Web application or FTP application but
currently, it is applicable in functional testing, JDBC database connections, Web
services, generic TCP connections and OS native processes. You can perform
various testing activities like Performance, Load, Stress, Regression and
Functional testing, in order to get accurate performance metrics against your web
server.
JMeter is not a browser and it doesn't render html pages like any browser does,
rather it works on protocol level.
8
Course Code/Title:CS2602 / Software Testing Unit: V
JMeter Features
o Mail: POP3.
Working of JMeter
9
Course Code/Title:CS2602 / Software Testing Unit: V
JMeter Installation
We assume that you have already installed 'jdk 1.6' or above on your machine and
successfully configured the environment variables required to run and compile java
programs.
However, to verify whether you have Java installed on your system. Open your
console and execute the following java commands as per the operating system
you are working on.
File Description
o After downloading JMeter, you need to extract the files at a convenient directory.
o The following image shows the structure of the directories and files -
10
Course Code/Title:CS2602 / Software Testing Unit: V
To launch JMeter in GUI mode - go to the bin directory and double click on
the respective executable file as per the operating system you are working on.
For example:
JMeter comprises of various elements which co-relates with each other but
designed for different purposes. Before you start working on JMeter, it is good to
know some of the major elements of JMeter with full detail description.
o Test Plan
o Thread Group
o Controllers
o Listeners
o Timers
o Configuration Elements
o Pre-Processor Elements
o Post-Processor Elements
Please refer to the below flow diagram to understand each component and their
relation to specific modules of JMeter.
11
Course Code/Title:CS2602 / Software Testing Unit: V
Test Plan
A test plan can be visualized as your JMeter script for running tests. A test plan
consists of test elements such as thread groups, logic controllers, sample-
generating controllers, listeners, timers, assertions, and configuration elements.
A test plan consists of all steps which execute the script. Everything which is
included in a test plan is executed in a sequence which is top to bottom or as per the
designed sequence in the test plan. The figure given below shows the directory level
of a test plan.
o The test plan should be saved before running the entire test plan.
o JMeter files or test plans are saved in form of .JMX extension files. JMX is
an open test based format, it enables the test plan to be launched in a text
editor.
o You can also save parts of test plan as the different selection. For example,if
you want to save HTTP request sampler with listener, you can save it as
test fragment so that it can be used in other test scenarios as well.
Thread Group
As the name implies, thread group represents the group of threads JMeter will
use during the test. Thread group elements are the beginning points of any test
plan. The controls provided by a thread group allow you to:
The steps to add a thread group in your test plan had been explained earlier in the
Add/Remove test elements portion.
o Itsname.
o Number of threads (the number of users you are testing).
o Ramp-up time (how much time you want to allow the Thread Group to
go from 0 to 3 users).
o Loop count (How many times the test should be looped).
o Scheduler checkbox (The checkbox at the bottom of the Thread Group
panel is used to enable/disable extra fields in which you can enter the
duration of test, the startup delay, the start and end times of the run).
Controllers
o Samplers
o Logical Controllers
Samplers
Samplers are the components which allow JMeter to send specific types of
requests to a [Link] simulates a user's request for a page to the target server.
12
Course Code/Title:CS2602 / Software Testing Unit: V
Samplers are a must to add component to a test plan as only it can let JMeter
know what type of request need to go to a server. Requests could be HTTP,
HTTP(s), FTP, TCP, SMTP, SOAP etc.
o FTP Request
o HTTP Request (can be used for SOAP or REST Webservice also)
o JDBC Request
o Java object request
o JMS request
o JUnit Test request
o LDAP Request
o Mail request
o OS Process request
o TCP request
Logical Controllers
Logic Controllers help you to control the flow the order of processing of samplers in
a thread. It can also change the order of requests coming from their child elements.
o Runtime Controller
o IF Controller
o Transaction Controller
o Recording Controller
o Simple Controller
o While Controller
o Switch Controller
o ForEach Controller
o Module Controller
o Include Controller
o Loop Controller
o Once Only Controller
o Interleave Controller
o Random Controller
o Random Order Controller
o Throughput Controller
Listeners
13
Course Code/Title:CS2602 / Software Testing Unit: V
Listeners can be adjusted anywhere in the test, including directly under the test
plan. There are around 15 listeners provided by JMeter but mostly used ones are
table, tree, and Graph.
o Graph Results
o Spline Visualizer
o Assertion Results
o Simple Data Writer
o Monitor Results
o Distribution Graph (alpha)
o Aggregate Graph
o Mailer Visualizer
o BeanShell Listener
o Summary Report
o Sample Result Save Configuration
o Graph Full Results
o View Results Tree
o Aggregate Report
o View Results in Table
Timers
When you perform any operation on a website or app, they naturally have pauses
and delays. These can be simulated with Timers.
JMeter sends requests without applying any delay between each sampler/request.
If you perform load/stress testing on your server without any delay, it will be
overloaded. This not exactly what you want. You can add a timer element which
will permit you to define a period to wait between each request.
Given below is the list of all the Timer elements provided by JMeter:
o Synchronizing Timer
o JSR223 Time
o BeanShell Time
o Gaussian Random Timer
o Uniform Random Timer
o Constant Throughput Timer
o BSF Time
o Poisson Random Time
Configuration Elements
It is a simple element where you can collects the corporate configuration values of all
samplers like webserver's hostname or database url etc.
14
Course Code/Title:CS2602 / Software Testing Unit: V
A configuration element is accessible from only inside the branch where you place the element.
Given below is the list of some of the most commonly used configuration elements
provided by JMeter:
Pre-processor Elements
A Pre-Processor element is executed just before the request made by the sampler.
If a Pre- processor is attached to a sampler element then it will execute just prior
to that sampler element running.
o JDBC Pre-processor
o JSR223 Pre-processor
o RegEx User Parameters
o BeanShell Pre-processor
o BSF Pre-processor
o HTML Link Parser
o HTTP URL Re-writing Modifier
o HTTP User Parameter Modifier
o User Parameters
Post-processor Elements
15
Course Code/Title:CS2602 / Software Testing Unit: V
A Post-processor is most often used to process the response data, for example, to
extract a particular value for future purpose.
o CSS/JQuery Extractor
o BeanShell Post-processor
o JSR223 Post-processor
o JDBC Post-processor
o Debug Post-processor
o Regular Expression Extractor
o XPath Extractor
o Result Status Action Handler
o BSF Post-processor
Build JMeter Test Plan
Atest plan can be visualized as your JMeter script for running tests. A test plan
consists of test elements such as thread groups, logic controllers, sample-
generating controllers, listeners, timers, assertions, and configuration elements.
There should be at least one thread group in every test plan. We can add or
remove elements as per our requirement.
o The default JMeter interface contains a Test Plan node where the real test
plan is kept.
o The Test Plan node contains Name of the test plan and user defined variables.
o User defined variables provides flexibility when you have to repeat any
value in several parts of the test plan.
o Once you have created a test plan for JMeter, the next step is to
add and remove elements to JMeter test plan.
o Select the test plan node and right click on the selected item.
o Mouse hover on "Add" option, then elements list will be displayed.
o Mouse hover on desired list element, and select the desired option by clicking.
o To remove an element, select the desired element.
o Right click on the element and choose the "Remove" option.
o To load elements to JMeter test plan tree, select and right click on any
Tree Element on which you want to add the loaded element.
o Select "Merge" option.
o Choose the .jmx file where you save the elements.
16
Course Code/Title:CS2602 / Software Testing Unit: V
Elements in the test plan can be configured by using controls present on JMeter’s
right hand side frame. These controls allow you to configure the behaviour of the
selected element. For example, a thread group can be configured by-
o Itsname.
o Number of threads (the number of users you are testing).
o Ramp-up time (how much time you want to allow the Thread Group to
go from 0 to 3 users).
o Loop count (How many times the test should be looped).
o Till now we are done with creating a test plan, adding an element and
configuring a Tree.
o Now, you can save the entire test plan by choosing the "Save" or "Save
Test Plan As" from file menu.
o You can run the test plan by clicking on the Start (Control + r) from the
Run menu item or you can simply click the green play button.
o When the test plan starts running, the JMeter interface shows a green
circle at the right- hand end of the section just under the menubar.
Step 7: Stop JMeter test plan.
o You can stop the test plan by using Stop (Control + '.') - It stops the
threads immediately if possible.
o You can also use Shutdown (Control + ',') - It requests the threads to
stop at the end of any on-going task.
o JMeter stores the test run details, warnings and errors to [Link] file.
o You can access JMeter logs by clicking on the exclamation sign present
at the right-hand side of the section just under the menubar.
LoadRunner:
IntroductiontoLoadRunner
A software testing tool called LoadRunner is used to measure system performance and behavior
under load, it is used to test applications.
Overview of LoadRunner
The idea behind LoadRunner is to record and repeat user actions to create the appropriate load
on the server. Creating a virtual load merely mimics the actions of a real user and aids in
determining how well a software program or system performs.
17
Course Code/Title:CS2602 / Software Testing Unit: V
LoadRunner creates virtual users to execute scripts that mimic actual user activity. “Vusers” is
the term for these virtual users.
The traffic on the server is produced by Vusers running concurrently throughout the execution of
performance tests.
After the test is over, LoadRunner gathers the data and stores it in a file called raw results.
The Microfocus Analysis tool can be used to open this file and undertake additional analysis of
the test result.
The analysis tool ultimately produces a report that summarizes the test outcome.
Virtual User Generator or VuGen: It is a tool that captures business processes used by end users and
builds an automated test script that looks like a programming language. The created script is referred to
as a “Test Script” or “VuGen Script.”
Load Generators: These are devices that create virtual loads following specifications. Every user in the
scenario is assigned to a load generator by the Controller during test execution. To replicate the users’
geographic location, a load generator is also employed.
Controller: It plans, directs, oversees, and keeps an eye on the load test. Workload modeling also
makes use of a controller. The process of creating a test scenario by NFR (non-functional requirement)
is known as workload modeling.
Agent: The LoadRunner agent establishes contact between the load generator and the controller.
Analysis: To check the test result against the specified NFRs (non-functional requirements) and
identify the bottleneck (performance problems), the analysis tool shows graphs and statistics of the test
results. Based on the test result, the analysis tool also produces a report.
LoadRunner goes through five main processes. Almost all of the performance testing products on the
market adhere to the same procedures as LoadRunner.
Script Creation
Scenario Creation
Test Execution and Monitoring
Result Gathering and Analysis
Reporting
Script Creation
To capture the business flows, LoadRunner features a special component called “VuGen,” or “Virtual
User Generator.” The actual user’s website
navigation is captured by VuGen, which then translates it into a script.
The ANSI C scripting language is supported by VuGen and is simple to learn and comprehend. The C
programming language makes it simple to define variables and functions, write custom code, and apply
new logic, which makes scripting in LoadRunner simple.
18
Course Code/Title:CS2602 / Software Testing Unit: V
Protocol Identification: You must be aware of the application’s technology and platform to write a
script.
Script Recording: LoadRunner’s greatest benefit is its recording feature. It eliminates the need for a
performance tester to spend time and energy writing manual code and supports recording for 90%–95%
of protocols.
Script Enhancement: LoadRunner creates a simple script of sophisticated correlation, parametrization,
etc. Upon recording completion, script enhancement fully automates the VuGen script. The steps in
script enhancement are as follows:
Parameterization
Correlation
Insert Transactions
Add Rendezvous Points
Insert Basic Function
Insert Comments
Enable log messages
Insert synchronization points
Set up the run-time setting.
Scenario Creation
A scenario outlines the test’s objectives and methodology. A load runner scenario includes the test time,
a list of machines, a defined workload model, and the script.
Performance testing is necessary under NFR(non-functional requirements) for the set of business flows
as they relate to the LoadRunner script.
The Performance Center’s “Test Plan” or the load runner’s “Controller” generates a scenario. The
configuration and scheduling of the scenario, which dictates the behavior of all load generators and
Vusers during the test, are set during scenario design.
Proper NFRs, the anticipated TPS (transaction per second), and user count are necessary before
creating a scenario.
The scenario must be created in a way that allows for the achievement of the desired metrics (TPS and
user load). To get the desired results, you may occasionally need to adjust the script’s thought time and
pacing. Consult the following calculators to assist you in generating the appropriate scenario:
Pacing
Think Time
No. of Users
TPS
No. of required LGs
Test Execution and Monitoring
To begin monitoring the graphs, you just need to “run” the scenario that has been constructed. You can
be sure that the performance test is running as planned and that every Vuser is adhering to the same
business processes that were addressed in the scripts.
The transactions of the Vuser script are measured, recorded, and shown on the dashboard by
LoadRunner during the test execution process.
There are numerous monitoring graphs available in LoadRunner that display client-side data.
There are several of them, including response time, TPS, running Vuser, throughput, system
performance, etc.
Monitoring server-side statistics is another advantage that comes with integrating some external
monitors, such as SiteScope.
Following the test, the controller compiles and aggregates the results. The raw format contains the
compiled result.
The test result can also be obtained in HTML format if you operate in the Performance Center and
select the “Collate and Analysis” option.
19
Course Code/Title:CS2602 / Software Testing Unit: V
These files with the test results can be downloaded to your local computer.
The “Analysis” tool, a feature exclusive to LoadRunner, is used to analyze the outcome.
The analysis tool offers the ability to view the raw result file, which is produced following the test and
shown in a tabular and graphical format.
The analysis tool is equipped with numerous features that provide an in-depth examination of the
obtained data and identify the real bottlenecks.
To finish diagnosing the problems, you can also add filters, correlation, merging, and overlay options
to the graphs.
Reporting
An analysis tool offers multiple report formats. After the test analysis is finished, you can create a
summary of the test results, identify the bottleneck and describe it, select the graphs you want to be
included in the report, and generate it in the format you want (.doc,.docx,.pdf,.html, etc.).
To let the client or project know who was involved in the testing, report generation also includes an
option to add the organization’s logo, the name of the author, the name of the tester, etc.
SECURITY TESTING
Security testing is an integral part of software testing, which is used to discover the
weaknesses, risks, or threats in the software application and also help us to stop the nasty attack from
the outsiders and make sure the security of our software applications.
The primary objective of security testing is to find all the potential ambiguities and
vulnerabilities of the application so that the software does not stop working. If we perform security
testing, then it helps us to identify all the possible security threats and also help the programmer to
fix those errors.
It is a testing procedure, which is used to define that the data will be safe and also continue
the working process of the software.
Principle of Security testing:
Availability: In this, the data must be retained by an official person, and they also guarantee that the
data and statement services will be ready to use whenever we need it.
Integrity: In this, we will secure those data which have been changed by the unofficial person. The
primary objective of integrity is to permit the receiver to control the data that is given by the system.
The integrity systems regularly use some of the similar fundamental approaches as
confidentiality structures. Still, they generally include the data for the communication to create the
source of an algorithmic check rather than encrypting all of the communication. And also verify that
correct data is conveyed from one application to another.
20
Course Code/Title:CS2602 / Software Testing Unit: V
Authorization: It is the process of defining that a client is permitted to perform an action and also
receive the services. The example of authorization is Access control.
Confidentiality: It is a security process that protracts the leak of the data from the outsider's because
it is the only way where we can make sure the security of our data.
Authentication: The authentication process comprises confirming the individuality of a person,
tracing the source of a product that is necessary to allow access to the private information or the
system.
Non-repudiation: It is used as a reference to the digital security, and it a way of assurance that the
sender of a message cannot disagree with having sent the message and that the recipient cannot
repudiate having received the message.
The non-repudiation is used to ensure that a conveyed message has been sent and received
by the person who claims to have sent and received the message.
Key Areas in Security Testing:
While performing the security testing on the web application, we need to concentrate on the
following areas to test the application:
System software security: In this, we will evaluate the vulnerabilities of the application based on
different software such as Operating system, Database system, etc.
Network security: In this, we will check the weakness of the network structure, such as policies and
resources.
Server-side application security: We will do the server-side application security to ensure that the
server encryption and its tools are sufficient to protect the software from any disturbance.
Client-side application security: In this, we will make sure that any intruders cannot operate on any
browser or any tool which is used by customers.
21
Course Code/Title:CS2602 / Software Testing Unit: V
Security Scanning: Security scanning can be done for both automation testing and manual testing.
This scanning will be used to find the vulnerability or unwanted file modification in a web-based
application, websites, network, or the file system. After that, it will deliver the results which help us
to decrease those threats. Security scanning is needed for those systems, which depends on the
structure they use.
Risk Assessment: To moderate the risk of an application, we will go for risk assessment. In this, we
will explore the security risk, which can be detected in the association. The risk can be further
divided into three parts, and those are high, medium, and low. The primary purpose of the risk
assessment process is to assess the vulnerabilities and control the significant threat.
Vulnerability Scanning: It is an application that is used to determine and generates a list of all the
systems which contain the desktops, servers, laptops, virtual machines, printers, switches, and
firewalls related to a network. The vulnerability scanning can be performed over the automated
application and also identifies those software and systems which have acknowledged the security
vulnerabilities.
Penetration testing: Penetration testing is a security implementation where a cyber-security
professional tries to identify and exploit the weakness in the computer system. The primary objective
of this testing is to simulate outbreaks and also finds the loophole in the system and similarly save
from the intruders who can take the benefits.
Security Auditing: Security auditing is a structured method for evaluating the security measures of
the organization. In this, we will do the inside review of the application and the control system for
the security faults.
Ethical hacking: Ethical hacking is used to discover the weakness in the system and also helps the
organization to fix those security loopholes before the nasty hacker exposes them. The ethical
hacking will help us to increase the security position of the association because sometimes the ethical
hackers use the same tricks, tools, and techniques that nasty hackers will use, but with the approval of
the official person.
The objective of ethical hacking is to enhance security and to protect the systems from malicious
users' attacks.
Posture Assessment: It is a combination of ethical hacking, risk assessments, and security scanning,
which helps us to display the complete security posture of an organization.
22
Course Code/Title:CS2602 / Software Testing Unit: V
The acronym OWASP refers to the Open Web Application Security Project. It is a non-profit
organization whose primary objective is to strengthen software security through the implementation of
community-developed open-source programs, the formation of local chapters throughout the globe
with participants, learning and meetings, forums, and conferences.
The following are the top 10 vulnerabilities:
1. Broken Access Control
2. Cryptographic Failures
3. Injection
4. Insecure Design
5. Security Misconfiguration
6. Vulnerable and Outdated Components
7. Identification and Authentication Failures
8. Software and Data Integrity Failures
9. Security Logging and Monitoring Failures
10. Server-Side Request Forgery
A02:2021—Cryptographic Failures
This vulnerability enables bad actors to bypass encryptions implemented over sensitive data such as
passwords, financial records, credit card numbers, health records, personal information, and even
business-related classified information.
This vulnerability is exploited in scenarios in which either automatic database encryption is used or a
lack of proper encryption of network requests or when simple or unsalted hashes are used for
encryption for data storage.
Impacts of Cryptographic Failures
Sensitive data breach
Hefty fines from legal authorities due to lack of data privacy compliance
How to prevent Cryptographic Failures
Encrypt sensitive data in transit and storage with secure protocols and standards
Delete sensitive data that is stored unnecessarily
Ensure cryptographic randomness wherever possible and ensure it is not predictable
Store passwords with strong and adaptive hashing functions
Avoid outdated cryptographic mechanisms
A03:2021 — Injection
This vulnerability allows attackers to exploit an application or even gain access to its infrastructure
when it does not properly sanitize user input.
23
Course Code/Title:CS2602 / Software Testing Unit: V
It can be executed by uploading unintended data or pieces of code along with the web request, which
makes the interpreter output sensitive information stored in the database server.
Also, injection is a group of vulnerabilities that contains:
SQL/NoSQL Injection
Command Injection
Cross-Site Scripting (XSS)
LDAP Injection
Impacts of Injection attacks?
Data leak
Partial or complete access to the server
Response manipulation
Loss of user integrity
How to prevent Injection attacks?
Source code review
User input sanitation and filtering
Output encoding
Implementing limit over output and connection timeout
A05:2021—Security Misconfiguration
Indeed we must configure security measures in our systems and applications. But what if they are not
properly configured?
It can be misconfigured or unchanged default (common) credentials, enable unnecessary features such
as (ports, services, privileges, pages, etc.), outdated software, etc.
Impacts of Security Misconfiguration
Complete access over the server or the system and the data stored
Functionality manipulation of the application, which affects the user
How to prevent Security Misconfiguration
Make the application minimal with just the necessary features and frameworks used
Share security practices and directives with the clients
Implement separate credentials for each phase of development (development, QA, production)
environments
24
Course Code/Title:CS2602 / Software Testing Unit: V
This vulnerability takes place if we haven’t updated or implemented the latest version of the secure
software. It results in making the entire application vulnerable from the vulnerable framework or
software we used within.
Also, this vulnerability takes place when you implement software and its related components in your
application for unreliable or untrusted sources.
Impacts of Vulnerable and Outdated Components
Server compromise
Data breach
Reputational damage over the firm
How to prevent Vulnerable and Outdated Components
Update the software and framework patches
Remove unnecessary dependencies
Only rely on components and dependencies from secure sources
Software and data integrity failures occur when an attacker can modify or delete data in an
unauthorized manner. This can happen due to vulnerabilities in the software or poor coding practices.
Attackers can exploit these vulnerabilities to gain access to sensitive information or cause damage to
the system.
25
Course Code/Title:CS2602 / Software Testing Unit: V
Security logging involves recording events that occur in an application or system. This includes user
activity, system events, errors, and other relevant information. Monitoring involves analyzing these
logs to detect potential security threats or issues.
Inability To Detect Attacks: Without proper monitoring tools in place, attacks may go
unnoticed until significant damage has already been done.
Lack Of Visibility: Without adequate logs being recorded, it can be difficult for organizations
to understand what happened during an attack.
Inability To Respond Quickly: If an organization does not have real-time visibility into their
systems’ activities through log analysis tools like SIEMs (Security Information Event
Management), they may not be able to respond quickly enough to prevent further damage.
Non-Compliance: Many compliance regulations require organizations to maintain logs for
auditing purposes. Failure to comply with these regulations can result in significant fines or legal
consequences.
Server Side Request Forgery (SSRF) is a type of vulnerability that allows an attacker to send requests
from the server to other internal or external systems. This can be done by manipulating input
parameters such as URLs, IP addresses, and ports.
An attacker could use SSRF to bypass authentication mechanisms by accessing internal APIs.
An attacker could use SSRF to scan internal networks for vulnerable services.
An attacker could use SSRF to launch attacks against third-party services.
26
Course Code/Title:CS2602 / Software Testing Unit: V
OWASP ZAP:
ZAP provides installers for Linux, Mac OS/X, and Windows download from URL [Link]
and install ZAP for the system to perform penetration testing [Link] are the requirements for ZAP and
each installer:
After installing ZAP, specify whether need to persist this ZAP session. ZAP sessions are recorded by
default to the disk in an HSQLDB database that gets a default location and name. If selected as not to
persist a session, the files are deleted once you exit [Link] decided to persist this session, all session
information is saved within the local database. ZAP lets you provide custom locations and names for
saving the [Link] that can access the database later.
27
Course Code/Title:CS2602 / Software Testing Unit: V
The Quick Start tab is an add-on included with your ZAP installation, which can help you get started
with ZAP. Here is how you can run a Quick Start Automated Scan:
Start ZAP, go to the Workspace Window, select the Quick Start tab, and choose the big Automated
Scan button.
1. Go to the URL to attack text box, enter the full URL of the web application you intend to
attack, and then click the Attack button.
After clicking the Attack button, ZAP starts crawling the web application with its spider, passively
scanning each page it finds. Next, ZAP uses the active scanner to attack all discovered pages,
parameters, and functionality.
ZAP includes two spiders that can crawl web applications. The key differences between the spiders:
A traditional ZAP spider—this spider discovers links by examining the HTML in responses
from a web app. It is fast but not always effective when you want to explore AJAX web
applications that generate links using JavaScript.
ZAP’s AJAX spider—this spider is for AJAX applications. It explores a web application by
invoking browsers, which then follow all the links that were generated. It is slower than the
traditional spider and requires extra configuration when using it in a “headless” environment.
Passive vs. active scanning
ZAP passively scans all responses and requests that are proxied through it. This type of scanning does
not change responses, which is why it is generally considered safe. The scanning is performed in a
background thread so as not to slow down exploration. Use passive scanning to find certain
vulnerabilities, get a sense of the basic security state of the tested web application, and find locations
requiring further investigation.
ZAP’s active scanning functionality attempts to identify more vulnerabilities. It works using known
attacks against the targets. Note that active scanning launches a real attack on the target and might put
the target at risk. You should only use active scanning against targets that have given you explicit
permission to conduct penetration testing.
28
Course Code/Title:CS2602 / Software Testing Unit: V
Burp suite :
Burp Suite is one of the most popular security testing tool. Burp Suite can be used to identify different
types of vulnerabilities, such as SQL injection or cross-site scripting, by testing the web application
beyond its graphical user interface (GUI). It is a type of proxy server, which means it sits between the
user’s web browser and the web server to observe and manipulate all the data that is being sent back and
forth.
Burp Suite has different features such as proxy, Repeater, intruder, scanner, decoder, and more.
Proxy: Burp Suite’s proxy function allows users to intercept and modify HTTP requests
between a user’s web browser and the web server. This allows for the observation and manipulation
of web traffic, which can help identify potential security issues.
Repeater: Burp Suite Repeater lets us grab a request, change it however we want, and send it
again and again. This can be super useful, especially when we have to guess a payload by trying
different things (like in SQLi) or when we want to see if an endpoint has any bugs.
Intruder: Burp Suite’s intruder feature contains several different attacks that can be performed
on a remote website. These attacks include dictionary attacks and brute force attacks, which can
help identify vulnerabilities in the web application’s authentication mechanisms.
Scanner: Burp Suite’s scanner function allows users to scan a particular website for potential
vulnerabilities. This feature automates the testing process and provides detailed reports on any
vulnerabilities that are found.
Decoder: Burp Suite’s decoder function allows users to decode different types of data, such as
URL encoding. This can help identify potential security issues in the web application’s handling of
data.
When to use Burp suite?
Hackers are always looking for ways to intercept calls so make sure hackers won’t be able to intercept
the calls.
Why to use Burp suite?
Ensure that app/web applications are secure and reliable.
By using the burp suite we can check the vulnerability of websites and applications.
Downloading and Setting Up Burp Suite on Windows
1. Go to the Burp Suite website and download the installer.
2. Run the installer and follow the prompts to complete the installation process, select “new
temporary project”, followed by “use burp defaults”
3. Click on Start Burp
29
Course Code/Title:CS2602 / Software Testing Unit: V
30
Course Code/Title:CS2602 / Software Testing Unit: V
2. You should see an entry in the table with a ticked Checkbox in the Running column, and
“[Link]:8080” showing in the Interface column.
31
Course Code/Title:CS2602 / Software Testing Unit: V
4. Go to the Proxy > Intercept tab and Click the Intercept is off button, so it toggles to Intercept is
on. This toggle allows you to intercept any request or response, and modify it before forwarding it.
32
Course Code/Title:CS2602 / Software Testing Unit: V
33
Course Code/Title:CS2602 / Software Testing Unit: V
Once the Burp’s CA cert is installed you should have no problem using Burp Suite as an interceptor. At
Firefox, try to browse to [Link] and can not see any security warning.
At Burp Suite, when the interceptor is turned on, can see all the requests made by the browser. So can
analyze the requests and make any modifications. Then click on the Forward button to send the message.
Intercepting a request
34
Course Code/Title:CS2602 / Software Testing Unit: V
You can also click on the HTTP History tab to view the list of request history.
35