# Software maintenance

> CIE A-Level Computer Science · 9618 (2022-2024)
> Source: https://www.owlsprep.com/study/cie-9618-u12-software-maintenance/

Software maintenance is the post-deployment phase of the software development lifecycle, covering all updates, fixes, and modifications to a working system after release. This guide explains core types, causes, costs, and common exam expectations for this topic.

**Prerequisites:** [Software development lifecycle models](https://www.owlsprep.com/study/cie-9618-u12-software-development-lifecycle-models/)

## Learning objectives

- Distinguish between the four core types of software maintenance
- Identify common causes of maintenance requirements in different scenarios
- Calculate the proportion of lifecycle cost spent on maintenance
- Explain the purpose of key maintenance activities like regression testing

## Core Types of Software Maintenance

CIE 9618 classifies software maintenance into four distinct categories, grouped by the purpose of the change. All maintenance work occurs after the software has been deployed to end users and is in active use.

**Software Maintenance** — All activities required to modify, update, correct, and improve a software product after it has been released to production use.

*Example:* Patching a newly discovered security vulnerability in a mobile banking app

| Type | Core Purpose | Example |
| --- | --- | --- |
| Corrective | Fix existing errors/bugs missed during testing | Fixing a checkout crash when an empty cart is processed |
| Adaptive | Adapt to new external requirements/environment | Updating an app to run on a new major version of Windows |
| Perfective | Add new features or improve user experience | Adding a dark mode to a social media app |
| Preventive | Prevent future issues, improve maintainability | Refactoring outdated, undocumented code before it causes errors |

**Worked example:** A school's internal attendance system was updated to comply with new government data protection rules. What type of maintenance is this? Justify your answer.

1. First, identify the driver of the change: the update is required to meet new external regulatory requirements that did not exist when the system was originally built.
2. Match the change driver to the maintenance types: adaptive maintenance covers modifications to meet new external environmental or regulatory requirements.
3. Conclusion: This is an example of adaptive maintenance.

## Common Causes of Software Maintenance

Maintenance requirements arise from multiple sources across the software lifecycle. Identifying the root cause of a change helps correctly classify the maintenance type in exam questions.

- Undiscovered errors and bugs that slipped through pre-release testing
- Changes to the operating environment: new hardware, operating systems, or third-party APIs
- Changes to legal or regulatory requirements governing the software's use
- Evolving user and business needs that require new features or changes to existing workflows
- Requirements to improve the long-term maintainability of an aging codebase

**Worked example:** Give two specific common causes of corrective maintenance.

1. Recall that corrective maintenance fixes existing faults in the software.
2. First common cause: Incomplete requirements capture that led to incorrect logic not picked up during development. For example, a tax calculation routine that does not account for newly introduced tax brackets that were added after requirements were finalized.
3. Second common cause: Incomplete testing that left edge-case bugs undiscovered before release. For example, a system that crashes when 1000 concurrent users log in, a volume that was never tested during pre-release testing.

## Costs of Software Maintenance

For most long-lived software products, maintenance accounts for 60-80% of the total lifecycle cost of the product, far exceeding the initial development cost. Costs include direct labour for changes and testing, plus indirect costs like downtime during updates and user retraining.

> **info**
>
> Common exam questions ask why maintenance costs are so high. Key reasons include: aging undocumented code, staff turnover, changing requirements, and the need for full regression testing after every change.

**Worked example:** A software project has an initial development cost of &#36;200,000. Over its 10-year lifetime, it costs &#36;45,000 per year for maintenance. What percentage of the total lifecycle cost is spent on maintenance?

1. Calculate total maintenance cost over the 10-year lifetime:
2. $$10 \times 45000 = 450000$$
3. Calculate total lifecycle cost, which is initial development plus total maintenance:
4. $$200000 + 450000 = 650000$$
5. Calculate the percentage of total cost spent on maintenance:
6. $$\left(\frac{450000}{650000}\right) \times 100 \approx 69.2\%$$
7. This matches the industry rule of thumb that maintenance makes up the majority of total software lifecycle cost for long-lived products.

## Key Maintenance Activities

The standard maintenance workflow follows four key steps: understanding the existing codebase, implementing the required change, testing the change, and deploying the updated version to end users.

Regression testing is the most critical testing step for maintenance: it re-runs all existing tests for affected modules to confirm that the new change did not break any existing working functionality.

**Worked example:** Explain why regression testing is required for almost all software maintenance work.

1. Any change to existing code can introduce new errors into previously working parts of the system, even if the change itself is correctly implemented.
2. Regression testing re-runs existing tests for the affected system modules to confirm that all existing functionality still works as expected after the change.
3. Without regression testing, fixing one bug can easily introduce multiple new bugs in unrelated parts of the system, leading to more maintenance work later.

## Common pitfalls

- **Wrong:** Confusing adaptive and perfective maintenance
  - Why it fails: Both are non-corrective changes, leading students to mix them up. Adaptive is for new external conditions, perfective is for new user features.
  - Correct: If the change is required to work with a new external environment, regulation, or hardware, it is adaptive. If it adds new functionality to meet user needs, it is perfective.
- **Wrong:** Thinking maintenance only includes fixing bugs
  - Why it fails: Only corrective maintenance fixes bugs. Three of the four core maintenance types are non-corrective.
  - Correct: Remember all four categories: corrective, adaptive, perfective, and preventive. Only corrective addresses existing bugs.
- **Wrong:** Automatically assuming maintenance is more expensive than initial development
  - Why it fails: While true for long-lived software, this is not the case for short-lived projects with a 1-2 year lifetime.
  - Correct: Always calculate total maintenance cost over the product's lifetime when comparing costs, do not rely on assumptions.
- **Wrong:** Forgetting that regression testing is a core maintenance activity
  - Why it fails: Students often confuse regression testing with pre-release unit testing, and miss it in exam questions about maintenance.
  - Correct: Remember regression testing is specifically re-testing existing functionality after a change, which is a required step for almost all maintenance work.

## Cheatsheet

| Maintenance Type | Core Purpose |
| --- | --- |
| Corrective | Fix existing bugs/defects |
| Adaptive | Adapt to new environment/regulations |
| Perfective | Add new user features/improve usability |
| Preventive | Prevent future problems, improve maintainability |

## What's next

Software maintenance is the final active phase of the software development lifecycle, and questions about classifying maintenance types and explaining maintenance costs are common in Paper 1 of CIE 9618. This topic builds on your understanding of the broader software development lifecycle, and connects to testing methods, requirement analysis, and project management topics that are also regularly tested. Solidifying your knowledge of maintenance classification will help you earn easy marks in scenario-based questions. Explore the related resources below to extend your learning.

- [Software Project Management](https://www.owlsprep.com/study/cie-9618-u12-software-project-management/)
- [Computational thinking & problem solving (including declarative, OO and AI)](https://www.owlsprep.com/study/cie-9618-u13-overview/)
- [Problem Decomposition](https://www.owlsprep.com/study/cie-9618-u13-problem-decomposition/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/cie-9618-u12-software-maintenance/
