Software Design Methodology 255
y Scenario 7. To operate interactively on the input: to allow the user to insert
and delete lines from the original list of lines.
y Scenario 8. To operate interactively on the output: to allow the user to insert
and delete lines from the circular shifted lists.
Whether a scenario is to be used in the SAAM analysis depends on whether
the scenario is considered as important.
Figure 10.3 Quality concerns of KWIC
10.2.2 Description of candidate architecture
The candidate architecture or architectures should be described in an architectural
notation that is well understood by the parties involved in the analysis. These
architectural descriptions must indicate the system’s computation and data
components as well as all relevant connections. Accompanying this description of
the architecture is a description of how the system behaves over time, or a more
dynamic representation of the architecture. This may take the form of a natural
language specification of the overall behaviour or some other more formal and
structured specification.
The KWIC Index System: Quality Concerns
The software that calculates keywords in context should also be
efficient in both space and time. Its components should serve as
reusable entities. It should be able to support the following changes in
the future.
1. Changes in the processing algorithm: For example, line shifting
can be performed on each line as it is read from the input device,
on all the lines after they are read, or on demand when the
alphabetisation requires a new set of shifted lines.
2. Changes in data representation: For example, lines, words, and
characters can be stored in various ways. Similarly, circular shifts
can be stored explicitly or implicitly (as pairs of index and
3. Enhancement to system function: For example, modify the system to
eliminate circular shifts that start with certain noise words (such as
a, an, and, etc.), change the systems to be interactive, and allow the
user to delete lines from the original lists (or from the circular
shifted lists).
256 Chapter 9. Analysis and Evaluation of Modifiability: The SAAM Method
For the KWIC index system, four architectural designs have been proposed in
the literature and investigated by Mary Shaw and David Garlan in their case
studies. Here, we use two of them, the shared data architecture and the abstract data
type architecture, as the examples to illustrate the subsequent analysis activities.
The architectural design of the KWIC index system in the
main-program-subroutine with shared data style is depicted in Figure 10.4. It
decomposes the system according to the four basic functions performed by the
system: input, shift, alphabetise and output. These computational components are
coordinated as subroutines by a main program that sequences through them in turn.
Data is communicated between the components through shared storage (‘core
storage’). Communication between the computational components and the shared
data is an unconstrained read-write protocol. This is possible because the
coordinating program guarantees sequential access to the data.
Figure 10.4 Design of KWIC in shared-memory architecture
This solution allows data to be represented efficiently, since computations can
share the same storage. The original input of the sequence of lines of characters is
stored in the shared data storage Characters. A circular shift of a line is represented
by a pair of indexes <line, character> and stored in the data storage Index. For
each pair of indexes <line, character>, the line is an integer that gives the position
of the first character of the line in the data storage Characters. The character is an
integer that gives the position of the first character of the shifted line. This
representation avoids the duplication of all the characters in the original input.
Alphabetised Index is an array of integers. Each integer points to a circular shifted
line in the Index. The solution also has a certain intuitive appeal, since distinct
computational aspects are isolated in different modules.
However, as Parnas argued, it has a number of serious drawbacks in terms of
its ability to handle changes. In particular, a change in the data storage format will
KWIC Index System: Architectural Design
in the Main-Program-Subroutine with Shared Data Style
Master Control
Index Alphabetised Index
Input Circular Shift Alphabetise Output

Get Software Design Methodology now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.