1 of 17

Software Maintenance

CS 3240: Software Engineering

CS 3240

2 of 17

Why do we change software?

CS 3240

3 of 17

Change is inevitable

  • New requirements emerge when the software is used
  • The business environment changes
  • Faults must be repaired
  • New computers and equipment is added to the system
  • The performance fails behind competition

CS 3240

4 of 17

Software Development Costs are Dominated by Maintenance

  • According to [IEEE Std 610.12-1990]
    • Software maintenance is the process of modifying a software system or component after delivery to ...
    • (Software) maintainability is the ease with which a software system or component can be modified to ... correct faults, improve performance or other attributes, or adapt to a changed environment.”
  • All successful software needs maintenance
  • Most cost of successful software comes during maintenance
  • Maintenance $ > requirements+design+implementation+testing $

CS 3240

5 of 17

Scenario

  • Consider a custom product that cost $2M to develop
  • Problems have arisen!
    • The custom hard disk in which all the data is stored has run out of room!
    • However, the company that build the original disk is no longer in business…
    • You could buy from a new vendor, but to make it work (Adapter pattern!) would cost upwards of $100K
    • Also, the original devs have left the company…
    • So, you now have new devs trying to make sense of everything...

CS 3240

6 of 17

Maintenance is “all the phases”

  • In this scenario, we have:
    • A new/modified requirement from a bug report
    • A need for doing design (the adapter pattern?)
    • Implementing the new interface
    • Testing (unit, integration, system, and regression!)
    • Pushing the change
    • And now supporting the new version into the future
  • To be good at maintenance, you need to be good at ALL of phases of development

Unique

  • Additional constraints imposed by existing system
  • Additional resources that can be reused

CS 3240

7 of 17

Lifespan of a long-lived system - Rajlich and Bennett

  • Initial development
    • First delivered version is produced
    • Knowledge about the system is fresh and constantly changing
    • An architecture emerge and stabilizes
  • Evolution (maintenance is part of it)
    • Simple changes are easy, major changes are possible at higher cost/risk
    • Knowledge about system is good, but some original developers have left
    • For many systems, most of its lifespan is spent in this phase
  • Servicing
    • The system is no longer a key asset
    • Effects of changes become harder to predict, only minor changes are made
    • Knowledge about the system has lessened
  • Phase out
    • Decision to replace or eliminate the system
    • Exit strategy is devised and implemented, including wrapping and data migration
    • System is shut down

CS 3240

8 of 17

Lifespan of a long-lived system - Rajlich and Bennett

CS 3240

9 of 17

Maybe not “Maintenance”

  • “Maintenance” is almost seen as a dirty word in development
  • Something “less than” new development
  • Maybe:
    • Software Evolution?
    • For simplicity, I’m still going to say “Maintenance” in lecture, though :-)
  • Software is a “living” creation and is expected to change
  • The first version of software is never the “right” version!

CS 3240

10 of 17

But who does software maintenance?

  • Depending on the company you are at, maintenance can be seen as the “lowest rung on the ladder”
  • Developers often want to be doing “green field” development (new systems, new designs, new problems)
  • Developers that have the most clout can work their way on those teams…
  • … so maintenance is often left to less experienced developers...

CS 3240

11 of 17

But who does software maintenance?

  • Cultural problem around maintenance
  • It is often the hardest job and seen as the least glamorous
  • But companies need the best folks to be on maintenance!
    • Institutional / system knowledge is CRUCIAL
    • Being able to work with customers, developers, testers, etc. is important
    • Being a really good debugger and really good at reading code are needed skills
  • Some companies do a “round-robin” rotation on maintenance

CS 3240

12 of 17

Categories of Maintenance

  • Corrective - fixing faults, no matter where they appear (code, docs, etc.)
  • Perfective - changes to improve the system performance
  • Adaptive - changes in the environment necessitate the change, not a request from the customer, per se
  • Preventive - changes to avoid future problems
  • Version Numbers: X.Y.Z bxxxx

CS 3240

13 of 17

Where does it start?

Change minicycle

  • The Defect/Bug Report!
  • Process
    • Defect is reported by stakeholder
    • Defect is investigated by developer (requirements elicitation, impact analysis)
    • A plan is devised to respond/postpone/ignore/fix
    • If fix is needed
      • A patch is created
      • Testing (including regression testing) occurs
      • Change request is then processed (this varies wildly by organization)

CS 3240

14 of 17

Playing the long game and technical debt

  • Changes
    • Are rarely isolated
    • Cause required changes in other parts of the software or artifacts
  • Technical debt “The extra development work that arises when code that is easy to implement in the short run is used instead of applying the best overall solution
  • Many similarities with unpaid financial debt (interests, harder to pay it the longer you have it)

CS 3240

15 of 17

Things you can do to make maintenance easier

  • List some things that can be done during the development lifecycle that can make maintenance tasks easier

CS 3240

16 of 17

Things you can do to make maintenance easier

  • Documentation and/or self-documenting code
  • Reduce dependencies
  • Following code conventions (language, system, and company)
  • Don’t over-design… but don’t under-design either
    • System: Fruit Inventory System for the Fruit Commission
    • Over-design: “Lets have an abstract class food extended by abstract class fruit, implement all the concrete fruit as extending fruit, that way if they ever make other types of food we have the structure to handle it.”
    • Under-design: “There are seven fruits that we grow. The database will thus have seven columns for the seven types of fruit.”
  • Keep solid trained team, with incentives to build for the long run

CS 3240

17 of 17

Modern Software Maintenance

  • Bug reports + Change requests ≈ pull request
    • Pull requests Preconditions
      • External Review
      • Tests
      • Docs
      • Link to triggers

  • Speed and Scale

CS 3240