Unit-IV(Testing)
Unit-IV(Testing)
Software Testing
By
Mr.B.Narsimha Reddy
MTech(CSE),(PhD)
Associate Professor
Dept of CSE
What is Testing
Execution Speed Much faster – suitable for running thousands of tests quickly.
Accuracy High – eliminates human errors during execution.
Initial Cost High – requires tools, frameworks, and skilled personnel.
Long-term Cost Lower – saves time and effort on repetitive test cases.
Best For Regression testing, load testing, and large-scale or long-term projects.
Skills Required Requires knowledge of scripting and automation tools.
Repeatability Excellent – tests can be rerun automatically any number of times.
• Statement Coverage
• Branch Coverage
• Path Coverage
• Loop Testing
• Condition Coverage
Statement Coverage
• Definition: Ensures that each line of code (statement) is executed at least once.
• Goal: To verify that all code statements are covered.
• Definition: Divides input data into valid and invalid partitions (also called
classes) that are treated the same by the system.
• Goal: To reduce the number of test cases by testing one value from each
partition.
• Example: For an input field accepting ages 18–56:
• Valid partition: 18–56
• Invalid partitions: below 18, above 56
• Test cases: 25 (valid), 15 (invalid), 65 (invalid)
Boundary Value Analysis (BVA)
• Definition: Tests the user interactions with the system using use
cases (scenarios).
• Goal: Validate end-to-end workflows from the user's point of view.
• Used In: Functional testing based on user stories or requirements.
• Example: A use case for online shopping might involve:
• Browse items → Add to cart → Checkout → Payment → Confirmation
Error Guessing
• Common mistakes that developers usually forget are :
• It combines the advantages of both black box and white box testing
• It combines developer and tester input and improves overall product
quality
• It reduces the overhead associated with the lengthy process of testing
functional and non-functional types
• It provides enough time for a developer to fix bugs
• Testing is conducted from the perspective of the user rather than the
designer
Gray Box Testing Techniques
Matrix Testing
Definition:
Matrix testing involves analyzing the
relationships between different
components, modules, or variables of a
program.
It checks how data and control flow
between them.
Purpose:
• To identify weak spots in the code based
on variable usage and function
dependencies.
• To prioritize tests based on complexity
and interaction.
Regression Testing
Definition:
Regression testing is the process of
re-testing the software after
changes (like bug fixes or new
features) to ensure that existing
functionalities still work correctly.
Purpose:
• To detect new bugs in previously
tested code.
• To ensure stability after code
modifications.
Pattern Testing
Definition:
Pattern testing involves using known patterns (architectural, design,
or behavior patterns) to validate whether the system behaves as
expected.
Purpose:
• To detect anomalies or deviations from standard patterns.
• To test common user interaction or code design scenarios.
Orthogonal Array Testing (OAT)
Definition:
• Orthogonal Array Testing is a statistical method of testing used to
identify the most efficient test combinations.
• It is a combinatorial technique that ensures maximum coverage with
minimal test cases.
Purpose:
• To test all possible combinations of input parameters in a reduced
number of test cases.
• To increase test coverage without exhaustive testing.
Summary
Cons:
• May not be as thorough as pure white box testing.
• Still requires some access to internal documentation.
Tools for Gray Box Testing
Comparison Table
Feature White Box Testing Black Box Testing Gray Box Testing
Internal Knowledge Full None Partial
Focus Code structure Functionality Integration and behavior
No programming Moderate (technical +
Tester Skill Required Programming skills required functional)
Integration/System
Use Cases Unit/Integration testing System/User acceptance
testing
Logic, performance Missing/incomplete
Detects errors features Security, data flow issues
Session management
Examples Code coverage testing Login form validation
validation
Types of Black Box Testing
• Functionality Testing
• Non-functionality Testing
• Maintenance Testing
Levels of Software 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.
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.
• 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.