Lecture 5 - Modifiability
Lecture 5 - Modifiability
Software Architectures
Introduction to Modifiability
Today
• Definition of Modifiability
• Modifiability Quality Attribute Scenarios
• Analyzing Modifiability
• Modifiability Tactics
© Matthew Bass 2
1
17/08/2025
Modifiability
• Very few systems are done after the initial release
• It’s common for changes to happen over time
• These changes occur for a variety of reasons:
• Bug fixes
• New capabilities are released
• The software is customized for a given context
• Technology has evolved and the system is changed to accommodate
the evolution
• …
© Matthew Bass 3
Bug Fixes
• After the initial system release bugs are almost always
discovered
• If you look at your iPhone/Android I suspect you’ll have outstanding
updates to apply
• How often do you get “Windows Updates” or do you need to update
“Flash”
• These are mostly patches to fix defects or bugs
• The system needs to be able to accommodate these patches
© Matthew Bass 4
2
17/08/2025
New Capabilities
• We see this in many different ways
• Released systems often evolve to increase the capabilities
• Sometimes this comes in the form of an “enhancement request”
• Sometimes this could be the next version of the system or software
• Sometimes the software evolves on a continuous basis
• We may also need to be able to accommodate multiple
versions of the product
• As with the cell phone or infotainment example
© Matthew Bass 5
Customized System
• Many systems need customization for multiple
deployments/contexts
• These customizations might include:
• Varying feature sets
• Changing the systemic properties
• Changing the underlying platform (hardware/OS/data
base/ect)
• Change the implementation of some existing capability
© Matthew Bass 6
3
17/08/2025
Evolving Technology
• Technology changes regularly
• Often for the same reason your systems evolve
• Sometimes these changes are small and benign
• Sometimes they can be disruptive
• Our systems often need to be able to accommodate these technological changes
• These changes can include:
• New version of the hardware
• OS
• Middleware
• Database
• Language
• …
© Matthew Bass 7
Related Concerns
• There are many concerns that are related to modifiability:
• Maintainability
• Extensibility
• Portability
• Variability
• …
• These are essentially the same concern, however
• They are all come down to the “cost of change”
© Matthew Bass 8
4
17/08/2025
Is My System Modifiable?
• The question is not: “is my system modifiable”?
• The answer is always “yes” – with respect to some change
• The question is also not: “can I make some change to my system”?
• You can change anything on any system - given unlimited budget and unlimited
schedule …
© Matthew Bass 9
What Is Modifiability
• With modifiability the key question is not “if”, but “how
much?”
• Modifiability is about the “cost of change”
• The relevant aspects of modifiability include:
• What will change?
• When will the change take place?
• How much time/effort can the change require?
© Matthew Bass 10
5
17/08/2025
© Matthew Bass 11
When?
• These changes could take place at different times in the
product life cycle
• These include:
• Design time changes
• Compile time changes
• Run time changes
• Again, each of these relies on different mechanisms in the
system
© Matthew Bass 12
6
17/08/2025
Cost
• We think of cost as being only monetary
• This is the majority of the concern with software as well
• With software development cost is often equated to staff time
• We might also be worried about calendar time, however
• This is true if we have a hard date (e.g. the Xmas sales cycle) that we
need to achieve
• With modifiability we typically articulate cost as staff time,
calendar time, or both
© Matthew Bass 13
Today
• Definition of Modifiability
• Modifiability Quality Attribute Scenarios
• Analyzing Modifiability
• Modifiability Tactics
© Matthew Bass 14
7
17/08/2025
Environment Runtime, compile time, build time, initiation time, design time
© Matthew Bass 15
Stimulus
• The stimulus describes the change to be made to the system
• The change can be any aspect of the system
• Functionality
• Quality attribute
• Technology
• Capacity
• These changes can be things like bug fixes or enhancements
• Other terms like “maintainability” or “flexibility” are essentially the
same as modifiability
© Matthew Bass 16
8
17/08/2025
Artifact
• The artifact specifies what will have to accommodate the
change
• Remember we don’t want to embed design decisions in the
requirement
• If you’ve not already decomposed the system this will be “the system”
• The perspective of the artifact (static or dynamic) should align
with the environment
• In this case the environment defines when the change will be made
© Matthew Bass 17
Environment
• This specifies when the change will be made
• Changes can be made at:
• Design time
• Compile time
• Build time
• Initiation time
• Runtime
© Matthew Bass 18
9
17/08/2025
Response
• Essentially this will describe what it means to accommodate
the change
• These could include:
• Make the change
• Test the change
• Deploy the change
• The response should align with what you need to be able to
do within the allotted cost/impact specified in the measure
© Matthew Bass 19
Response Measure
• The responses take time and cost money
• The time/cost is what differentiates a system that modifiable
enough from one that’s not
• Measures can include:
• Staff time
• Calendar time
• Direct cost
• Impact to existing system
© Matthew Bass 20
10
17/08/2025
Today
• Definition of Modifiability
• Modifiability Quality Attribute Scenarios
• Analyzing Modifiability
• Modifiability Tactics
© Matthew Bass 21
Analyzing Modifiability
• The way we analyze a system is going to depend on the concern we are
analyzing
• With modifiability we can separate run time changes from static changes
• With run time changes we are typically worried about things like:
• Impact on existing capability
• Faults introduced
• Time until system becomes operational
• We’ll talk about these in a couple of minutes
© Matthew Bass 22
11
17/08/2025
Static Modifications
• The more common modifiability concern is how much
time/effort is involved with a static change to the system
• In many ways analyzing effort required to make a change is
not any different from estimate construction effort
• The architectural aspect is to ensure it’s clear what is involved
in making the change
• If we’re going to change code this requires analyzing the coupling
• If we’re changing the support for a quality attribute things become a
bit more complicated
© Matthew Bass 23
Coupling
• Let’s assume we are going to modify existing code
• We need to look at 2 general kinds of dependencies
• Direct dependencies
• Indirect dependencies
• A dependency can be syntactic and/or semantic
• A syntactic dependency depends on the syntax of the interface
• These are dependencies that can be caught by a compiler
• A semantic dependency is a dependency based on meaning
• These can not typically be caught by a compiler
© Matthew Bass 24
12
17/08/2025
A B C D
© Matthew Bass 25
Code Module
A B C D
Uses
© Matthew Bass 26
13
17/08/2025
© Matthew Bass 27
© Matthew Bass 28
14
17/08/2025
Estimating Effort
• Estimating effort is no different than estimating time to construct some
portion of the system
• We can use “top down” techniques such as
• Function point analysis
• We are in a position to consider “bottom up” techniques as well
• This is where we look at the actual work involved and estimate effort
• This may require considering the detailed design for some part of the
system
• Depending on how important our estimate is, this might be worthwhile
© Matthew Bass 29
Today
• Definition of Modifiability
• Modifiability Quality Attribute Scenarios
• Analyzing Modifiability
• Modifiability Tactics
© Matthew Bass 30
15
17/08/2025
Modifiability Tactics
• In general there are 4 kinds of things we can do
to decrease the cost of change:
• Reduce module size
• Increase cohesion
• Reduce coupling
• Defer binding time
© Matthew Bass 31
© Matthew Bass 32
16
17/08/2025
Increase Cohesion
• Several tactics involve moving responsibility from one module
to another
• This is done in order to reduce the side effects of making a change
• A side effect is an unintended consequence of making a
change
• If one module has responsibilities that serve multiple
purposes, you might want to relocate some of those
responsibilities
• This will increase the semantic coherence
© Matthew Bass 33
Semantic Coherence
• This means that the responsibilities of a given module are
focused on the same concern
• The idea is that most desired changes are related to a given
set of functional responsibilities
• If you co-locate those responsibilities they will be easier to change
• Can anyone think of a situation where “semantic coherence”
might not be the right partitioning from a modifiability
perspective?
© Matthew Bass 34
17
17/08/2025
Reduce Coupling
• These tactics all reduce coupling between modules
• Encapsulation
• Use an intermediary
• Restrict dependencies
• Refactor
• Abstract common services
© Matthew Bass 35
Encapsulation
• Encapsulation hides data and/or services behind a fixed interface
• The idea is you focus on the variable aspect of the system
• Identify what will change
• Hide the variable aspects behind a fixed interface
• While the implementation will change, the interface won’t
• The dependency was moved from the implementation to the interface
• This means that anything that used to depend on the code (that will change) now
depends on the interface (that will not change)
© Matthew Bass 36
18
17/08/2025
Use An Intermediary
• Using an intermediary breaks a dependency
• Examples of intermediaries are:
• Publish subscribe mechanism
• Message based interaction
• Directory service
• Shared data
• …
• The type of dependency that is reduced depends on the type
of intermediary
© Matthew Bass 37
© Matthew Bass 38
19
17/08/2025
Restrict Dependencies
• This tactic reduces the modules that a given module is
dependent on
• This can be accomplished by:
• Reducing visibility (making an interface “private”)
• Adding authorization (making an interface available to only
“authorized” modules)
• This tactic is realized in several patterns such as:
• Layered system
• Wrapper
© Matthew Bass 39
Example: Layers – 1
• The layered pattern is used to structure applications that can be decomposed into
groups of elements in each of which address a different level of abstraction.
• Elements
• elements are layers and are typically libraries or collections of related services
• specific and related functional responsibilities are assigned to each layer
• Relations
• relationships between layers is often implicit and is usually call-return oriented
© Matthew Bass 40
20
17/08/2025
Example: Layers – 2
• Perspective and view
• code oriented; usually module view, although in practice mixed perspectives are
often and incorrectly utilized
• Topology
• layers are positions adjacent to one another
• relationships between layers are not usually explicitly depicted – this is OK, if the
pattern semantics are adhered to.
Layer A
Layer B
Layer C
© Matthew Bass 41
Example: Layers – 3
• Semantics
• Layers can only call on services of the next lower layer; that is, each layer provides
services to the layer above it and calls on services provided by the layer below it.
• Example properties promoted
• modifiability, portability, reusability
• Example properties inhibited
• performance, size of implementation; that is executable code built using this pattern
will be larger
© Matthew Bass 42
21
17/08/2025
This structure has semantics, properties it promotes and inhibits. Knowing these enables
early analysis of the properties.
Assume that we chose this structure without any analysis and we find out that the system is
too slow,… what can we do?
We can bridge layers,… but what happens to portability?
These decisions are only good or bad depending upon the relative importance of portability
and performance – but without the proper expertise, early analysis is impossible!
© Matthew Bass 43
Refactor
• We often end up in a situation where multiple modules
are affected by the same change
• This occurs when responsibility is duplicated in
multiple modules
• Can easily occur when functionality drives decomposition
• Co-locating these responsibilities can reduce the effort
required to make the change
© Matthew Bass 44
22
17/08/2025
© Matthew Bass 45
© Matthew Bass 46
23
17/08/2025
© Matthew Bass 47
24
17/08/2025
Runtime Binding
• There are many runtime binding mechanisms
• Runtime registration
• Dynamic lookup
• Interpret parameters
• Name servers
• Plug-ins
• Publish subscribe mechanisms
• Polymorphism
• Shared repositories
© Matthew Bass 49
25
17/08/2025
Summary
• When analyzing the “modifiability” of a system we are concerned with
the “cost of change”
• We need to know what will change, when will the change be made, and
how much effort can be involved in making the change
• The effort should align with the needs of the business as they relate to
this system
• You need to be sure to analyze all dependencies, direct and indirect in
order to get a sense for what level of effort is involved
© Matthew Bass 51
26