SlideShare a Scribd company logo
Software Engineering
KCS-601, Unit-III
Dr APJ Abdul Kalam Technical
University, Lucknow
By
Dr Anuranjan Misra
1
Dr Anuranjan Misra
innovation
Ambassador
Ministry of Education,
Government of India
& Professor & Dean,
GNIOT, Greater
Noida
Unit-III
Unit-III
Design and Implementation
Software design and implementation
 The process of converting the system
specification into an executable system.
 Software design
• Design a software structure that realises the
specification;
• Design a software structure that realises the
specification;
 Implementation
• Translate this structure into an executable
program;
 The activities of design and implementation are
closely related and may be inter-leaved.
The Design Phase
High-level (architectural) design consists
of developing an architectural structure for
software programs, databases, the user
software programs, databases, the user
interface, and the operating environment.
Low-level (detailed) design entails
developing the detailed algorithms and
data structures that are required for
program development.
The Implementation Phase
Primary objectives are to ensure that:
System is built, tested and installed (actual
programming of the system)
The implementation phase includes five
The implementation phase includes five
activities:
Construct software components
Verify and test
Develop prototypes for tuning
Train and document
Install the system
Design
 Designer plans to produce a s/w system such that it is
• Functional
• Reliable
• Easy to understand, modify, & maintain
SRS manifested with functional, information, and
 SRS manifested with functional, information, and
behavioral models feed the design process.
 Design produces
• Data Design
• Architecture Design
• Procedural Design
• Interface Design
Analysis Vs Design Models
Design Models ?
 Data Design
• created by transforming the data dictionary and ERD into
implementation data structures.
• requires as much attention as algorithm design.
 Architectural Design
• Defines relationship b/w structural elements of the s/w.
• Defines relationship b/w structural elements of the s/w.
• derived from the analysis model and the subsystem interactions
defined in the DFD.
 Interface Design
• derived from DFD and CFD and describes communication of
software elements with other software elements, other systems,
and human users.
 Procedural Design
• Transforms structural elements into procedural description.
The Software Design Process
R
equir
ements
specifica
tion
Design acti
vities
Ar
chitectur
al
design
Abstr
act
specifica
tion
Inter
face
design
Component
design
Da
ta
structur
e
design
Algorithm
design
System
architectur
e
Softw
are
specifica
tion
Inter
face
specifica
tion
Component
specifica
tion
Da
ta
structur
e
specifica
tion
Algorithm
specifica
tion
Design pr
oducts
Architectural Design
 Layered Architecture Example (UNIX)
• Core Layer Kernel
• Utility Layer System Calls
• Application Layer Shell & Library routines
• User Interface Layer User Application
 Data Centered Architecture: Central database is processed
through other components which add, delete, and update the
data.
 Data Flow Architecture: Applied when input data is to be
transformed into output data through a series of components.
Generally uses concepts of pipes and filters.
 Object Oriented Architecture: Data and operations
encapsulated together and communication among objects is
through message passing.
UNIX Layered Architecture
Importance of Design
 Design is a phase where quality is fostered.
 Without proper design we risk building an unstable
software.
 Design acts as a foundation for all subsequent
 Design acts as a foundation for all subsequent
phases.
Importance of Design
What is a Module?
 A lexically contiguous sequence of program
statements, bounded by boundary elements, with
an aggregate identifier.
• “Lexically contiguous”
• “Lexically contiguous”
• Adjoining in the code
• “Boundary elements”
• { ... }
• begin ... end
• “Aggregate identifier”
• A name for the entire module
Modularity
 Attribute of the s/w that allows it to be
managed intellectually.
 A monolithic s/w can’t be easily grasped by a
reader
Degree of Modularity
Cost
of
Efforts
Cost to module
Cost to
Interface
Overall efforts
Modularity
 Attribute of s/w that allows it to be managed intellectually. A
monolithic s/w can not be grasped by a reader easily.
 Therefore, it is easier to solve a complex problem by dividing
it into manageable pieces (modules).
 C(x): perceived complexity of the problem
C(x): perceived complexity of the problem
 E(x): Effort required to solve the problem
 For two problems P1 and P2
If C(P1) > C(P2) Then E(P1) > E(P2)
 Also it has been observed that
C(P1)+C(P2) < C(P1+P2)
 It therefore, follows that
E(P1)+E(P2) < E(P1+P2)
Control Hierarchy
 Organization of program components is depicted
through
• Depth and Width of the structure (graph)
representing
representing
• Number of levels of control.
• and overall span of control.
• Concept of FAN-IN and FAN-OUT.
• Concept of Super ordinate and subordinate
modules.
• Concept of Visibility and Connectivity.
Control Hierarchy
Control Hierarchy
Coupling
 The degree of interaction between two modules.
• Seven categories or levels of coupling
1. No direct coupling (Good)
1. No direct coupling (Good)
2. Data coupling
3. Stamp coupling
4. Control coupling
5. External coupling
6. Common coupling
7. Content coupling (Bad)
Content Coupling
 Two modules are content coupled if one module
directly modifies content or branches into the
middle of the other module.
 Examples:
• Module p modifies a statement of module q.
• Module p modifies a statement of module q.
• Module p refers to local data of module q in
terms of some numerical displacement within q.
• Module p branches into a local label of module q.
Why is Content Coupling So Bad?
 Almost any change to module q, requires a change
to module p
Example
Common Coupling
 Two modules are common coupled if they share
or have write access to the global data.
 Example 1:
• Modules cca and ccb can access and change the
value of global_variable
value of global_variable
Common Coupling (contd)
 Example 2:
• Modules cca and ccb both have access to the same
database, and can both read and write the same record
 Example 3:
• FORTRAN common
• COBOL common (nonstandard)
• COBOL-80 global
• C extern
Example
External Coupling
 Two modules are externally related by a common
data structure or device format etc.
 A form of coupling in which a module has a
dependency to other module, external to the
dependency to other module, external to the
software being developed or to a particular type of
hardware.
 This is basically related to the communication to
external tools and devices.
Control Coupling
 Two modules are control coupled if one module
controls the other by passing control flag as
parameter to the other.
 Example:
 Example:
• A control switch passed as an argument.
Stamp Coupling
 Some languages allow only simple variables as parameters
• part_number
• satellite_altitude
• degree_of_multiprogramming
 Many languages also support the passing of data
 Many languages also support the passing of data
structures
• part_record
• satellite_coordinates
• segment_table
 Two modules are stamp coupled if a data structure is
passed as a parameter, but the called module operates on
some but not all of the individual components of the data
structure.
Data Coupling
 Two modules are data coupled if all parameters are
homogeneous data items (simple parameters, or
data structures all of whose elements are used by
called module)
 Examples:
• display_time_of_arrival (flight_number);
• compute_product (first_number, second_number);
• get_job_with_highest_priority (job_queue);
Coupling Values
Sr. No. Type of Coupling Value
1. Content Coupling 0.95
2. Common Coupling 0.70
3. External Coupling 0.60
3. External Coupling 0.60
4. Control Coupling 0.50
5. Stamp Coupling 0.35
6. Data Coupling 0.20
7. No Direct Coupling 0.00
Cohesion
 The degree of interaction within a module. A
measure of the degree to which the elements of a
module are functionally related.
 Seven categories or levels of cohesion
1. Functional cohesion (good)
1. Functional cohesion (good)
2. Sequential cohesion
3. Communicational cohesion
4. Procedural cohesion
5. Temporal cohesion
6. Logical cohesion
7. Coincidental cohesion (bad)
Types of Cohesion
Coincidental Cohesion
 Coincidental cohesion exists in modules containing
instructions that have little or no relationship to one another.
 A module has coincidental cohesion if it performs multiple,
completely unrelated functions/actions.
 X and Y have no conceptual relationship.
 X and Y have no conceptual relationship.
 Example: Module checks user security,authenticates and
also prints monthly payrol.
• print_next_line, reverse_string_of_characters_comprising_second_
parameter, add_7_to_fifth_parameter,
convert_fourth_parameter_to_ floating_point
It’s BAD BECAUSE:
 It degrades maintainability.
 A module with coincidental cohesion is not reusable.
Logical Cohesion
 A module has logical cohesion when it performs a
series of logically related actions, one of which is
selected by the calling module.
 Example 1:
• An object performing all inputs irrespective of the device
• An object performing all inputs irrespective of the device
it is coming from or the nature of use of the data.
 Example 2:
• For more than one data items of type date in an input
transaction, separate code would be written to check that
each date is a valid date.
• A better way is to construct a DATECHECK module and
call it wherever necessary.
Temporal Cohesion
 A module has temporal cohesion when it performs a
series of actions related in time. May be performed in
the same time span.
 Example:
• open_old_master_file, new_master_file, transaction_file,
• open_old_master_file, new_master_file, transaction_file,
and print_file; initialize_sales_district_table,
read_first_transaction_record,
read_first_old_master_record (a.k.a. perform_initialization)
• The set of functions responsible for initialization, setting
start up values such as setting program counter or control
flags exhibit temporal cohesion. They should not be put in
the same function.
Procedural Cohesion
 A module has procedural cohesion if it performs a
series of actions related by the procedure to be
followed by the product.
 The two components X and Y are structured the
same way.
same way.
 Example:
• Data entry, Checking, and manipulation are
three functions but performed in a proper
sequence.
• Calculate student GPA, print student record,
calculate cumulative GPA, Print cumulative GPA
 A module has communicational cohesion if it performs a
series of actions related by the procedure to be followed
by the product, but in addition all the actions operate on
the same data
 Two components operate on the same input data or
Communicational Cohesion
 Two components operate on the same input data or
contribute to the same output data.
 X and Y operate on the same i/p data or contribute to
same o/p data.
 Example 1: Fetching of unrelated data from tape or disk
because it requires only one access.
 Example 2:
calculate_new_coordinates_and_send_them_to_terminal
Functional Cohesion
 A module with functional cohesion performs exactly
one action
 X and Y are part of the same functional task.
 Example 1:
 Example 1:
• get_temperature_of_furnace
 Example 2:
• compute_orbital_of_electron
 Example 3:
• write_to_floppy_disk
 Example 4:
• calculate_sales_commission
Sequential Cohesion
 More than one functions performed by the module
occur in an order prescribed by the specifications.
 X outputs some data which forms the input to Y.
 X outputs some data which forms the input to Y.
Cohesion Values
Sr. NO. Type of Cohesion Value
1. Coincidental 0.20
2. Logical 0.23
3. Temporal 0.25
3. Temporal 0.25
4. Procedural 0.40
5. Communicational 0.60
6. Sequential 0.70
7. Functional 0.95
Design Strength
 Dependence Matrix
• Depicts quantitative measure of dependence of
modules.
• Used to find strength of design.
• Used to find strength of design.
• Primarily affected by the coupling and
cohesion.
• Gives the probability of having to change
module i given that module j is changed.
• First order dependence and complete
dependence matrix are found.
First Order Dependence Matrix
 Represent coupling among various modules by a coupling matrix
C which will be symmetric i.e. Ci,j = Cj,I and diagonal elements
will be 1 i.e. Ci,i = 1.
 Represent strength of various modules by the strength vector S.
 FODM is constructed by the following formula
Di,j = 0.15*(Si+Sj)+0.7*Ci,j
Di,j = 0.15*(Si+Sj)+0.7*Ci,j
= 0 where Ci,j = 0
= 1 where Ci,j = 1
 FODM can be represented by a undirected graph having
links labeled with the dependence values.
 Initial connectivity status of modules can also be depicted by
a undirected graph having links assigned the coupling value
and nodes the strength value.
 FODM does not give a clear picture of dependence because
it is not able to incorporate indirect connectivity.
Undirected Graph for FODM
Observation about FODM
 Probability that module 3 changes if module 1 is changed
is not simply 0.2 as given by FODM .
 This probability will be in fact higher than 0.2 because
change in module 1 leads to a change in 4 which in turn
leads to a change in 8. A change in 8 due to external
leads to a change in 8. A change in 8 due to external
coupling leads to a change in 7 due to external coupling 7
which leads to a change in 3.
 FODM depicts that there is no dependence b/w module 1
and 9 which is really not correct.
 Infact there is a dependence among all module but the
level of dependence may be high or low.
 Due to this reason, a Complete Dependence Matrix
(CDM) is required for stability analysis of a program.
Complete Dependence Matrix
 CDM is obtained by finding out all unique paths from
one module to all other modules.
 Because these paths may not be mutually exclusive
to each other, hence addition law of probability is
not directly applicable.
not directly applicable.
 IF there are three unique paths to B from A labeled
as x, y, and z respectively with probabilities as P(x),
P(y), and P(z) THEN
 P(B changing) = P(x) + P(y) + P(z) - P(x)*P(y)
- P(y)*P(z) - P(x)*P(z) + P(x)*P(y)*P(z)
Undirected Graph & FODM
A B C D
A 1.0 0.4 0.3 0.0
B 0.4 1.0 0.4 0.5
C 0.3 0.4 1.0 0.2
D 0.0 0.5 0.2 1.0
Finding CDM
 Assume that A changes, probability of B changing is not
0.4 as shown by FODM but is higher than this.
 There are three possible chances of B changing as
there are three paths to B from A.
 Probabilities of these paths are
 Probabilities of these paths are
• P(x: A to B) = 0.4
• P(y: A to C to B) = 0.3 x 0.4 = 0.12
• P(z: A to C to D to B) = 0.3 x 0.2 x 0.5 = 0.030
 P(B Changing)= (0.4+0.12+0.030) - (0.4x0.12) -
(0.12x0.030) - (0.4x0.030) + (0.4x0.12x0.030) = 0.4878
 In similar way other probabilities and hence CDM can
be obtained.
Strength Measures
 CDM can be used to find the following measures
• Expected Change Measure (ECM) which gives
a probability of changing the number of modules
if a particular module changes.
ECMi = ΣDi,j where i and j are not equal.
ECMi = ΣDi,j where i and j are not equal.
• Overall Design Measure (ODM) which gives the
expected number of modules to be changed
given a module changes.
ODM = Σ Σ Di,j /m for i,j = 1 to m
Design of Computer
 A highly incompetent
computer architect
decides to build an
ALU, shifter, and 16
registers with AND,
registers with AND,
OR, and NOT gates,
rather than NAND or
NOR gates.
Figure 7.1
Design of Computer (contd..)
 The architect
designs 3
silicon chips
Figure 7.2
Design of Computer (Contd..)
 Redesign with
one gate type per
chip.
Resulting
 Resulting
“masterpiece”.
Figure 7.3
Computer Design (contd)
 The two designs are functionally equivalent but the
second design is
• Hard to understand.
• Hard to locate faults.
• Difficult to extend or enhance.
• Cannot be reused in another product.
 Modules must be like the first design
• Maximal relationships within modules, and
• Minimal relationships between modules.
Software Development Approaches
 The past
Procedural programs
Deterministic execution
Program in control
 The present
Interactive program
Event-driven execution
Objects
Structured Approach
 Systematic approaches to develop a software
design.
 The design is usually documented as a set of
graphical models.
graphical models.
 Possible models
• Object model;
• Sequence model;
• State transition model;
• Structural model;
• Data-flow model.
Structured approach
 Modeling techniques
DFD
ERD
ERD
 Problems
Sequential and transformational
Inflexible solutions
No reuse
Structured Approach
 The structured paradigm was successful initially
but started to fail with larger products (> 50,000
LOC)
 Post delivery maintenance problems (today, 70 to
80 percent of total effort)
80 percent of total effort)
 Reason: Structured methods are
• Action oriented (e.g., finite state machines,
data flow diagrams); or
• Data oriented (e.g., entity-relationship
diagrams);
• But not both
Structure Chart Notations
Example
Transaction Centered Structure
Description
Modules to Objects
Objects with high cohesion and low coupling

Objects

Information hiding
Information hiding

Abstract data types

Data encapsulation

Modules with high cohesion and low coupling

Modules
Object-Oriented approach
 Data-centric
 Event-driven
 Addresses emerging applications
Follows iterative and incremental process
 Follows iterative and incremental process
Structured versus Object-Oriented
Paradigm
Account Balance
Deposit
Withdrawal
Determine
Balance
Balance
Account
Balance
Message
Withdrawal
Determine
Balance
Account
Balance
Deposit Message
Message
Strengths of the Object-Oriented
Paradigm
 Information hiding reduces post-delivery maintenance due to
reduced chances of regression faults.
 Development is easier because Objects generally have physical
counterparts and this simplifies the modeling process.
 Well-designed objects are independent units as everything that
relates to the real-world object being modeled is encapsulated in
relates to the real-world object being modeled is encapsulated in
the object.
• Communication is by sending messages.
• Independence is enhanced by responsibility-driven design.
 A classical product conceptually consists of a single unit and
hence complex. But, object-oriented paradigm reduces complexity
because the product generally consists of independent units.
 The object-oriented paradigm promotes reuse of objects as they
are independent entities.
Classical Phases vs Object-
Oriented Workflows
Classical Paradigm
1. Requirements phase
2. Analysis &
specification phase
3. Design phase
Object-Oriented Paradigm
1. Requirements workflow
2. Object-Oriented Analysis
workflow
3. Object-Oriented Design
 There is no correspondence between phases and
workflows
3. Design phase
4. Implementation phase
5. Post-delivery
maintenance
6. Retirement
3. Object-Oriented Design
workflow
4. Object-Oriented
Implementation workflow
5. Post-delivery maintenance
6. Retirement
In More Details
Classical paradigm
2. Analysis (specification) phase
• Determine what the product is
to do
3. Design phase
• Architectural design
• Detailed design
4. Implementation phase
Object-Oriented paradigm
2. Object-Oriented Analysis workflow
• Determine what the product is to
do
• Extract the classes
3. Object-Oriented Design workflow
• Detailed design
4. Object-Oriented Implementation
 Objects enter here
 Modules (objects) are introduced as early as the object-oriented
analysis workflow.
• This ensures a smooth transition from the analysis workflow to
the design workflow
 The objects are then coded during the implementation workflow
• Again, the transition is smooth
4. Implementation phase
• Code the modules in an
appropriate programming
language.
• Integrate the coded modules.
4. Object-Oriented Implementation
workflow
• Code the modules in an
appropriate OO prog. language.
• Integrate
Modeling Primitives
 Objects
• an entity that has state, attributes and services.
• Interested in problem-domain objects for requirements
analysis.
 Classes
• Provide a way of grouping objects with similar attributes or
services.
services.
• Classes form an abstraction hierarchy though ‘is_a’
relationships.
 Attributes
• Together represent an object’s state.
• May specify type, visibility and modifiability of each attribute.
 Relationships
• ‘is_a’ classification relations.
• ‘part_of’ assembly relationships.
• ‘associations’ between classes.
Modeling Primitives
 Methods (services, functions)
• These are the operations that all objects in a class
can do when called on to do so by other objects
• E.g. Constructors/Destructors (if objects are
created dynamically)
created dynamically)
• E.g. Set/Get (access to the object’s state)
 Message Passing
• How objects invoke services of other objects.
 Use Cases/Scenarios
• Sequences of message passing between objects.
• Represent specific interactions.
Key Principles
 Classification (using inheritance)
• Classes capture commonalities of a number of
objects.
• Each subclass inherits attributes and methods
from its parent.
from its parent.
• Forms an ‘is_a’ hierarchy
 Child class may ‘specialize’ the parent class.
• by adding additional attributes & methods.
• by replacing an inherited attribute or method with
another.
 Multiple inheritance is possible where a class is
subclass of several different super classes.
Key Principles
 Information Hiding
• internal state of an object need not be visible to
external viewers.
• Objects can encapsulate other objects, and keep
their services internal.
their services internal.
 Aggregation
• Can describe relationships between parts and the
whole objects.
UML Diagram Types (9)
 These can be classified into 'static' and 'dynamic' diagrams.
• Static
Structure
• Class diagram
• Object diagram
Implementation
• Component diagram
• Deployment diagram
• Dynamic
Functionality
• Use Case diagram
Behavior
• Activity diagram
• State chart diagram
Interaction
• Collaboration
diagram
• Sequence diagram
System
Model
Parts of UML
 Class Diagrams
• Structure models
 Object Diagrams
• example models
Use Case Diagrams
 Use Case Diagrams
• document who can do what in a system
 Sequence Diagrams
• shows interactions between objects used to implement a
use case
 Collaboration Diagrams
• same as sequence diagrams but in different style
Parts of UML (Cont…)
 State chart Diagrams
• possible states and responses of a class and what transitions
them.
 Activity Diagrams
• describe the behavior of a class in response to internal
• describe the behavior of a class in response to internal
processing.
 Component Diagrams
• Organization of and dependencies amongst software
implementation components.
 Deployment Diagrams
• Describe the mapping of software implementation components
onto processing nodes.
• A concept, abstraction, or thing with crisp
boundaries and meaning for the problem at
hand
• promote understanding of the real world
• provide a practical basis for computer
implementation
Object
implementation
Problem Decomposition
 Decomposition of a problem into
objects depends on
• Judgment
• The nature of the problem being solved
• The nature of the problem being solved
• Not only the domain: two analyses of the same
domain will turn out differently depending upon the
kind of programs we wish to produce.
Classes
 A class describes a group of objects
with similar properties.
• Class: Instructor
• Object: David Penny
• Object: David Penny
• Object: Matthew Zaleski
Instructor Department
Example
• Class: Department
• Object: Department of Computer Science
• Object: Department of Electrical Engineering
Attributes
 Data values held by the objects of a class
Instructor
name: string
age: integer
weight: integer
Operations
 A function or a transformation that may be
applied to or by objects in a class.
• Not often used (not often terribly useful) in an
OOA
Instructor
Instructor
name
age
weight
teach
mark
listen_to_complaints
Links and Associations
 The means for establishing
relationships among objects and
classes.
• link: a connection between two object
• link: a connection between two object
instances
• association: a collection of links with
common structure and semantics.
Instructor Department
teaches for
Object Diagrams
 Models instances of things contained in class
diagrams.
 Shows a set of objects and their links at a
point in time
 Useful preparatory to deciding on class
structures.
 Useful in order to better explain more
complex class diagrams by giving instance
examples.
i: Instructor
name = “Penny”
: Department
name = “DCS”
name = “Penny”
j: Instructor
name = “Zaleski”
: Department
name = “ECE”
Multiplicity
 Used to indicate the number of potential
instances involved in the association when the
other associated classes are fixed.
Instructor Department
teaches
for
A given instructor
can teach for
potentially many
departments or none)
A given department
employs zero or
more instructors
*
*
N-ary Associations
Instructor Department
teaches
1 1
A given instructor
teaching for a given
There is exactly
one instructor
Course
*
teaching for a given
department may
teach zero or more
courses for that
department.
one instructor
teaching a given
course for a given
department
Try to avoid them!
Attributes on Associations
teaches for
pay
Instructor Department
teaches for
Aggregation Indicators (Part-Of)
Department
Implied
multiplicity of 1
Window
Student
multiplicity of 1
Frame
Composition
(strong ownership,
coincident lifetime)
Aggregation
(no associated semantics)
Generalization (a.k.a.
Inheritance, is-a)
Shape
Rectangle Circle Triangle
Square
Example
 We are asked to build a system for
keeping track of the time our workers
spend working on customer projects.
 We divide projects into activities, and
 We divide projects into activities, and
the activities into tasks. A task is
assigned to a worker, who could be a
salaried worker or an hourly worker.
 Each task requires a certain skill, and
resources have various skills at various
level of expertise.
Steps
 Analyze the written requirements
• Extract nouns: make them classes
• Extract verbs: make them associations
• Draw the OOA UML class diagrams
• Determine attributes
• Determine attributes
• Draw object diagrams to clarify class diagrams
Steps (contd..)
 Determine the system’s use cases
• Identify Actors
• Identify use case
• Relate use cases
Draw sequence diagrams
 Draw sequence diagrams
• One per use case
• Use to assign responsibilities to classes
 Add methods to OOA classes
Example
 We are asked to build a system for
keeping track of the time our workers
spend working on customer projects.
Customer
Worker
Customer
Project
Time
spends *
1
*
*
*
*
*
1
contracts
Example
 We divide projects into activities, and
the activities into tasks. A task is
assigned to a worker, who could be a
salaried worker or an hourly worker.
salaried worker or an hourly worker.
Project
Worker
SalariedWorker HourlyWorker
Activity
1..*
Task
1..*
*
1
Assignment
Time
spent on ◄
Example
 Each task requires a certain skill, and
workers have various skills at various
level of expertise.
Worker
Skill
Task
requires
◄
ha
s
SkillLevel
1..*
*
*
1..*
Steps
 Analyze the written requirements
• Extract nouns: make them classes
• Extract verbs: make them associations
• Draw the OOA UML class diagrams
• Determine attributes
• Determine attributes
• Draw object diagrams to clarify class diagrams
 Determine the system’s use cases
• Identify Actors
• Identify use case
• Relate use cases
Example
Customer
companyName
primeContact
address
phone
Project
contracts
phone
fax
N.B.
• Project has no attribute in Customer
• association is enough
• no database id for Customer shown
• in an OOA, only include an id if visible to users
• may include such things during database design or OOD
Example
Project
name
description
startDate: date
Customer
contracts ◄
startDate: date
Activity
name
description
startDate: date
estHours: int
deliverable: string
Task
Example
Task
Activity
Constraint: A task may only
be assigned to a worker who
has the required skill.
description
startDate: date
estHours: int
Skill
Worker
requires
assigned to
has
Example
Worker
SkillLevel
level: int
rateMultiplier: real
assigned to
Skill
name: string
has
Worker
name: string
SalariedWorker
salary: real
vacationDays: int
HourlyWorker
hourlyWage: real
Task
assigned to
Example
Time
start: dateTime
end: dateTime
hours: real
spent on
Assignment
Task Worker
assigned to
spent on
Steps
 Analyze the written requirements
• Extract nouns: make them classes
• Extract verbs: make them associations
• Draw the OOA UML class diagrams
• Determine attributes
• Draw object diagrams to clarify class diagrams
 Determine the system’s use cases
• Identify Actors
• Identify use case
• Relate use cases
 Draw sequence diagrams
• One per use case
• Use to assign responsibilities to classes
 Add methods to OOA classes
Object Diagrams
:Time
start: Jan.23, 2002, 8:00
end: Jan.23, 2002, 18:00
hours: 4.2
:Assignment
:Task
description: “develop class diagrams”
:Worker
name: “Matt”
Steps
 Analyze the written requirements
• Extract nouns: make them classes
• Extract verbs: make them associations
• Draw the OOA UML class diagrams
• Draw object diagrams to clarify class diagrams
• Determine attributes
• Determine attributes
 Determine the system’s use cases
• Identify Actors
• Identify use case
• Relate use cases
 Draw sequence diagrams
• One per use case
• Use to assign responsibilities to classes
 Add methods to OOA classes
Use Cases
 Actors:
• Represent users of a system
• human users
• other systems
 Use cases
• Represent functionality or services
provided by a system to its users
Use Case Diagrams
Time & Resource Management System
(TRMS)
resource
manager
Manage
Resources
Manage
project
manager
manager
worker
<<actor>>
Backup
System
Log Time
Manage
Projects
Administer
System
system
administrator
Resource Manager Use Cases
Add
Skill
Remove
Skill
Find
Skill
<<uses>>
resource
manager
Skill
Update
Skill
More Resource Manager Use
Cases
Add
Worker
Remove
Worker
Find
Worker
<<uses>>
resource
manager
Update
Worker
Find
Skill
<<uses>>
Assign Skill
to Worker
Unassign Skill
from Worker
<<extends>>
Steps
 Analyze the written requirements
• Extract nouns: make them classes
• Extract verbs: make them associations
• Draw the OOA UML class diagrams
• Draw object diagrams to clarify class diagrams
• Determine attributes
• Determine attributes
 Determine the system’s use cases
• Identify Actors
• Identify use case
• Relate use cases
 Draw sequence diagrams
• One per use case
• Use to assign responsibilities to classes
 Add methods to OOA classes
Sequence Diagram – Assign Skill to
Worker Use Case
resource
manager
Res. Mgr. Win: UI :Worker :Skill :SkillLevel
find worker
find worker
find skill
assign skill
to worker
find worker
by name
find skill by name
[worker does not currently have skill]
assign skill to worker
Steps
 Analyze the written requirements
• Extract nouns: make them classes
• Extract verbs: make them associations
• Draw the OOA UML class diagrams
• Draw object diagrams to clarify class diagrams
• Determine attributes
• Determine attributes
 Determine the system’s use cases
• Identify Actors
• Identify use case
• Relate use cases
 Draw sequence diagrams
• One per use case
• Use to assign responsibilities to classes
 Add methods to OOA classes
Add Methods
 Read sequence diagrams to identify necessary
methods
Worker
Worker
name: string
+ static Worker findWorker(String name);
+ static list of Workers getWorkers();
In Design
 Bring methods closer to implementation
Worker
name: string
name: string
+ static Worker findWorker(String name);
+ static int getNWorkers();
+ static Worker getWorker(int);
In Design
 Bring methods closer to implementation
WorkList
Int getNumListElements(); ListModel
Worker
name: string
+ static Worker findWorker(String name);
Int getNumListElements();
String getListElement(int n);
ListModel
int getNumListElements();
String getListElement(int n);
Software Measurement
 Software Measurement: Quantitative
determination of an attribute of the software.
 Why to Measure the Software ?
 Why to Measure the Software ?
 To gain insight by providing mechanisms for
objective evaluation.
 To improve understanding of particular entities
and attributes.
 Developers measure software to check whether
 Requirements are consistent and complete.
 Design is of high quality.
 Code is ready to be tested.
 Project Managers measure software to
 Decide about delivery date (Schedule).
Software Measurement
 Decide about delivery date (Schedule).
 Check the Budget.
 Evaluate Attributes of process and product.
 Customers measure software to check
 Whether Requirements are met ?
 Quality of the product.
 Attributes of the final product.
 Maintainers measure software to decide
 What to be up-graded and improved ?
 Aspects of adaptability.
Software Measurement Objectives
 Indicate quality of the Software.
 Assess the productivity of the people.
 Assess benefits derived from new methods
and tools.
and tools.
 Form baseline for future estimation.
 Justifications for new tools and training.
 To ensure control in project management.
“You can not control what you can not measure”
- DeMarco (1982)
What to Measure ?
 Size
 Complexity
 Reliability
 Quality
 Coupling and Cohesion
 Cost
 Duration
 Efforts
Function Points
Parameter Simple + Average + Complex = Fi
Distinct input items 3( ) + 4( ) + 6( ) = ?
Output screens/
reports
4( ) + 5( ) + 7( ) = ?
reports
Types of user queries 3( ) + 4( ) + 6( ) = ?
Number of files 7( ) + 10( ) + 15( ) = ?
External interface 5( ) + 7( ) + 10( ) = ?
Total (T) = ?
Function Point Equation
FP = T * (0.65 + 0.01 * Q)
Where T = unadjusted table total
Q = score from questionnaire
Q = score from questionnaire
(14 items with values 0 to 5)
 Cost of producing one function point? May be
organization specific.
Function Point Questionnaire
1. Backup.
2. Data communication.
3. Distributed processes.
4. Optimal performance.
9. Complex inputs,
queries, outputs.
10. Complex internal
processing.
11. Reusable code.
5. Heavily used
operating system.
6. On-line data security.
7. Multiple screens.
8. On-line master file
update.
11. Reusable code.
12. Conversion or
installation.
13. Multiple user sites.
14. Ease of use.
Halstead’s Software Science
Assumptions
 complete algorithm specification exist
 programmer works alone
programmer knows what to do
 programmer knows what to do
 Based on counting of
n1 = # of unique operators
n2 = # of unique operands
N1 = # of occurrences of operators
N2 = # of occurrences of operands
Halstead Equations
 Program Vocabulary (n) = n1+n2
 Program Length (N) = N1+N2
 Program Length (N) = n1* log2 (n1) + n2* log2 (n2)
 Program Volume (V) = N* log2 (n)
 Program Volume (V) = N* log2 (n)
 Program Level (L) = V*/V = (2/n1)*(n2/N2)
 Effort (E) = V/L = V2 /V*=V*[(n1*N2)/(2*n2)]
 Language Level (l) = LV* (Constant)
 Time (T)= E/B where B = (18) 5 to 20
Example1
PROGRAM1(input,otput)
VAR
a,b,c,d,m: integer;
BEGIN
BEGIN
readln(a,b,c,d);
a:= a+a;
b:=b+b;
c:=c*d;
m:= a+b-c;
writeln(m)
END.
Calculations (Example1)
n1=11 (BEGIN_END , readln () ; := + * - writeln .)
n2= 5 (a b c d m)
N1= 23 (1+3+1+2+5+4+3+1+1+1+1)
N2= 18 (5+5+4+2+2)
N2= 18 (5+5+4+2+2)
V= 41*log(11+5)=164
E= 164*[911*18)/(2*5)]=3247
Example2
PROGRAM2(input,otput);
VAR
a,b,c,d,m: integer;
BEGIN
readln(a,b,c,d);
IF a>b THEN
IF b>c THEN
m:= a+b
ELSE
m:=b+c
ELSE
m:=b+c+d;
writeln(m)
END.
Calculations (Example2)
n1 = 11 (BEGIN_END readln () , ; IF-THEN-ELSE
> := + writeln .)
n2 = 5 (a b c d m)
N1 = 22 (1+1+2+3+2+2+2+3+4+1+1)
N1 = 22 (1+1+2+3+2+2+2+3+4+1+1)
N2 = 19 (3+6+4+2+4)
V = 41*log(11+5) = 164
E = 164*[(11*19)/(2*5)] = 3427
Halstead Modified Theory
 Certain operators and operands which are part of
control statements contribute extra in the count value.
 Assign weights so that measures can reflect complexity
produced by the non sequential control structures.
Nw =Σx in T [1+µ(x)*{L(x)+Adw(x)}]
 Nw1 =Σx in T [1+µ(x)*{L(x)+Adw(x)}]
 Nw2 =Σx in R [1+µ(x)*{L(x)+Adw(x)}]
 Where µ(x) = 1 if x is the part of control statement
= 0 otherwise
 L(x) is the level of the statement and Adw(x) is the
additional weight assigned depending on the number of
test conditions checked for taking decision.
Calculations (Example2)
 n1 = 11 (BEGIN_END readln () , ; IF-THEN-ELSE >
:= + writeln . )
 n2 = 5 (a b c d m)
 Nw1 = N1+6 = 28
 Nw1 = N1+6 = 28
 Nw2 = N2+6 = 25
 Vw = 53*log(11+5) = 212
 Ew = 212*[(11*25)/(2*5)] = 5830
Cyclomatic Complexity Measure
Cyclomatic Complexity
 Cyclomatic complexity of the program is computed
from its flow graph using the formula
• CC(G) = E – N + 2*k where k is number of
connected components.
connected components.
• CC(G)=P+1 where P is the number of predicate
nodes which can be counted by the conditional
statements in the PDL representation.
• CC(G)= R+1 where R is the number of closed
regions in the flow graph.
Basis Path Testing
 Determine the basis set of linearly independent
paths.
 Cardinality of this set is the program cyclomatic
complexity
 Prepare test cases that will force the execution
of each path in the basis set.
Example1
Example2
Example3
Example4
Solutions

More Related Content

Similar to Software Engineering - SOFTWARE DESIGN Process

SE2018_Lec 15_ Software Design
SE2018_Lec 15_ Software DesignSE2018_Lec 15_ Software Design
SE2018_Lec 15_ Software Design
Amr E. Mohamed
 
Unit_4_Software_Design.pptx
Unit_4_Software_Design.pptxUnit_4_Software_Design.pptx
Unit_4_Software_Design.pptx
taxegap762
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptx
gauriVarshney8
 
Software design
Software designSoftware design
Software design
Himanshu Awasthi
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineering
Rupesh Vaishnav
 
object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptx
urvashipundir04
 
Chapter 4 software design
Chapter 4  software designChapter 4  software design
Chapter 4 software design
Cliftone Mullah
 
Design Engineering and Design concepts
Design Engineering and Design conceptsDesign Engineering and Design concepts
Design Engineering and Design concepts
JigyasaAgrawal7
 
Software engg. pressman_ch-9
Software engg. pressman_ch-9Software engg. pressman_ch-9
Software engg. pressman_ch-9
Dhairya Joshi
 
UNIT 3-DEMONSTRATING A COMPREHENSIVE UNDERSTANDING OF SOFTWARE DESIGN.pptx
UNIT 3-DEMONSTRATING A COMPREHENSIVE UNDERSTANDING OF SOFTWARE DESIGN.pptxUNIT 3-DEMONSTRATING A COMPREHENSIVE UNDERSTANDING OF SOFTWARE DESIGN.pptx
UNIT 3-DEMONSTRATING A COMPREHENSIVE UNDERSTANDING OF SOFTWARE DESIGN.pptx
LeahRachael
 
Object oriented sad-5 part i
Object oriented sad-5 part iObject oriented sad-5 part i
Object oriented sad-5 part i
Bisrat Girma
 
Se ii unit2-software_design_principles
Se ii unit2-software_design_principlesSe ii unit2-software_design_principles
Se ii unit2-software_design_principles
Ahmad sohail Kakar
 
Software Designing - Software Engineering
Software Designing - Software EngineeringSoftware Designing - Software Engineering
Software Designing - Software Engineering
Purvik Rana
 
Unit-3.doc
Unit-3.docUnit-3.doc
Unit-3.doc
chitranshidheeraj6
 
Fundamental design concepts
Fundamental design conceptsFundamental design concepts
Fundamental design concepts
srijavel
 
rEFUP.pdf
rEFUP.pdfrEFUP.pdf
Software engg. pressman_ch-10
Software engg. pressman_ch-10Software engg. pressman_ch-10
Software engg. pressman_ch-10
Dhairya Joshi
 
Middleware Technologies
Middleware Technologies Middleware Technologies
Middleware Technologies
prakashk453625
 
software Design.ppt
software Design.pptsoftware Design.ppt
software Design.ppt
Satyanandaram Nandigam
 
Middle ware Technologies
Middle ware TechnologiesMiddle ware Technologies
Middle ware Technologies
prakashk453625
 

Similar to Software Engineering - SOFTWARE DESIGN Process (20)

SE2018_Lec 15_ Software Design
SE2018_Lec 15_ Software DesignSE2018_Lec 15_ Software Design
SE2018_Lec 15_ Software Design
 
Unit_4_Software_Design.pptx
Unit_4_Software_Design.pptxUnit_4_Software_Design.pptx
Unit_4_Software_Design.pptx
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptx
 
Software design
Software designSoftware design
Software design
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineering
 
object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptx
 
Chapter 4 software design
Chapter 4  software designChapter 4  software design
Chapter 4 software design
 
Design Engineering and Design concepts
Design Engineering and Design conceptsDesign Engineering and Design concepts
Design Engineering and Design concepts
 
Software engg. pressman_ch-9
Software engg. pressman_ch-9Software engg. pressman_ch-9
Software engg. pressman_ch-9
 
UNIT 3-DEMONSTRATING A COMPREHENSIVE UNDERSTANDING OF SOFTWARE DESIGN.pptx
UNIT 3-DEMONSTRATING A COMPREHENSIVE UNDERSTANDING OF SOFTWARE DESIGN.pptxUNIT 3-DEMONSTRATING A COMPREHENSIVE UNDERSTANDING OF SOFTWARE DESIGN.pptx
UNIT 3-DEMONSTRATING A COMPREHENSIVE UNDERSTANDING OF SOFTWARE DESIGN.pptx
 
Object oriented sad-5 part i
Object oriented sad-5 part iObject oriented sad-5 part i
Object oriented sad-5 part i
 
Se ii unit2-software_design_principles
Se ii unit2-software_design_principlesSe ii unit2-software_design_principles
Se ii unit2-software_design_principles
 
Software Designing - Software Engineering
Software Designing - Software EngineeringSoftware Designing - Software Engineering
Software Designing - Software Engineering
 
Unit-3.doc
Unit-3.docUnit-3.doc
Unit-3.doc
 
Fundamental design concepts
Fundamental design conceptsFundamental design concepts
Fundamental design concepts
 
rEFUP.pdf
rEFUP.pdfrEFUP.pdf
rEFUP.pdf
 
Software engg. pressman_ch-10
Software engg. pressman_ch-10Software engg. pressman_ch-10
Software engg. pressman_ch-10
 
Middleware Technologies
Middleware Technologies Middleware Technologies
Middleware Technologies
 
software Design.ppt
software Design.pptsoftware Design.ppt
software Design.ppt
 
Middle ware Technologies
Middle ware TechnologiesMiddle ware Technologies
Middle ware Technologies
 

More from Dr Anuranjan Misra

Software Engineering Software Project Management
Software Engineering Software Project ManagementSoftware Engineering Software Project Management
Software Engineering Software Project Management
Dr Anuranjan Misra
 
Software Engineering TESTING AND MAINTENANCE
Software Engineering TESTING AND MAINTENANCESoftware Engineering TESTING AND MAINTENANCE
Software Engineering TESTING AND MAINTENANCE
Dr Anuranjan Misra
 
Software Engineering REQUIREMENTS ANALYSIS AND SPECIFICATION
Software Engineering REQUIREMENTS ANALYSIS AND SPECIFICATIONSoftware Engineering REQUIREMENTS ANALYSIS AND SPECIFICATION
Software Engineering REQUIREMENTS ANALYSIS AND SPECIFICATION
Dr Anuranjan Misra
 
Software Engineering Perspective and Specialized Process Models
Software Engineering Perspective and Specialized Process ModelsSoftware Engineering Perspective and Specialized Process Models
Software Engineering Perspective and Specialized Process Models
Dr Anuranjan Misra
 
Various Process of Software Engineering notes
Various Process of Software Engineering notesVarious Process of Software Engineering notes
Various Process of Software Engineering notes
Dr Anuranjan Misra
 
Introduction to Software Engineering Notes
Introduction to Software Engineering NotesIntroduction to Software Engineering Notes
Introduction to Software Engineering Notes
Dr Anuranjan Misra
 

More from Dr Anuranjan Misra (6)

Software Engineering Software Project Management
Software Engineering Software Project ManagementSoftware Engineering Software Project Management
Software Engineering Software Project Management
 
Software Engineering TESTING AND MAINTENANCE
Software Engineering TESTING AND MAINTENANCESoftware Engineering TESTING AND MAINTENANCE
Software Engineering TESTING AND MAINTENANCE
 
Software Engineering REQUIREMENTS ANALYSIS AND SPECIFICATION
Software Engineering REQUIREMENTS ANALYSIS AND SPECIFICATIONSoftware Engineering REQUIREMENTS ANALYSIS AND SPECIFICATION
Software Engineering REQUIREMENTS ANALYSIS AND SPECIFICATION
 
Software Engineering Perspective and Specialized Process Models
Software Engineering Perspective and Specialized Process ModelsSoftware Engineering Perspective and Specialized Process Models
Software Engineering Perspective and Specialized Process Models
 
Various Process of Software Engineering notes
Various Process of Software Engineering notesVarious Process of Software Engineering notes
Various Process of Software Engineering notes
 
Introduction to Software Engineering Notes
Introduction to Software Engineering NotesIntroduction to Software Engineering Notes
Introduction to Software Engineering Notes
 

Recently uploaded

math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 

Recently uploaded (20)

math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 

Software Engineering - SOFTWARE DESIGN Process

  • 1. Software Engineering KCS-601, Unit-III Dr APJ Abdul Kalam Technical University, Lucknow By Dr Anuranjan Misra 1 Dr Anuranjan Misra innovation Ambassador Ministry of Education, Government of India & Professor & Dean, GNIOT, Greater Noida
  • 3. Software design and implementation  The process of converting the system specification into an executable system.  Software design • Design a software structure that realises the specification; • Design a software structure that realises the specification;  Implementation • Translate this structure into an executable program;  The activities of design and implementation are closely related and may be inter-leaved.
  • 4.
  • 5. The Design Phase High-level (architectural) design consists of developing an architectural structure for software programs, databases, the user software programs, databases, the user interface, and the operating environment. Low-level (detailed) design entails developing the detailed algorithms and data structures that are required for program development.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. The Implementation Phase Primary objectives are to ensure that: System is built, tested and installed (actual programming of the system) The implementation phase includes five The implementation phase includes five activities: Construct software components Verify and test Develop prototypes for tuning Train and document Install the system
  • 11. Design  Designer plans to produce a s/w system such that it is • Functional • Reliable • Easy to understand, modify, & maintain SRS manifested with functional, information, and  SRS manifested with functional, information, and behavioral models feed the design process.  Design produces • Data Design • Architecture Design • Procedural Design • Interface Design
  • 13. Design Models ?  Data Design • created by transforming the data dictionary and ERD into implementation data structures. • requires as much attention as algorithm design.  Architectural Design • Defines relationship b/w structural elements of the s/w. • Defines relationship b/w structural elements of the s/w. • derived from the analysis model and the subsystem interactions defined in the DFD.  Interface Design • derived from DFD and CFD and describes communication of software elements with other software elements, other systems, and human users.  Procedural Design • Transforms structural elements into procedural description.
  • 14. The Software Design Process R equir ements specifica tion Design acti vities Ar chitectur al design Abstr act specifica tion Inter face design Component design Da ta structur e design Algorithm design System architectur e Softw are specifica tion Inter face specifica tion Component specifica tion Da ta structur e specifica tion Algorithm specifica tion Design pr oducts
  • 15. Architectural Design  Layered Architecture Example (UNIX) • Core Layer Kernel • Utility Layer System Calls • Application Layer Shell & Library routines • User Interface Layer User Application  Data Centered Architecture: Central database is processed through other components which add, delete, and update the data.  Data Flow Architecture: Applied when input data is to be transformed into output data through a series of components. Generally uses concepts of pipes and filters.  Object Oriented Architecture: Data and operations encapsulated together and communication among objects is through message passing.
  • 17.
  • 18.
  • 19.
  • 20. Importance of Design  Design is a phase where quality is fostered.  Without proper design we risk building an unstable software.  Design acts as a foundation for all subsequent  Design acts as a foundation for all subsequent phases.
  • 22. What is a Module?  A lexically contiguous sequence of program statements, bounded by boundary elements, with an aggregate identifier. • “Lexically contiguous” • “Lexically contiguous” • Adjoining in the code • “Boundary elements” • { ... } • begin ... end • “Aggregate identifier” • A name for the entire module
  • 23.
  • 24. Modularity  Attribute of the s/w that allows it to be managed intellectually.  A monolithic s/w can’t be easily grasped by a reader Degree of Modularity Cost of Efforts Cost to module Cost to Interface Overall efforts
  • 25. Modularity  Attribute of s/w that allows it to be managed intellectually. A monolithic s/w can not be grasped by a reader easily.  Therefore, it is easier to solve a complex problem by dividing it into manageable pieces (modules).  C(x): perceived complexity of the problem C(x): perceived complexity of the problem  E(x): Effort required to solve the problem  For two problems P1 and P2 If C(P1) > C(P2) Then E(P1) > E(P2)  Also it has been observed that C(P1)+C(P2) < C(P1+P2)  It therefore, follows that E(P1)+E(P2) < E(P1+P2)
  • 26. Control Hierarchy  Organization of program components is depicted through • Depth and Width of the structure (graph) representing representing • Number of levels of control. • and overall span of control. • Concept of FAN-IN and FAN-OUT. • Concept of Super ordinate and subordinate modules. • Concept of Visibility and Connectivity.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. Coupling  The degree of interaction between two modules. • Seven categories or levels of coupling 1. No direct coupling (Good) 1. No direct coupling (Good) 2. Data coupling 3. Stamp coupling 4. Control coupling 5. External coupling 6. Common coupling 7. Content coupling (Bad)
  • 34. Content Coupling  Two modules are content coupled if one module directly modifies content or branches into the middle of the other module.  Examples: • Module p modifies a statement of module q. • Module p modifies a statement of module q. • Module p refers to local data of module q in terms of some numerical displacement within q. • Module p branches into a local label of module q. Why is Content Coupling So Bad?  Almost any change to module q, requires a change to module p
  • 36. Common Coupling  Two modules are common coupled if they share or have write access to the global data.  Example 1: • Modules cca and ccb can access and change the value of global_variable value of global_variable
  • 37. Common Coupling (contd)  Example 2: • Modules cca and ccb both have access to the same database, and can both read and write the same record  Example 3: • FORTRAN common • COBOL common (nonstandard) • COBOL-80 global • C extern
  • 39. External Coupling  Two modules are externally related by a common data structure or device format etc.  A form of coupling in which a module has a dependency to other module, external to the dependency to other module, external to the software being developed or to a particular type of hardware.  This is basically related to the communication to external tools and devices.
  • 40. Control Coupling  Two modules are control coupled if one module controls the other by passing control flag as parameter to the other.  Example:  Example: • A control switch passed as an argument.
  • 41. Stamp Coupling  Some languages allow only simple variables as parameters • part_number • satellite_altitude • degree_of_multiprogramming  Many languages also support the passing of data  Many languages also support the passing of data structures • part_record • satellite_coordinates • segment_table  Two modules are stamp coupled if a data structure is passed as a parameter, but the called module operates on some but not all of the individual components of the data structure.
  • 42. Data Coupling  Two modules are data coupled if all parameters are homogeneous data items (simple parameters, or data structures all of whose elements are used by called module)  Examples: • display_time_of_arrival (flight_number); • compute_product (first_number, second_number); • get_job_with_highest_priority (job_queue);
  • 43. Coupling Values Sr. No. Type of Coupling Value 1. Content Coupling 0.95 2. Common Coupling 0.70 3. External Coupling 0.60 3. External Coupling 0.60 4. Control Coupling 0.50 5. Stamp Coupling 0.35 6. Data Coupling 0.20 7. No Direct Coupling 0.00
  • 44. Cohesion  The degree of interaction within a module. A measure of the degree to which the elements of a module are functionally related.  Seven categories or levels of cohesion 1. Functional cohesion (good) 1. Functional cohesion (good) 2. Sequential cohesion 3. Communicational cohesion 4. Procedural cohesion 5. Temporal cohesion 6. Logical cohesion 7. Coincidental cohesion (bad)
  • 46. Coincidental Cohesion  Coincidental cohesion exists in modules containing instructions that have little or no relationship to one another.  A module has coincidental cohesion if it performs multiple, completely unrelated functions/actions.  X and Y have no conceptual relationship.  X and Y have no conceptual relationship.  Example: Module checks user security,authenticates and also prints monthly payrol. • print_next_line, reverse_string_of_characters_comprising_second_ parameter, add_7_to_fifth_parameter, convert_fourth_parameter_to_ floating_point It’s BAD BECAUSE:  It degrades maintainability.  A module with coincidental cohesion is not reusable.
  • 47. Logical Cohesion  A module has logical cohesion when it performs a series of logically related actions, one of which is selected by the calling module.  Example 1: • An object performing all inputs irrespective of the device • An object performing all inputs irrespective of the device it is coming from or the nature of use of the data.  Example 2: • For more than one data items of type date in an input transaction, separate code would be written to check that each date is a valid date. • A better way is to construct a DATECHECK module and call it wherever necessary.
  • 48. Temporal Cohesion  A module has temporal cohesion when it performs a series of actions related in time. May be performed in the same time span.  Example: • open_old_master_file, new_master_file, transaction_file, • open_old_master_file, new_master_file, transaction_file, and print_file; initialize_sales_district_table, read_first_transaction_record, read_first_old_master_record (a.k.a. perform_initialization) • The set of functions responsible for initialization, setting start up values such as setting program counter or control flags exhibit temporal cohesion. They should not be put in the same function.
  • 49. Procedural Cohesion  A module has procedural cohesion if it performs a series of actions related by the procedure to be followed by the product.  The two components X and Y are structured the same way. same way.  Example: • Data entry, Checking, and manipulation are three functions but performed in a proper sequence. • Calculate student GPA, print student record, calculate cumulative GPA, Print cumulative GPA
  • 50.  A module has communicational cohesion if it performs a series of actions related by the procedure to be followed by the product, but in addition all the actions operate on the same data  Two components operate on the same input data or Communicational Cohesion  Two components operate on the same input data or contribute to the same output data.  X and Y operate on the same i/p data or contribute to same o/p data.  Example 1: Fetching of unrelated data from tape or disk because it requires only one access.  Example 2: calculate_new_coordinates_and_send_them_to_terminal
  • 51. Functional Cohesion  A module with functional cohesion performs exactly one action  X and Y are part of the same functional task.  Example 1:  Example 1: • get_temperature_of_furnace  Example 2: • compute_orbital_of_electron  Example 3: • write_to_floppy_disk  Example 4: • calculate_sales_commission
  • 52. Sequential Cohesion  More than one functions performed by the module occur in an order prescribed by the specifications.  X outputs some data which forms the input to Y.  X outputs some data which forms the input to Y.
  • 53. Cohesion Values Sr. NO. Type of Cohesion Value 1. Coincidental 0.20 2. Logical 0.23 3. Temporal 0.25 3. Temporal 0.25 4. Procedural 0.40 5. Communicational 0.60 6. Sequential 0.70 7. Functional 0.95
  • 54. Design Strength  Dependence Matrix • Depicts quantitative measure of dependence of modules. • Used to find strength of design. • Used to find strength of design. • Primarily affected by the coupling and cohesion. • Gives the probability of having to change module i given that module j is changed. • First order dependence and complete dependence matrix are found.
  • 55. First Order Dependence Matrix  Represent coupling among various modules by a coupling matrix C which will be symmetric i.e. Ci,j = Cj,I and diagonal elements will be 1 i.e. Ci,i = 1.  Represent strength of various modules by the strength vector S.  FODM is constructed by the following formula Di,j = 0.15*(Si+Sj)+0.7*Ci,j Di,j = 0.15*(Si+Sj)+0.7*Ci,j = 0 where Ci,j = 0 = 1 where Ci,j = 1  FODM can be represented by a undirected graph having links labeled with the dependence values.  Initial connectivity status of modules can also be depicted by a undirected graph having links assigned the coupling value and nodes the strength value.  FODM does not give a clear picture of dependence because it is not able to incorporate indirect connectivity.
  • 57. Observation about FODM  Probability that module 3 changes if module 1 is changed is not simply 0.2 as given by FODM .  This probability will be in fact higher than 0.2 because change in module 1 leads to a change in 4 which in turn leads to a change in 8. A change in 8 due to external leads to a change in 8. A change in 8 due to external coupling leads to a change in 7 due to external coupling 7 which leads to a change in 3.  FODM depicts that there is no dependence b/w module 1 and 9 which is really not correct.  Infact there is a dependence among all module but the level of dependence may be high or low.  Due to this reason, a Complete Dependence Matrix (CDM) is required for stability analysis of a program.
  • 58. Complete Dependence Matrix  CDM is obtained by finding out all unique paths from one module to all other modules.  Because these paths may not be mutually exclusive to each other, hence addition law of probability is not directly applicable. not directly applicable.  IF there are three unique paths to B from A labeled as x, y, and z respectively with probabilities as P(x), P(y), and P(z) THEN  P(B changing) = P(x) + P(y) + P(z) - P(x)*P(y) - P(y)*P(z) - P(x)*P(z) + P(x)*P(y)*P(z)
  • 59. Undirected Graph & FODM A B C D A 1.0 0.4 0.3 0.0 B 0.4 1.0 0.4 0.5 C 0.3 0.4 1.0 0.2 D 0.0 0.5 0.2 1.0
  • 60. Finding CDM  Assume that A changes, probability of B changing is not 0.4 as shown by FODM but is higher than this.  There are three possible chances of B changing as there are three paths to B from A.  Probabilities of these paths are  Probabilities of these paths are • P(x: A to B) = 0.4 • P(y: A to C to B) = 0.3 x 0.4 = 0.12 • P(z: A to C to D to B) = 0.3 x 0.2 x 0.5 = 0.030  P(B Changing)= (0.4+0.12+0.030) - (0.4x0.12) - (0.12x0.030) - (0.4x0.030) + (0.4x0.12x0.030) = 0.4878  In similar way other probabilities and hence CDM can be obtained.
  • 61. Strength Measures  CDM can be used to find the following measures • Expected Change Measure (ECM) which gives a probability of changing the number of modules if a particular module changes. ECMi = ΣDi,j where i and j are not equal. ECMi = ΣDi,j where i and j are not equal. • Overall Design Measure (ODM) which gives the expected number of modules to be changed given a module changes. ODM = Σ Σ Di,j /m for i,j = 1 to m
  • 62. Design of Computer  A highly incompetent computer architect decides to build an ALU, shifter, and 16 registers with AND, registers with AND, OR, and NOT gates, rather than NAND or NOR gates. Figure 7.1
  • 63. Design of Computer (contd..)  The architect designs 3 silicon chips Figure 7.2
  • 64. Design of Computer (Contd..)  Redesign with one gate type per chip. Resulting  Resulting “masterpiece”. Figure 7.3
  • 65. Computer Design (contd)  The two designs are functionally equivalent but the second design is • Hard to understand. • Hard to locate faults. • Difficult to extend or enhance. • Cannot be reused in another product.  Modules must be like the first design • Maximal relationships within modules, and • Minimal relationships between modules.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71. Software Development Approaches  The past Procedural programs Deterministic execution Program in control  The present Interactive program Event-driven execution Objects
  • 72. Structured Approach  Systematic approaches to develop a software design.  The design is usually documented as a set of graphical models. graphical models.  Possible models • Object model; • Sequence model; • State transition model; • Structural model; • Data-flow model.
  • 73. Structured approach  Modeling techniques DFD ERD ERD  Problems Sequential and transformational Inflexible solutions No reuse
  • 74. Structured Approach  The structured paradigm was successful initially but started to fail with larger products (> 50,000 LOC)  Post delivery maintenance problems (today, 70 to 80 percent of total effort) 80 percent of total effort)  Reason: Structured methods are • Action oriented (e.g., finite state machines, data flow diagrams); or • Data oriented (e.g., entity-relationship diagrams); • But not both
  • 75.
  • 76.
  • 77.
  • 78.
  • 83.
  • 84. Modules to Objects Objects with high cohesion and low coupling  Objects  Information hiding Information hiding  Abstract data types  Data encapsulation  Modules with high cohesion and low coupling  Modules
  • 85. Object-Oriented approach  Data-centric  Event-driven  Addresses emerging applications Follows iterative and incremental process  Follows iterative and incremental process
  • 86. Structured versus Object-Oriented Paradigm Account Balance Deposit Withdrawal Determine Balance Balance Account Balance Message Withdrawal Determine Balance Account Balance Deposit Message Message
  • 87. Strengths of the Object-Oriented Paradigm  Information hiding reduces post-delivery maintenance due to reduced chances of regression faults.  Development is easier because Objects generally have physical counterparts and this simplifies the modeling process.  Well-designed objects are independent units as everything that relates to the real-world object being modeled is encapsulated in relates to the real-world object being modeled is encapsulated in the object. • Communication is by sending messages. • Independence is enhanced by responsibility-driven design.  A classical product conceptually consists of a single unit and hence complex. But, object-oriented paradigm reduces complexity because the product generally consists of independent units.  The object-oriented paradigm promotes reuse of objects as they are independent entities.
  • 88. Classical Phases vs Object- Oriented Workflows Classical Paradigm 1. Requirements phase 2. Analysis & specification phase 3. Design phase Object-Oriented Paradigm 1. Requirements workflow 2. Object-Oriented Analysis workflow 3. Object-Oriented Design  There is no correspondence between phases and workflows 3. Design phase 4. Implementation phase 5. Post-delivery maintenance 6. Retirement 3. Object-Oriented Design workflow 4. Object-Oriented Implementation workflow 5. Post-delivery maintenance 6. Retirement
  • 89. In More Details Classical paradigm 2. Analysis (specification) phase • Determine what the product is to do 3. Design phase • Architectural design • Detailed design 4. Implementation phase Object-Oriented paradigm 2. Object-Oriented Analysis workflow • Determine what the product is to do • Extract the classes 3. Object-Oriented Design workflow • Detailed design 4. Object-Oriented Implementation  Objects enter here  Modules (objects) are introduced as early as the object-oriented analysis workflow. • This ensures a smooth transition from the analysis workflow to the design workflow  The objects are then coded during the implementation workflow • Again, the transition is smooth 4. Implementation phase • Code the modules in an appropriate programming language. • Integrate the coded modules. 4. Object-Oriented Implementation workflow • Code the modules in an appropriate OO prog. language. • Integrate
  • 90. Modeling Primitives  Objects • an entity that has state, attributes and services. • Interested in problem-domain objects for requirements analysis.  Classes • Provide a way of grouping objects with similar attributes or services. services. • Classes form an abstraction hierarchy though ‘is_a’ relationships.  Attributes • Together represent an object’s state. • May specify type, visibility and modifiability of each attribute.  Relationships • ‘is_a’ classification relations. • ‘part_of’ assembly relationships. • ‘associations’ between classes.
  • 91. Modeling Primitives  Methods (services, functions) • These are the operations that all objects in a class can do when called on to do so by other objects • E.g. Constructors/Destructors (if objects are created dynamically) created dynamically) • E.g. Set/Get (access to the object’s state)  Message Passing • How objects invoke services of other objects.  Use Cases/Scenarios • Sequences of message passing between objects. • Represent specific interactions.
  • 92. Key Principles  Classification (using inheritance) • Classes capture commonalities of a number of objects. • Each subclass inherits attributes and methods from its parent. from its parent. • Forms an ‘is_a’ hierarchy  Child class may ‘specialize’ the parent class. • by adding additional attributes & methods. • by replacing an inherited attribute or method with another.  Multiple inheritance is possible where a class is subclass of several different super classes.
  • 93. Key Principles  Information Hiding • internal state of an object need not be visible to external viewers. • Objects can encapsulate other objects, and keep their services internal. their services internal.  Aggregation • Can describe relationships between parts and the whole objects.
  • 94. UML Diagram Types (9)  These can be classified into 'static' and 'dynamic' diagrams. • Static Structure • Class diagram • Object diagram Implementation • Component diagram • Deployment diagram • Dynamic Functionality • Use Case diagram Behavior • Activity diagram • State chart diagram Interaction • Collaboration diagram • Sequence diagram System Model
  • 95. Parts of UML  Class Diagrams • Structure models  Object Diagrams • example models Use Case Diagrams  Use Case Diagrams • document who can do what in a system  Sequence Diagrams • shows interactions between objects used to implement a use case  Collaboration Diagrams • same as sequence diagrams but in different style
  • 96. Parts of UML (Cont…)  State chart Diagrams • possible states and responses of a class and what transitions them.  Activity Diagrams • describe the behavior of a class in response to internal • describe the behavior of a class in response to internal processing.  Component Diagrams • Organization of and dependencies amongst software implementation components.  Deployment Diagrams • Describe the mapping of software implementation components onto processing nodes.
  • 97. • A concept, abstraction, or thing with crisp boundaries and meaning for the problem at hand • promote understanding of the real world • provide a practical basis for computer implementation Object implementation
  • 98. Problem Decomposition  Decomposition of a problem into objects depends on • Judgment • The nature of the problem being solved • The nature of the problem being solved • Not only the domain: two analyses of the same domain will turn out differently depending upon the kind of programs we wish to produce.
  • 99. Classes  A class describes a group of objects with similar properties. • Class: Instructor • Object: David Penny • Object: David Penny • Object: Matthew Zaleski Instructor Department
  • 100. Example • Class: Department • Object: Department of Computer Science • Object: Department of Electrical Engineering
  • 101. Attributes  Data values held by the objects of a class Instructor name: string age: integer weight: integer
  • 102. Operations  A function or a transformation that may be applied to or by objects in a class. • Not often used (not often terribly useful) in an OOA Instructor Instructor name age weight teach mark listen_to_complaints
  • 103. Links and Associations  The means for establishing relationships among objects and classes. • link: a connection between two object • link: a connection between two object instances • association: a collection of links with common structure and semantics. Instructor Department teaches for
  • 104. Object Diagrams  Models instances of things contained in class diagrams.  Shows a set of objects and their links at a point in time  Useful preparatory to deciding on class structures.  Useful in order to better explain more complex class diagrams by giving instance examples.
  • 105. i: Instructor name = “Penny” : Department name = “DCS” name = “Penny” j: Instructor name = “Zaleski” : Department name = “ECE”
  • 106. Multiplicity  Used to indicate the number of potential instances involved in the association when the other associated classes are fixed. Instructor Department teaches for A given instructor can teach for potentially many departments or none) A given department employs zero or more instructors * *
  • 107. N-ary Associations Instructor Department teaches 1 1 A given instructor teaching for a given There is exactly one instructor Course * teaching for a given department may teach zero or more courses for that department. one instructor teaching a given course for a given department Try to avoid them!
  • 108. Attributes on Associations teaches for pay Instructor Department teaches for
  • 109. Aggregation Indicators (Part-Of) Department Implied multiplicity of 1 Window Student multiplicity of 1 Frame Composition (strong ownership, coincident lifetime) Aggregation (no associated semantics)
  • 111. Example  We are asked to build a system for keeping track of the time our workers spend working on customer projects.  We divide projects into activities, and  We divide projects into activities, and the activities into tasks. A task is assigned to a worker, who could be a salaried worker or an hourly worker.  Each task requires a certain skill, and resources have various skills at various level of expertise.
  • 112. Steps  Analyze the written requirements • Extract nouns: make them classes • Extract verbs: make them associations • Draw the OOA UML class diagrams • Determine attributes • Determine attributes • Draw object diagrams to clarify class diagrams
  • 113. Steps (contd..)  Determine the system’s use cases • Identify Actors • Identify use case • Relate use cases Draw sequence diagrams  Draw sequence diagrams • One per use case • Use to assign responsibilities to classes  Add methods to OOA classes
  • 114. Example  We are asked to build a system for keeping track of the time our workers spend working on customer projects. Customer Worker Customer Project Time spends * 1 * * * * * 1 contracts
  • 115. Example  We divide projects into activities, and the activities into tasks. A task is assigned to a worker, who could be a salaried worker or an hourly worker. salaried worker or an hourly worker. Project Worker SalariedWorker HourlyWorker Activity 1..* Task 1..* * 1 Assignment Time spent on ◄
  • 116. Example  Each task requires a certain skill, and workers have various skills at various level of expertise. Worker Skill Task requires ◄ ha s SkillLevel 1..* * * 1..*
  • 117. Steps  Analyze the written requirements • Extract nouns: make them classes • Extract verbs: make them associations • Draw the OOA UML class diagrams • Determine attributes • Determine attributes • Draw object diagrams to clarify class diagrams  Determine the system’s use cases • Identify Actors • Identify use case • Relate use cases
  • 118. Example Customer companyName primeContact address phone Project contracts phone fax N.B. • Project has no attribute in Customer • association is enough • no database id for Customer shown • in an OOA, only include an id if visible to users • may include such things during database design or OOD
  • 119. Example Project name description startDate: date Customer contracts ◄ startDate: date Activity name description startDate: date estHours: int deliverable: string Task
  • 120. Example Task Activity Constraint: A task may only be assigned to a worker who has the required skill. description startDate: date estHours: int Skill Worker requires assigned to has
  • 121. Example Worker SkillLevel level: int rateMultiplier: real assigned to Skill name: string has Worker name: string SalariedWorker salary: real vacationDays: int HourlyWorker hourlyWage: real Task assigned to
  • 122. Example Time start: dateTime end: dateTime hours: real spent on Assignment Task Worker assigned to spent on
  • 123. Steps  Analyze the written requirements • Extract nouns: make them classes • Extract verbs: make them associations • Draw the OOA UML class diagrams • Determine attributes • Draw object diagrams to clarify class diagrams  Determine the system’s use cases • Identify Actors • Identify use case • Relate use cases  Draw sequence diagrams • One per use case • Use to assign responsibilities to classes  Add methods to OOA classes
  • 124. Object Diagrams :Time start: Jan.23, 2002, 8:00 end: Jan.23, 2002, 18:00 hours: 4.2 :Assignment :Task description: “develop class diagrams” :Worker name: “Matt”
  • 125. Steps  Analyze the written requirements • Extract nouns: make them classes • Extract verbs: make them associations • Draw the OOA UML class diagrams • Draw object diagrams to clarify class diagrams • Determine attributes • Determine attributes  Determine the system’s use cases • Identify Actors • Identify use case • Relate use cases  Draw sequence diagrams • One per use case • Use to assign responsibilities to classes  Add methods to OOA classes
  • 126. Use Cases  Actors: • Represent users of a system • human users • other systems  Use cases • Represent functionality or services provided by a system to its users
  • 127. Use Case Diagrams Time & Resource Management System (TRMS) resource manager Manage Resources Manage project manager manager worker <<actor>> Backup System Log Time Manage Projects Administer System system administrator
  • 128. Resource Manager Use Cases Add Skill Remove Skill Find Skill <<uses>> resource manager Skill Update Skill
  • 129. More Resource Manager Use Cases Add Worker Remove Worker Find Worker <<uses>> resource manager Update Worker Find Skill <<uses>> Assign Skill to Worker Unassign Skill from Worker <<extends>>
  • 130. Steps  Analyze the written requirements • Extract nouns: make them classes • Extract verbs: make them associations • Draw the OOA UML class diagrams • Draw object diagrams to clarify class diagrams • Determine attributes • Determine attributes  Determine the system’s use cases • Identify Actors • Identify use case • Relate use cases  Draw sequence diagrams • One per use case • Use to assign responsibilities to classes  Add methods to OOA classes
  • 131. Sequence Diagram – Assign Skill to Worker Use Case resource manager Res. Mgr. Win: UI :Worker :Skill :SkillLevel find worker find worker find skill assign skill to worker find worker by name find skill by name [worker does not currently have skill] assign skill to worker
  • 132. Steps  Analyze the written requirements • Extract nouns: make them classes • Extract verbs: make them associations • Draw the OOA UML class diagrams • Draw object diagrams to clarify class diagrams • Determine attributes • Determine attributes  Determine the system’s use cases • Identify Actors • Identify use case • Relate use cases  Draw sequence diagrams • One per use case • Use to assign responsibilities to classes  Add methods to OOA classes
  • 133. Add Methods  Read sequence diagrams to identify necessary methods Worker Worker name: string + static Worker findWorker(String name); + static list of Workers getWorkers();
  • 134. In Design  Bring methods closer to implementation Worker name: string name: string + static Worker findWorker(String name); + static int getNWorkers(); + static Worker getWorker(int);
  • 135. In Design  Bring methods closer to implementation WorkList Int getNumListElements(); ListModel Worker name: string + static Worker findWorker(String name); Int getNumListElements(); String getListElement(int n); ListModel int getNumListElements(); String getListElement(int n);
  • 136. Software Measurement  Software Measurement: Quantitative determination of an attribute of the software.  Why to Measure the Software ?  Why to Measure the Software ?  To gain insight by providing mechanisms for objective evaluation.  To improve understanding of particular entities and attributes.
  • 137.  Developers measure software to check whether  Requirements are consistent and complete.  Design is of high quality.  Code is ready to be tested.  Project Managers measure software to  Decide about delivery date (Schedule). Software Measurement  Decide about delivery date (Schedule).  Check the Budget.  Evaluate Attributes of process and product.  Customers measure software to check  Whether Requirements are met ?  Quality of the product.  Attributes of the final product.  Maintainers measure software to decide  What to be up-graded and improved ?  Aspects of adaptability.
  • 138. Software Measurement Objectives  Indicate quality of the Software.  Assess the productivity of the people.  Assess benefits derived from new methods and tools. and tools.  Form baseline for future estimation.  Justifications for new tools and training.  To ensure control in project management. “You can not control what you can not measure” - DeMarco (1982)
  • 139. What to Measure ?  Size  Complexity  Reliability  Quality  Coupling and Cohesion  Cost  Duration  Efforts
  • 140. Function Points Parameter Simple + Average + Complex = Fi Distinct input items 3( ) + 4( ) + 6( ) = ? Output screens/ reports 4( ) + 5( ) + 7( ) = ? reports Types of user queries 3( ) + 4( ) + 6( ) = ? Number of files 7( ) + 10( ) + 15( ) = ? External interface 5( ) + 7( ) + 10( ) = ? Total (T) = ?
  • 141. Function Point Equation FP = T * (0.65 + 0.01 * Q) Where T = unadjusted table total Q = score from questionnaire Q = score from questionnaire (14 items with values 0 to 5)  Cost of producing one function point? May be organization specific.
  • 142. Function Point Questionnaire 1. Backup. 2. Data communication. 3. Distributed processes. 4. Optimal performance. 9. Complex inputs, queries, outputs. 10. Complex internal processing. 11. Reusable code. 5. Heavily used operating system. 6. On-line data security. 7. Multiple screens. 8. On-line master file update. 11. Reusable code. 12. Conversion or installation. 13. Multiple user sites. 14. Ease of use.
  • 143. Halstead’s Software Science Assumptions  complete algorithm specification exist  programmer works alone programmer knows what to do  programmer knows what to do  Based on counting of n1 = # of unique operators n2 = # of unique operands N1 = # of occurrences of operators N2 = # of occurrences of operands
  • 144. Halstead Equations  Program Vocabulary (n) = n1+n2  Program Length (N) = N1+N2  Program Length (N) = n1* log2 (n1) + n2* log2 (n2)  Program Volume (V) = N* log2 (n)  Program Volume (V) = N* log2 (n)  Program Level (L) = V*/V = (2/n1)*(n2/N2)  Effort (E) = V/L = V2 /V*=V*[(n1*N2)/(2*n2)]  Language Level (l) = LV* (Constant)  Time (T)= E/B where B = (18) 5 to 20
  • 146. Calculations (Example1) n1=11 (BEGIN_END , readln () ; := + * - writeln .) n2= 5 (a b c d m) N1= 23 (1+3+1+2+5+4+3+1+1+1+1) N2= 18 (5+5+4+2+2) N2= 18 (5+5+4+2+2) V= 41*log(11+5)=164 E= 164*[911*18)/(2*5)]=3247
  • 147. Example2 PROGRAM2(input,otput); VAR a,b,c,d,m: integer; BEGIN readln(a,b,c,d); IF a>b THEN IF b>c THEN m:= a+b ELSE m:=b+c ELSE m:=b+c+d; writeln(m) END.
  • 148. Calculations (Example2) n1 = 11 (BEGIN_END readln () , ; IF-THEN-ELSE > := + writeln .) n2 = 5 (a b c d m) N1 = 22 (1+1+2+3+2+2+2+3+4+1+1) N1 = 22 (1+1+2+3+2+2+2+3+4+1+1) N2 = 19 (3+6+4+2+4) V = 41*log(11+5) = 164 E = 164*[(11*19)/(2*5)] = 3427
  • 149. Halstead Modified Theory  Certain operators and operands which are part of control statements contribute extra in the count value.  Assign weights so that measures can reflect complexity produced by the non sequential control structures. Nw =Σx in T [1+µ(x)*{L(x)+Adw(x)}]  Nw1 =Σx in T [1+µ(x)*{L(x)+Adw(x)}]  Nw2 =Σx in R [1+µ(x)*{L(x)+Adw(x)}]  Where µ(x) = 1 if x is the part of control statement = 0 otherwise  L(x) is the level of the statement and Adw(x) is the additional weight assigned depending on the number of test conditions checked for taking decision.
  • 150. Calculations (Example2)  n1 = 11 (BEGIN_END readln () , ; IF-THEN-ELSE > := + writeln . )  n2 = 5 (a b c d m)  Nw1 = N1+6 = 28  Nw1 = N1+6 = 28  Nw2 = N2+6 = 25  Vw = 53*log(11+5) = 212  Ew = 212*[(11*25)/(2*5)] = 5830
  • 152. Cyclomatic Complexity  Cyclomatic complexity of the program is computed from its flow graph using the formula • CC(G) = E – N + 2*k where k is number of connected components. connected components. • CC(G)=P+1 where P is the number of predicate nodes which can be counted by the conditional statements in the PDL representation. • CC(G)= R+1 where R is the number of closed regions in the flow graph.
  • 153. Basis Path Testing  Determine the basis set of linearly independent paths.  Cardinality of this set is the program cyclomatic complexity  Prepare test cases that will force the execution of each path in the basis set.