Se Unit
Se Unit
Se Unit
DEPARTMENT OF CSE
(Accredited to National Board of Accreditation)
CS8494 SOFTWARE ENGINEERING
II YEAR – IV SEMESTER
LECTURE NOTES - UNIT III
Mrs.E.Archana,
Mrs.S.Padmapriya Dr.V.Subedha Principal
Asst.Professor HOD/CSE
PIT – CSE II Year / IV Sem
UNIT III
SOFTWARE DESIGN
3.Design process:
Software design:
Software design is model of software which translates the requirements into finished
software products in which the details about software data structures, architectures,
interfaces and components that are necessary to implement the system are given.
Levels of design:
The design should provide a complete picture of the software, addressing the data,
functional, and behavioral domains from an implementation perspective.
Quality Guidelines
1. A design should exhibit an architecture that
(1) Has been created using recognizable architectural styles or patterns,
(2) Is composed of components that exhibit good design characteristics,
(3) Can be implemented in an evolutionary fashion.
2. A design should be modular; that is, the software should be logically partitioned into
elements or subsystems.
3. A design should contain distinct representations of data, architecture, interfaces, and
components.
4. A design should lead to data structures that are appropriate for the classes to be
implemented and are drawn from recognizable data patterns.
5. A design should lead to components that exhibit independent functional characteristics.
6. A design should lead to interfaces that reduce the complexity of connections between
components and with the external environment.
7. A design should be derived using a repeatable method that is driven by infor mation
obtained during software requirements analysis.
8. A design should be represented using a notation that effectively communicates its
meaning.
Quality Attributes
Functionality
Usability
Reliability
Performance
Supportability
3.1Design Concepts
The software Design Concepts provides a framework for implementing the right software.
1. Abstraction
2. Modularity
3. Architecture
4. Refinement
5. Pattern
6. Information hiding
7. Functional independence
8. Refinement
9. Design classes
1.Abstraction:
When you consider a modular solution to any problem, many levels of abstraction
can be posed.
Highest level of abstraction, a solution is stated in broad terms.
Lower levels of abstraction, a more detailed description of the solution is provided.
Lowest level of abstraction, the solution is stated in a manner that can be directly
implemented.
Two types:
1. Procedural abstraction
2. Data abstraction
Procedural abstraction refers to a sequence of instructions that have a specific and
limited function. Data abstraction is a named collection of data that describes a data
object.
2.Architecture:
Architecture is the structure or organization of program components (Modules), the
manner in which these components interact, and the structure of data that are used
by the components.
3.Patterns:
A design pattern describes a design structure that solves a particular design
problem within a specific context and amid “forces” that may have an impact on the
manner in which the pattern is applied and used.
The intent of each design pattern is to provide a description that enables a designer
to determine
(1) Whether the pattern is applicable to the current work,
(2) Whether the pattern can be reused (hence, saving design time), and
(3) Whether the pattern can serve as a guide for developing a similar, but functionally or
structurally different pattern.
Separation of Concerns:
Separation of concerns is a design concept that suggests that any complex problem
can be more easily handled if it is subdivided into pieces that can each be solved
and/or optimized independently.
A concern is a feature or behavior that is specified as part of the requirements model
for the software.
By separating concerns into smaller and therefore more manageable pieces, a
problem takes less effort and time to solve.
It also follows that the perceived complexity of two problems when they are
combined is often greater than the sum of the perceived complexity when each is
taken separately.
If an error occurs within a module then those errors are localized and not spread to other
modules.
The 5 criteria to evaluate a design method with respect to its modularity ,
Modular understandability
Module should be understandable as a standalone unit (no need to refer to other modules)
Modular continuity
If small changes to the system requirements result in changes to individual modules, rather
than system wide changes, the impact of side effects will be minimized.
Modular protection
If an error occurs within a module then those errors are localized and not spread to other
modules.
Modular Composability
Design method should enable reuse of existing components.
Modular Decomposability
Complexity of the overall problem can be reduced if the design method provides a
systematic mechanism to decompose a problem into sub problems.
5.Information Hiding:
Modules should be specified and designed so that information (algorithms and data)
contained within a module is inaccessible to other modules that have no need for
such information.
Hiding implies that effective modularity can be achieved by defining a set of
independent modules that communicate with one another only that information
necessary to achieve software function.
The use of information hiding as a design criterion for modular systems provides
the greatest benefits when modifications are required during testing and later
during software maintenance.
Because most data and procedural detail are hidden from other parts of the
software, inadvertent errors introduced during modification are less likely to
propagate to other locations within the software.
6.Functional Independence:
The concept of functional independence is a direct outgrowth of separation of
concerns, modularity, and the concepts of abstraction and information hiding.
You should design software so that each module addresses a specific subset of
requirements and has a simple interface when viewed from other parts of the
program structure.
Independent modules are easier to maintain (and test) because secondary effec ts
caused by design or code modification are limited, error propagation is reduced, and
reusable modules are possible.
Functional independence is a key to good design, and design is the key to software
quality.
Independence is assessed using two qualitative criteria:
1. cohesion
2. coupling
Cohesion is an indication of the relative functional strength of a module.
Coupling is an indication of the relative interdependence among modules.
Cohesion is a natural extension of the information-hiding.
A cohesive module performs a single task, requiring little interaction with other
components in other parts of a program.
Types of Cohesion:
Co-incidental cohesion - It is unplanned and random cohesion, which might be the
result of breaking the program into smaller modules for the sake of modularization.
Because it is unplanned, it may serve confusion to the programmers and is generally
not-accepted.
Logical cohesion - When logically categorized elements are put together into a
module, it is called logical cohesion.
Temporal Cohesion - When elements of module are organized such that they are
processed at a similar point in time, it is called temporal cohesion.
Procedural cohesion - When elements of module are grouped together, which are
executed sequentially in order to perform a task, it is called procedural cohesion.
Communicational cohesion - When elements of module are grouped together,
which are executed sequentially and work on same data (information), it is called
communicational cohesion.
Sequential cohesion - When elements of module are grouped because the output of
one element serves as input to another and so on, it is called sequential cohesion.
Functional cohesion - It is considered to be the highest degree of cohesion, and it is
highly expected. Elements of module in functional cohesion are grouped because
they all contribute to a single well-defined function. It can also be reused.
Types of Coupling:
7.Refinement:
Refinement is actually a process of elaboration. You begin with a statement of
function (or description
Refinement helps you to reveal low-level details as design progresses
8.Refactoring
Refactoring is a reorganization technique that simplifies the design (or code) of a
component without changing its function or behavior.
Refactoring is the process of changing a software system in such a way that it does
not alter the external behavior of the code [design] yet improves its internal
structure.
When software is refactored, the existing design is examined for redundancy,
unused design elements, inefficient or unnecessary algorithms, poo rly constructed
or inappropriate data structures, or any other design failure that can be corrected to
yield a better design.
Object-Oriented Design Concepts
The object-oriented (OO) paradigm is widely used in modern software engineering.
It includes classes and objects, inheritance, messages, and polymorphism
9.Design Classes:
As the design model evolves, you will define a set of design classes that refine the
analysis classes by providing design detail that will enable the classes to be
implemented, and implement a software infrastructure that supports the business
solution.
Five different types of design classes, each representing a different layer of the
design architecture
1. User interface classes define all abstractions that are necessary for human
computer interaction (HCI). In many cases, HCI occurs within the context of a
metaphor (e.g., a checkbook, an order form, a fax machine), and the design classes
for the interface may be visual representations of the elements of the metaphor.
2. Business domain classes are often refinements of the analysis classes defined
earlier. The classes identify the attributes and services (methods) that are required
to implement some element of the business domain.
3. Process classes implement lower-level business abstractions required to fully
manage the business domain classes.
4. Persistent classes represent data stores (e.g., a database) that will persist beyond
the execution of the software.
5. System classes implement software management and control functions that enable
the system to operate and communicate within its computing environment and with
the outside world.
The process dimension indicates the evolution of the design model as design tasks
are executed as part of the software process.
The abstraction dimension represents the level of detail as each element of the
analysis model is transformed into a design equivalent and then refined iteratively.
3.3DESIGN HEURISTICS:
1. Evaluate the "first iteration" of the program structure to reduce coupling and
improve cohesion.
Once the program structure has been developed, modules may be exploded or imploded
with an eye toward improving module independence. An exploded module becomes two or
more modules in the final program structure.
An imploded module is the result of combining the processing implied by two or more
modules. An exploded module often results when common processing exists in two or
more modules and can be redefined as a separate cohesive module. When high coupling is
expected, modules can sometimes be imploded to reduce passage of control, reference to
global data, and interface complexity.
2. Attempt to minimize structures with high fan-out; strive for fan-in as depth
increases.
The structure shown inside the cloud in figure does not make effective use of factoring. All
modules are “pancaked” below a single control module. In general, a more reasonable
distribution of control is shown in the upper structure. The structure takes an oval shape,
indicating a number of layers of control and highly utilitarian modules at lower levels.
3. Keep the scope of effect of a module within the scope of control of that
module.
The scope of effect of module e is defined as all other modules that are affected by a
decision made in module e. The scope of control of module e is all modules that are
subordinate and ultimately subordinate to module e. Referring to figure, if module e makes
a decision that affects module r, we have a violation of this heuristic, because module r lies
outside the scope of control of module e.
4. Evaluate module interfaces to reduce complexity and redundancy and
improve consistency.
Module interface complexity is a prime cause of software errors .Interfaces should be
designed to pass information simply and should be consistent with the function of a
module. Interface inconsistency (i.e., seemingly unrelated data passed via an a rgument list
or other technique) is an indication of low cohesion. The module in question should be
reevaluated.
5. Define modules whose function is predictable, but avoid modules that are
overly restrictive.
A module is predictable when it can be treated as a black box; that is, the same external
data will be produced regardless of internal processing details. Modules that have internal
"memory" can be unpredictable unless care is taken in their use.
6. Strive for “controlled entry” modules by avoiding "pathological connections."
This design heuristic warns against content coupling. Software is easier to understand and
therefore easier to maintain when module interfaces are constrained and controlled.
Pathological connection refers to branches or references into the middle of a module.
In some cases the data repository is passive. That is, client software accesses the
data independent of any changes to the data or the actions of other client software.
A variation on this approach transforms the repository into a “blackboard” that
sends notifications to client software when data of interest to the client change.
Data-centered architectures promote inerrability. That is, existing components can
be changed and new client components can be added to the architecture without
concern about other clients (because the client components operate
independently).
Client components independently execute process.
In addition, data can be passed among clients using the blackboard mechanism (i.e.,
the blackboard component serves to coordinate the transfer o f information between
clients).
Data-flow architectures:
This architecture is applied when input data are to be transformed through a series
of computational or manipulative components into output data.
A pipe and filter pattern has a set of components, called filters, connected by pipes
that transmit data from one component to the next.
Each filter works independently of those components upstream and downstream, is
designed to expect data input of a certain form, and produces data output (to the
next filter) of a specified form.
However, the filter does not require knowledge of the working of its neighboring
filters.
If the data flow degenerates into a single line of transforms, it is termed batch
sequential. This pattern accepts a batch of data and then applies a series of
sequential components (filters) to transform it.
Object-oriented architectures:
The components of a system encapsulate data and the operations that must be
applied to manipulate the data.
Communication and coordination between components is accomplished via
message passing.
Layered architectures:
A number of different layers are defined, each accomplishing operations that
progressively become closer to the machine instruction set.
At the outer layer, components service user interface operations. At the inner layer,
components perform operating system interfacing.
Intermediate layers provide utility services and application software functions.
These architectural styles are only a small subset of those available to the software
designer.
Once requirements engineering uncovers the characteristics and constraints of the
system to be built, the architectural pattern (style) or combination of patterns
(styles) that best fits those characteristics and constraints can be chosen.
In many cases, more than one pattern might be appropriate and alternative
architectural styles might be designed and evaluated.
Super ordinate systems—those systems that use the target system as part of some
higher-level processing scheme.
Subordinate systems—those systems that are used by the target system and provide
data or processing that are necessary to complete target system functionality.
Peer-level systems—those systems that interact on a peer-to-peer basis (i.e.,
information is either produced or consumed by the peers and the target system.
Actors—entities (people, devices) that interact with the target system by producing
or consuming information that is necessary for requisite processing.
Defining Archetypes
An archetype is a class or pattern that represents a core abstraction that is critical to the
design of an architecture for the target system. In general, a relatively small set of
archetypes is required to design even relatively complex systems. The target system
architecture is composed of these archetypes, which represent stable elements of the
architecture but may be instantiated many different ways based on the behavior of the
system.
Node: Represents a cohesive collection of input and output elements of the home security
function. For example a node might be comprised of
(1) various sensors and (2) a variety of alarm (output) indicators.
Detector: An abstraction that encompasses all sensing equipment that feeds information
into the target system.
Indicator: An abstraction that represents all mechanisms (e.g., alarm siren, flashing lights,
bell) for indicating that an alarm condition is occurring.
Controller: An abstraction that depicts the mechanism that allows the arming or disarming
of a node. If controllers reside on a network, they have the ability to communicate with one
another.
Transform flow:
A transform flow is a sequence of paths which forms transition in which input data are
transformed into output data.
Transaction flow:
A transaction flow represents the information flow in which single data item triggers the
overall information flow along the multiple paths.
Transform Mapping
Transform mapping is a set of design steps that allows a DFD with transform flow
characteristics to be mapped into a specific architectural style.
Transform Mapping
Step 2. Review and refine data flow diagrams for the software.
Step 4. Isolate the transform center by specifying incoming and outgoing flow
boundaries.
Step 7. Refine the first-iteration architecture using design heuristics for improved
software quality.
Transaction Mapping
In many software applications a single data item leads to one or more information
flows.
Each information flow specifies some distinct functionality. This data item is called
transaction center.
Step 6. Factor and refine the transaction structure and the structure of each action
path.
Step 7. Refine the first-iteration architecture using design heuristics for improved
software quality.
User interface:
User interface is a communication between human and computer.
HCI (Human Computer Interaction).
User interface design:
The overall process for designing a user interface begins with the creation of
different models of system function (as perceived from the outside).
The human- and computer-oriented tasks that are required to achieve system
function are then delineated; design issues that apply to all interface designs are
considered; tools are used to prototype and ultimately implement the design model;
and the result is evaluated for quality.
The User model The Design model The system model The implementation
model
User models:
To build an effective user interface, “all design should begin with an understanding of the
intended users, including profiles of their age, gender, physical abilities, education, cultural
or ethnic background, motivation, goals and personality”.
Design Model :
1. It consists of data, architectural, interface and procedural representation of the
software.
2. While preparing this model, the requirement specification must be used properly to
set the system constraints
Mental Model (System Model):
The user’s mental model (system perception) is the image of the system that end
users carry in their heads.
For example, if the user of a particular word processor were asked to
describe its operation, the system perception would guide the response. Th e
accuracy of the description will depend upon the user’s profile (e.g., novices
would provide a sketchy response at best) and overall familiarity with
software in the application domain.
A user who understands word processors fully but has worked with th e specific
word processor only once might actually be able to provide a more complete
description of its function than the novice who has spent weeks trying to learn
the system.
Implementation model:
Implementation model gives the look and feel of the interface, coupled with all
supporting information (books, manuals, videotapes, help files) that describes
interface syntax and semantics.
Matching implementation model with users mental model is necessary so that
user feel comfortable with developed system.
The design process for user interfaces is iterative and can be represented using a spiral
model. The user interface design process encompasses four distinct framework activities:
1. environment analysis and modeling
2. Interface design
3. Interface implementation
4. Interface validation
Interface analysis: It focuses on the profile of the users who will interact with the system.
Skill level, business understanding, and general receptiveness to the new system are
recorded; and different user categories are defined. For each user category, requirements
are elicited.
Interface design: The goal of interface design is to define a set of interface objects and
actions (and their screen representations) that enable a user to perform all def ined tasks in
a manner that meets every usability goal defined for the system.
Interface construction normally begins with the creation of a prototype that enables usage
scenarios to be evaluated. As the iterative design process continues, a user interface tool kit
may be used to complete the construction of the interface.
Interface validation focuses on
(1) The ability of the interface to implement every user task correctly, to accommodate all
task variations, and to achieve all general user requirements;
(2) The degree to which the interface is easy to use and easy to learn, and
(3) The users’ acceptance of the interface as a useful tool in their work.
User Analysis
User Interviews. The most direct approach, members of the software team meet with end
users to better understand their needs, motivations, work culture, and a myriad of other
issues. This can be accomplished in one-on-one meetings or through focus groups.
Sales input. Sales people meet with users on a regular basis and can gather information
that will help the software team to categorize users and better understand their
requirements.
Marketing input. Market analysis can be invaluable in the definition of market segments
and an understanding of how each segment might use the software in subtly diffe rent ways.
Support input. Support staff talks with users on a daily basis. They are the most likely
source of information on what works and what doesn’t, what users like and what they
dislike, what features generate questions and what features are easy to use.
Design Issues
Response time:System response time is measured from the point at which the user
performs some control action (e.g., hits the return key or clicks a mouse) until the
software responds with desired output or action.
Help facilities.
Will help be available for all system functions and at all times during system
interaction?
How will the user request help?
How will help be represented?
How will the user return to normal interaction?
Error handling.In general, every error message or warning produced by an
interactive system should have the following characteristics:
The message should describe the problem in jargon that the user can
understand.
The message should provide constructive advice for recovering from the error.
Menu and command labeling.
Will every menu option have a corresponding command?
What form will commands take? Options include a control sequence (e.g., alt-P),
function keys, or a typed word.
How difficult will it be to learn and remember the commands? What can be done
if a command is forgotten?
Can commands be customized or abbreviated by the user?
Application accessibility.Accessibility for users (and software engineers) who may
be physically challenged is an imperative for ethical, legal, and business reasons. A
variety of accessibility guidelines many designed for Web applications but often
applicable to all types of software—provide detailed suggestions for designing
interfaces that achieve varying levels of accessibility.
Internationalization.Software engineers and their managers invariably
underestimate the effort and skills required to create user interfaces that
accommodate the needs of different locales and languages.
Box Diagram
o It is also called as NS chart.
o The scope of the programming constructs such as repetition . if-then-else is well
defined.
o Arbitrary transfer of the control is not possible using the notation.
o Recursion can be represented conveniently.
o The scope of local and global data can be defined systematically.
Data declaration,
Block structuring,
Condition constructs,
Repetition constructs,
Input-output (I/O) constructs.
o It should be noted that PDL can be extended to include keywords.
Part A
1. What are the elements of design model? [APR/MAY 2015] [R]
i. Data design
ii. Architectural design
iii. Interface design
iv. Component-level design
9. What are the common activities in design process? [APR/MAY 2015] [U]
i. System structuring – The system is subdivided into principle subsystems
components and communications between these subsystems are identified.
ii. Control modeling – A model of control relationships between different parts of
the system is established.
iii. Modular decomposition – The identified subsystems are decomposed into
modules.
12. What are the advantages of vertical partitioning? [APR/MAY 2012] [U]
i. These are easy to maintain changes.
ii. They reduce the change impact and error propagation.
14. List the guidelines for data design. [NOV/DEC 2014] [R]
i. Apply systematic analysis on data.
ii. Identify data structures and related operations.
iii. Establish data dictionary.
iv. Use information hiding in the design of data structure.
v. Apply a library of useful data structures and operations.
Part B:
1. Explain in detail the design concepts.[U]
2. Explain the design principles.
3. Explain the design steps of the transform mapping.
4. Explain in detail about the real time systems.
5. Explain in detail about SCM.
6. Explain about user interface design
7. Brief about real time executives
8. Explain about Data acquisition systems
9. Narrate User interface design [NOV/DEC 2014] [U]
10. Write note on monitoring and control system.
11. Explain the design model. [APR/MAY 2012] [U]
12. Explain in detail about the designing components. [APR/MAY 2012] [R]
13. What is cohesion? How is it related to coupling? Discuss in detail different types of cohesion
and coupling with suitable examples. [APR / MAY 2017][An]
14. What is software architecture? Describe in detail different types of software
architectures with illustrations. [APR / MAY 2017][U]
15. What is software architecture? Describe the different software architectural styles with
examples. [APR / MAY 2018][U]
16. Explain in detail types of cohesion and coupling with examples. [APR / MAY 2018][R]
17. What is the purpose of DFD? What are the components of DFD? Construct DFD for the
following system: [APR / MAY 2018][C]
An on – line shopping system for XYZ provides many services and benefits to its members
and staffs. Currently, XYZ staffs manually handle the purchasing information with the use of
basic office software such as Microsoft Office Word and Excel. It may results in having
mistaken easily and the process is very inconvenient. XYZ needs an online shopping system
at their Intranet based on the requirements of users. XYZ online shopping system has five
features:
i) To provide the user friendly online shopping cart function to members to
replace hardcopy ordering form.
ii) To store inventory and sales information in database to reduce the human
mistakes, increase accuracy and enhance the flexibility of information
processing.
iii) To provide an efficient inventory system which can help the XYZ staffs to gain
enough information to update the inventory.
iv) To be able to print invoices to members and print a set of summary reports for
XYZ’s internal usage.
v) To design the system that is easy to maintain and upgrade.
18.Consider the problem of determining the number of different words in an input file.
Carry out structured design by performing transform and transaction analysis construct
the structured chart. [APR / MAY 2018][C]