Final Software Maintenance
Final Software Maintenance
Type notes
UNIT 1
Software Maintenance
Process of modifying existing software after it's been deployed to fix defects,
improve performance, or enhance functionality.
Why We Need Software Maintenance:
Bug Fixes: Software is complex, and errors (bugs) inevitably arise. Fixing
these bugs ensures the software works as intended and avoids user
frustration or data loss.
Software Maintenance 1
Benefits of Software Maintenance:
Types of errors:
Common issues:
Emergency fixes (patching): Quick fixes done under pressure, which can
cause more problems later by increasing complexity.
2. Adaptive Change
Software Maintenance 2
Government regulations: New laws or policies that require software
updates.
Common adaptations:
Migrating code: Moving from old to new platforms, like shifting from
sequential processing to parallel processing.
3. Perfective Change
Why it’s done: As users experiment with the software, they often request new
features or improvements beyond its original design.
Examples:
4. Preventive Change
Why it’s needed: Over time, multiple corrective and adaptive changes can
lead to structural degradation, making the software harder to maintain.
Common tasks:
Software Maintenance 3
Documentation updates: Updating system and user documentation after
changes to keep everything aligned with the current state of the software.
Avoiding ripple effects: Sometimes, changes to one part of the software can
unexpectedly affect other parts. Techniques like modularization (dividing the
software into smaller parts) and information hiding (limiting data visibility) can
reduce these risks.
Ongoing Support
Ongoing support involves providing services to address non-programming-related
requests.
1. Effective Communication
Software Maintenance 4
Building rapport: Establishing good relationships improves understanding and
reduces the risk of misinterpreting user requests.
2. Training of End-Users
Objective: Provide users with the skills and knowledge to use the system
effectively.
Methods of training:
On-line help and telephone queries: Used when manuals are insufficient.
Short courses: Formal or informal training sessions to help users deal with
problems.
Peer group training through user groups (e.g., for CAD software users).
Users share experiences and learn from each other, forming a symbiotic
relationship.
Examples:
Software Maintenance 5
With accurate information, the company can decide whether to enhance
the current system or replace it entirely.
Lientz and Swanson Study: The following distribution was reported in 487
data processing organizations:
Application type.
Software Maintenance 6
Quality of accompanying documentation.
2. Alternative Terminology:
Software Maintenance 7
This perception undervalues the complex work involved in maintaining
software.
1. User
2. Environment
Software Maintenance 8
Types of Environments:
3. Maintenance Process
'Dead' Paradigms: Many systems are built on outdated concepts, limiting their
adaptability to user needs over time.
Error Detection and Correction: All software has residual errors, which
become more costly to fix the later they are found in the lifecycle.
4. Software Product
Software Maintenance 9
Maturity of Application Domain: Well-established applications (e.g., payroll)
typically experience fewer changes than emerging systems (e.g., medical
information).
Inherent Quality: The evolution of software is closely tied to its design and
structure.
5. Maintenance Personnel
Working Practices: The methods used for making changes significantly affect
future maintenance ease. Factors include:
Key Methods:
Software Maintenance 10
1. Advanced Requirement Specification Approaches: Using better
requirement methods leads to more clarity and easier maintainability.
Supporting Evidence: Only recently have empirical studies (like the FEAST
projects) started to validate the benefits of investing in maintenance during the
development phase.
Challenges:
Replacing them risks losing this valuable knowledge base, which could
be useful for future projects and avoid “reinventing the wheel.”
Software Maintenance 11
3. Enhancement of the Existing System
Challenge: Complete replacement is often not viable due to the cost and risk
involved.
Approach:
Enhancing the current system to evolve with more advanced features and
technologies is a more practical solution.
Existing systems, despite being old, are still valuable assets due to their
embedded technical knowledge and working culture.
Key Goals:
Software Maintenance 12
The generic stages in a maintenance-conscious model (Figure 5.10) compared
with the traditional development model appear similar on the surface but
within the stages there are great differences in emphasis and procedure.
There is more effort required and very different emphases on the early stages,
and conversely less effort required in the later stages, of the maintenance
model as opposed to the development model.
Software Maintenance 13
Also known as the "firefighting" or "hack and patch" model.
How it works:
3. Minimal Testing: Limited testing is conducted to ensure the quick fix doesn't
worsen the existing situation but often overlooks potential side effects.
4. Deploy and Repeat: The quick fix is deployed, potentially masking underlying
issues and contributing to a growing technical debt. The cycle repeats with
each new problem, creating a vicious cycle of short-term solutions.
Software Maintenance 14
Pressure to Deliver: Organizations under tight deadlines or facing critical
production issues may prioritize quick fixes to keep operations running.
Lack of Resources: Limited budget, staffing, or expertise can limit the ability
to implement a more structured approach.
Urgency Over Quality: The focus on immediate results can overshadow the
importance of long-term software health.
Long-Term Problems:
Code Complexity: Unplanned changes and patches can lead to messy, poorly
documented code, hindering comprehension and further development.
Increased Risk: Unforeseen consequences and side effects from quick fixes
can introduce new vulnerabilities and bugs.
Limited Scalability: The quick fix model is ill-suited for complex systems or
large-scale maintenance projects, leading to unmanageable codebases.
Boehm's Model
1. In 1983 Boehm proposed a model for the maintenance process based upon
economic models and principles.
3. Boehm's thesis was that economic models and principles could not only
improve productivity in maintenance but also help understanding of the
process.
Software Maintenance 15
5. He theorize that it is the stage where management decisions are made that
drives the process.
7. The approved changes are accompanied by their own budgets which will
largely determine the extent and type of resource expended.
Osborne's Model
1. Another approach is proposed by Osborne .
2. The difference between this model and the others is that it deals directly with
the reality of the maintenance environment.
3. Where as, other models tend to assume some facet of an ideal situation - the
existence of full documentation.
4. Example-Osborne's model makes allowance for how things are rather than
how we would like them to be.
Software Maintenance 16
5. The maintenance model is treated as continuous iterations of the software life-
cycle with.
7. If good maintenance features already exist, for example full and formal
specification or complete documentation, all well and good, but if not,
allowance is made for them to be built in.
Software Maintenance 17
a means of verifying that maintenance goals have been met; performance
4. The motivation for this model was the environment where requirements were
not fully understood and a full system could not be built.
Analysis.
Software Maintenance 18
The Reuse-Oriented Model
1. This model is based on the principle that maintenance could be viewed as an
activity involving the reuse of existing program components.
Identification of the parts of the old system that are candidates for reuse,
4. With the full reuse model the starting point may be any phase of the life-cycle
- the requirements, the design, the code or the test data - unlike other models.
5. For example, in the quick-fix model, the starting point is always the code.
Software Maintenance 19
a. Problem Domain
3. The selection of personnel with the appropriate level of expertise and skills is
another aspect.
b. Execution Effect
Software Maintenance 20
2. At a low level of abstraction - they need to know the results that individual
program units will produce on execution.
3. Knowledge of data flow, control flow and algorithmic patterns can facilitate the
accomplishment of these goals
The cause-effect relation can be used to trace the flow of information through
the program. The point in the program where there is an unusual interruption
of this flow may signal the source of a bug
d. Product-Environment Relation
2. An environment is the totality of all conditions and influences which act from
outside upon the product
3. It is essential for the maintenance personnel to know not only the nature but
the extent of the relation.
4. This knowledge can be used to predict how changes in these elements will
affect the product in general and the underlying programs in particular
e. Decision-Support Features
Software Maintenance 21
3. The maintainability of the system may be used as an indicator of its quality.
A. Managers
B. Analyst
Software Maintenance 22
determining the functional and non-functional requirements.
to establish the relationship between the system and the elements of its
environment.
4. Prior to implementing the change, the analyst needs to have a global view of
the system.
6. analysts do not need the local view - a picture of localized parts of the system
and how they are implemented.
C. Designers
1. The design process of a software system can take place at two levels:
go through the existing source code to get a rough idea of the size of the job,
the areas of the system that will be affected, and the knowledge and skills that
will be needed by the programming team that does the job
Software Maintenance 23
D. Programmers
Software Maintenance 24
Mental Models: Key Points
What is a mental model?
The complexity and accuracy of the model depends on the user's information
needs.
Doesn't need to be complete, but should convey key information about the
target system.
Software Maintenance 25
For software, should at least embody the software's functionality.
In essence, a mental model is a tool that helps us make sense of the world
around us. It allows us to predict, explain, and interact with complex systems.
Top-Down Model
Software Maintenance 26
3. The cognitive structure and cognitive process of a mental model resulting
from a top-down strategy can be explained in terms of a design metaphor.
5. Composition entails mapping what the program does in the problem domain,
into a collection of computer instructions of how it works in the programming
domain, using a programming language.
3. The high-level structures are then chunked together into even bigger
structures in a repetitive bottom up fashion until the program is understood.
Software Maintenance 27
The main weaknesses of both the top-down and bottom-up comprehension
strategies are:
1. failure to take into consideration the contribution that other factors such as the
available support tools make to understanding.
2. the fact that the process of understanding a program rarely takes place in
such a well-defined fashion as these models portray. On the contrary,
programmers tend to take advantage of any clues they come across in an
opportunistic way.
Opportunistic Model
1. When using this model the understander makes use of both bottom-up and
top-down strategies, although not simultaneously.
Software Maintenance 28
A mental model: This expresses the programmer's current understanding of
the target program.
4. This information then triggers the invocation of appropriate plans from the
knowledge base to enable them to form a mental model of the program to be
understood
2. Implementation Issues:
Specific Factors:
Software Maintenance 29
Decomposition Mechanism: Well-structured modularity enhances
understanding.
3. Naming Style:
Possible Reasons:
4. Comments:
Types:
In-line comments: Explain specific code sections and how they achieve
goals.
Software Maintenance 30
Key Point: The quality of comments matters more than simply their presence
or absence. Comments should provide useful, additional information.
5. Decomposition Mechanism:
6. Documentation:
Types:
Techniques:
Software Maintenance 31
Spacing: Using blank lines and white spaces to separate code segments
and comments.
Boxing & Shading: Highlighting key aspects and relationships within the
code.
Examples:
9. Evolving Requirements:
Reality: Requirements are dynamic, not static, and evolve throughout the
software lifecycle.
Solutions:
Vision: Develop a vision for how requirements will evolve to handle change
effectively.
Software Maintenance 32
Implications of Comprehension Theories and Studies
No Single Best Strategy: There is no definitive best program understanding
strategy.
Knowledge acquisition
Design Principles
Software Maintenance 33
Design Implications: Understanding comprehension processes informs
design choices, including:
Documentation standards
UNIT 2
Reverse engineering -
The process of analyzing a subject system to:
Software Maintenance 34
Understand a software system in terms of its functionality, implementation,
and architecture.
Objectives:
Provide alternative views of the system (data flow, control flow, entity-
relationship diagrams).
Software Maintenance 35
Identify logic and data flow problems that could lead to unexpected
behavior.
Reduce time spent on understanding the system, allowing faster and more
efficient maintenance.
Levels of RE
Software Maintenance 36
1. Redocumentation
Goals:
Purpose: Helps maintainers and developers better understand and work with
the system by improving or providing documentation.
2. Design Recovery
Goals:
Software Maintenance 37
1. Recover meaningful higher-level design abstractions.
2. The resulting design can be used for future system modifications or for
developing similar applications.
Approaches:
Examples:
The design can be reused for other non-identical systems like building a
spell checker from an existing word processor.
3. Specification Recovery
Representation:
Software Maintenance 38
Benefits:
Software Maintenance 39
Supporting technique:
1. Forward Engineering
2. Restructuring
Focuses on improving the physical state of the code in line with a given
standard.
Types of Restructuring:
1. Control-flow-driven restructuring:
2. Efficiency-driven restructuring:
3. Adaption-driven restructuring:
Software Maintenance 40
Besides source code, other system representations like requirements
specifications, data models, and design plans can also be restructured.
Tools: Some automatic restructuring tools exist, though fully automating the
process is challenging.
3. Reengineering
1. Encapsulation
2. Transformation
3. Normalization
4. Interpretation
5. Abstraction
Applications of SCORE/RM:
Software Maintenance 41
2. Supports retrospective specification of a system based on available
source code.
Corrective Change:
Adaptive/Perfective Change:
This helps in understanding where new requirements fit and how they
relate to existing components.
Preventive Change:
2. Software Reuse
Software Maintenance 42
Definition:
Component Reuse:
Practical Use:
Practical Applications:
These techniques have been used to manage very large and complex
software systems in different organizations.
It's essentially taking something you've already built and using it again.
Reusability
Software Maintenance 43
Benefits of Reuse:
Testability: Components that are easily testable and have comprehensive test
cases facilitate confidence in their reuse.
Software Maintenance 44
Improved Maintainability: Reusing well-defined components makes
codebases easier to understand and maintain, ultimately leading to a more
maintainable system.
Reduce Development Time & Effort: Reusing existing code, designs, and
knowledge eliminates the need to start from scratch for every project.
2. Increase Quality:
Software Maintenance 45
Focus on Portability: The goal is to create code that can be readily used in
various settings with minimal modifications.
Reuse Benefits:
Challenges & Success:
Benefits of Reuse:
1. Reduction in Maintenance Time & Effort:
Reduced Learning Curve: Familiarity with reused code over time leads to a
faster learning curve for developers.
2. Improved Maintainability:
Software Maintenance 46
Approaches to Reuse
Two Main Approaches:
1. Composition-Based Reuse:
2. Generation-Based Reuse:
Software Maintenance 47
Types of transformation: Step-wise refinement, linguistic transformation.
Domain Analysis
Types of Reuse:
Domain Analysis:
Software Maintenance 48
Advantages of Domain Analysis:
Components Engineering
Composition-Based Reuse:
Software Maintenance 49
Two Approaches:
Strong Design: Apply principles that promote both evolvability and reuse.
Balance: Achieve the right balance between broad applicability and actual
benefit.
Software Maintenance 50
2. Reverse Engineering:
3. Components-Based Processes:
Reasons:
Software Maintenance 51
Propositions: Several models have been proposed to address this.
Steps:
Software Maintenance 52
Multi-project View: Encourages reuse across projects.
6. Applicability to Maintenance:
Integrate a reuse model (like Kang's) without discarding the current model.
Software Maintenance 53
Programming Languages: Using multiple languages hinders component
reuse. Solution: Mandate a single language for projects.
"Not Invented Here" Factor: Software engineers often prefer to develop their
own code. Solution: Foster a culture that values and encourages reuse.
Software Maintenance 54
2 Control:
Key Principle: "You cannot control what you cannot measure." (DeMarco)
3 Assessment:
Examples:
4 Improvement:
5 Prediction:
Examples:
Example Measures:
1. Size
Software Maintenance 55
Definition: Number of program lines excluding comments and blank lines.
Formula:
LOC = Total program lines- Comment lines - Blank lines
2. Complexity
Formula: v(F) = e - n + 2
where:
Software Maintenance 56
Definition: Evaluates the effort required to understand and modify a
program.
E = program effort
3. Quality in General
4. Product Quality
Software Maintenance 57
Higher number indicates potential quality issues.
5. Process Quality
6. Understandability
Measured using:
Documentation quality
7. Maintainability
Measured using:
8. Cost Estimation
Methods:
Software Maintenance 58
Mathematical Models: (COCOMO, COCOMO II) which consider various
cost drivers.
Clarity is Key: Clearly define what you want to achieve with the measures.
2. Personnel Involvement:
Purposeful Use: Ensure measures are used for their intended purpose,
avoiding misuse or misinterpretation.
Avoid Punitive Application: People should feel measures are for improvement,
not punishment.
3. Ease of Use:
Additional Notes:
Low Implementation Cost: Weigh the value of the measures against the cost
of implementing them.
Software Maintenance 59
UNIT 3 CONFIGURATION MANAGEMENT
Change Control:
Software Maintenance 60
Documentation:
Starts when the system need is conceived and continues until the system is
decommissioned.
Software Maintenance 61
Alternative Documentation Classification (Macro's Scheme):
Software Maintenance 62
Maintenance Manuals: Detail functional specifications, design, code, test
data, and results. This classification is largely equivalent to the user/system
documentation scheme.
User Guidance: Serves as the primary system introduction for users. Provides
system capabilities description, installation/customization instructions, and
malfunction handling information.
Software Maintenance 63
System Complement: Integral part of the software system. Essential for
ensuring the software meets requirements and is maintainable.
Software Maintenance 64
Organizing maintenance tasks for productivity, cost control, and high-
quality system delivery (depending on organizational modes).
Software Maintenance 65
Maintenance Team Structures:
I. Maintenance Team Structure and Productivity:
Software Maintenance 66
Raise Awareness: Improve understanding of maintenance processes, the
differences between development and maintenance, and the critical role of
maintenance in organizational success. This is crucial for both managers
and programmers.
Organisational Modes
I. Combined Development and Maintenance: This approach integrates
development and maintenance responsibilities within the same team or
organizational unit. Several sub-approaches are detailed:
A. Module Ownership:
Software Maintenance 67
Disadvantages: Lacks overall system-level responsibility, potential for
uneven workload distribution, difficulties in handling enhancements due to
unknown dependencies between modules, and challenges in enforcing
consistent coding standards across the entire system.
B. Change Ownership:
C. Work-Type (W-Type):
D. Application-Type (A-Type):
Software Maintenance 68
Mechanism: Maintenance activities are handled by a dedicated department
distinct from the development department.
UNIT 4
I. Software Quality and Maintainability:
Standards (e.g., IEEE 1219-1993, TICKIT) are important for ensuring quality and
maintainability throughout the software lifecycle.
Software Maintenance 69
A. Fitness for Purpose: The system meets its specified requirements. Hard
(measurable) requirements are crucial for evaluating changes and determining
effective solutions. Vague requirements hinder maintainability.
Software Maintenance 70
complex and time-consuming to use. C is considered a borderline case, closer
to assembly language than a typical 3GL.
Characteristics:
Easier debugging.
Automated documentation.
Software Maintenance 71
Increased Productivity: Faster implementation of changes due to
conciseness.
Overhyped Ease of Use: While simpler than 3GLs, 4GLs still require some
programming knowledge; ease of use can lead to poorly designed,
unmaintainable code.
Poor Design Potential: Ease of use can lead to poorly designed and
documented systems if used by individuals lacking software engineering
expertise or understanding of the business problem.
Software Maintenance 72
Emergence of Object-Oriented Programming (OOP): Developed to handle the
complexity of large, dynamic systems (air traffic control, airline reservations,
etc.). Addresses the limitations of procedural approaches for large-scale
software development and maintenance. Procedural programming remains
relevant within the context of OOP for smaller, well-defined components.
Decomposition Approaches:
Objects and Classes: The real world is modeled as a set of objects with
attributes (characteristics) and operations (actions). Objects with similar
attributes belong to a class; each object is an instance of its class.
Software Maintenance 73
Smaller Systems: Code reuse through common mechanisms leads to smaller,
more manageable systems.
Resilience to Change: OOP systems are more easily adaptable and evolvable.
Education and Training: Insufficient training and education on OOP in the past
hampered widespread adoption. Retraining existing personnel is expensive
and time-consuming.
Language Selection: Choosing the right OOP language is crucial but can be
risky before the paradigm is fully established.
Approaches:
Rewrite: Starting from scratch with an OOP approach (suitable only for
small systems).
Software Maintenance 74
MAINTENANCE TOOLS
Prior Manual Verification: Any technique automated by the tool should first be
proven functional without automation. Automation won't fix inherently flawed
methods.
II. Features:
Beyond Basic Functionality: The tool should offer features beyond the core
task, similar to how a word processor includes spell check, thesaurus, etc.
Consider the required features and rate their importance.
Hardware and Software: Ensure the tool is compatible with the organization's
existing hardware and software infrastructure (e.g., IBM mainframes, PCs,
Unix/Linux).
Software Maintenance 75
Paradigm Shifts: In the event of migrating to a new programming paradigm
(e.g., object-oriented), ensure the tool supports the target language.
Usability Testing: Consider user training and the potential learning curve.
Integration with Other Tools: Prioritize tools that can be integrated with other
software tools from different vendors for flexibility and extensibility.
Avoid Vendor Lock-in: Avoid proprietary tools that restrict integration and limit
choices.
Open Architecture Mitigation: This concern is less critical if the tool has an
open architecture, allowing for easier switching to alternative solutions.
Work Patterns and Processes: The tool should align with the organization's
existing workflow and culture to maximize adoption and minimize disruption.
Consider user training and integration within existing processes.
Taxonomy of Tools
I. Program Understanding and Reverse Engineering Tools: These tools help you
grasp how existing software works:
Program Slicer: Shows you only the code parts affecting a specific variable.
Like zooming in on a relevant section.
Static Analyzer: Examines the code without running it, providing an overview
of its structure (modules, functions, variables). Think of it as a code map.
Software Maintenance 76
Dynamic Analyzer: Watches the code while it runs, showing you what paths
the program takes. Like tracking a car's route.
Data Flow Analyzer: Traces where data goes in the code, crucial for seeing
how changes might affect other parts. Like tracing a river's path.
Transformation Tool: Converts code from one format to another (like text to a
diagram), making it easier to understand.
Test Path Generator: Figures out all the possible ways your code could run,
making sure you test all scenarios.
Other Utilities: Basic file management tools ( ls , dir , find ) also help organize
the project's files.
Complexity Assessment Tools: Tools that measure how complicated the code
is, helping to find areas that are more prone to bugs.
Software Maintenance 77