D0430a - Week 2
D0430a - Week 2
Reengineering
CSC-444
MODULARIZATION
WEEK 2
Content
To explain basic concept of Modularization
To describe the challenges of software modularization
2
Modularization
Understanding the structure of the software is crucial
for comprehension of the software system, as it provides
developers with higher-level structural information about
the numerous software components, their interfaces,
and their interconnections which is very important for
software comprehension.
4
Aim of Modularization
Knowing the software architecture, software
developers can perform fit-gap analysis and
estimate the costs and risks of the required
changes, and
Also will be able to determine which
components can be reused.
For large and complex software systems, the
software modularization is not simple, owing to
a large number of interactions between
different artifacts, and the large size of the
source code.
5
Challenges of Software
Modularization
The question that comes to mind is, can we
extract subsystems directly and automatically
from the source code without the intervention of
designers?
The simple answer to this question is “yes we
can”.
Important and fundamental facts about software
systems can be extracted from the source code.
6
Challenges of Software
Modularization
Graphs are generally used to improve the
comprehensibility of complex software systems,
in which nodes represent the artifacts of the
software system and their interactions are
represented by edges.
One well known type of graph used to
represent software artifacts is called the artifact
dependency graph (ADG), and is depicted in Fig.
Each partition of this graph can be considered
as a modularization of the software’s artifacts.
The final goal is to partition an ADG into
meaningful subsystems.
7
88
8
Challenges of Software
Modularization
The general problem of graph-partitioning
methods (of which software modularization is a
special case) is based on large graphs; thus, we
need an efficient way to create precise graphs.
Graph modularization is an NP-Complete problem
since if we want to modularize a graph with n
nodes into m modules, the number of possible
states grows exponentially in relation to n.
Among all possible ways, we consider only ways
in which meaningful subsystems are achieved
since even for small graphs the number of
possible partitions is too high.
9
Challenges of Software
Modularization
Moreover, a small difference between two
partitions may lead to very different results. For
example, consider the ADG in Fig. 1.1; the two
partitions of the ADG shown in Figs. 1.2 and 1.3
are very similar, i.e., only two nodes have been
exchanged.
Despite these apparently small differences, the
second partition (Fig. 1.3) provides better
results, since it has placed a larger number of
seemingly related nodes in a module.
10
Challenges of Software
Modularization
In other words, related artifacts are placed in
the same module.
Therefore, we need a technique which quickly
filters out meaningless and unacceptable
partitions and only finds ways that lead to
meaningful partitions.
11
Challenges of Software
Modularization
From a domain expert’s point of view, cohesion
(i.e., connections between artefacts within the
same module) and coupling (i.e., connections
between artifacts in different modules) are two
properties that have a great impact on some
critical software quality attributes, such as
maintainability, reliability, portability,
reusability, operability, flexibility and testability
12
Challenges of Software
Modularization
The management of cohesion and coupling is
of critical importance for system design and
cost reduction.
For example, Fig. 1.4 presents a partition with
three modules, Cluster 1 to Cluster 3 of an ADG
with eight nodes, N1 to N8. Edges C1;C2; C5; C6
and C7–C9 indicate cohesion, while edges
C3;C4;C10, and C11 indicate coupling.
Therefore, cohesion, and
coupling are used to determine
the quality of the extracted
software architecture.
13
Challenges of Software
Modularization
One of the main challenges in obtaining a high
quality reconstruction of a system architecture
is to find a partitioning that allows low coupling
and high cohesion between the subsystems.
14
Challenges of Software
Modularization
During the modularization process, each artifact in
an ADG should be assigned to a subsystem.
However, a system might have a few artifacts that
do not seem to belong to any particular subsystem,
but rather belong to several subsystems.
These artifacts have been called “omnipresent”,
because they either use or are used by a large
number of artifacts in the system.
For example, in a C program, it may not make
sense to assign “stdio.h” to any particular
subsystem, especially if a large number of
subsystems perform I/O operations.
One solution for this problem is to isolate all driver
artifacts in one subsystem and all library artifacts
in another subsystem.
15
Challenges of Software
Modularization
During the software maintenance process, the
structure of a software system inevitably
changes.
For example, a new artifact is introduced, an
old artifact is replaced, inter-module relations
are added or deleted, etc.
As a result of such process, orphan artifact
may appear.
An orphan artifact is either a new artifact that
is being integrated into the system, or an
artifact that went to structural changes.
16
Challenges of Software
Modularization
Sometimes users require the modularization
process to follow their logic and preferences.
For example, a user may wish to determine the
number of modules before the modularization
process is started, or place two classes or
artifacts that are conceptually very similar in
the same module.
Under such circumstances, meaningful
partitioning of the dependency graph of the
artifacts is certainly more difficult.
17