Evolution2.pdf
Document Details
Uploaded by NeatestStrength
Tags
Full Transcript
Chapter 9 – Software Evolution 1 Topics covered Software maintenance 2 Software maintenance Factors 3 Software maintenance Modifying a program after it has been put into use. The term is mostly used for changing custom software. Generic software products are said to evolve to c...
Chapter 9 – Software Evolution 1 Topics covered Software maintenance 2 Software maintenance Factors 3 Software maintenance Modifying a program after it has been put into use. The term is mostly used for changing custom software. Generic software products are said to evolve to create new versions. Maintenance does not normally involve major changes to the system’s architecture. Changes are implemented by modifying existing components and adding new components to the system. 4 Types of maintenance Fault repairs (Corrective Maintenance) ◦ Changing a system to fix bugs/vulnerabilities and correct deficiencies in the way meets its requirements. Environmental adaptation (Adaptive Maintenance) ◦ Maintenance to adapt software to a different operating environment ◦ Changing a system so that it operates in a different environment (computer, OS, etc.) from its initial implementation. Functionality addition and modification (Perfective Maintenance) ◦ Modifying the system to satisfy new requirements. ◦ Add new Functionality 5 Maintenance effort distribution 6 Maintenance costs 1 Usually greater than development. Affected by both technical and non-technical factors. Increases as software is maintained. Maintenance corrupts the software structure so makes further maintenance more difficult. Ageing software can have high support costs (e.g. old languages, compilers etc.). 7 Maintenance costs 2 It is usually more expensive to add new features to a system during maintenance than it is to add the same features during development ◦ A new team has to understand the programs being maintained ◦ Separating maintenance and development means there is no incentive for the development team to write maintainable software ◦ Program maintenance work is unpopular Maintenance staff are often inexperienced and have limited domain knowledge. ◦ As programs age, their structure degrades and they become harder to change 8 Maintenance prediction 9 Change prediction Predicting the number of changes requires and understanding of the relationships between a system and its environment. Tightly coupled systems require changes whenever the environment is changed. Factors influencing this relationship are ◦ Number and complexity of system interfaces; ◦ Number of inherently volatile system requirements; ◦ The business processes where the system is used. 10 Complexity metrics Predictions of maintainability can be made by assessing the complexity of system components. Studies have shown that most maintenance effort is spent on a relatively small number of system components. Complexity depends on ◦ Complexity of control structures; ◦ Complexity of data structures; ◦ Object, method (procedure) and module size. 11 Process metrics Process metrics may be used to assess maintainability ◦ Number of requests for corrective maintenance; ◦ Average time required for impact analysis; ◦ Average time taken to implement a change request; ◦ Number of outstanding change requests. If any or all of these is increasing, this may indicate a decline in maintainability. 12 Software reengineering Restructuring or rewriting part or all of a legacy system without changing its functionality. Applicable where some but not all sub-systems of a larger system require frequent maintenance. Reengineering involves adding effort to make them easier to maintain. The system may be restructured and re-documented. 13 Advantages of reengineering Reduced risk ◦ There is a high risk in new software development. There may be development problems, staffing problems and specification problems. Reduced cost ◦ The cost of re-engineering is often significantly less than the costs of developing new software. 14 The reengineering process 15 Reengineering process activities Source code translation ◦ Convert code to a new language. Reverse engineering ◦ Analyse the program to understand it; Program structure improvement ◦ Restructure automatically for understandability; Program modularisation ◦ Reorganise the program structure; Data reengineering ◦ Clean-up and restructure system data. 16 Reengineering approaches 17 Reengineering cost factors The quality of the software to be reengineered. The tool support available for reengineering. The extent of the data conversion which is required. The availability of expert staff for reengineering. ◦ This can be a problem with old systems based on technology that is no longer widely used. 18 Refactoring Refactoring is the process of making improvements to a program to slow down degradation through change. You can think of refactoring as ‘preventative maintenance’ that reduces the problems of future change. Refactoring involves modifying a program to improve its structure, reduce its complexity or make it easier to understand. When you refactor a program, you should not add functionality but rather concentrate on program improvement. 19 Refactoring and reengineering Re-engineering takes place after a system has been maintained for some time and maintenance costs are increasing.You use automated tools to process and re-engineer 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. 20 ‘Bad smells’ in program code 1 Duplicate code ◦ The same or 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. Long methods ◦ If a method is too long, it should be redesigned as a number of shorter methods. Switch (case) statements ◦ These often involve duplication, where the switch depends on the type of a value. The switch statements may be scattered around a program. In objectoriented languages, you can often use polymorphism to achieve the same thing. 21 ‘Bad smells’ in program code 2 Data clumping ◦ Data clumps occur when the same group of data items (fields in classes, parameters in methods) re-occur in several places in a program. These can often be replaced with an object that encapsulates all of the data. Speculative generality ◦ This occurs when developers include generality in a program in case it is required in the future. This can often simply be removed. 22 Key points Software development and evolution can be thought of as an integrated, iterative process that can be represented using a spiral model. For custom systems, the costs of software maintenance usually exceed the software development costs. The process of software evolution is driven by requests for changes and includes change impact analysis, release planning and change implementation. Legacy systems are older software systems, developed using obsolete software and hardware technologies, that remain useful for a business. 23 Key points 1 It is often cheaper and less risky to maintain a legacy system than to develop a replacement system using modern technology. The business value of a legacy system and the quality of the application should be assessed to help decide if a system should be replaced, transformed or maintained. There are 3 types of software maintenance, namely bug fixing, modifying software to work in a new environment, and implementing new or changed requirements. 24 Key points 2 Software re-engineering is concerned with re-structuring and re-documenting software to make it easier to understand and change. Refactoring, making program changes that preserve functionality, is a form of preventative maintenance. 25