SE - Chapter 13 Software Testing
SE - Chapter 13 Software Testing
Chapter 13
Software Testing
What is Verification?
Verification is the process of ensuring that the software work products (such as
requirements, design, and code) conform to specified requirements and standards. It focuses
on checking correctness and consistency without necessarily executing the software.
What is Validation?
Validation is the process of evaluating the software during or after development to ensure it
fulfills its intended use and meets user and stakeholder needs. It typically involves
executing the software and observing its behavior in real or simulated environments.
1
Tanvi Nerurkar
UNIT III Software Engineering
Verification Validation
2
Tanvi Nerurkar
UNIT III Software Engineering
➢ Introduction to Testing:
3
Tanvi Nerurkar
UNIT III Software Engineering
For example:
1. All system functions that are accessed through menus should be tested.
2. Combinations of functions (e.g., text formatting) that are accessed through the same menu
must be tested.
3. Where user input is provided, all functions must be tested with both correct and incorrect
input.
4
Tanvi Nerurkar
UNIT III Software Engineering
➢ Principle of Testing
Software testing is an important aspect of software development, ensuring that
applications function correctly and meet user expectations. From test planning to execution,
analysis and understanding these principles help testers in creating a more structured and
focused approach to software testing, resulting in a higher-quality product.
5
Tanvi Nerurkar
UNIT III Software Engineering
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 i.e. testing will perform at the requirement
analysis phase.
4. Defect Clustering
In a project, a small number of modules can contain most of the defects. The Pareto
Principle for software testing states that 80% of software defects come 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 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.
➢ Level of Testing
Software Testing is an important part of the Software Development Life Cycle which is
help to verify the product is working as expected or not. In SDLC, we used different
levels of testing to find bugs and errors.
6
Tanvi Nerurkar
UNIT III Software Engineering
1. Unit Testing
Unit Testing is the first step in testing your software. It focuses on checking individual
components or functions of the application to make sure they work correctly on their own.
The goal here is to catch any issues early before those small components are integrated with
the rest of the system.
Unit tests help developers spot bugs early in the development process, making it easier and
quicker to fix them. It's the first layer of defense to verify that each part of the application
performs as expected.
Mainly features are:
• Testing individual functions or components.
• Ensuring correct behavior at the smallest level.
• Catching errors early.
2. Integration Testing
After unit testing, Integration Testing takes over. This level checks how different modules
or components of the software work together. It's important because even if individual parts
work perfectly, they might face issues when interacting with one another.
Integration testing ensures that data flows correctly between modules and that they
communicate seamlessly. It helps catch problems that might arise when different parts of
the system interact.
3. System testing
System Testing is when you test the software as a system. This stage checks whether the
entire system functions as expected in a real-world environment. It includes both functional
and non-functional tests to ensure that the software meets customer needs.
• Full end-to-end testing of the software.
• Verifying both functional and non-functional requirements.
• Testing the software's behavior in real-world conditions.
4. Acceptance Testing
Acceptance Testing, also known as User Acceptance Testing (UAT), is the final test
before releasing the software to the end-users. In this phase, the customer or end-users
verify if the software meets their needs and expectations.
UAT is crucial because it verify the software is ready for production. It’s the last chance to
catch any overlooked issues before deployment. If the software passes this stage, the
customer gives the green light for release.
• Validating the software against business requirements.
7
Tanvi Nerurkar
UNIT III Software Engineering
1. Manual Testing
Manual Testing is a technique to test the software that is carried out using the functions
and features of an application. Which means manual testing will check the defect manually
with trying one by one function is working as expected.
2. Automation Testing
Automation Testing It is a technique where the Tester writes scripts independently and
uses suitable Software or Automation Tools to test the software. It is an Automation
Process of a Manual Process. It allows for executing repetitive tasks without the use of a
Manual Tester.
Types of Manual Testing
Manual testing will be divided into further types which is following:
1. White Box Testing
White Box Testing is a software testing technique that involves testing the internal
structure and workings of a software application. The tester has access to the source code
and uses this knowledge to design test cases that can verify the correctness of the software
at the code level.
8
Tanvi Nerurkar
UNIT III Software Engineering
Here, Internals are not required to be Here, the Internal code of the
3.
known. application and database is known.
9
Tanvi Nerurkar
UNIT III Software Engineering
10
Tanvi Nerurkar
UNIT III Software Engineering
➢ Test-Case design
● Test case design is a part of system and component testing where you design the test cases
(inputs and predicted outputs) that test the system.
● The goal of the test case design process is to create a set of test cases that are effective in
discovering program defects and showing that the system meets its requirements.
● To design a test case, you select a feature of the system or component that you are testing.
● You then select a set of inputs that execute that feature, document the expected outputs or
output ranges and, where possible, design an automated check that tests that the actual and
expected outputs are the same.
● There are various approaches that you can take to test case design:
1. Requirements-based testing where test cases are designed to test the system requirements. This
is mostly used at the system-testing stage as system requirements are usually implemented by
several components. For each requirement, you identify test cases that can demonstrate that the
system meets that requirement.
2. Partition testing where you identify input and output partitions and design tests so that the
system executes inputs from all partitions and generates outputs in all partitions. Partitions are
groups of data that have common characteristics such as all negative numbers, all names less than
30 characters, all events arising from choosing items on a menu, and so on.
3. Structural testing where you use knowledge of the program’s structure to design tests that
exercise all parts of the program. Essentially, when testing a program, you should try to execute
each statement at least once. Structural testing helps identify test cases that can make this
possible.
● In general, when designing test cases, you should start with the highest-level tests from the
requirements then progressively add more detailed tests using partition and structural testing.
1 Requirements-based testing:
A general principle of requirements engineering is that requirements should be testable. That is,
the requirement should be written in such a way that a test can be designed so that an observer
can check that the requirement has been satisfied. Requirements-based testing, therefore, is a
systematic approach to test case design where you consider each requirement and derive a set of
tests for it.
Requirements-based testing is validation rather than defect testing demonstrates that the system
has properly implemented its requirements.
11
Tanvi Nerurkar
UNIT III Software Engineering
2 Partition testing:
One systematic approach to test case design is based on identifying all partitions for a system or
component.
Test cases are designed so that the inputs or outputs lie within these partitions. Partition testing
can be used to design test cases for both systems and components. Input equivalence partitions
are sets of data where all of the set members should be processed in an equivalent way.
Output equivalence partitions are program outputs that have common characteristics, so they can
be considered as a distinct class.
You also identify partitions where the inputs are outside the other partitions that you have chosen.
These test whether the program handles invalid input correctly. Valid and invalid inputs also form
equivalence partitions.
You identify partitions by using the program specification or user documentation and, from
experience, where you predict the classes of input value that are likely to detect errors.
For example, say a program specification states that the program accepts 4 to 8 inputs that are
five-digit integers greater than 10,000.
12
Tanvi Nerurkar
UNIT III Software Engineering
3. Structural testing:
● Structural testing is an approach to test case design where the tests are derived from knowledge
of the software’s structure and implementation.
● This approach is sometimes called ‘white-box’, ‘glass-box’ testing, or ‘’clear-box’ test-
● ing to distinguish it from black-box testing.
● Understanding the algorithm used in a component can help you identify further partitions and
test cases.
● Structural testing, also known as glass box testing or white box testing is an approach where the
tests are derived from the knowledge of the software's structure or internal implementation.
4. Path testing:
● Path Testing is a structural testing method based on the source code or algorithm and NOT
based on the specifications.
13
Tanvi Nerurkar
UNIT III Software Engineering
Junction Node – a node with more than one arrow entering it.
Decision Node – a node with more than one arrow leaving it.
Region – area bounded by edges and nodes (area outside the graph is also counted as a region.).
14
Tanvi Nerurkar
UNIT III Software Engineering
15
Tanvi Nerurkar
UNIT III Software Engineering
16
Tanvi Nerurkar
UNIT III Software Engineering
Independent Paths :
An independent path in the control flow graph is the one which introduces at least one new edge
that has not been traversed before the path is defined. The cyclomatic complexity gives the
number of independent paths present in a flow graph. This is because the cyclomatic complexity
17
Tanvi Nerurkar
UNIT III Software Engineering
is used as an upper-bound for the number of tests that should be executed in order to make sure
that all the statements in the program have been executed at least once. Consider first graph given
above here the independent paths would be 2 because number of independent paths is equal to the
cyclomatic complexity.
Note – Independent paths are not unique. In other words, if for a graph the cyclomatic complexity
comes out be N, then there is a possibility of obtaining two different sets of paths which are
independent in nature.
Finally, after obtaining the independent paths, test cases can be designed where each test case
represents one or more independent paths.
Advantages :
1. More Coverage – Basis path testing provides the best code coverage as it aims to achieve
maximum logic coverage instead of maximum path coverage. This results in an overall thorough
testing of the code.
2. Maintenance Testing – When a software is modified, it is still necessary to test the changes
made in the software which as a result, requires path testing.
3. Unit Testing – When a developer writes the code, he or she tests the structure of the program
or module themselves first. This is why basis path testing requires enough knowledge about the
structure of the code.
4. Integration Testing – When one module calls other modules, there are high chances of
Interface errors. In order to avoid the case of such errors, path testing is performed to test all the
paths on the interfaces of the modules.
5. Testing Effort – Since the basis path testing technique takes into account the complexity of the
software (i.e., program or module) while computing the cyclomatic complexity, therefore it is
intuitive to note that testing effort in case of basis path testing is directly proportional to the
complexity of the software or program.
➢ References:
• [Link]
• Software Engineering by Ian Somerville
18
Tanvi Nerurkar