Software Engineering- Module 6
Software Testing and Maintenance
Notes
By – Charushila Jadhav
Software Testing:
Q. Define black-box testing.
Q. What is white-box testing?
Q. Define Software Testing?
Q. Explain grey-box testing.
Q. Analyze testing approaches based on code knowledge.
Q. Analyze differences between black-box and white-box testing.
Q. Testing Approach?
Definition:
Software testing is the process of evaluating a software system to check its correctness,
completeness, and quality with respect to user requirements.
Based on code knowledge there are 3 types of testing:
1) Black Box Testing :
Black box testing is also known as system or function testing.
This testing is done by the Tester.
Overall functionality get checked in this type.
Tester check internal functionality depend upon external functionality.
Ex: Tester check whenever data in sign module got entered & user press sign up
button, this button is process to store entered data. Tester check whether the data is
stored correctly or not.
So here internal functionality is storing of data & external functionality is filling up
data in fields & submit button’s process.
Tester test the +ve as well as -ve scenario.
→ +ve scenario
→ -ve scenario
2) White Box or Unit Testing:
White box testing is done by coder.
It is also called as:
→ Code level testing
→ Unit testing
→ Clear box testing
In the white box testing whenever coder completes his code writing, he checks or
compile code, then if any bug found, coder have to solve it.
Coder can not send code to tested without doing white box testing.
Coder check or test only positive scenario.
White box testing has purpose to test correctness and completeness of the program.
3) Grey Box Testing:
Gray box testing is combination of white box testing and black box testing.
Tester is involve in this testing.
To do gray box testing, tester need programming knowledge.
The role of Gray Box tester is, whenever final s/w is handed over to tester, tester
checks its functionality & if any fault occurs in the o/p of function then tester does not
revert system back to developer, instead of that tester himself solve or make changes in
the code. So knowledge of coding is required.
Importance of Software Testing
1. Ensures Software Quality
Identifies defects and errors in the system
Ensures the software meets functional and non-functional requirements
2. Improves Reliability
Ensures the system works correctly under different conditions
Reduces chances of system failure after deployment
3. Enhances User Satisfaction
Provides a smooth and error-free user experience
Builds trust and confidence in users
4. Reduces Cost
Early detection of bugs saves time and cost
Fixing defects in later stages is expensive
5. Improves Security
Identifies vulnerabilities and security risks
Protects system from attacks and data breaches
6. Ensures Performance
Checks speed, scalability, and stability
Ensures system can handle heavy load
7. Supports Maintainability
Well-tested software is easier to maintain and update
Reduces future risks during modifications
Sanity Testing:
First stage of testing is sanity testing.
It is process of checking correctness & completeness of the core functionalities.
We check for stability of build.
We check that build is ready for testing or not.
Sanity testing is also known as:
o Zero level testing
o Build verification testing
o Tester acceptance testing
Sanity testing includes 5 factors:
o Core functionality testing
o Link validation/testing
o Page validation/testing
o Tab validation
o GUI validation
Integration Testing:
Integration testing is the process of testing the interaction between two or more modules to
ensure they work together correctly.
Integration testing is performed after unit testing to ensure that combined modules function
correctly as a system.
Objectives
Check module interaction
Identify interface defects
Validate data communication
Types (Detailed)
1. Top-Down Approach
Start from top-level modules
Use stubs for lower modules
Easy to detect high-level design issues
2. Bottom-Up Approach
Start from lower-level modules
Use drivers for higher modules
Good for testing utility modules
3. Big Bang Approach
All modules integrated at once
Difficult to identify errors
Advantages
Early detection of interface errors
Improves system reliability
Ensures smooth module interaction
Disadvantages
Complex to perform
Requires proper planning
Debugging can be difficult (especially Big Bang)
Functional & Non Functional Testing:
Introduction
Software testing ensures that a system is correct, reliable, and efficient. It is broadly
classified into Functional Testing and Non-Functional Testing, which together ensure overall
software quality.
1. Functional Testing
Definition
Functional testing verifies that the software system works according to specified
requirements. It checks what the system does.
Objectives
Validate system features
Ensure correct input-output behaviour
Verify business logic
Characteristics
Based on requirements/specifications
Does not require code knowledge (black-box testing)
Focuses on user actions and outputs
Types of Functional Testing
1. Unit Testing
Tests individual components
Done by developers
2. Integration Testing
Tests interaction between modules
3. System Testing
Tests complete system
4. Acceptance Testing
Done by users to validate requirements
Examples
Login functionality
Registration form
Payment gateway
Search feature
Non-Functional Testing
Definition
Non-functional testing evaluates how well the system performs. It checks how the system
behaves rather than what it does.
Objectives
Ensure system performance and speed
Verify security and reliability
Improve user experience
Characteristics
Focus on quality attributes
Not based on specific functions
Measures system performance
Types of Non-Functional Testing
1. Performance Testing
Checks speed and response time
2. Load Testing
Tests system under expected user load
3. Stress Testing
Tests system beyond limits
4. Security Testing
Identifies vulnerabilities
5. Usability Testing
Ensures system is user-friendly
Examples
Website handling 1000 users
Checking response time of a page
Testing system security
Difference Between Functional and Non-Functional Testing
Functional Testing Non-Functional Testing
What system does How system performs
Requirements Quality attributes
Black-box Performance/behavior
Correctness Efficiency
Login system Load testing
Importance
Functional Testing:
Ensures correctness of features
Prevents functional errors
Non-Functional Testing:
Ensures system efficiency
Improves performance and security
Verification and Validation Testing:
Introduction
Verification and Validation are two important processes in software testing used to ensure
that the software is built correctly and meets user requirements. Both are essential for
achieving high software quality.
1. Verification
Definition
Verification is the process of evaluating software at different stages of development to
ensure that it meets the specified requirements.
Characteristics
It is a static process (no code execution required)
Performed during development phases
Focuses on documents, design, and code correctness
Techniques of Verification
Reviews
Inspections
Walkthroughs
Advantages
Detects errors early
Reduces development cost
Improves design quality
2. Validation
Definition
Validation is the process of evaluating the final software to check whether it meets user
requirements and expectations.
Characteristics
It is a dynamic process (requires execution of code)
Performed after development
Focuses on final product behavior
Techniques of Validation
System testing
Acceptance testing
User testing
Advantages
Ensures customer satisfaction
Confirms real-world usability
Detects missing requirements
Difference Between Verification and Validation
Basis Verification Validation
Nature Static Dynamic
Execution No execution Requires execution
Focus Correctness User needs
Stage During development After development
Example Code review Testing login system
Importance
Ensures high-quality software
Reduces defects and failures
Improves user satisfaction
Saves time and cost
Basis Path Testing and Control Structure Testing
1. Basis Path Testing
Definition
Basis Path Testing is a white-box testing technique that ensures all independent execution
paths in a program are tested at least once.
Objective
Achieve maximum code coverage
Detect logical errors in the program
Key Concept: Cyclomatic Complexity
It measures the number of independent paths
Formula:
V(G) = E – N + 2
Where:
E = Number of edges
N = Number of nodes
Steps in Basis Path Testing
1. Draw the Control Flow Graph (CFG)
2. Calculate Cyclomatic Complexity
3. Identify independent paths
4. Design test cases for each path
5. Execute test cases
Advantages
Ensures complete path coverage
Identifies logical errors
Improves code quality
Example
If a program has 3 independent paths, then at least 3 test cases are required to test all
paths.
2. Control Structure Testing
Definition
Control Structure Testing is a white-box testing technique that focuses on testing the control
structures of a program such as loops, conditions, and decision points.
Objective
Ensure correct execution of program logic
Verify all control structures work properly
Types of Control Structure Testing
1. Condition Testing
Tests logical conditions (if, else, switch)
Checks true/false outcomes
2. Loop Testing
Tests loops like for, while
Ensures loops execute correctly
Types of loop testing:
Simple loop
Nested loop
Concatenated loop
3. Data Flow Testing
Tests how data moves through the program
Checks variable initialization and usage
Advantages
Detects logical errors
Ensures proper control flow
Improves reliability
Difference Between Basis Path and Control Structure Testing
Basis Path Testing Control Structure Testing
Focus on paths Focus on control structures
Uses CFG Uses conditions & loops
Measures complexity Tests logic execution
Software Maintenance and Its Types
Definition
Software maintenance is the process of modifying and updating software after delivery to
correct faults, improve performance, or adapt to changes.
Software maintenance is essential to keep the system updated, efficient, and useful over
time.
Need for Maintenance
Fix errors after deployment
Adapt to new hardware/software environment
Improve performance and usability
Add new features
Types of Software Maintenance
1. Corrective Maintenance
Fixes bugs and errors
Example: fixing login failure issue
2. Adaptive Maintenance
Modifies software to adapt to environment changes
Example: updating software for new OS
3. Perfective Maintenance
Enhances features and performance
Example: adding new payment option
4. Preventive Maintenance
Improves maintainability and prevents future issues
Example: code optimization and documentation
Software Re-engineering
Definition
Software re-engineering is the process of improving existing software without changing its
external behaviour.
Re-engineering helps upgrade outdated systems and improve performance without
developing software from scratch.
Objectives
Improve software quality
Reduce maintenance cost
Modernize old systems
Activities in Re-engineering
1. Code Restructuring – Improve code quality
2. Data Restructuring – Organize data properly
3. Reverse Engineering – Understand existing system
4. Forward Engineering – Rebuild improved system
Advantages
Extends software life
Improves maintainability
Reduces risk
Disadvantages
Time-consuming
Requires skilled developers
Reverse Engineering
Definition
Reverse engineering is the process of analyzing existing software to understand its design,
structure, and functionality.
Reverse engineering is important for analyzing and maintaining existing software, especially
when documentation is missing.
Objectives
Understand legacy systems
Recover lost documentation
Support maintenance and re-engineering
Process
1. Analyze code
2. Extract design information
3. Create documentation
Advantages
Helps understand old systems
Useful for maintenance and debugging
Supports system improvement
Disadvantages
Time-consuming
May not give complete information
Requires expertise