- Home
- /
- Computational Thinking
- /
- Software Design & Development
- /
- Code Maintenance
Code Maintenance
Also known as: software maintenance, legacy code
Grade 9-12
View on concept mapThe ongoing process of updating, fixing, and improving software after its initial release to correct bugs, adapt to new requirements, improve performance, and keep dependencies current. Most professional developers spend more time maintaining existing code than writing new code.
Definition
The ongoing process of updating, fixing, and improving software after its initial release to correct bugs, adapt to new requirements, improve performance, and keep dependencies current. Maintenance includes four types: corrective (fixing bugs), adaptive (adapting to new environments), perfective (improving functionality), and preventive (reducing future problems).
๐ก Intuition
Software is never 'done.' Like a garden, it needs constant tending โ fixing bugs, updating dependencies, and adapting to changing needs.
๐ฏ Core Idea
Maintenance typically consumes 60-80% of software's total lifetime cost. Writing maintainable code from the start saves enormous effort later.
Example
๐ Why It Matters
Most professional developers spend more time maintaining existing code than writing new code. Maintenance skills are essential because well-maintained software stays secure, reliable, and relevant, while neglected software becomes a liability.
๐ญ Hint When Stuck
When maintaining code, start by understanding what the existing code does before changing it. Write tests for the current behavior so you can verify your changes do not break anything. Make small, focused changes and test after each one rather than attempting large rewrites.
Formal View
Related Concepts
๐ง Common Stuck Point
Maintenance isn't just fixing bugs โ it includes adapting to new requirements, improving performance, and preventing future problems.
โ ๏ธ Common Mistakes
- Neglecting to update dependencies, leaving known security vulnerabilities unpatched
- Making changes without understanding the existing code, introducing new bugs while fixing old ones
- Rewriting working code from scratch instead of incrementally improving it, which is almost always riskier and more expensive
Frequently Asked Questions
What is Code Maintenance in CS Thinking?
The ongoing process of updating, fixing, and improving software after its initial release to correct bugs, adapt to new requirements, improve performance, and keep dependencies current. Maintenance includes four types: corrective (fixing bugs), adaptive (adapting to new environments), perfective (improving functionality), and preventive (reducing future problems).
When do you use Code Maintenance?
When maintaining code, start by understanding what the existing code does before changing it. Write tests for the current behavior so you can verify your changes do not break anything. Make small, focused changes and test after each one rather than attempting large rewrites.
What do students usually get wrong about Code Maintenance?
Maintenance isn't just fixing bugs โ it includes adapting to new requirements, improving performance, and preventing future problems.
Prerequisites
Next Steps
How Code Maintenance Connects to Other Ideas
To understand code maintenance, you should first be comfortable with documentation and software development life cycle. Once you have a solid grasp of code maintenance, you can move on to version control.