8.2.4 Maintaining software solutions

Modifications to code are often required. These modifications need not be made by the original developers. In these situations, original documentation is very important in understanding the logic used in the solution. Students should be given opportunities to modify their code and to gain experience in modifying the code of others with varying amounts of documentation available. 

Students could be asked to modify solutions as a means of assessing their understanding. 
Students should be reminded of the ethical issues associated with accessing and modifying the code of others.


Outcomes

A student:

P1.2 describes and uses appropriate data types

P2.2 describes the effects of program language developments on current practices

P3.1 identifies the issues relating to the use of software solutions

P4.1 analyses a given problem in order to generate a computer-based solution

P4.2 investigates a structured approach in the design and implementation of a software solution

P4.3 uses a variety of development approaches to generate software solutions and distinguishes between these approaches

P5.1 uses and justifies the need for appropriate project management techniques

P5.2 uses and develops documentation to communicate software solutions to others

P6.1 describes the skills involved in software development

P6.2 communicates with appropriate personnel throughout the software development process

P6.3 designs and constructs software solutions with appropriate interfaces.


Students learn about:

Reasons for maintaining code


  • changing user requirements

  • upgrading the user interface

  • changes in the data to be processed

  • introduction of new hardware or software

  • changing organisational focus

  • changes in government requirements

  • poorly implemented code


Features in source code that improve its maintainability, including:


  • use of variables instead of literal constants

  • use of meaningful variable names

  • explanatory comments in the code

  • use of standard control structures with appropriate indentation

  • appropriate use of white space to improve legibility of the source code

  • a clear and uncluttered mainline

  • one logical task per subroutine

  • meaningful names for subroutines and modules


Understanding source code


  • reading original documentation in order to understand code

  • documentation for the user (including user manuals)

  • documentation for developers

  • reading original algorithms to identify:

  • inputs

  • the type and purpose of variables used

  • processes

  • outputs

  • creating algorithms for source code when they are not available to aid in understanding

  • identify the control structures that have been used

  • understand how variables have been used

Inclusion of code from other sources

  • copyright issues

  • compatibility of code



Students learn to:




  • identify and describe features in code that allow it to be easily maintained









  • create solutions that are easy to maintain












  • convert a fragment of source code into its equivalent algorithm


  • define the purpose of the code to be maintained


  • modify code to meet changed requirements










  • provide appropriate acknowledgement of the code of other programmers that has been incorporated as part of the maintenance process

  • assess the compatibility of code to be included in the source code of an existing solution