Unit 3 SE Min
Unit 3 SE Min
- Introduction
- Design quality
- Design concepts
- The design model
Five Notable Design Quotes
• "Questions about whether design is necessary or affordable are quite beside the
point; design is inevitable. The alternative to good design is bad design, [rather
than] no design at all." Douglas Martin
• "You can use an eraser on the drafting table or a sledge hammer on the
construction site." Frank Lloyd Wright
• "The public is more familiar with bad design than good design. If is, in effect,
conditioned to prefer bad design, because that is what it lives with; the new
[design] becomes threatening, the old reassuring." Paul Rand
• "A common mistake that people make when trying to design something
completely foolproof was to underestimate the ingenuity of complete fools."
Douglas Adams
• "Every now and then go away, have a little relaxation, for when you come back
to your work your judgment will be surer. Go some distance away because then
the work appears smaller and more of it can be taken in at a glance and a lack of
harmony and proportion is more readily seen." Leonardo DaVinci
4
Purpose of Design
• Design is where customer requirements, business needs, and technical
considerations all come together in the formulation of a product or system.
• The design model provides detail about the software data structures,
architecture, interfaces, and components.
• The design model can be assessed for quality and be improved before code
is generated and tests are conducted
• Does the design contain errors, inconsistencies, or omissions?
• Are there better design alternatives?
• Can the design be implemented within the constraints, schedule, and cost
that have been established?
5
Purpose of Design (continued)
• A designer must practice diversification and convergence
• The designer selects from design components, component solutions, and
knowledge available through catalogues , textbooks, and experience
• The designer then chooses the elements from this collection that meet the
Requirements defined by Requirements Engineering and Analysis Modelling.
• Convergence occurs as alternatives are considered and rejected until one
particular configuration of components is chosen
• Software design is an iterative process through which requirements are
translated into a blueprint for constructing the software
• Design begins at a high level of abstraction that can be directly traced back to
the data, functional, and behavioral requirements
• As design iteration occurs, subsequent refinement leads to design
representations at much lower levels of abstraction. 6
From Analysis Model to Design Model
• Each element of the analysis model provides information that is necessary to create the
four design models
• The Data/Class design transforms analysis classes into Design classes along with the
data structures required to implement the software(Class and Collaboration
Diagram )
• The Architectural design defines the relationship between major structural elements
of the software; architectural styles and design patterns help achieve the
requirements defined for the system(Use Case Diagram & Sequence Diagram)
• The Interface design describes how the software communicates with systems that
interoperate with it and with humans that use it.(Use Case Diagram, Sequence
Diagram, Activity Diagram )
• The Component-level design transforms Structural elements of the software
architecture into a Procedural description of software components(Activity Diagram
& State Diagram)
Interface Design
Architectural Design
Data/Class Design
"Writing a clever piece of code that works is one thing; designing something
that can support a long-lasting business is quite another."
14
Design Quality Guidelines
Component-level Design
Interface Design
Architectural Design
Data/Class Design
Dimensions of the Design Model
High
Analysis model
Abstraction Dimension
Design model
26
Design Elements
• Data/class design
• Creates a model of data and objects that is represented at a high level of
abstraction
• Architectural design
• Depicts the overall layout of the software
• Interface design
• Tells how information flows into and out of the system and how it is
communicated among the components defined as part of the architecture
• Includes the user interface, external interfaces, and internal interfaces
• Component-level design elements
• Describes the internal detail of each software component by way of data
structure definitions, algorithms, and interface specifications
• Deployment-level design elements
• Indicates how software functionality and subsystems will be allocated
27
within the physical computing environment that will support the software
Pattern-based Software Design(Design Pattern)
• Mature engineering disciplines make use of thousands of design patterns for such
things as buildings, highways, electrical circuits, factories, weapon systems, vehicles,
and computers
• Design patterns also serve a purpose in software engineering
• Architectural patterns
• Define the overall structure of software.
• Indicate the relationships among subsystems and software components.
• Define the rules for specifying relationships among software elements.
28
☺
Cont…
• Design patterns
• Address a specific element of the design such as an aggregation of
components or solve some design problem, relationships among
components, or the mechanisms for effecting inter-component
communication.
• Consist of creational, structural, and behavioral patterns
• Coding patterns
• Describe language-specific patterns that implement an algorithmic or
data structure element of a component, a specific interface protocol,
or a mechanism for communication among components .
Design documentation
1. The Design Specification addresses different aspects of the design model
and is completed as the designer refines his representation of the software.
First, the overall scope of the design effort is described. Much of the
information presented here is derived from the System Specification and the
analysis model (Software Requirements Specification).
2. Next, the data design is specified. Database structure, any external file
structures, internal data structures, and a cross reference that connects data
objects to specific files are all defined.
3. The architectural design indicates how the program architecture has been
derived from the analysis model. In addition, structure charts are used to
represent the module hierarchy (if applicable).
Cont…
4. The design of external and internal program interfaces is represented
and a detailed design of the human/machine interface is described. In
some cases, a detailed prototype of a GUI may be represented.
5. Components—separately addressable elements of software such as
subroutines, functions, or procedures—are initially described with an
English-language processing narrative. The processing narrative explains
the procedural function of a component (module). Later, a procedural
design tool is used to translate the narrative into a structured description.
6. The Design Specification contains a requirements cross reference. The
purpose of this cross reference (usually represented as a simple matrix) is
(a) to establish that all requirements are satisfied by the software design
and (b) to indicate which components are critical to the implementation of
specific requirements.
7. The first stage in the development of test documentation is also
contained in the design document. Once program structure and
interfaces have been established, we can develop guidelines for
testing of individual modules and integration of the entire package. In
some cases, a detailed specification of test procedures occurs in
parallel with design. In such cases, this section may be deleted from
the Design Specification.
8. Design constraints, such as physical memory limitations or the
necessity for a specialized external interface, may dictate special
requirements for assembling or packaging of software. Special
considerations caused by the necessity for program overlay, virtual
memory management, high-speed processing, or other factors may
cause modification in design derived from information flow or
structure. In addition, this section describes the approach that will be
used to transfer software to a customer site.
9. The final section of the Design Specification contains
supplementary data.
Algorithm descriptions, alternative procedures, tabular data,
excerpts from other documents, and other relevant information are
presented as a special note or as a separate appendix.
It may be advisable to develop a Preliminary
Operations/Installation Manual and include it as an appendix to the
design document.
Modular Design
Cohesion
• Cohesion is the measure of strength of the association of elements
within a module. Modules whose elements are strongly and
genuinely related to each other are desired. A module should be
highly cohesive.
Types of Cohesion
• There are 7 types of cohesion in a module
• Coincidental Cohesion – A module has coincidental cohesion if its elements
have no meaningful relationship to one another. It happens when a module is
created by grouping unrelated instructions that appear repeatedly in other
modules.
• Logical Cohesion – A logically cohesive module is one whose elements
perform similar activities and in which the activities to be executed are
chosen from outside the module. Here the control parameters are passed
between those functions. For example, Instructions grouped together due to
certain activities, like a switch statement. For ex. A module that performs all
input & output operations.
• Temporal Cohesion – A temporally cohesive module is one whose elements
are functions that are related in time. It occurs when all the elements are
interrelated to each other in such a way that they are executed a single time.
For ex. A module performing program initialization.
• Procedural Cohesion – A procedurally cohesive module is one whose elements
are involved in different activities, but the activities are sequential. Procedural
cohesion exists when processing elements of a module are related and must be
executed in a specified order. For example, Do-while loops.
• Communication Cohesion – A communicationally cohesive module is one
whose elements perform different functions, but each function references the
same input information or output. For example, Error handling modules.
• Sequential Cohesion – A sequentially cohesive module is one whose functions are
related such that output data from one function serves as input data to the next
function. For example, deleting a file and updating the master record or function
calling another function.
• Functional Cohesion – A functionally cohesive module is one in which all of the
elements contribute to a single, well-defined task. Object-oriented languages tend
to support this level of cohesion better than earlier languages do. For example,
When a module consists of several other modules.
Coupling
• Coupling is the measure of the interdependence of one module to
another. Modules should have low coupling. Low coupling minimizes
the "ripple effect" where changes in one module cause errors in
other modules.
Types of Coupling
• There are 6 types of coupling in the modules are
• No direct Coupling – These are independent modules and so are not
really components of a single system. For e.g., this occurs between
modules a and d.
• Data Coupling – Two modules are data coupled if they communicate
by passing parameters. This has been told to you as a "good design
principle" since day one of your programming instruction. For e.g.,
this occurs between module a and c.
• Stamp Coupling – Two modules are stamp coupled if they
communicate via a passed data structure that contains more
information than necessary for them to perform their functions. For
e.g., this occurs between modules b and a.
Cont…
• Control Coupling – Two modules are control coupled if they
communicate using at least one "control flag". For e.g., this occurs
between modules d and e.
• Common Coupling – Two modules are common coupled if they both
share the same global data area. Another design principle you have
been taught since day one: don't use global data. For e.g., this occurs
between modules c, g and k.
• Content Coupling – Two modules are content coupled if:
• One module changes a statement in another (Lisp was famous for this ability).
• One module references or alters data contained inside another module.
• One module branches into another module.
Difference between Cohesion and Coupling
No Cohesion Coupling
Cohesion is the measure of strength of the Coupling is the measure of the interdependence
1.
association of elements within a module. Of one module to another.
2. A module should be highly cohesive. Modules should have low coupling.
Cohesion is a property or characteristics Coupling is a property of a collection of
3.
of an individual module. modules.
The advantage of cohesion is the ability to The advantage of coupling is the ability to bind
4. avoid changing source and target systems systems by sharing behavior, and bound data,
just to facilitate integration. versus simple sharing information.
The fact that systems coupled could cease to
5. The fact that a single system failure won’t function if one or more of the coupled systems
bring down all connected systems. go down.
Design Heuristics
• Once program structure has been developed, effective modularity can be
achieved by applying the design concepts. The program structure can be
manipulated according to the following set of 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 below 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
above, 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.
• It covers the overall structure of the software and the ways in which that
structure provides conceptual integrity for a system.
• So, architecture is the hierarchical structure of program components
(modules), the manner in which these components interact and the structure
of data that are used by the components.
• An architectural design can be represented using any of the 5 – models given
below:
• Structural Models – They represent architecture as an organized collection of program
components.
• Framework Models – They increase the level of design abstraction by attempting to
identify repeatable architectural design frameworks.
• Dynamic Models – They address the behavioral aspects of the program architecture
(states).
• Process Models – They focus on the design of the business or technical process that the
system must accommodate.
• Functional Models – They can be used to represent the functional hierarchy of a system.
• A number of different architectural description languages (ADLs) have been
developed to represent these models.
Control Hierarchy
• The initial analysis activity 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. In essence, the software engineer attempts to understand
the system perception for each class of users.
• Once general requirements have been defined, a more detailed task
analysis is conducted. Those tasks that the user performs to
accomplish the goals of the system are identified, described, and
elaborated (over a number of iterative passes through the spiral).
b. Interface design
• The information gathered as part of the analysis activity is used to create an
analysis model for the interface. Using this model as a basis, the design activity
commences. 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
defined tasks in a manner that meets every usability goal defined for the
system.
c. Interface construction
• The implementation activity 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
d. Validation focuses on
• The ability of the interface to implement every user task correctly, to
accommodate all task variations, and to achieve all general user requirements;
Milestones, Walkthroughs and Inspections
• These activities help in exposing errors, provide increased project
communication, keeping the project in schedule, and verification
that the design satisfies the requirements.
• Milestones
1. These are a set of occasions in project design where the proper
progress of the project can be assessed in such a way that corrective
measures could be taken if necessary.
a. The two major milestones are –
• Preliminary Design Review (PDR) :- Its normally held near the end of architectural
design and prior to detailed design.
• Critical design Review (CDR) :- Its normally held at the end of detailed design and prior
to implementation.
b. The major goal of Preliminary Design Review(PDR) is to demonstrate the
externally observable characteristics and architectural structure of the product
which would satisfy the customer’s requirements.
• Functional characteristics,
• performance attributes,
• external interface,
• user dialogs,
• report formats,
• exception conditions and exception handling
• and future enhancements
are reviewed during PDR.
c. The Critical Design Review CDR provides a final management decision point
, to build or cancel the system.
Walkthroughs(systematic review process)
• A structured walkthrough is an in-depth, technical review of some aspects of
a software system. Walkthroughs can be anytime , during any phase of a
software project.
• A walkthrough team consists of 4 to 6 people. The person whose material is
being reviewed is responsible for providing copies of the review materials to
the members of the walkthrough group in advance of the walkthrough
session and the team members are responsible for understanding the
reviewing material before the session.
• During the walkthrough the reviewed “walks through” the material while the
reviewers look for errors, request clarification and explore problem areas in
the material under review.
• High-level managers should not attend walkthrough sessions as the aim of
walkthroughs is error detection not corrective action. Its important to note
that the material is reviewed not the person whose material is being
reviewed.
Inspections
• Design inspections are conducted by teams of trained inspectors
who have a check list of items to be examined.
• Special forms are used to record problems encountered.
• A typical inspection team consists of a Moderator or Secretary, a
Designer, an Implementor and a Tester. The Designer, Implementor
and Tester may or may not be the people responsible for the actual
design, implementation and testing of the product being inspected.
• The team members are trained for their specific roles and typically
conduct a dual 2-hrs sessions per day.
Software Configuration Management
1. Software configuration management (SCM) is an umbrella activity that is
applied throughout the software process, because change can occur at any
time.
2. SCM activities are developed to
1. Identify change,
2. Control change,
3. Ensure that change is being properly implemented, and
4. Report changes to others who may have an interest.
3. It is important to make a clear distinction between software support and
software configuration management.
1. Support is a set of software engineering activities that occur after software has been
delivered to the customer and put into operation.
2. Software configuration management is a set of tracking and control activities that begin
when a software engineering project begins and terminate only when the software is taken
out of operation(retired).
4. A primary goal of software engineering is to improve the ease with which changes
can be accommodated and reduce the amount of effort expended when changes must
be made.
5. The output of the software process is information that may be divided into three
broad categories:
1. Computer programs (both source level and executable forms);
2. Documents that describe the computer programs (targeted at both technical practitioners and
users), and
3. Data (contained within the program or external to it).
4. The items that comprise all information produced as part of the software process are
collectively called a software configuration.
6. As the software process progresses, the number of software configuration items
(SCIs) grows rapidly. A System Specification issues a Software Project Plan and
Software Requirements Specification (as well as hardware related documents). These
in turn issue other documents to create a hierarchy of information. If each SCI simply
spawned other SCIs, little confusion would result. Unfortunately, another variable enters
the process—change. Change may occur at any time, for any reason. In fact, the First
Law of System Engineering states: “No matter where you are in the system life cycle,
the system will change, and the desire to change it will persist throughout the life
cycle.”
7. There are four fundamental sources of change:
1. New business or market conditions dictate changes in product requirements or
business rules.
2. New customer needs demand modification of data produced by information
systems, functionality delivered by products, or services delivered by a computer-
based system.
3. Reorganization or business growth/downsizing causes changes in project priorities or
software engineering team structure.
4. Budgetary or scheduling constraints cause a redefinition of the system or product.
8. Software configuration management is a set of activities that have been
developed to manage change throughout the life cycle of computer software.
SCM can be viewed as a software quality assurance activity that is applied
throughout the software process.
Baselines
• A baseline is a software configuration management concept that helps us to control
change without seriously blocking justifiable change. The IEEE defines a baseline as: “A
specification or product that has been formally reviewed and agreed upon, that
thereafter serves as the basis for further development, and that can be changed only
through formal change control procedures.
• Consider the doors to the kitchen in a large restaurant. One door is marked OUT and the other is
marked IN. The doors have stops that allow them to be opened only in the appropriate direction.
• If a waiter picks up an order in the kitchen, places it on a tray and then realizes he has selected the
wrong dish, he may change to the correct dish quickly and informally before he leaves the kitchen.
• If, however, he leaves the kitchen, gives the customer the dish and then is informed of his error, he
must follow a set procedure:
• Look at the check to determine if an error has occurred,
• Apologize profusely,
• Return to the kitchen through the IN door,
• Explain the problem, and so forth.
• A baseline is analogous to the kitchen doors in the restaurant. Before a software configuration
item becomes a baseline, change may be made quickly and informally. However, once a
baseline is established, we figuratively pass through a swinging oneway door. Changes can be
made, but a specific, formal procedure must be applied to evaluate and verify each change.
• In the context of software engineering, a baseline is a milestone in the development of
software that is marked by the delivery of one or more software configuration items and the
approval of these SCIs that is obtained through a formal technical review.
• For example, the elements of a Design Specification have been documented and reviewed. Errors are found and
corrected. Once all parts of the specification have been reviewed, corrected and then approved, the Design
Specification becomes a baseline. Further changes to the program architecture (documented in the Design
Specification) can be made only after each has been evaluated and approved. Although baselines can be
defined at any level of detail, the most common software baselines are shown in Figure below.
• The progression of events that lead to a baseline is also illustrated in Figure below.
• Software engineering tasks produce one or more SCIs. After SCIs are reviewed and approved,
they are placed in a project database (also called a project library or software repository). When
a member of a software engineering team wants to make a modification to a baselined SCI, it is
copied from the project database into the engineer's private work space. However, this
extracted SCI can be modified only if SCM controls are followed. The arrows in Figure above
illustrate the modification path for a baselined SCI.
Software Configuration Items(SCI)
• A SCI could be considered to be a single section of a large
specification or one test case in a large suite of tests.
• An SCI is a document, an entire suite of test cases, or a named
program component (e.g., a C++ function or an Ada package).
• In addition to the SCIs that are derived from software work products,
many software engineering organizations also place software tools
under configuration control. That is, specific versions of editors,
compilers, and other CASE tools are "frozen" as part of the software
configuration. Because these tools were used to produce
documentation, source code, and data, they must be available when
changes to the software configuration are to be made.
• Although problems are rare, it is possible that a new version of a tool (e.g., a
compiler) might produce different results than the original version. For this
reason, tools, like the software that they help to produce, can be baselined as
part of a comprehensive configuration management process. In reality, SCIs
are organized to form configuration objects that may be cataloged in the
project database with a single name.
• A configuration object has a name, attributes, and is "connected" to other
objects by relationships. Referring to Figure below, the configuration objects,
Design Specification, data model, component N, source code and Test
Specification are each defined separately. However, each of the objects is
related to the others as shown by the arrows. A curved arrow indicates a
• compositional relation. That is, data model and component N are part of the
object Design Specification. A double-headed straight arrow indicates an
interrelationship.
• If a change were made to the source code object, the interrelationships
enable a software engineer to determine what other objects (and SCIs) might
be affected.
SCM Process
Formal technical reviews (FTR) – It’s a part of Software Quality Assurance (SQA) procedures. The objectives of
FTR are
• To uncover errors in functions, logic or implementation,
• To verify that the software under review should meet its requirement,
• To ensure that the representation of the software is according to the standards,
• To make the project more manageable
• It consists of walkthroughs, inspections and round-robin reviews.
• Software configuration audit – It consists of the following auditing procedures
To check whether the changes specified in the ECO (Engineering Change Order) has been properly
made and to check if any additional modules are added,
To check whether formal technical reviews are conducted for the assessment of technical correctness,
To check whether SE standards are properly followed,
To check whether the change is highlighted in the SCI (Software Configuration Items) documentation
and also the attributes of the configuration object should reflect the change,
To check whether SCM (Software Configuration Management) procedures like noting change,
recording it and reporting it has been properly done,
To check whether all the related SCIs are properly updated.
5. Configuration Status reporting (CSR) – Its an SCM task which summarizes the
activities done so far which includes the following
• The report of all the activities done,
• The report on the persons involved in the above reported activities,
• The report on the time and date when the reported activities were
accomplished,
• The report on various other factors or objects that will be affected due to the
reported activity.
Following are the situations where the CSR needs updating
• Each time when a SCI is assigned a new or updated identification,
• Each time ECO is issued i.e a when a change is approved by the CCA/CCB,
• Each time a configuration audit is conducted.
• The CSR is made available online and is updated occasionally in order to keep
the management and concerned individuals updated on the changes. It
improves the communication among all the people involved.