Software is changed throughout its life. A system that is not changed becomes less and less useful, since the world around it does not stand still.
Need for Maintenance
Software maintenance is the modification of a software product after delivery. The need arises for several reasons. Faults that escaped testing appear in use and must be corrected. The environment changes, with new operating systems, hardware, laws and business rules. Users ask for new features and better performance. Technology moves on, and the product must be kept up to date to continue to give value. Lehman's laws of software evolution state that a system that is used must be continually changed, and that its structure becomes more complex as it is changed unless effort is made to reduce this.
Definition: Software maintenance. The modification of a software product after delivery to correct faults, to improve performance or other attributes, or to adapt it to a changed environment.
Categories of Maintenance
Corrective maintenance repairs faults found after delivery, such as a wrong calculation. Adaptive maintenance modifies the software to keep it working in a changed environment, such as a new version of the operating system or a change in tax law. Perfective maintenance improves the software or adds features in response to user requests, such as a faster search or a new report. Preventive maintenance, also called restructuring, changes the software to improve its future maintainability and reliability without changing its behaviour. Studies show that perfective maintenance takes the largest share of effort, often over half, followed by adaptive and then corrective maintenance.
Why Maintenance is Difficult
The people who wrote the software may have left. The documents may be out of date or missing. The code was not written with change in mind. A change in one place can cause faults elsewhere, which is called the ripple effect. Testing a change needs regression testing of everything affected. The pressure of users to fix a problem quickly encourages quick fixes that damage the structure.
Table 4.1: Categories of maintenance
| Category | Purpose | Example |
|---|---|---|
| Corrective | Fix faults | Correct a wrong total |
| Adaptive | Fit a changed environment | Support a new tax rate |
| Perfective | Improve or add features | Add an export button |
| Preventive | Make future change easier | Restructure a messy module |
Example 4.1: Classifying maintenance requests
Problem: Classify these requests: (a) a report prints the wrong month, (b) the application must run on a new mobile operating system, (c) users want a search by date, (d) a long, confusing module is rewritten into smaller functions.
Solution:
- A wrong month is a fault, so it is corrective.
- The new operating system is a changed environment, so it is adaptive.
- The search by date is a new feature, so it is perfective.
- Rewriting without a change of behaviour is preventive.
Result: (a) corrective, (b) adaptive, (c) perfective, (d) preventive.
Common mistakes
- Thinking that maintenance is only fixing faults.
- Making quick fixes that ignore the design, which makes the software harder to maintain.
- Changing the code without updating the documents and tests.
Key takeaways
- Maintenance is modification after delivery.
- The four categories are corrective, adaptive, perfective and preventive.
- Perfective maintenance takes the largest share of effort.
- The ripple effect means that a change in one place can cause faults elsewhere.
Practice questions
- Name the categories of maintenance.
- What is adaptive maintenance?
- What is the ripple effect?
Answers to the practice questions
- Corrective, adaptive, perfective and preventive.
- Modifying software to keep it working in a changed environment.
- A change in one part of the software causing faults in other parts.
Sources
- Official BCA syllabus Advanced Software Engineering, course code 25BCA405DS01, Unit IV
