SE Module4
SE Module4
SE Module4
Software Design
Design Principles
6. Accommodate change –
The software should be designed in such a way that it accommodatesthe change implying
that the software should adjust to the change that is required to be done as per the user’s
need.
7. Degrade gently –
The software should be designed in such a way that it degrades
gracefully which means it should work properly even if an error occurs during the
execution.
8. Assessed or quality –
The design should be assessed or evaluated for the quality meaning that during the
evaluation, the quality of the design needs to be checked and focused on.
10. Design is not coding and coding is not design – Design means describing
the logic of the program to solve anyproblem and coding is a type of language
that is used for the implementation of a design.
Design Concepts
Abstraction
1. Functional Abstraction
2. Data Abstraction
Functional Abstraction
Data Abstraction
Details of the data elements are not visible to the users of data. Data Abstraction forms the
basis for Object Oriented design approaches.
Modularity
Modularity specifies to the division of software into separate modules which are differently
named and addressed and are integrated later on in to obtain the completely functional
software. It is the only property that allows a program to be intellectually manageable. Single
large programs are difficult to understand and read due to a large number of reference
variables, control paths, global variables, etc.
Advantages of Modularity
Disadvantages of Modularity
o Information hiding:
The fundamental of Information hiding suggests that modules can be characterized by the
design decisions that protect from the others, i.e., Inother words, modules should be specified
that data include within a module is inaccessible to other modules that do not need for such
information.
The use of information hiding as design criteria for modular system provides the most
significant benefits when modifications are required during testing's and later during software
maintenance. This is because as most data and procedures are hidden from other parts of the
software, inadvertent errors introduced during modifications are less likely to propagate to
different locations within the software.
o Concurrency
Computer has limited resources and they must be utilized efficiently as much as possible. To
utilize these resources efficiently, multiple tasks must be executed concurrently. This
requirement makes concurrency one
of the major concepts of software design. Every system must be designed to allow multiple
processes to execute concurrently, whenever possible. For example, if the current process is
waiting for some event to occur, the system must execute some other process in the mean time.
However, concurrent execution of multiple processes sometimes may result in undesirable
situations such as an inconsistent state, deadlock, etc. For example, consider two processes A
and B and a data item Q1 with the value ‘200’. Further, suppose A and B are being
executedconcurrently and firstly A reads the value of Q1 (which is ‘200’) to add ‘100’ to it.
However, before A updates es the value of Q1, B reads the value ofQ1 (which is still ‘200’)
to add ’50’ to it. In this situation, whether A or B first updates the value of Q1, the value of
would definitely be wrong resulting in an inconsistent state of the system. This is because
the actions of A and B are not synchronized with each other. Thus, the system must control
the concurrent execution and synchronize the actions of concurrent processes.
Effective Modular Design
Any software comprises of many systems which contains several sub- systems and those sub-
systems further contains their sub-systems. So, designing a complete system in one go
comprising of each and every required functionality is a hectic work and the process can have
many errors because of its vast size.
Thus in order to solve this problem the developing team breakdown the complete software
into various modules. A module is defined as the unique and addressable components of the
software which can be solvedand modified independently without disturbing ( or affecting
in very small amount ) other modules of the software. Thus every software design should
follow modularity.
The process of breaking down a software into multiple independent modules where each
module is developed separately is
called Modularization.
Effective modular design can be achieved if the partitioned modules are separately solvable,
modifiable as well as compilable. Here separate compilable modules means that after making
changes in a module thereis no need of recompiling the whole software system.
In order to build a software with effective modular design there is a factor “Functional
Independence” which comes into play. The meaning of Functional Independence is that a
function is atomic in nature so that it performs only a single task of the software without or
with least interaction with other modules. Functional Independence is considered as a sign of
growth in modularity i.e., presence of larger functional independence results in a software
system of good design anddesign further affects the quality of the software.
Coupling:
Coupling is a measure of strength in relationship between various modules within a software.
It is of 6 types which are listed below in theorder of low to high coupling:
1. Data Coupling
2. Stamp Coupling
3. Control Coupling
4. External Coupling
5. Common Coupling
6. Content Coupling
Data Coupling: If the dependency between the modules is based on the fact that they
communicate by passing only data, then the modules are said to be data coupled. In data
coupling,the components are independent to each other and
communicating through data. Module communications don’t
contain tramp data. Example-customer billing system.
Stamp Coupling In stamp coupling, the complete data structure is passed from one
module to another module. Therefore, it involves tramp data. It may be necessary due
to efficiency factors- this choice made by the insightful designer, not a lazy
programmer.
Control Coupling: If the modules communicate by passing control information, then
they are said to be control coupled. Itcan be bad if parameters indicate completely
different behaviorand good if parameters allow factoring and reuse of functionality.
Example- sort function that takes comparison function as an argument.
External Coupling: In external coupling, the modules depend on other modules,
external to the software being developed or to a particular type of hardware. Ex-
protocol, external file, device format, etc.
Common Coupling: The modules have shared data such as global data structures.The
changes in global data mean tracing back to all modules which access that data to evaluate
the effectof the change. So it has got disadvantages like difficulty in reusing modules,
reduced ability to control data accesses and reduced maintainability.
Content Coupling: In a content coupling, one module can modify the data of another
module or control flow is passed from one module to the other module. This is the worst
form ofcoupling and should be avoided.
Architectural Design
The software needs the architectural design to represents the designof software.
IEEE defines architectural design as “the process of defining a collection of hardware and
software components and their interfacesto establish the framework for the development of a
computer
system.”
The software that is built for computer-based systems can exhibit one of these many
architectural styles.
What is a Component?
Views of a Component
A component can have three different views − object-oriented view, conventional view, and
process-related view.
Object-oriented view
A component is viewed as a set of one or more cooperating classes. Eachproblem domain
class (analysis) and infrastructure class (design) are explained to identify all attributes and
operations that apply to its implementation. It also involves defining the interfaces that enable
classes to communicate and cooperate.
Conventional view
It is viewed as a functional element or a module of a program that integrates the processing
logic, the internal data structures that are required to implement the processing logic and an
interface that enables the component to be invoked and data to be passed to it.
Process-related view
In this view, instead of creating each component from scratch, thesystem is building from
existing components maintained in a library. As the software architecture is formulated,
components are selected from the library and used to populate the architecture.
Characteristics of Components
Creates a naming conventions for components that are specified as part of the architectural
model and then refines or elaborates as part of the component-level model.
Attains architectural component names from the problem domain and ensures that they
have meaning to all stakeholders who view the architectural model.
Extracts the business process entities that can exist independently without any
associated dependency on other entities.
Recognizes and discover these independent entities as new components.
Uses infrastructure component names that reflect their implementation-specific
meaning.
Models any dependencies from left to right and inheritance from top(base class) to
bottom (derived classes).
Model any component dependencies as interfaces rather than representing them as a
direct component-to-component dependency.
Recognizes all design classes that correspond to the problem domain as defined in the analysis
model and architectural model.
Recognizes all design classes that correspond to the infrastructure domain.
Describes all design classes that are not acquired as reusablecomponents, and specifies
message details.
Identifies appropriate interfaces for each component and elaborates attributes and
defines data types and data structures required to implement them.
Describes processing flow within each operation in detail by means of pseudo code or
UML activity diagrams.
Describes persistent data sources (databases and files) and identifies the classes
required to manage them.
Develop and elaborates behavioral representations for a class or component. This can
be done by elaborating the UML state diagrams created for the analysis model and by
examining all use cases that are relevant to the design class.
Elaborates deployment diagrams to provide additionalimplementation detail.
Demonstrates the location of key packages or classes of components in a system by
using class instances and designating specific hardware and operating system
environment.
The final decision can be made by using established design principles and guidelines.
Experienced designers consider all (or most) of the alternative design solutions before
settling on the finaldesign model.
Advantages
User interface is the front-end application view to which user interacts in order to use the
software. The software becomes morepopular if its user interface is:
Attractive
Simple to use
Responsive in short time
Clear to understand
Consistent on all interface screens There are two
types of User Interface:
1. Command Line Interface: Command Line Interface provides acommand prompt, where
the user types the command and feedsto the system. The user needs to remember the
syntax of the command and its use.
CLI Elements
2. Graphical User Interface: Graphical User Interface provides the simple interactive
interface to interact with the system. GUI can be a combination of both hardware and
software. Using GUI,user interprets the software.
GUI Elements
Radio-button - Displays available options for selection. Only one can be selected
among all offered.
Check-box - Functions similar to list-box. When an option is selected, the box is
marked as checked. Multiple optionsrepresented by check boxes can be selected.
List-box - Provides list of available items for selection. More than one item can be
selected.
User Interface Design Activities
There are a number of activities performed for designing user interface. The process of GUI
design and implementation is alike SDLC. Any model can be used for GUI implementation
among Waterfall, Iterative or Spiral Model.
A model used for GUI design and development should fulfill these GUI specific steps.
GUI Requirement Gathering - The designers may like to have list of all functional
and non-functional requirements of GUI. This can be taken from user and their existing
software solution.
User Analysis - The designer studies who is going to use the software GUI. The target
audience matters as the design details change according to the knowledge and
competency level of the user. If user is technical savvy, advanced and complex GUI
can be incorporated. For a novice user, more information is included on how-to of
software.
Task Analysis - Designers have to analyze what task is to be doneby the software
solution. Here in GUI, it does not matter how it willbe done. Tasks can be represented
in hierarchical manner taking one major task and dividing it further into smaller sub-
tasks. Tasksprovide goals for GUI presentation. Flow of information among sub-tasks
determines the flow of GUI contents in the software.
GUI Design & implementation - Designers after having information about
requirements, tasks and user environment,
design the GUI and implements into code and embed the GUI with working or dummy
software in the background. It is then self- tested by the developers.
Testing - GUI testing can be done in various ways. Organization can have in-house
inspection, direct involvement of users andrelease of beta version are few of them.
Testing may includeusability, compatibility, user acceptance etc.
The following rules are mentioned to be the golden rules for GUI design, described by
Shneiderman and Plaisant in their book (Designing the User Interface).
Strive for consistency - Consistent sequences of actions should be required in similar
situations. Identical terminology should be used in prompts, menus, and help screens.
Consistent commands should be employed throughout.
Enable frequent users to use short-cuts - The user’s desire to reduce the number of
interactions increases with the frequency of use. Abbreviations, function keys, hidden
commands, and macro facilities are very helpful to an expert user.
Offer informative feedback - For every operator action, there should be some system
feedback. For frequent and minor actions, the response must be modest, while for
infrequent and majoractions, the response must be more substantial.
Design dialog to yield closure - Sequences of actions should be organized into groups
with a beginning, middle, and end. Theinformative feedback at the completion of a
group of actions gives the operators the satisfaction of accomplishment, a sense of
relief, the signal to drop contingency plans and options from their minds, and this
indicates that the way ahead is clear to prepare for the next group of actions.
Offer simple error handling - As much as possible, design the system so the user will
not make a serious error. If an error is made, the system should be able to detect it and
offer simple, comprehensible mechanisms for handling the error.
Permit easy reversal of actions - This feature relieves anxiety, since the user knows
that errors can be undone. Easy reversal of actions encourages exploration of
unfamiliar options. The units of
reversibility may be a single action, a data entry, or a complete group of actions.
Support internal locus of control - Experienced operators strongly desire the sense
that they are in charge of the system and that the system responds to their actions.
Design the system to make users the initiators of actions rather than the responders.
Reduce short-term memory load - The limitation of human information processing
in short-term memory requires the displays to be kept simple, multiple page displays
be consolidated, window- motion frequency be reduced, and sufficient training time
be allotted for codes, mnemonics, and sequences of actions.