Show understanding of the need for continuing maintenance of a system and the differences between each type of maintenance

Published by Patrick Mutisya · 14 days ago

Cambridge A-Level Computer Science 9618 – Program Testing and Maintenance

12.3 Program Testing and Maintenance

Why Ongoing Maintenance Is Essential

Software is never truly finished. After a system is released it continues to operate in a changing environment. Ongoing maintenance is required to:

  • Fix defects that were not discovered during testing.
  • Adapt to new hardware, operating systems, or external APIs.
  • Improve performance, usability or security in response to user feedback.
  • Prevent future problems by refactoring or updating documentation.

Neglecting maintenance can lead to system failures, security breaches, increased cost of later fixes, and loss of user confidence.

Types of Maintenance

The IEEE defines four primary categories of software maintenance. Each type addresses a different need and has distinct activities.

Maintenance TypePurposeTypical ActivitiesWhen It Is Triggered
CorrectiveFix faults discovered after deployment.

  • Bug identification and debugging.
  • Patch creation and distribution.
  • Regression testing to ensure no new faults.

When errors are reported by users or detected by monitoring tools.
AdaptiveModify the system to work in a changed environment.

  • Porting to new operating systems or hardware.
  • Updating third‑party libraries or APIs.
  • Changing configuration files for new network settings.

When external dependencies, standards, or platforms evolve.
PerfectiveEnhance functionality, performance, or usability.

  • Adding new features requested by users.
  • Optimising algorithms for speed or memory.
  • Improving user interface design.

When stakeholders request improvements or competitive pressures arise.
PreventiveReduce the risk of future failures.

  • Refactoring code to improve structure.
  • Updating documentation and comments.
  • Implementing additional test cases.

Proactively, often as part of a scheduled maintenance cycle.

Relationship Between Testing and Maintenance

Effective testing supports all four maintenance types:

  1. Regression testing ensures corrective changes do not introduce new faults.
  2. Compatibility testing validates adaptive modifications against new environments.
  3. Performance testing measures the impact of perfective enhancements.
  4. Static analysis and code reviews help identify areas for preventive work.

Illustrative Workflow

Below is a simplified workflow that demonstrates how a maintenance request moves through testing and implementation.

Suggested diagram: Flowchart showing “Report → Classification (Corrective/Adaptive/Perfective/Preventive) → Impact Analysis → Development → Testing (unit, integration, regression) → Deployment → Review”.

Key Points to Remember

  • Maintenance is a continuous activity that extends the useful life of software.
  • Each maintenance type has a distinct focus but they often overlap in practice.
  • Testing is integral to every maintenance activity to maintain system reliability.
  • Preventive maintenance, though less visible, can significantly reduce future corrective costs.

Example Calculation

Suppose a system has 5,000 lines of code (LOC) and a defect density of 0.8 defects per KLOC after release. The expected number of defects to be fixed during corrective maintenance is:

\$\text{Defects} = \frac{5{,}000}{1{,}000} \times 0.8 = 4\$

Understanding such metrics helps plan maintenance resources.