19 Software Maintenance

SOFTWARE MAINTENANCE

 

Software maintenance is the general process of changing a system after it has been delivered. The term is usually applied to custom software in which separate development groups are involved before and after delivery. The changes made to the software may be simple changes to correct coding errors, more extensive changes to correct design errors, or significant enhancements to correct specification errors or accommodate new requirements. Changes are implemented by modifying existing system components and, where necessary, by adding new components to the system. There are three different types of software maintenance namely Fault repairs, Environmental adaptation and Functionality addition.

 

1.  Fault repairs: Coding errors are usually relatively cheap to correct; design errors are more expensive as they may involve rewriting several program components. Requirements errors are the most expensive to repair because of the extensive system redesign which may be necessary.

2. Environmental adaptation: This type of maintenance is required when some aspect of the system’s environment such as the hardware, the platform operating system, or other support software changes. The application system must be modified to adapt it to cope with these environmental changes.

3. Functionality addition: This type of maintenance is necessary when the system requirements change in response to organizational or business change. The scale of the changes required to the software is often much greater than for the other types of maintenance.

 

SOFTWARE MAINTENANCE- TERMINOLOGY

 

Software Maintenance consists of the activities required to keep a software system operational and responsive after it is accepted and placed into production.

    Software Evolution

The continuous change of software from a lesser, simpler, or worse state to a higher or better state.

 

Software Maintainer

The person whose mission is to support existing software systems is called a software maintenance person.

 

NEED FOR MAINTENANCE

 

Maintenance is needed to ensure that the software continues to satisfy user requirements. Maintenance is applicable to software that is developed using any software life cycle model (for example, spiral or linear). Software products change due to corrective and non corrective software actions. Maintenance must be performed in order to perform the following:

  • Correct faults;
  • Improve the design;
  • Implement enhancements;
  • Interface with other software;
  • Adapt programs so that different hardware, software, system features, and telecommunications facilities can be used;
  • Migrate legacy software; and Retire software.

SOFTWARE MAINTENANCE PROBLEMS

 

Most computer programs are difficult and expensive to maintain. This is due to the fact that software changes are poorly designed and implemented. Therefore, the repair and enhancement of software often injects new bugs that must later be repaired. Moreover, changing priorities is difficult due to chaotic nature of maintenance requests, the length of maintenance tasks causing new requests to come along before an ongoing task is done. Inadequate testing methods and lack of time set aside for testing, non availability of comprehensive test data, rigorous testing requirements as a standard for signing off are the major problems in software maintenance. Other problems include, performance measurement difficulties on how to measure individual or group performance, system documentation incompleteness problem, time problem including training time since training takes a long time for learning an application so programmers get stuck on one piece of software are the problems to be addressed in maintenance. In short, maintenance requires adapting to the rapidly changing business environments and changes in hardware and software since they become obsolete very fast.

 

RELATIVE COSTS OF MAINTENANCE

 

Software errors must be identified and fixed as early as possible. The reason for this is that at a later stage, changes are becoming costly. The costs of maintenance after each phase of the software development life cycle are as follows:

  • 3%  Requirements definition
  • 3%  Preliminary design
  • 5%  Detailed design
  • 7%   Implementation
  • 15% Testing
  • 67% Operations and Maintenance
MAINTENANCE CATEGORIES

 

The major categories in software maintenance are as follows:

  • Corrective maintenance
  • Adaptive maintenance
  • Perfective maintenance
  • Preventive maintenance

Corrective maintenance

 

Corrective maintenance deals with the repair of faults or defects found in day-today system functions. A defect can result due to errors in software design, logic and coding. Design errors occur when changes made to the software are incorrect, incomplete, wrongly communicated, or the change request is misunderstood. Logical errors result from invalid tests and conclusions, incorrect implementation of design specifications, faulty logic flow, or incomplete test of data. All these errors, referred to as residual errors, prevent the software from conforming to its agreed specifications. Note that the need for corrective maintenance is usually initiated by bug reports drawn by the users.

 

In the event of a system failure due to an error, actions are taken to restore the operation of the software system. The approach in corrective maintenance is to locate the original specifications in order to determine what the system was originally designed to do. However, due to pressure from management, the maintenance team sometimes resorts to emergency fixes known as patching. Corrective maintenance accounts for 20% of all the maintenance activities.

 

Adaptive Maintenance

 

Adaptive maintenance is the implementation of changes in a part of the system, which has been affected by a change that occurred in some other part of the system. Adaptive maintenance consists of adapting software to changes in the environment such as the hardware or the operating system. The term environment in this context refers to the conditions and the influences which act (from outside) on the system. For example, business rules, work patterns, and government policies have a significant impact on the software system.

 

For instance, a government policy to use a single ‘European currency’ will have a significant effect on the software system. An acceptance of this change will require banks in various member countries to make significant changes in their software systems to accommodate this currency. Adaptive maintenance accounts for 25% of all the maintenance activities.

Perfective Maintenance

 

Perfective maintenance mainly deals with implementing new or changed user requirements. Perfective maintenance involves making functional enhancements to the system in addition to the activities to increase the system’s performance even when the changes have not been suggested by faults. This includes enhancing both the function and efficiency of the code and changing the functionalities of the system as per the users’ changing needs.

 

Examples of perfective maintenance include modifying the payroll program to incorporate a new union settlement and adding a new report in the sales analysis system. Perfective maintenance accounts for 50%, that is, the largest of all the maintenance activities.

 

Preventive Maintenance

 

Preventive maintenance involves performing activities to prevent the occurrence of errors. It tends to reduce the software complexity thereby improving program understandability and increasing software maintainability. It comprises documentation updating, code optimization, and code restructuring. Documentation updating involves modifying the documents affected by the changes in order to correspond to the present state of the system. Code optimization involves modifying the programs for faster execution or efficient use of storage space. Code restructuring involves transforming the program structure for reducing the complexity in source code and making it easier to understand.

 

Preventive maintenance is limited to the maintenance organization only and no external requests are acquired for this type of maintenance. Preventive maintenance accounts for only 5% of all the maintenance activities.

 

PREVENTATIVE MAINTENANCE BY REFACTORING

 

Refactoring is the process of making improvements to a program to slow down degradation through change. It means modifying a program to improve its structure, to reduce its complexity, or to make it easier to understand. Refactoring is sometimes considered to be limited to object-oriented development but the principles can be applied to any development approach. When refactoring a program, one should not add functionality but should concentrate on program

 

improvement. one can therefore think of refactoring as ‘preventative maintenance’ that reduces the problems of future change.

 

Although reengineering and refactoring are both intended to make software easier to understand and change, they are not the same thing. Reengineering takes place after a system has been maintained for some time and maintenance costs are increasing. The programmer must use automated tools to process and reengineer a legacy system to create a new system that is more maintainable. Refactoring is a continuous process of improvement throughout the development and evolution process. It is intended to avoid the structure and code degradation that increases the costs and difficulties of maintaining a system. Refactoring is an inherent part of agile methods such as extreme programming because these methods are based around change. Program quality is therefore liable to degrade quickly so agile developers frequently refactor their programs to avoid this degradation. The emphasis on regression testing in agile methods

lowers the risk of introducing new errors through refactoring. Any errors that are introduced should be detectable as previously successful tests should then fail. However, refactoring is not dependent on other ‘agile activities’ and can be used with any approach to development. Fowler suggest that there are stereotypical situations (he calls them ‘bad smells’) in which the code of a program can be improved. Examples of bad smells that can be improved through refactoring include:

  1. Duplicate code The same of very similar code may be included at different places in a program. This can be removed and implemented as a single method or function that is called as required.
  2. Long methods If a method is too long, it should be redesigned as a number of shorter methods. 3. Switch (case) statements These often involve duplication, where the switch depends on the type of some value. The switch statements may be scattered around a program. In object-oriented languages, you can often use polymorphism to achieve the same thing.
  3. Data clumping Data clumps occur when the same group of data items (fields in classes, parameters in methods) reoccur in several places in a program. These can often be replaced with an object encapsulating all of the data.
  4. Speculative generality This occurs when developers include generality in a program in case it is required in future.

This can often simply be removed. Fowler, also suggests some primitive refactoring transformations that can be used singly or together to deal with the bad smells. Examples of these transformations include Extract method, where one must remove duplication and create a new method; Consolidate conditional expression, where the programmer replaces a sequence of tests with a single test; and Pull up method, where the programmer replaces similar methods in subclasses with a single method in a super class. Interactive development environments, such as Eclipse, include refactoring support in their editors. This makes it easier to find dependent parts of a program that have to be changed to implement the refactoring.

 

Maintenance work in the above categories is often performed concurrently. Moreover, the Maintenance Process begins when a request for change is initiated by a user and ends when the system passes testing, is accepted by the user and is released for operation. In between, there are many activities that must be planned and co-ordinated by use of Change Management techniques.

 

SOFTWARE MAINTENANCE PROCESS

 

The software maintenance process consists of the following seven-steps:

 

Step 1 –  Change Management

    Step 2 –  Impact Analysis

 

Step 3 –  System Release Planning

 

Step 4 –  Design Changes

 

Step 5 –  Coding

 

Step 6 –  Testing

 

Step 7 –  System Release

 

Step 1 – Change Management

 

It is used to uniquely identify, describe and track the status of each requested change. In an organization, change requests are recorded and tracked through all stages of the maintenance process in a Change Management Tracking System. Moreover, Project Management and Quality Assurance receive information about the status of the Change Requests.

 

Step 2 – Impact Analysis

 

An Impact Analysis identifies all systems/system products affected by a change request developing an estimate of the resources needed to accomplish the change. It consists of two important steps namely the evaluation of change requests and the estimation of resources.

 

Step 3 – System Release Planning

 

The aims of system release planning are to establish the schedule of system releases and to determine the contents of a system release. Moreover, the System Release/Version Description Document describes the contents / timing of a system release, communicates between maintainers and users and provides the guidelines to plan hardware, operational procedures and backup procedures.

 

Step 4 – Design Changes

 

The aims of design changes are to develop a revised logical (system level) and physical (program level) design for the change. It analyses and makes the design changes, updates the documentation, updates the configuration management system, and updates the change request for management. It is useful to design the changes for each of the categories of maintenance.

 

Step 5 – Code

 

The aim: of coding is to clarify existing code and simplify changing it. It includes the Re-Engineering of Source Code by restructuring it and by performing the redesign and rewriting of the code. Finally, codes are reviewed as it is done for design.

 Step 6 – Software Testing

 

Software testing is also necessary during the maintenance phase for comparing the maintenance and development differences. The testing carried out during the maintenance phase must ensure the following

 

Step 7 – System Release

 

The main aim of system release is to package the system for release. It consists of many components including documentation, software design checking, training, comparison with other products and by proper maintenance of the hardware. It helps to deliver the system to the user and to install the system release with backup procedures.

 

SUMMARY

 

There are 3 (4) categories of maintenance namely corrective, adaptive, perfective,(preventative). There is a defined maintenance process, which ensures the delivery of quality software which consists of a change control procedure. Moreover, perfective maintenance includes the selection of criteria, a search for the data and the use of a Pareto Analysis.