Unit-2 Chapter - 1 - Design
Unit-2 Chapter - 1 - Design
Unit-2
Design process and concepts, Effective Modular design, the design model, Design
documentation, Approaches to Software design.
During the software design phase, the design document is produced, based on the
customer requirements as documented in the SRS document.
The design document produced at the end of the design phase should be
implementable using a programming language in the subsequent (coding) phase.
Depending on the order in which various design activities are performed, we can
broadly classify them into two important stages.
The outcome of high-level design is called the program structure or the software
architecture. High-level design is a crucial step in the overall design of a software.
When the high-level design is complete, the problem should have been
decomposed into many small functionally independent modules that are
cohesive, have low coupling among themselves, and are arranged in a hierarchy.
Many different types of notations have been used to represent a high-level design.
A notation that is widely being used for procedural development is a tree-like
diagram called the structure chart. Another popular design representation
techniques called UML that is being used to document object-oriented design,
involves developing several types of diagrams to document the object-oriented
design of a systems.
DETAILED DESIGN
The outcome of the detailed design stage is usually documented in the form of a
module specification (MSPEC) document. After the high-level design is complete,
the problem would have been decomposed into small modules, and the data
structures and algorithms to be used described using MSPEC and can be easily
grasped by programmers for initiating coding.
The analysis results are generic and does not consider implementation or the
issues associated with specific platforms. The analysis model is usually
documented using some graphical formalism. In case of the function-oriented
approach that we are going to discuss, the analysis model would be
documented using data flow diagrams (DFDs), whereas the design would be
documented using structure chart. On the other hand, for object-oriented
approach, both the design model and the analysis model will be documented using
unified modelling language (UML). The analysis model would normally be very
difficult to implement using a programming language.
Modularity
For example, consider two alternate design solutions to a problem that are
represented in Figure 5.2, in which the modules M1, M2 etc. have been drawn as
rectangles. The invocation of a module by another module has been shown as an
arrow. It can easily be seen that the design solution of Figure 5.2(a) would be
easier to understand since the interactions among the different modules is low.
Note: A software design with high cohesion and low coupling among modules is
the effective problem decomposition.
Layered design
A layered design is one in which when the call relations among different modules
are represented graphically, it would result in a tree-like diagram with clear
layering. In a layered design solution, the modules are arranged in a hierarchy
of layers.
A module can only invoke functions of the modules in the layer immediately
below it. The higher layer modules can be considered to be similar to managers
that invoke (order) the lower layer modules to get certain tasks done. A layered
design can be considered to be implementing control abstraction, since a module
at a lower layer is unaware of (about how to call) the higher layer modules.
A layered design can make the design solution easily understandable, since to
understand the working of a module, one would at best have to understand
how the immediately lower layer modules work without having to worry about
the functioning of the upper layer modules.
Coupling: Intuitively, we can think of coupling as follows. Two modules are said to
be highly coupled, if either of the following two situations arise:
1. If the function calls between two modules involve passing large chunks of
shared data, the modules are tightly coupled.
2. If the interactions occur through some shared data, then also we say that
they are highly coupled.
If two modules either do not interact with each other at all or at best interact by
passing no data or only a few primitive data items, they are said to have low
coupling.
Cohesion:
Suppose you listened to a talk by some speaker. You would call the speech to be
cohesive, if all the sentences of the speech played some role in giving the talk a
single and focused theme.
Now, we can extend this to a module in a design solution. When the functions of
the module co-operate with each other for performing a single objective, then
the module has good cohesion. If the functions of the module do very different
things and do not co-operate with each other to perform a single piece of work,
then the module has very poor cohesion.
Classification of Coupling
These different types of coupling, in increasing order of their severities have also
been shown in Figure 5.5.
1. Data coupling: Two modules are data coupled, if they communicate using
an elementary data item that is passed as a parameter between the two,
e.g. an integer, a float, a character, etc. This data item should be problem
related and not used for control purposes.
Or
When data of one module is passed to another module, this is called data
coupling.
Two modules are stamp coupled if they communicate using composite data items
such as structure, objects, etc. When the module passes non-global data
structure or entire structure to another module, they are said to be stamp
coupled. For example, passing structure variable in C or object in C++ language to
a module.
Control Coupling exists among two modules if data from one module is used to
direct the structure of instruction execution in another.
4. Common coupling: Two modules are common coupled, if they share some
global data items.
Or
Two modules are common coupled if they share information through some global
data items.
Content Coupling exists among two modules if they share code, e.g., a branch
from one module into another module.
Note: High coupling among modules not only makes a design solution
difficult to understand and maintain, but it also increases development effort
and also makes it very difficult to get these modules developed independently by
different team members.
Classification of Cohesiveness
Or
A module is said to have coincidental cohesion if it performs a set of tasks that are
associated with each other very loosely, if at all.
A module is said to be logically cohesive if all the elements of the module perform
a similar operation. For example Error handling, data input and data output, etc.
logout() all do different thing and operate on different data. However, they
are normally executed one after the other during typical order processing by
a sales clerk.
Or
A module is said to be procedural cohesion if the set of purpose of the module are
all parts of a procedure in which particular sequence of steps has to be carried out
for achieving a goal, e.g., the algorithm for decoding a message.
A module is said to have communicational cohesion, if all tasks of the module refer
to or update the same data structure, e.g., the set of functions defined on an array
or a stack.
customer requests for some item, it is first determined if the item is in stock.
In this case, if the functions create-order(), check-item-availability(), place-
order on-vendor() are placed in a single module, then the module would
exhibit sequential cohesion. Observe that the function create-order() creates
an order that is processed by the function check-item-availability()(whether
the items are available in the required quantities in the inventory) is input to
place-order-on-vendor().
Or
There are two fundamentally different approaches to software design that are in
use today— function-oriented design, and object-oriented design. Though these
two design approaches are radically different, they are complementary rather than
competing techniques. The object-oriented approach is a relatively newer
technology and is still evolving. For development of large programs, the object-
oriented approach is becoming increasingly popular due to certain advantages
that it offers. On the other hand, function-oriented designing is a mature
technology and has a large following.
Function-oriented Design
The following are the salient features of the function-oriented design approach:
• assign-membership-number
• create-member-record
• print-bill
Each of these subfunctions may be split into more detailed subfunctions and so on.
Centralised system state: The system state can be defined as the values of certain
data items that determine the response of the system to a user action or
external event.
For example, the set of books (i.e. whether borrowed by different users or
available for issue) determines the state of a library automation system. Such data
in procedural programs usually have global scope and are shared by many
modules.
Data-flow diagrams are a useful and intuitive way of describing a system. They
are generally understandable without specialized training, notably if control
information is excluded. They show end-to-end processing. That is the flow of
processing from when data enters the system to where it leaves the system can be
traced.
Data-flow design is an integral part of several design methods, and most CASE
tools support data-flow diagram creation. Different ways may use different icons
to represent data-flow diagram entities, but their meanings are similar.
Data Dictionaries
A data dictionary lists all data elements appearing in the DFD model of a system.
The data items listed contain all data flows and the contents of all data stores
looking on the DFDs in the DFD model of a system.
A data dictionary lists the objective of all data items and the definition of all
composite data elements in terms of their component data items.
Structured Charts
It partitions a system into block boxes. A Black box system that functionality is
known to the user without the knowledge of internal design.
• Further, these sub-systems and components may have their on set of sub-
system and components and creates hierarchical structure in the system.
• Top-down design takes the whole software system as one entity and then
decomposes it to achieve more than one sub-system or component based
on some characteristics.
• This process keeps on running until the lowest level of system in the top-
down hierarchy is achieved.
Prepared By: Er. Inderjeet Singh(e8822) Page 22
Software Engineering
• When all components are composed the whole system comes into
existence.
Advantages:
• The main advantage of top down approach is that its strong focus on
requirements helps to make a design responsive according to its
requirements.
Disadvantages:
Bottom Up Design
• The bottom up design model starts with most specific and basic components.
• It keeps creating higher level components until the desired system is not
evolved as one single component.
Advantages:
Disadvantages:
Hybrid Design: It is a combination of both the top – down and bottom – up design
strategies. In this we can reuse the modules.
Object-oriented Design
Each object contains its own data and is responsible for managing it. The data
internal to an object cannot be accessed directly by other objects and only
through invocation of the methods of the object. The system state is
decentralised since there is no globally shared data in the system and data is
stored in each object.
1. Objects: All entities involved in the solution design are known as objects.
For example, person, banks, company, and users are considered as objects.
Every entity has some attributes associated with it and has some methods to
perform on the attributes.
2. Classes: A class is a generalized description of an object. An object is an
instance of a class. A class defines all the attributes, which an object can
have and methods, which represents the functionality of the object.
3. Messages: Objects communicate by message passing. Messages consist of
the integrity of the target object, the name of the requested operation, and
any other action needed to perform the function. Messages are often
implemented as procedure or function calls.
4. Abstraction In object-oriented design, complexity is handled using
abstraction. Abstraction is the removal of the irrelevant and the
amplification of the essentials.
5. Encapsulation: Encapsulation is also called an information hiding concept.
The data and operations are linked to a single unit. Encapsulation not only
bundles essential information of an object together but also restricts access
to the data and methods from the outside world.
6. Inheritance: OOD allows similar classes to stack up in a hierarchical manner
where the lower or sub-classes can import, implement, and re-use allowed
variables and functions from their immediate superclasses. This property of
In many to many relations one entity is connected to more than one entity as
well as other entity also connected with first entity using more than one
entity.
Architectural design: It defines the relationship between major structural
elements of the software. It is about decomposing the system into
interacting components. It is expressed as a block diagram defining an
overview of the system structure – features of the components and how
these components communicate with each other to share data. It defines
the structure and properties of the component that are involved in the
system and also the inter-relationship among these components.
User Interfaces design: It represents how the Software communicates with
the user i.e. the behaviour of the system. It refers to the product where
user interact with controls or displays of the product. For example, Military,
vehicles, aircraft, audio equipment, computer peripherals are the areas
where user interface design is implemented. UI design becomes efficient only
after performing usability testing. This is done to test what works and what
does not work as expected. Only after making the repair, the product is said
to have an optimized interface.
Component level design: It transforms the structural elements of the
software architecture into a procedural description of software
components. It is a perfect way to share a large amount of data.
Components need not be concerned with how data is managed at a
centralized level i.e. components need not worry about issues like backup
and security of the data.
Data design encompasses the manner in which the data objects are realized
within the design. It helps to simplify the program flow, makes the design and
implementation of the software components easier, and makes overall
processing more efficient.
The user interface is the main thing of any software. No matter how good its
internal functions are or how well designed its architecture is but if the user
interface is poor and end-users don’t feel ease to handle the software then it
leads to the opinion that the software is bad.
Coupling of different components into one is done in many ways like via a
component interface, by messaging, or through global data. As the level of
coupling increases, error propagation also increases, and overall maintainability of
the software decreases. Therefore, component coupling should be kept as low as
possible.
The design specification addresses different aspects of the design model and is
completed as the designer refines his representation of the software. These design
documents are written by software engineers/designers or project managers and
further passed to the software development team to give them an overview of
what needs to be built and how.
1. Interface description
2. Design language(or other) description
3. Modules used
2. Transfer consideration
Design Documentation
• The Design Document will be the starting point work product for a number of
assignments.
• In many cases the Design Document is done before any of the actual
"work".
• The Design Document could be seen a part of the Plan on what you will do.
• The Implementation then would be the final step, in which you detail
exactly – often in a step-by-step manner - what you did to actually complete
the work required by the Design Document and Plan.
• Design - the picture that describes the end result (it often doesn't include
product names, but might in some cases).
• Plan - a milestone-level view of how that design will get accomplished (no
commands are included, but product names and the processes selected
might very well be documented).
Documentation can vary from project to project. Many consulting companies and
resellers have standard documentation templates that they use when designing
solutions. A properly documented design should include the following
information:
• Architecture design
• Implementation plan
• Installation guide
• Operational procedures
a. Executive summary
b. Design methodology
2. Conceptual design
• Document version log: It contains the log of authors and changes made to
the document
• List of tables: It is the index of tables included in the document for quick
reference
• List of figures: It is the index of figures included in the document for quick
reference
• Physical design: It contains the details of the selected hardware and the
configuration of the physical and virtual hardware
• The implementation plan defines the project roles and defines what is
expected of the customer and what they can expect during the
implementation of the design.
• Document version log: It contains the log of authors and changes made to
the document
• List of tables: It is the index of tables included in the document for quick
reference
• List of figures: It is the index of figures included in the document for quick
reference
1. Purpose statement
2. Project contacts
3. Implementation requirements
• This guide should include detailed information about how to implement and
configure all the resources associated with the virtual datacenter project.
• In many projects, the person creating the design is not the person
responsible for implementing the design.
• The installation guide outlines the steps necessary to implement the physical
design outlined in the architecture design document.
• Document version log: It contains the log of authors and changes made to
the document
• List of tables: It is the index of tables included in the document for quick
reference
• List of figures: It is the index of figures included in the document for quick
reference
1. Purpose statement
2. Assumption statement
• The validation test plan documents how the implementation will be verified.
• It documents the criteria that must be met to determine the success of the
implementation and the test procedures that should be followed when
validating the environment.
• The criteria and procedures defined in the validation test plan determine
whether or not the design requirements have been successfully met.
Note: The validation test plan should include the following information:
• Purpose statement
• Assumption statement
• Success criteria
• Test procedures
• Document version log: It contains the log of authors and changes made to
the document
• List of tables: It is the index of tables included in the document for quick
reference
• List of figures: It is the index of figures included in the document for quick
reference
starting the design to ensure that both types of requirements are satisfied.
It’s also worth including in this doc information about constraints and
assumptions because they will influence the design decisions.
• User journeys – This document outlines the path a user may take to reach
their goal when using a product.
• Style guides – This document lists a set of standards for the stylization of
design. Styles, colors, and typefaces are essential pieces of this guide.
• Project scope and implementation plan – This document describes the roles
and flow of cross-team collaboration. The implementation plan documents
the requirements necessary to complete the implementation of the design.
For simple projects, it might be a high-level overview of the steps required to
complete the implementation. For complex projects, it can include a project
timeline with information about the time required to complete each of the
steps.