Software Engineering
Comprehensive exam revision notes for BCA-423E Unit 5 (Software Testing, Maintenance, Reliability & Reengineering). Includes Section A (2M), Section B (5M), and Section C (15M) questions, answers, and diagrams.
Software Engineering
Software Testing, Maintenance, Reliability & Reengineering
Core Definitions & Key Concepts
Error, Fault (Bug), and Failure
- Error: A human developer mistake or misunderstanding during design or coding.
- Fault (Bug): The physical flaw or incorrect line written into the software code.
- Failure: The observable departure of program execution from its specified requirements.
Verification and Validation
- Verification: 'Are we building the product right?' Checks conformance to specifications without running code (reviews, walkthroughs, inspections).
- Validation: 'Are we building the right product?' Executes code to ensure it satisfies user needs (system & acceptance testing).
What are Test Stubs and Test Drivers in integration testing
- Stub: A dummy called routine simulating unfinished lower-level modules in Top-Down testing.
- Driver: A dummy calling routine that invokes the module under test in Bottom-Up testing.
Alpha Testing and Beta Testing
- Alpha Testing: Acceptance testing conducted by users at the developer's site in a controlled lab environment.
- Beta Testing: Acceptance testing conducted by real end-users in their own live operational environments at customer sites.
What are the four recognized categories of Software Maintenance
- Corrective: Fixing residual bugs/defects.
- Adaptive: Adapting software to changes in OS, hardware, or statutory laws.
- Perfective: Adding new user features and improving performance (over 50% of cost).
- Preventive: Refactoring code to enhance future maintainability.
State the formulas for MTBF and System Availability (A)
$MTBF = MTTF + MTTR Availability (A) = \frac{MTTF}{MTTF + MTTR} × 100\%$
What is Mutation Testing
A fault-based testing technique where intentional syntactic mutations (errors) are injected into the source code to verify whether the test suite detects and 'kills' the mutants.
What is Cleanroom Software Engineering
A formal software development philosophy combining mathematical formal specifications, box structure designs, and statistical usage testing to certify correctness without standard trial-and-error unit debugging.
Conceptual & Architectural Analysis
Compare Black-Box Testing vs White-Box Testing in a Structured Matrix
| Dimension | Black-Box Testing (Functional) | White-Box Testing (Structural) |
|---|---|---|
| Knowledge of Code | Zero knowledge of internal code structure | Full access to source code and control logic |
| Basis for Tests | Requirements specification (SRS) | Control flow graphs, logic branches, conditions |
| Performed By | Independent QA Testers / End-users | Software Developers / Test Engineers |
| Core Techniques | - Equivalence Class Partitioning (ECP)<br>- Boundary Value Analysis (BVA)<br>- Cause-Effect Graphing | - Statement Coverage<br>- Branch / Decision Coverage<br>- Basis Path Testing |
| Primary Objective | Validate external functional behavior | Verify internal algorithms and code paths |
Equivalence Class Partitioning (ECP) and Boundary Value Analysis (BVA) with a Practical Case
Black-Box Testing Case Study
Requirement: An employee bonus calculator accepts integer years of service between 1 and 30 years.
1. Equivalence Class Partitioning (ECP):
- Invalid Partition 1: Years < 1 (e.g., -5, 0) \implies Rejection.
- Valid Partition: 1 ≤ Years ≤ 30 (e.g., 15) \implies Bonus Calculated.
- Invalid Partition 2: Years > 30 (e.g., 35, 100) \implies Rejection.
2. Boundary Value Analysis (BVA):
Experience proves errors cluster at boundaries (min, min+1, nom, max-1, max):
- Lower Boundary: 0 (Invalid), $1$ (Boundary), 2 (Valid).
- Nominal Value: 15 (Valid).
- Upper Boundary: 29 (Valid), $30$ (Boundary), 31 (Invalid).
- Test Values: 0, 1, 2, 15, 29, 30, 31.
Top-Down vs Bottom-Up Integration Testing Strategies
| Feature | Top-Down Integration | Bottom-Up Integration |
|---|---|---|
| Starting Point | Main control executive module | Lowest-level leaf modules |
| Scaffolding Needed | Requires Stubs to simulate lower children | Requires Drivers to simulate calling parents |
| Early Advantage | Major architectural control verified early | Critical low-level I/O & utility routines verified early |
| Disadvantage | Stubs are complex to mock realistically | System architecture is not seen until final integration |
Software Maintenance Cost Distribution and Maintenance Process
Software Maintenance Effort Distribution
Empirical software engineering data reveals that maintenance consumes 60% to 80% of total lifecycle cost:
- Perfective Maintenance: 50% to 55% (Continuous feature requests, UI upgrades).
- Adaptive Maintenance: 20% to 25% (OS migrations, cloud deployment).
- Corrective Maintenance: 15% to 20% (Bug fixes).
- Preventive Maintenance: 5% (Code refactoring).
Change Request ---> Impact Analysis ---> Approval ---> Design Update ---> Regression Test ---> BaselineIn-Depth Analysis & Implementation
Solve a Comprehensive Software Reliability Problem Calculating MTTF, MTTR, MTBF, and Percentage Availability
University Examination Model Numerical Solution
Operational System Metrics for a Web Server over 1 Year (8,760 Hours):
- Total operational runtime observed: 8,760 hours.
- During the year, the server experienced 6 unexpected crashes (failures).
- Total downtime spent diagnosing and repairing the 6 failures: 30 hours.
Step-by-Step Mathematical Derivations:
- Total Uptime:
$Uptime = Total Time - Downtime = 8,760 - 30 = \mathbf{8,730 hours}$
- Mean Time To Failure (MTTF):
$MTTF = \frac{Total Operational Uptime}{Number of Failures} = \frac{8,730}{6} = \mathbf{1,455 hours}$
- Mean Time To Repair (MTTR):
$MTTR = \frac{Total Repair Downtime}{Number of Failures} = \frac{30}{6} = \mathbf{5 hours}$
- Mean Time Between Failures (MTBF):
$MTBF = MTTF + MTTR = 1,455 + 5 = \mathbf{1,460 hours}$
- Percentage Availability ($A$):
$A = \frac{MTTF}{MTBF} × 100 = \frac{1,455}{1,460} × 100 = \mathbf{99.657\%}$
The system satisfies 'Three Nines' availability standards.
Code Coverage Metrics in White-Box Testing (Statement, Branch, Condition, Path Coverage) with Code
1// Code Segment to evaluate test coverage2int process_order(int stock, int is_vip) {3 int discount = 0;4 if (stock > 0) { // Decision 15 if (is_vip == 1) { // Decision 26 discount = 20;7 }8 }9 return discount;10}1. Statement Coverage vs Branch Coverage Trap:
- Test Case 1:
stock = 10, is_vip = 1\implies Executes all lines! 100% Statement Coverage achieved! - Vulnerability: If
stock = 0, an implicit else branch exists that was NEVER tested! Branch coverage is only 50%.
2. Comprehensive Coverage Hierarchy:
- Statement Coverage: Percentage of executable lines traversed.
- Branch (Decision) Coverage: Every
if/elsebranch evaluates to both TRUE and FALSE. - Condition Coverage: Each individual boolean sub-condition in a compound expression evaluates to TRUE and FALSE.
- Path Coverage: Every distinct combination of paths from entry to exit is executed (most rigorous; required in aerospace).
The Software Reengineering Lifecycle: Reverse Engineering, Code Restructuring, and Forward Engineering
The Software Reengineering Paradigm
Legacy System Target System
================= =================
Legacy Source Code Modern Source Code
| ^
| (Reverse Engineering) | (Forward Engineering)
v |
Design Abstractions === (Restructuring) ===> Modern Architecture
(DFDs, Call Graphs) (Clean Microservices)3 Stages of Software Reengineering:
- Reverse Engineering: Analyzing legacy binaries and unmaintained source code to extract high-level architectural designs, entity relationships, and business rules.
- Restructuring & Refactoring: Removing code smells, eliminating dead code, transforming spaghetti code into modular functions, and migrating data schemas without altering business rules.
- Forward Engineering: Re-implementing the modernized design using contemporary programming languages, frameworks, and modern automated CI/CD testing pipelines.
Important Exam Points & Quick Revision
Solve the numerical problem for MTTF/MTTR/Availability, explain ECP/BVA with boundary values, and contrast Black-box vs White-box testing.
100% left on this page — finishing it closes the gap for Software Testing, Maintenance, Reliability & Reengineering.
Software Testing, Maintenance, Reliability & Reengineering still counts as a weak topic until you finish this note and answer its questions.
Practise this unitTest Your Understanding
Now that you've read through these notes, practice unit MCQs to identify weak points and solidify your learning before exams.