Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Software and Program Design: Part Three

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

Part Three

Software and Program Design


This part is concerned with various aspects of software design. It
introduces the process of design and covers the important initial phase of
program design. It also describes the complementary design strategies and
principles of user interface design.

Contents
1. Software Design
2. Program Design

Part Three Software and Program Design


Objectives:

 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.

3.1 Software Design


A customer wants to build a new system either because there is no existing system or
because there is a major problem with the old system. The customer’s need forces us to think of
system design in two ways: as a process and as a product. Good design is the key to effective
engineering. Design is the creative process requiring insight and flair on the part of the designer.
It must be practiced and learned by experience and study of existing systems.

Any design problem must be tackled in three stages:


1. Study and understand the problem. The problem should be examined from a number
of different angles or viewpoint as these provide different insights.
2. Identify gross features of at least one possible solution. Designers usually prefer
familiar solutions even if there are not optimal, as they understand their advantages
and disadvantages.
3. Describe each abstraction used in the solution. Errors and omission in high-level
design will probably be discovered during this analysis.

The Design Process

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

Architectural Abstract Interface Component Data Structure Algorithm


Design Specification Design Design Design Design

System Software Interface Component Data Structure Algorithm


Architecture Specification Specification Specification Specification Specification

Figure 3.1.1. A general model of the design process


Software Engineering | For CICT Classroom Use Only

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

Two design strategies may be summarized as follows:

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

The cohesion of a component is a measure of the closeness of the


relationships between its components. A component should implement a single
logical function or should implement a single logical entry.

Constantine and Yourdon (1979) identify seven levels of cohesion in order


of increasing strengths:

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.

Software Engineering | For CICT Classroom Use Only

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

Coupling is related to cohesion. It is indication of the strength of interconnections


between the components in the design. Highly coupled systems have strong
interconnections. Loosely coupled systems are made up of components which are
independent or almost independent.

 Understandability

The understandability of a design is important because anyone changing the


design must first understand it. There are a number of components characteristics that
affect understandability, including:

1. Cohesion and coupling


2. Naming
3. Documentation
4. Complexity

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

The adaptability of a design is a general estimate of how easy it is to change the


design. An adaptable design should have a high level of traceability. For optimum
adaptability, a component should be self-contained. Self-contained components are
components which have no dependence on other, external components.

Object-oriented design

The characteristics of an object-oriented design (OOD) are:

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.

Object-oriented analysis, design and programming are all part of object-oriented


development whereby an object-oriented strategy is used throughout the development process.
However, they are not the same thing:

 Object-oriented analysis. This is concerned with developing an object-oriented model of


the application domain.
 Object-oriented design. It deals with developing an object-oriented model of a software
system to implement the identified requirements.
 Object-oriented programming. This is concerned with realizing a software design using
an object-oriented language.

User interface design

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.

The advantages of GUIs are:


Software Engineering | For CICT Classroom Use Only

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

Software Engineering | For CICT Classroom Use Only

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.

Examples of possible data visualization are:

1. Weather information, gathered from a number of sources, is shown as a weather


map with isobars, weather fronts and so on.
2. The state of a telephone network is displayed graphically in a network
management center.
3. A model of molecules is displayed and manipulated in three dimensional using a
virtual reality system.

 The use of color

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.

Unfortunately, it is easy to misuse color to produce displays that are error-prone


and disturbing to many users. The most common errors made by designers when
incorporating color in a user interface are:

1. Color is used to communicate meaning. A significant number of men are color-


blind and many misinterpret the meaning. Human color perceptions are different
and there are different conventions in different professions about the meaning or
particular color.
2. Too many colors are used in the display and/or the colors are used in
inconsistent ways. If too many colors are used or if the colors are too bright, the
display may be confusing. The mass of the color may disturb the user and visual
fatigue.

Key guidelines for the effective use of color in user interface:

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.

Software Engineering | For CICT Classroom Use Only

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:

1. The message produced by the system in response to user actions.


2. The online help system
3. The documentation provided with the system

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.

3.2 Program Design


Software Engineering | For CICT Classroom Use Only

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.

Program design modules contain descriptions of the processing logic needed to


implement the corresponding module, including:

 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.

 Modularity and Independence


Modularity is a key factor in good program design, just as it is in system design.
The working of the system was broken into modules so that distinct functions or objects
could be isolated from one another. The advantage of this approach is that removing a
module deletes exactly one function or data object from the system. Modularity allows us

Software Engineering | For CICT Classroom Use Only

54
to identify quickly the affected modules; independence assures us that revising only those
modules will implement the changes.

 Logical vs. Physical design

An abstract or logical design must be enhance or modified to incorporate


constraints placed on it by the physical environment in which the system will operate. A
physical design is a refinement of a logical design to allow the system to work in a
proposed environment.

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.

Process Collection Point

Decision Expansion Point

Figure 3.2.1. Flow Diagram Building Blocks


Software Engineering | For CICT Classroom Use Only

55
 Pseudocode

A set of programming-like statements, called Pseudocode, uses syntax like a


programming language to describe the processing each module is to do. In Figure 3.2.2 a
selection describing using if-then-else, the construction is formed by denoting the IF,
THEN, ELSE selection.

IF measurement in acceptable range


THEN update data type
ELSE ask for retransmission
ENDIF

Figure 3.2.1. Flow Diagram Building Blocks

 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

A very formal structured Pseudocode has been presented by Caine and


Gordon as a Program Design Language. PDL is a marriage of English with IF and
DO programming language constructs.

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.

 Error Prevention and Correction

Software Engineering | For CICT Classroom Use Only

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

Error detection is the discovery of an error within a system. The detection


of an error during a system’s execution is known as passive error detection.
However, rather than waiting for an error to appear, he system can check itself
periodically for a symptoms of an error, this form of detection is known as active
error detection.

o Defensive Designing

Just as other system design, we must also design defensively by checking


for errors that may be committed or overlooked by others. Many of these error
checks involve ensuring that the data are in the proper range or have the correct
attributes.

o Error Correction

Error correction is the system’s compensation for the presence of an


error. It does not usually correct the cause of the error; it fixes only the damage
done by the error.

o Error Tolerance

Error tolerance is the isolation of damage caused by an error. Certainly,


tolerating the error is better than stopping production complete until the system is
fixed.

Software Engineering | For CICT Classroom Use Only

57
EVALUATION
1. Suggest how color might be used to improve the interface of an application system which
you use.

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

Software Engineering | For CICT Classroom Use Only

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.

Software Engineering | For CICT Classroom Use Only

60
______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

Software Engineering | For CICT Classroom Use Only

61
______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

______________________________________________________________________________
___________________

Software Engineering | For CICT Classroom Use Only

62

You might also like