CHAPTER 11
TESTING
Syllabus
Principles of testing; Need of testing; stages; Testing process and activities; classification;
Testing strategies; Levels of software testing; Software testing types; (Integration testing,
functional testing, end to-end testing need to be explained in detail)
Introduction
Software testing can be stated as the process of verifying and validating whether a
software or application is bug-free, meets the technical requirements as guided by its
design and development, and meets the user requirements effectively and efficiently
by handling all the exceptional and boundary cases.
The process of software testing aims not only at finding faults in the existing software
but also at finding measures to improve the software in terms of efficiency, accuracy,
and usability.
It mainly aims at measuring the specification, functionality, and performance of a
software program or application.
Software testing can be divided into two steps,
a. Verification: it refers to the set of tasks that ensure that the software correctly
implements a specific function.
Verification: “Are we building the product right?”
b. Validation: it refers to a different set of tasks that ensure that the software that has
been built is traceable to customer requirements.
Validation: “Are we building the right product?”
Software testing is the process of executing a program with the aim of finding the
error.
To make our software perform well it should be error-free.
If testing is done successfully it will remove all the errors from the software.
Principles of Testing
1. Testing shows the presence of defects
The goal of software testing is to make the software fail.
Software testing reduces the presence of defects.
Software testing talks about the presence of defects and doesn’t talk about the
absence of defects.
Software testing can ensure that defects are present but it cannot prove that
software is defect-free.
Even multiple testing can never ensure that software is 100% bug-free.
Testing can reduce the number of defects but not remove all defects.
2. Exhaustive testing is not possible
It is the process of testing the functionality of the software in all possible
inputs (valid or invalid) and pre-conditions is known as exhaustive testing.
Exhaustive testing is impossible means the software can never test at every
test case.
It can test only some test cases and assume that the software is correct and it
will produce the correct output in every test case.
If the software will test every test case then it will take more cost, effort, etc.,
which is impractical.
3. Early Testing
To find the defect in the software, early test activity shall be started.
The defect detected in the early phases of SDLC will be very less expensive.
For better performance of software, software testing will start at the initial
phase
4. Defect clustering
In a project, a small number of modules can contain most of the defects. Pareto
Principle to software testing state that 80% of software defect comes from 20% of
modules.
5. Pesticide paradox
Repeating the same test cases, again and again, will not find new bugs. So it is
necessary to review the test cases and add or update test cases to find new bugs.
6. Testing is context-dependent
The testing approach depends on the context of the software developed. Different
types of software need to perform different types of testing. For example, The testing
of the e-commerce site is different from the testing of the Android application.
7. Absence of errors fallacy
If a built software is 99% bug-free but it does not follow the user requirement, then it
is unusable. It is not only necessary that software is 99% bug-free but it is also
mandatory to fulfill all the customer requirements.
Need of Testing
Software testing is the process of evaluating and verifying that a software product or
application does what it is supposed to do. The benefits of testing include preventing bugs,
reducing development costs and improving performance.
A study conducted by National Institute of Standards and Technology (NIST) in 2002
reported that
software bugs cost the U.S. economy 59.5 billion dollars annually.
More than one-third of this cost could be avoided if better software testing was performed.
Therefore testing is necessary as some errors can turn out to be expensive or dangerous.
Every product needs to be checked to ensure there are no errors. If developers check their
own
product, there are chances that they might miss errors due to bad assumptions or blind spots.
It is
advisable to get the product checked by another individual who was not involved in product
development.
For software systems, some errors are important while others are not.
Stages of Testing
Software Testing Life Cycle (STLC) is a sequence of different activities performed
during the software testing process.
The STLC involves strategizing, planning, executing and completing test cycles.
Each STLC phase is useful in its own way to achieve high-quality software releases.
Characteristics of STLC
STLC is a fundamental part of Software Development Life Cycle (SDLC) but STLC
consists of only the testing phases.
STLC starts as soon as requirements are defined or software requirement document is
shared by stakeholders.
STLC yields a step-by-step process to ensure quality software.
Phases of STLC
Requirement Analysis
Requirement Analysis is the first step of Software Testing Life Cycle (STLC).
In this phase quality assurance team understands the requirements like what is
to be tested.
If anything is missing or not understandable then quality assurance team meets
with the stakeholders to better understand the detail knowledge of
requirement.
Fig: Phases of STLC
Test Planning
Test Planning is most efficient phase of software testing life cycle where all
testing plans are defined.
In this phase manager of the testing team calculates estimated effort and cost
for the testing work.
This phase gets started once the requirement gathering phase is completed.
Test Case Development
The test case development phase gets started once the test planning phase is
completed.
In this phase testing team note down the detailed test cases.
Testing team also prepare the required test data for the testing.
When the test cases are prepared then they are reviewed by quality assurance
team.
Test Environment Setup
Test environment setup is the vital part of the STLC.
Basically test environment decides the conditions on which software is tested.
This is independent activity and can be started along with test case
development.
In this process the testing team is not involved.
Either the developer or the customer creates the testing environment.
Test Execution
After the test case development and test environment setup, test execution
phase gets started.
In this phase testing team start executing test cases based on prepared test
cases in the earlier step.
Test Closure
This is the last stage of STLC in which the process of testing is analyzed.
Testing Process
There are 11 steps are there in software testing process.
1. Assess Development Plan and Status
This initiative may be prerequisite to putting together Verification, Validation,
and Testing Plan.
During this step, testers challenge completeness and correctness of plan.
Based on extensiveness and completeness of Project Plan testers can estimate
quantity of resources they’re going to got to test implemented software
solution.
2. Develop the Test Plan
Forming plan for testing will follow an equivalent pattern as any software
planning process.
The structure of all plans should be an equivalent, but content will vary.
3. Test Software Requirements
Incomplete, inaccurate, or inconsistent requirements cause most software
failures.
Testers, through verification, must determine that requirements are accurate,
complete, and they do not conflict with another.
4. Test Software Design
This step tests both external and internal design primarily through verification
techniques.
The testers are concerned that planning will achieve objectives of wants, also
because design being effective and efficient on designated hardware.
5. Build Phase Testing
Experience has shown that it’s significantly cheaper to spot defects during
development phase, than through dynamic testing during test execution step.
6. Execute and Record Result
This involves testing of code during dynamic state.
The approach, methods, and tools are used in test plan are going to be validate
that executable code actually meets stated software requirements, and
therefore the structural specifications of design, coding are needed.
7. Acceptance Test
Acceptance testing enables users to gauge applicability and usefulness of
software in performing their day-to-day job functions.
This tests what user believes software should perform.
8. Report Test Results
Test reporting is continuous process.
It may be both oral and written.
It is important that defects and concerns be reported to the appropriate parties
as early as possible, so that corrections can be made at the lowest possible
cost.
9. The Software Installation
Once test team has confirmed that software is prepared for production use,
power to execute that software during production environment should be
tested.
This tests interface to operating software, related software, and operating
procedures.
10. Test Software Changes
Within context of performing maintenance after software is implemented,
concept is additionally applicable to changes throughout implementation
process.
Whenever requirements changes, test plan must change, and impact of that
change on software systems must be tested and evaluate.
11. Evaluate Test Effectiveness
Testing improvement can best be achieved by evaluating effectiveness of
testing at top of every software test assignment.
While this assessment is primarily performed by testers, it should involve
developers, users of software, and quality assurance professionals.
Testing Activities
The activities of testing can be divided into the following basic steps,
1. Planning and Control
2. Analysis and Design
3. Implementation and Execution
4. Evaluating exit criteria and Reporting
5. Test Closure activities
Planning and Control
Planning involves producing a document that describes an overall approach and test
objectives.
It involves reviewing the test basis, identifying the test conditions based on analysis of
test items, writing test cases and Designing the test environment.
Completion or exit criteria must be specified so that we know when testing (at any
stage) is complete.
This is the activity of comparing actual progress against the plan, and reporting the
status, including deviations from the plan.
It involves taking actions necessary to meet the mission and objectives of the project.
Analysis and Design
Test analysis and Test Design has the following major tasks,
To review the test basis. The test basis is the information on which test cases are
based, such as requirements, design specifications, product risk analysis, architecture
and interfaces
To identify test conditions
To design the tests
To design the test environment set-up and identify the required infrastructure and
tools
Implementation and Execution
Test execution involves actually running the specified test on a computer system
either manually or by using an automated test tool.
It is a Fundamental Test Process in which actual work is done.
Test implementation has the following major task,
To develop and prioritize test cases by using techniques and create test data
for those tests.
To create test suites from the test cases for efficient test execution. Test suite
is a collection of test cases that are used to test a software program
To re-execute the tests that previously failed in order to confirm a fix.
To log the outcome of the test execution. A test log is the status of the test case
(pass/fail).
To compare actual results with expected results.
Evaluating Exit Criteria and Reporting
Evaluating exit criteria is a process defining when to stop testing.
It depends on coverage of code, functionality or risk.
Basically it also depends on business risk, cost and time and vary from project to
project.
Exit criteria come into picture, when,
Maximum test cases are executed with certain pass percentage
Bug rate falls below certain level
When we achieve the deadlines
Test Closure Activities
Test closure activities are done when software is ready to be delivered.
The testing can be closed for the other reasons also like,
a. When a project is cancelled
b. When some target is achieved
Test closure activities have the following major tasks,
To check which planned deliverables are actually delivered and to ensure that all
incident reports have been resolved.
Testing Strategies
The main objective of software testing is to design the tests in such a way that it
systematically finds different types of errors without taking much time and effort so that less
time is required for the development of the software.