Maintenance is expensive. Studies suggest that it takes between 40 and 80 percent of the total cost of a software product over its life. Understanding the cost helps to plan it.
Factors that Affect the Cost
The cost depends on the size and age of the software, since old software has a degraded structure. It depends on the quality of the original design, code and documents, on the skill and continuity of the staff, on the programming language and tools, on the stability of the environment, and on the number of users and the demands that they place. A poorly designed product that was built cheaply may cost many times more to maintain than a well-designed one.
Definition: Maintenance cost. The total cost of modifying a software product after its delivery, usually expressed in effort such as person-months per year.
Boehm's Estimation of Maintenance Effort
Boehm proposed that the maintenance effort can be estimated from the development effort by the annual change traffic (ACT), the fraction of the code that is added or changed in a year: ACT = (KLOC added + KLOC modified) / KLOC total. The annual maintenance effort is then AME = ACT × DE, where DE is the development effort. It may be adjusted by an effort adjustment factor for the conditions of the project. If development took 200 person-months and 10 percent of the code changes each year, the yearly maintenance effort is 20 person-months.
The Maintenance Process
A typical process has several steps. A change request is received and logged. It is analysed to find the type of maintenance, the effect, the cost and the priority. The change is designed, with a study of the parts of the code that are affected. It is implemented, which means changing the code and updating the documents. It is tested, including regression testing. Finally, the new version is released and the records are updated. Configuration management controls the versions of all items that change. Urgent faults may need an emergency repair, which is done quickly and then repeated properly later.
Table 4.2: Factors affecting maintenance cost
| Factor | Effect on cost | Reason |
|---|---|---|
| Poor documentation | Raises it | Hard to understand code |
| Staff turnover | Raises it | Knowledge is lost |
| Old and complex structure | Raises it | Change causes more faults |
| Good design and tests | Lowers it | Changes are safer |
Example 4.2: Annual maintenance effort
Problem: A system of 80 KLOC took 320 person-months to develop. Each year 6 KLOC are added and 10 KLOC are modified. Find the annual change traffic and the annual maintenance effort.
Solution:
- ACT = (6 + 10) / 80 = 0.2.
- AME = ACT × DE = 0.2 × 320.
Result: The annual change traffic is 0.2 (20 percent), and the annual maintenance effort is 64 person-months.
added, modified, total, de = 6, 10, 80, 320
act = (added + modified) / total
print(act, act * de)
Output
0.2 64.0
Common mistakes
- Budgeting for development only and ignoring the cost of maintenance.
- Making emergency repairs and never repeating them properly.
- Forgetting regression testing after a change.
Key takeaways
- Maintenance takes about 40 to 80 percent of the life cost of software.
- ACT = (KLOC added + KLOC modified) / KLOC total.
- AME = ACT × development effort.
- The process is request, analysis, design, implementation, testing and release.
Practice questions
- What is annual change traffic?
- Write Boehm's formula for annual maintenance effort.
- Name two factors that raise maintenance cost.
Answers to the practice questions
- The fraction of the code that is added or modified in a year.
- AME = ACT × DE.
- Poor documentation and staff turnover (also old, complex structure).
Sources
- Official BCA syllabus Advanced Software Engineering, course code 25BCA405DS01, Unit IV
