Software and Program Design: Part Three
Software and Program Design: Part Three
Software and Program Design: Part Three
Contents
1. Software Design
2. Program Design
To describe the process of software design where informal ideas are transported to
detailed implementation descriptions.
To introduce the different stages in the design process including architectural design,
interface design and data structure design.
To describe design quality attributes such as cohesion, coupling and understandability
and adaptability.
To develop an example which illustrate the process of object-oriented design.
Develop creativity and good study habits.
The design process involves developing several models of the system at different levels
of abstraction. As a design is decomposed, errors and omissions in earlier stages are discovered.
Figure 3.1.1 is a generic model of the design process and the design descriptions produced at
different stages of design. It also suggests that the stages of the design process are sequential. In
fact, design process activities processes activities precede in parallel. However, the activities
shown are all part of the design process for large software systems.
Requirements
Specification
47
The design activities are:
1. Architectural design. The sub-systems making up the system and their relationships
are identified and documented.
2. Abstract specification. For each sub-system, and abstract specification of the services
it provides and the constraints under which it must operate is produced.
3. Interface design. For each sub-system, its interface with other sub-systems is
designed and documented.
4. Component design. Services are allocated to different components and the interfaces
of these components are designed.
5. Data structure design. The data structured used in the system implementation are
designed in detail and specified.
6. Algorithm design. The algorithms used to provide services are designed in detail and
specified.
This process is repeated for each sub-system until the components identified can be
mapped directly into language components such as packages, procedures or functions.
Design strategies
1. Functional design. The system is designed from a functional viewpoint, starting with
a high-level and progressively refining this into a more detailed design.
2. Object-oriented design. The system is viewed as a collection of objects rather than as
functions.
Design quality
Cohesion
1. Coincidental cohesion. The parts of a component are not related but simply
bundled in to single components.
2. Logical association. Components that perform similar functions such as input,
error handling and so on are put together in single components.
3. Temporal cohesion. All of the component make up a single time, such as start
up or shut down, are brought together.
48
4. Procedural cohesion. The elements in a component make up a single control
sequence.
5. Sequential cohesion. The output from one element in the component serves as
input for some or produces the same output data.
6. Functional cohesion. Each part of the component is necessary for the
execution of a single function.
Coupling
Understandability
The term “complexity” is used in an intuitive way. High complexity implies many
relationships between different parts of the design components and deeply nested if-then-
else statement. Complexity measures can only provide an indicator to the understanding
of a component.
Adaptability
Object-oriented design
1. Object are abstraction of real-world or system entities which are responsible for
managing their own private state and offering services to other objects.
2. Objects are independent entities that may readily be change because state and
representation information is held within the object. Changes to the representation may
be made without reference to other system objects.
Software Engineering | For CICT Classroom Use Only
49
3. System functionality is expressed in terms of operation or services associated with each
object.
4. Shared data areas are eliminated. Objects communicate be calling on service offered by
other objects rather than sharing variables. This reduce overall system coupling.
5. Objects may be distributed and may execute either sequential or on parallel.
The user interface of a system is often the yardstick by which that system is judge. An
interface which is difficult to use will, at beast, result in a high level of user errors. At worst, it
will cause the software system to discarded, irrespective of its functionality.
Graphical user interface are familiar to most readers. They are available in all PCs; Apply
computers and UNIX workstations. Figure 3.1.2 shows the principal characteristics of this type
of interface.
Table 3.1.1
The characteristics of graphical user interface.
Characteristics Description
Windows Multiple windows allow different information to be
displayed simultaneously on the user’s screen.
Icons Icons represent different types of information. On some
system, icons represent files; on other, icons represent
process.
Menus Commands are selected from a menu rather than typed in
a command language.
Pointing A pointing device such as a mouse is used for selecting
choices from a menu or indicating items of interest is a
window.
Graphics Graphical elements can be mixed with text on the same
display.
50
They are relatively easy to learn and use
The user has multiple screens (windows) for system interaction. Switching from one task
to another is possible without losing sight of information generated during the first task.
Fast, full-screen interaction is possible with immediate access to anywhere on the screen.
User interface design principles
User interface design must take into account the needs, experience and capabilities of the
system user. Potential users should be involved in the design process. It is impossible to judge
user interface from an abstract description. Human capabilities are the basis for the design
guidelines. These are general principles which are applicable to all user interface designs.
Characteristics of GUIs:
User familiarity. The interface should use terms and concepts which are drawn from the
experiences of the anticipated class of user.
Consistency. The interface should be consistent in that comparable operation should be
activated in the same way.
Minimal surprises. User should never be surprised by the behavior of the system.
Recoverability. The interface should include mechanism to allow users to recover.
User guide. The interface should incorporate some form of context-sensitive user
guidance and assistance.
Information presentation
All interactive systems have to provide some way of presenting information to users. It is
a good designer practice to keep the software required for information presentation separate from
the information itself. By separating the presentation system from the data, the presentation on
the user’s screen can be change without having to change the underlying computational system.
In deciding how to present information, the designer must take a number of factors into
account:
1. Is the user interested is precise information or in the relationships between different data
value?
2. How quickly do the information values change? Should the change in a value be
indicated immediately to the user?
3. Must the user take some action in response to a change in information?
4. Does the user need to interact with the displayed information via a direct manipulation of
interface?
5. Is the information to be displayed textual or number? Are relative values of information
items important?
Data visualization
51
Very large amounts of information must usually be visualized graphically if they
are to be meaningful. This presentation may be used to navigate through the information
or may be a way of exposing relationships which are not obvious from the raw data.
Colors give the user interface designer an extra dimension which can be exploited
in the display of complex information structure. In some cases, system complexity is so
high that, without color, the display is incomprehensible. In other case, color may be used
to draw the operator’s attention to important events which have been detected be the
software.
1. Limit the number of colors used and be conservative how these are used. No more
than four or five separate color should be used in a window and no more than
seven in a system interface. Color should be used selectively and consistently. It
should not simply used to brighten up an interface.
2. Use color change to slow a change in a system status. If a display changes color,
this should mean that a significant event has occurred. Color highlighting is
particularly important in complex displays where hundreds of distinct entities may
be displayed.
52
3. Use color coding to support the task which users are trying to perform. If they
have to identify anomalous instances, highlight these instances; if similarities are
also to discovered, highlight these using different color.
4. Be careful about paring. Because of the physiology of the eye, people cannot
focus on red and blue simultaneously. Other color combination may be visually
disturbing or difficult to read.
User guidance
A design principle suggested in the previous section was that user interface should
always provide some form of on-line help system. Help systems are one facet of a general part of
user interface design, namely the provision of user guidance which covers three areas:
Managers must allow sufficient writers and graphic artist in the process. When designing
error messages or help text, the factors shown in figure 2.3.2 should be taken into account:
Table 3.1.2
Design factors in message wording.
Factors Description
Context The user guidance system should be aware of what the user is doing
and should adjust the output message to the current context.
Experience The user guidance system should provide both types of messages and
allow the user to control messages conciseness.
Skill Level Messages should be tailored to the user’s skill as well as their
experiences.
Style Messages should be positive rather than negative.
Culture Wherever possible, the designer of messages should be familiar with
the culture where the system is sold.
Error Messages
The first impression which users may have of a software system is the system error
messages, inexperienced users may start work, make an initial error and immediately have to
understand the resulting error messages.
Error messages should always be polite, concise, consistent and constrictive. They must
not abuse and should not have associated beeps or other noise which might embarrass the user.
53
Design quality is extremely important; the better the design, the less likely we are
required major changes later in development. Thus, we investigate techniques for evaluating and
improving a design.
Program design is the definition of modules and intermodular interfaces so each module
of the system design corresponds to a new set of modules containing program specifications.
Program specification for a module, they are instructions to a programmer that describes
the input, output, and processing to be performed by the module.
Specifications are technical and detailed. They reference specific data formats and
describes the steps of any algorithms to be used.
Detailed algorithms
Data representations and structures
Relationships among the functions performed and the data used
Each module can then be coded as a procedure, a subroutine, a function, or some type of
nameable object.
Design guidelines
Our first consideration is whether to examine the system modules from most general to
more detailed, to begin with detailed modules and work up to the more general, or to use some
combination of both.
Top-down approach
Top down approach analyze and examine all modules but first translates higher
levels to more concrete program specifications before descending to lower levels. At any
point, only data and control information and structures necessary for a module are
defined. The details of the design at lower levels remain hidden.
Bottom-up approach
By starting with the lowest level, we identify common functions that can be used
by many of the higher-level modules.
54
to identify quickly the affected modules; independence assures us that revising only those
modules will implement the changes.
Design tools
Tools are design aids are available to help us with our design. Some of the tools describe
can be used throughout all of system development.
Flow charts
Figure 3.2.1 shows the building blocks used to construct flow diagrams. In any
flow diagram, each process block or decision point is accompanied by a written
description of the process or decision.
55
Pseudocode
Structured English
There are many kinds of Pseudocode, some more formal than other. Structured
English often uses universal constructs; that is, it does not always use constructs specific
to a particular programming language.
PDL
Design quality
Accomplishing any design tool or method is a set of rules about how to use it to generate
a high-quality design.
Structured Design
The design guidelines express at the beginning help us to increase our design’s
quality. In general, the more structured a design, the easier it is to understand, to
implement, and to maintain. Positive results have been noted many times in various
writings. A well-structured design has the following characteristics.
1. It is composed of modules that are highly cohesive.
2. There is a low degree of coupling among modules.
3. Each module has a single entry and single exit.
56
A structured design helps us to avoid errors, since it encourages us to consider all
cases, reduces complexity where it can, and make the tracking and eventual elimination
of error easier.
o Error Detection
o Defensive Designing
o Error Correction
o Error Tolerance
57
EVALUATION
1. Suggest how color might be used to improve the interface of an application system which
you use.
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
58
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
2. Form your own point of view, what do you understand by the term cohesion, coupling
and adaptability.
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
Software Engineering | For CICT Classroom Use Only
59
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
3. What factors have to be taken into account when designing a menu based interface for
‘walk-up’ system such as bank ATM machine? Explain your answer.
60
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
61
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
______________________________________________________________________________
___________________
62