Training activity information

Details

Review and bring legacy code into conformance with best practice

Type

Developmental training activity (DTA)

Evidence requirements

Evidence the activity has been undertaken by the trainee​.

Reflection on the activity at one or more time points after the event including learning from the activity and/or areas of the trainees practice for development.

An action plan to implement learning and/or to address skills or knowledge gaps identified.

Considerations

  • Legislation and guidance
  • Verification, validation and fitness for current purpose
  • Review and change management processes
  • Good programming practice including version control system, appropriate software tools etc.

Reflective practice guidance

The guidance below is provided to support reflection at different time points, providing you with questions to aid you to reflect for this training activity. They are provided for guidance and should not be considered as a mandatory checklist. Trainees should not be expected to provide answers to each of the guidance questions listed.

Before action

  • What defines ‘legacy code’? What are some common issues found in legacy code? What constitutes ‘best practice’ in software development? What strategies can be used to refactor or update legacy code?
  • What skills in understanding and working with existing, potentially complex, codebases do you aim to develop? What insights do you expect to gain into the challenges of maintaining and improving older software systems? How will this DTA enhance your ability to apply modern coding standards and design principles to existing software?
  • What specific legacy code will you be working with, and what is its purpose? What coding standards and best practices will you focus on implementing? What tools or techniques might be helpful in analysing and refactoring the legacy code? How do you feel about the task of reviewing and updating legacy code?

In action

  • Pay attention to your actions in reviewing and refactoring legacy code.
    • How are you currently approaching the task of understanding the existing code?
    • What criteria are you using to identify areas that do not conform to best practices (e.g., readability, efficiency, maintainability, security)?
    • What refactoring techniques are you employing to bring the code into conformance?
    • What decisions are you making regarding which parts of the code to focus on, the extent of the refactoring efforts, and how to ensure that changes do not introduce new issues?
    • What aspects of code review and refactoring feel intuitive based on your understanding of good software design principles, and what requires more conscious effort in deciphering older code and applying modern best practices?
  • How effective are your current methods in improving the quality and maintainability of the legacy code without breaking existing functionality?
    • What challenges are you encountering as you work with older code (e.g., lack of documentation, complex logic, dependencies on outdated libraries)?
    • What can you learn about the evolution of software development practices and the challenges of maintaining and updating older systems as you are actively engaged in this review and refactoring process?
    • How does this activity connect to your understanding of software architecture, design patterns, and the importance of code maintainability?
  • Are there alternative refactoring strategies or tools you could be considering?
    • How are you prioritising the areas for improvement based on their impact and risk?
    • What support or resources (e.g., static analysis tools, version control history) might you need at this moment to better understand the legacy code and guide your refactoring efforts?
    • Are you ensuring that your changes adhere to current best practices and that you are documenting your refactoring process?

On action

  • Describe the legacy code you reviewed. What were some of its characteristics? Summarise the best practices you aimed to implement. Note the challenges you encountered in understanding and modifying the legacy code.
  • What are some common issues and challenges associated with legacy code? What are effective strategies for understanding and working with existing codebases? What best practices are particularly important when refactoring or updating legacy code? How do you balance the need to update legacy code with the risks of introducing new issues?
  • What approaches will you use when faced with legacy code in future projects? What specific best practices will you focus on when reviewing and updating code? What tools or techniques can aid in the process of understanding and refactoring legacy code?

Beyond action

  • Have you looked back at the legacy code you reviewed and the changes you made to bring it into conformance? How does your understanding of legacy code challenges and best practices for refactoring compare now? Have you encountered other legacy systems since?
  • How has this activity enhanced your skills in understanding and improving existing codebases? Has it made you more aware of the importance of maintainable and well-documented code in your own development?
  • What transferable skills, such as problem-solving, analytical skills, and attention to detail, did you develop? What clear actions can you take to further develop your skills in legacy code remediation and software modernisation techniques?

Relevant learning outcomes

# Outcome
# 4 Outcome

Use good software design and programming practice.

# 5 Outcome

Use programming languages.

# 9 Outcome

Review and appraise code developed by others.

# 10 Outcome

Verify, validate and document software, and provide training to end users.

# 12 Outcome

Practice in accordance with legislation, ethics and best practice.