Professional Documents
Culture Documents
Software Engineering
Software Engineering
Software Engineering
Engineering
CS3201 [3 1 0 4]
Contents
• Complex complicated
8
The Role of Software Engg. (1)
A bridge from customer needs to programming implementation
Customer
Programmer
System-to-be
(includes hardware)
Problem Domain
Software-to-be
User
10
Example: ATM Machine
Understanding the money-machine problem:
Communication link
1
4 2
7 5 3
8 6
0 9
Bank’s
remote
ATM machine
datacenter
Bank
customer
11
Problem-solving Strategy
Divide-and-conquer:
• Identify logical parts of the system that each
solves a part of the problem
• Easiest done with the help of a domain expert
who already knows the steps in the process (“how
it is currently done”)
• Result:
A Model of the Problem Domain
(or “domain model”)
12
How ATM Machine Might Work Domain Model
Transaction
How may I record
help you? Cash
Bookkeeper
Speakerphone Safe
Safe keeper
Phone
Window clerk
Datacenter
liaison
Dispenser
Bank’s
remote
datacenter 13
Customer
Cartoon Strip : How ATM Machine Works
A Enter B C Verify
account
D
your PIN
XYZ
Verify
this
account
Withdraw Dispense
H Dispensing!
$60 $60
Please take
your cash
14
Sub-disciplines of Software Engineering
• Software engineering can be divided into 11 sub disciplines. They are:
• Software requirements: The elicitation, analysis, specification, and validation of
requirements for software.
• Software architecture: The elicitation, analysis, specification, definition and design, and
validation and control of software architecture requirements.
• Software design: The design of software is usually done with Computer-Aided Software
Engineering (CASE) tools and use standards for the format, such as the Unified Modeling
Language (UML).
• Software development: The construction of software through the use of programming
languages.
• Software testing
• Software maintenance: Software systems often have problems and need enhancements for
a long time after they are first completed. This subfield deals with those problems.
16
Projects were:
• Late.
• Over budget.
• Unreliable.
• Difficult to maintain.
• Performed poorly.
18
Software Crisis
Example 1: 2009,Computer glitch delays flights
• The problem did not create a safety issue but could cause
delays in flights.
Software Crisis
Example 2: Ariane 5 Explosion
Software Crisis
Example 3: 1992, London Ambulance Service
• Overloaded problem.
• 46 deaths.
22
Therefore…
A well-disciplined approach to
software development and
management is necessary. This is
called engineering.
23
Software Engineering
What is Software?
Programs
Software
System
Documentation
Documentati
Data on
User
Documentation
25
Types of Software
• Generic products.
• Stand-alone systems that are marketed and sold to any customer who wishes to buy
them.
• Examples – PC software such as graphics programs, project management tools; CAD
software; software for specific markets such as appointments systems for dentists.
• The specification of what the software should do is owned by the software developer
and decisions on software change are made by the developer.
Systems Engineering:
Interdisciplinary engineering field (computer, software, and process eng.).
Focuses on how complex engineering projects should be designed and managed.
What is software? Computer programs, data structures and associated documentation. Software
products may be developed for a particular customer or may be developed for a
general market.
What are the attributes of good Good software should deliver the required functionality and performance to the
software? user and should be maintainable, dependable and usable.
What is software engineering? Software engineering is an engineering discipline that is concerned with all
aspects of software production.
What is the difference between Computer science focuses on theory and fundamentals; software engineering
software engineering and is concerned with the practicalities of developing and delivering useful software.
computer science?
What is the difference between System engineering is concerned with all aspects of computer-based systems
software engineering and system development including hardware, software and process engineering. Software
engineering? engineering is part of this more general process.
Essential attributes of good software
Product Description
characteristic
Maintainability Software should be written in such a way so that it can evolve to meet the changing needs
of customers. This is a critical attribute because software change is an inevitable
requirement of a changing business environment.
Dependability and Software dependability includes a range of characteristics including reliability, security and
security safety. Dependable software should not cause physical or economic damage in the event
of system failure. Malicious users should not be able to access or damage the system.
Efficiency Software should not make wasteful use of system resources such as memory and
processor cycles. Efficiency therefore includes responsiveness, processing time, memory
utilisation, etc.
Acceptability Software must be acceptable to the type of users for which it is designed. This means that
it must be understandable, usable and compatible with other systems that they use.
Software Qualities
Pressman's definition of “Software Quality”
1.explicitly stated functional and performance requirements,
2.explicitly documented development standards, and
3.implicit characteristics that are expected of all professionally developed
software.
IEEE Definition of “Software Quality”
1.The degree to which a system, component, or process meets specified
requirements.
2.The degree to which a system, component, or process meets customer
or user needs or expectations.
Software Qualities
• Software quality:
• Conformance to explicitly stated requirements and
standards
• Quality assurance:
• is the activity that leads to “fitness of purpose”.
• Quality product:
• is the one that does what the customer expects it to do.
User satisfaction = compliant product + good quality + delivery within
budget and schedule
Software Qualities
Quality criteria include but are not limited to:
• Correctness • Evolvability
• Reliability • Reusability
• Robustness • Portability
• Performance • Understandability
• User friendliness • Productivity
• Verifiability
• Size
• Maintainability
• Timeliness
• Reparability
• Safety • Visibility
M a in t a in a b ilit y P o r ta b ility
F le x ib ility
R e u s a b ility
T e s ta b ility
I n te r o p e r a b ility
P R O D U C T R E V IS IO N P R O D U C T T R A N S IT IO N
P R O D U C T O P E R A T IO N
C o rre c tn e s s U s a b ility E f f ic ie n c y
R e lia b ility I n te g r it y
McCall’s Software Quality Factors
• Product Operations
• Operational characteristics
• Product Revision
• Ability to undergo changes
• Product Transition
• Adaptability to new environments
McCall’s Quality Factors Model Tree
McCall’s Software Quality Factors
Factor Criteria Description
Product Maintainability Can I fix it?
Revision Flexibility Can I change it?
Testability Can I test it?
Product Portability Will I be able to use it on another machine?
Transition Reusability Will I be able to reuse some of the other
software in other application?
Interoperability Will I be able to interface it with another
system?
Product Correctness Does it do what I want?
Operation Reliability Does it do it accurately all the time?
Efficiency Will it run as well as it can?
Integrity Is it secure?
Usability Is it easy to use?
McCall Quality Model and Alternative Models
Alternative factor models
No. Software quality McCall’s classic Evans and Deutsch and
factor model Marciniak model Willis model
1 Correctness + + +
2 Reliability + + +
3 Efficiency + + +
4 Integrity + + +
5 Usability + + +
6 Maintainability + + +
7 Flexibility + + +
8 Testability +
9 Portability + + +
10 Reusability + + +
11 Interoperability + + +
12 Verifiability + +
13 Expandability + +
14 Safety +
15 Manageability +
16 Survivability +
45
Description of the software process that represents one view, such as the
activities, data or roles of people involved.
Component-Based Software
Waterfall approach Iterative development
Engineering CBSE
Depends on:
The process used, and
The type of software being developed.
Roughly 60% of costs are development costs, 40% are testing costs.
Cost distribution
Custom software development (Bespoke)
Software Model Waterfall Model
Cost units 0 25 50 75 100
Cost distribution
Software development activity Specification Design Development Integration and testing
Iterative Development
0 25 50 75 100
Cost distribution
Generic software development
0 25 50 75 100
What is CASE?
Activity
What are the key attributes for..
Players, score, scenes, theme. Client accounts, stocks bonds, heart rate, temperature, blood
money transfers. pressure.
54
Result:
YES!
Stu Elmer
Object:
method-1: method-2: method-3:
ATM machine
Accept card Read code Take selection
1234
5678
12345
1
4 2
7 5 3
8 6
0 9
Object Interface
Interface defines method “signatures”
Method signature: name, parameters, parameter types, return type
Interface
method-1 Object hides its
state (attributes).
method-2 The attributes
are accessible
only through the
method-3 interface.
Clients, Servers, Messages
Client
Client Object
Object Server
Server
Object
Object
Message
Data
(state)
Business •On basis of the flow of information and distribution between various business
Modeling channels, the product is designed
Data Modeling •The information collected from business modeling is refined into a set of data
objects that are significant for the business
Process Modeling •The data object that is declared in the data modeling phase is transformed to
achieve the information flow necessary to implement a business function
Application •Automated tools are used for the construction of the software, to convert
Generation process and data models into prototypes
Testing and •As prototypes are individually tested during every iteration, the overall testing
Turnover time is reduced in RAD.
When to use RAD Methodology?
• When a system needs to be produced in a short span of time (2-3
months)
• When the requirements are known
• When the user will be involved all through the life cycle
• When technical risk is less
• When there is a necessity to create a system that can be modularized in
2-3 months of time
• When a budget is high enough to afford designers for modeling along
with the cost of automated tools for code generation
RAD Examples
• Purchase Order
• Gather all the people who know the process best, starting with the procurement team.
Bring together current forms and a complete understanding of the workflow. Discuss
how you want the app to function. With purchase orders, it’s often helpful to also have a
vendor database for quick reference to call up information in the form.
• Employee Resignation
• Travel Request
RAD Model Vs Traditional SDLC
• The traditional SDLC follows a rigid process models with high emphasis on
requirement analysis and gathering before the coding starts. It puts pressure
on the customer to sign off the requirements before the project starts and the
customer doesn’t get the feel of the product as there is no working solution
available for a long time.
• The customer may need some changes after he gets to see the software.
However, the change process is quite rigid and it may not be feasible to
incorporate major changes in the product in the traditional SDLC.
• The RAD model focuses on iterative and incremental delivery of working
models to the customer. This results in rapid delivery to the customer and
customer involvement during the complete development cycle of product
reducing the risk of non-conformance with the actual user requirements.
Advantages of the RAD Model
• Changing requirements can be accommodated.
• Progress can be measured.
• Iteration time can be short with use of powerful RAD tools.
• Productivity with fewer people in a short time.
• Reduced development time.
• Increases reusability of components.
• Quick initial reviews occur.
• Encourages customer feedback.
• Integration from very beginning solves a lot of integration issues.
Disadvantages of the RAD Model
• Dependency on technically strong team members for identifying business requirements.
• Only system that can be modularized can be built using RAD.
• Requires highly skilled developers/designers.
• High dependency on modeling skills.
• Inapplicable to cheaper projects as cost of modeling and automated code generation is
very high.
• Management complexity is more.
• Suitable for systems that are component based and scalable.
• Requires user involvement throughout the life cycle.
• Suitable for project requiring shorter development times.
Agile Modeling
• Rapid development and delivery is now often the most important
requirement for software systems
• Businesses operate in a fast –changing requirement and it is practically impossible
to produce a set of stable software requirements
• Software has to evolve quickly to reflect changing business needs.
• The process of establishing the services the system should provide and the
constraints under which it must operate’ - Roger S. Pressman Software Engineering
– A practitioner’s Approach European Adaptation, fifth edition
• The appropriate mechanism for understanding what the customer wants, analyzing
need, assessing feasibility, negotiating a reasonable solution, specifying the solution
unambiguously, validating the specification, and managing the requirements as they
are transformed into an operational system.
- Thayer, R.H. and M. Dorfman, Software requirements engineering.
Requirements Engineering
• The process of establishing the services that a customer requires from a
system and the constraints under which it operates and is developed.
• Begins during the communication activity and continues into the
modeling activity
• Builds a bridge from the system requirements into software design and
construction
• Allows the requirements engineer to examine
• the context of the software work to be performed
• the specific needs that design and construction must address
• the priorities that guide the order in which work is to be completed
• the information, function, and behavior that will have a profound impact on the
resultant design
Requirements Engineering Tasks
• Seven distinct tasks
• Inception
• Elicitation (Induction)
• Elaboration
• Negotiation
• Specification
• Validation
• Requirements Management
• Some of these tasks may occur in parallel and all are adapted to the
needs of the project
• All strive to define what the customer wants
• All serve to establish a solid foundation for the design and construction
of the software
Inception Task
• During inception, the requirements engineer asks a set of questions to
establish…
• A basic understanding of the problem
• The people who want a solution
• The nature of the solution that is desired
• The effectiveness of preliminary communication and collaboration between the
customer and the developer
• Through these questions, the requirements engineer needs to…
• Identify the stakeholders
• Recognize multiple viewpoints
• Work toward collaboration
• Break the ice and initiate the communication
Elicitation Task
• Elicitation may be accomplished through two activities
• Collaborative requirements gathering
• Quality function deployment
• Eliciting requirements is difficult because of
• Problems of scope in identifying the boundaries of the system or
specifying too much technical detail rather than overall system
objectives
• Problems of understanding what is wanted, what the problem
domain is, and what the computing environment can handle
(Information that is believed to be "obvious" is often omitted)
• Problems of volatility because the requirements change over time
Collaborative Requirements Gathering
• Meetings are conducted and attended by both software engineers,
customers, and other interested stakeholders
• Rules for preparation and participation are established
• An agenda is suggested that is formal enough to cover all important
points but informal enough to encourage the free flow of ideas
• A "facilitator" (customer, developer, or outsider) controls the meeting
• A "definition mechanism" is used such as work sheets, flip charts, wall
stickers, electronic bulletin board, chat room, or some other virtual
forum
• The goal is to identify the problem, propose elements of the solution,
negotiate different approaches, and specify a preliminary set of solution
requirements
Quality Function Deployment
• This is a technique that translates the needs of the customer into
technical requirements for software.
• It emphasizes an understanding of what is valuable to the customer
and then deploys these values throughout the engineering process
through functions, information, and tasks.
• It identifies three types of requirements
• Normal requirements: These requirements are the objectives and goals stated for
a product or system during meetings with the customer.
• Expected requirements: These requirements are implicit to the product or system
and may be so fundamental that the customer does not explicitly state them.
• Exciting requirements: These requirements are for features that go beyond the
customer's expectations and prove to be very satisfying when present.
Elicitation Work Products
The work products will vary depending on the system, but should include one or
more of the following items:
1. A statement of need and feasibility
2. A bounded statement of scope for the system or product
3. A list of customers, users, and other stakeholders who participated in
requirements elicitation
4. A description of the system's technical environment
5. A list of requirements (organized by function) and the domain constraints
that apply to each
6. A set of preliminary usage scenarios (in the form of use cases) that provide
insight into the use of the system or product under different operating
conditions
7. Any prototypes developed to better define requirements
Elaboration Task
• During elaboration, the software engineer takes the information
obtained during inception and elicitation and begins to expand and
refine it.
• Elaboration focuses on developing a refined technical model of
software functions, features, and constraints.
• It is an analysis modeling task
• Use cases are developed.
• Domain classes are identified along with their attributes and relationships.
• State machine diagrams are used to capture the life on an object.
• The end result is an analysis model that defines the functional,
informational, and behavioral domains of the problem.
Negotiation Task
• During negotiation, the software engineer reconciles the conflicts
between what the customer wants and what can be achieved given
limited business resources.
• Requirements are ranked (i.e., prioritized) by the customers, users, and
other stakeholders.
• Risks associated with each requirement are identified and analyzed.
• Rough guesses of development effort are made and used to assess the
impact of each requirement on project cost and delivery time.
• Using an iterative approach, requirements are eliminated, combined
and/or modified so that each party achieves some measure of
satisfaction.
The Art of Negotiation
• Recognize that it is not competition
• Map out a strategy
• Listen actively
• Focus on the other party’s interests
• Don’t let it get personal
• Be creative
• Be ready to commit
Specification Task
• System requirements
• A structured document setting out detailed descriptions of the
system’s functions, services and operational constraints. Defines
what should be implemented so may be part of a contract between
client and contractor.
User and System Requirements
Functional and Non-functional Requirements
• Functional requirements
• Statements of services the system should provide, how the system
should react to particular inputs and how the system should behave
in particular situations.
• May state what the system should not do.
• Non-functional requirements
• Constraints on the services or functions offered by the system such as
timing constraints, constraints on the development process,
standards, etc.
• Often apply to the system as a whole rather than individual features
or services.
• Domain requirements
• Constraints on the system from the domain of operation
Functional Requirements
• Describe functionality or system services.
• Depend on the type of software, expected users and
the type of system where the software is used.
• Functional user requirements may be high-level
statements of what the system should do.
• Functional system requirements should describe the
system services in detail.
Non-functional Requirements
• These define system properties and constraints e.g. reliability, response
time and storage requirements. Constraints are I/O device capability,
system representations, etc.
• Process requirements may also be specified mandating a particular IDE,
programming language or development method.
• Non-functional requirements may be more critical than functional
requirements. If these are not met, the system may be useless.
Types of Non-functional Requirement
Users of a requirements document
Types of Requirements
• Functional requirements
• Performance requirements
• Speed, accuracy, frequency, throughput
• External interface requirements
• Design constraints
• Requirements are usually about “what”, this is a
“how”.
• Quality attributes
• i.e. reliability, portability, maintainability,
supportability
System Analyst
• A systems analyst is an IT professional who specializes in analyzing, designing
and implementing software systems.
• Interpersonal skill: This skills deal with relationships and the interface of
the analyst with people in business. They are useful in establishing trust,
resolving conflict, and communicating information.
162
Class Identification
• General classifications for a potential class
• External entity (e.g., another system, a device, a person)
• Thing (e.g., report, screen display)
• Occurrence or event (e.g., movement, completion)
• Role (e.g., manager, engineer, salesperson)
• Organizational unit (e.g., division, group, team)
• Place (e.g., manufacturing floor, loading dock)
• Structure (e.g., sensor, vehicle, computer)
163
Class Identification
• Six class selection characteristics
1) Retained information
– Information must be remembered about the system over time
2) Needed services
– Set of operations that can change the attributes of a class
3) Multiple attributes
– Whereas, a single attribute may denote an atomic variable rather
than a class
4) Common attributes
– A set of attributes apply to all instances of a class
5) Common operations
– A set of operations apply to all instances of a class
6) Essential requirements
– Entities that produce or consume information
164
Class Identification - Example
• Manipal University Jaipur wants to make a library management
system for its library.
• Library has 10000 books.
• For memberships of library, there are 2 types : - Faculty &
Students.
• Librarian should issue books.
• There should be functionality to deposit books.
• There are four types of books.
• Magazine
• E-Books
• Journals
• Text Books.
165
Class Identification - Example
Potential classes General classification Selection Characteristics
MUJ External Entity
Library Management Structure
System
Library Organizational Unit
Book External Entity
Membership Role
Faculty External Entity
Student External Entity
Librarian Role
Magazine External Entity
E-Books External Entity
Journals External Entity
Text Books External Entity 166
Defining Attributes of a Class
• Attributes of a class are those nouns from the grammatical parse that
reasonably belong to a class
• Attributes hold the values that describe the current properties or state of
a class
• An attribute may also appear initially as a potential class that is later
rejected because of the class selection criteria
• In identifying attributes, the following question should be answered
• What data items (composite and/or elementary) will fully define a specific
class in the context of the problem at hand?
• Usually an item is not an attribute if more than one of them is to be
associated with a class
167
Defining Operations of a Class
• Operations define the behavior of an object
• Four categories of operations
• Operations that manipulate data in some way to change the state of an object (e.g.,
add, delete, modify)
• Operations that perform a computation
• Operations that inquire about the state of an object
• Operations that monitor an object for the occurrence of a controlling event
• An operation has knowledge about the state of a class and the nature of
its associations
• The action performed by an operation is based on the current values of
the attributes of a class
• Using a grammatical parse again, circle the verbs; then select the verbs
that relate to the problem domain classes that were previously identified.
168
Class Diagram
• Recall: A class is a collection of objects with common structure,
common behavior, common relationships and common semantics
• A class diagram
• expresses class definitions to be implemented
• lists name, attributes, and methods for each class
• shows relationships between classes
• describes the structure of a system.
• Most common diagram.
• The main building block in object oriented modeling.
Where do we use class diagrams
Class diagrams are used in:
• Analysis To build a conceptual domain model with semantic
associations between concepts
• Design Structural model of a design in terms of class interfaces
• Implementation Source code documentation, exposing the
implementation
Class Diagram - Notation
• A class with three
sections. Produt
• The upper part holds serialNumber
the name of the class name
• The middle part price
contains the attributes Class Name
buy()
of the class display()
• The bottom part gives Attributes
the methods or
operations the class Operations
can take or undertake
Class Name - Signature
• Name should start with capital letter.
• It should be noun.
Attributes - Signature
[visibility] name [[multiplicity]] [: type] [=initial value] [{property}]
• First word of the name should start with small letter followed by
capital letter for next words.
• visibility: the access rights to the attribute
- multiplicity: how many instances of the attribute are they:
- middleName [0..1] : String, phoneNumber [1..*]
- Type: the type of the attribute (integer, String, Person, Course)
- initial value: a default value of the attribute
- salary : Real = 10000, position : Point = (0,0)
- property: predefined properties of the attribute
- Changeable, readOnly, addOnly, frozen (C++: const, Java: final)
Attributes - Examples
+ isLightOn : boolean = false
- numOfPeople : int
mySport
+ passengers : Customer[0..10]
- id : long {readOnly}
Operations - Signature
[visibility] name ([parameter-list]) [: return-type] [{property}]
Instance scope
Frame
class scope
header : FrameHeader
uniqueID : Long
private
Responsibilities
-- handles deposits
-- reports fraud to managers
Multiplicity
• It specifies the number of instances of one class that
may relate to a single instance of the associated
class.
• UML diagrams explicitly list multiplicity at the end of
association lines.
• Intervals are used to express multiplicity:
• 1 (exactly one)
• 0..1 (zero or one)
• 1..* (one or more)
• 0..* (zero or more)
• 3..5 (three to five inclusive)
Different levels of detail
Tips for modeling
Express as much or as little detail as needed
Often, a rectangle with a name is enough
write <<interface>> on top of interfaces'
names
use italics for an abstract class name
Perhaps a method or an attribute clarifies
Simple is good
Sketches on paper or white board are
effective 10
UML
6-184 184
First up: Class Diagrams
A class diagram
− expresses class definitions to be implemented
− lists name, attributes, and methods for each class
− shows relationships between classes
UML allows different levels of detail on both the attributes
and the methods of one class
− could be just the the class name in a rectangle
− or like the general form shown on the next slide
6-185 185
Software Specification (Class Name)
attribute
attribute : type
attribute : type = initial value
classAttribute
derivedAttribute
...
method1()
method2(parameter : Type) : return type
abstractMethod()
+publicMethod()
-privateMethod()
#protectedMethod()
classMethod()
...
6-186 186
AccountCollection
- allAccounts : HashMap
+AccountCollection ()
+getAccountWithID (ID: String) : Account
+add(accountToAdd: Account) : boolean
+iterator() : Iterator
6-187 187
Sterotypes
6-188 188
Different levels of detail
6-189 189
Relationships
6-190 190
1) Dependency: A Uses Relationship
Dependencies
− occurs when one object depends on another
− if you change one object's interface, you need to
change the dependent object
− arrows point from dependent to needed objects
CardReader
Jukebox
CDCollection
SongSelector
6-191 191
2) Association: Structural Relationship
Association
− a relationship between classes indicates some meaningful or
interesting connection
− Associations can be labeled getAccountWithID for example
− BTW: The box with association is an official UML comment, must have that fold ☺
association
getAccountWithID
Jukebox JukeboxAccountCollection
1 1
6-192 192
Associations
Associations imply
− our knowledge that a relationship must be preserved for some
time (0.01 ms to forever)
Between what objects do we need to remember a relationship?
•Does a Transaction need to remember Account?
•Would AccountCollection need to remember Accounts?
Stores
AccountCollection Account
1 0..*
6-193 193
Notation and Multiplicity Adornments
UML Association:
− a line between two concepts and a name
− they are bi-directional * T
zero or more;
"many"
− can have a multiplicity
− exist in class diagrams 1..*
T one or more
1..52
T one to fifty two
5
Multiplicity T exactly five
adornments
6-194 194
Association
Names • Read these Type-VerbPhrase-Type
• POST is a Point of Sale Terminal)
Store • Not shown here: Attributes and Methods
1
• This just shows associations between objects
Contains
1..*
Airline
1
Employs
1..*
Assigned-to Assigned-to
Person Flight Plane
1 * * 1
1 *
6-195 195
Supervises
Aggregation: A Special Association
*
Student
− Model aggregation or composition? When in doubt, use association (just a
simple line) don't sweat the diff in 335
6-197 197
Sequence Diagrams
Interaction diagrams describe how groups of objects
collaborate in some behavior
The UML defines several forms of interaction
diagram, the most common is the sequence diagram
A class diagram shows a fixed view of a system
A sequence diagram represents a dynamic view of a
system by capturing message sends over time
− Can document a scenario such as
Dealer deals cards to all players
Withdraw Money when there is enough balance
Withdraw Money when there is not enough balance
6-198 198
Sequence Diagrams
6-199 199
Syntax
Objects are lined up on top in rectangles
Object names :CardReader
Dashed lines represent lifetime of objects
Rectangles are activation lines
− When the object is "alive"
− Activation bar of the receivers of the message is
smaller than the sender's activation bar
Not much detail written
6-200 200
Example
Scenario: The user tries to use an ATM, but the account is not known
6-201 201
Scenario: The user
successfully withdraws
money from an ATM
6-202 202
Software
Engineering
CS3201 [3 1 0 4]
Contents
• Once the Expected Value has been determined, Historical (LOC) and
(FP) Productivity data are applied.
Lines of Code Estimation
• The measure was first proposed when programs were typed on
cards with one line per card.
• Traditional way for estimating application size.
• Advantage: Easy to do.
• Disadvantages:
• Focus on developer’s point of view.
• No standard definition for “Line of Code”.
• “You get what you measure”: If the number of lines of code is the primary
measure of productivity, programmers ignore opportunities of reuse.
• Multi-language environments: Hard to compare mixed language projects with
single language projects.
Example - Statement of Scope
• The mechanical CAD software will accept two- and three-dimensional
geometric data from an engineer. The engineer will interact and control
the CAD system through a user interface that will exhibit characteristics of
good human/machine interface design. All geometric data and other
supporting information will be maintained in a CAD database. Design
analysis modules will be developed to produce the required output,
which will be displayed on a variety of graphics devices. The software will
be designed to control and interact with peripheral devices that include a
mouse, digitizer, laser printer.
EXAMPLE OF (LOC) BASED ESTIMATION
FUNCTIONS ESTIMATED LOC
Total Estimated Project Cost and Project Effort can be calculated as: follows-
Considering that the Total LOC ( ∑ LOC) for the System is 33,200
➢ Total Estimated Project Cost = (33200 * 13 ) = $431,600
FP = UFP TCF
Advantages of Function Point Estimation
• Independent of implementation language and technology
• Estimates are based on design specification
• Usually known before implementation tasks are known
• Users without technical knowledge can be integrated into the
estimation process
• Incorporation of experiences from different organizations
• Easy to learn
• Limited time effort
Disadvantages of Function Point Estimation
• Complete description of functions necessary
• Often not the case in early project stages -> especially in iterative
software processes
• Only complexity of specification is estimated
• Implementation is often more relevant for estimation
• High uncertainty in calculating function points:
• Weight factors are usually deducted from past experiences
(environment, used technology and tools may be out-of-date in the
current project)
• Does not measure the performance of people
Example : Function Point Analysis
Example : Function Point Analysis
Example : Function Point Analysis
Assuming
Estimated FP = 400
Organisation average productivity (similar project type) = 6.5
FP/p-m (person-month)
Burdened labour rate = 8000 $/p-m
Then
Estimated effort = 400/6.5 = (61.54) = 62 p-m
Cost per FP = 8000/6.5 = 1231 $/FP
Project cost = 8000 * 62 = 496000 $
COCOMO (COnstructive COst MOdel)
• Developed by Barry Boehm in 1981.
• Also called COCOMO I or Basic COCOMO or COCOMO’81.
• COCOMO’81 is derived from the analysis of 63 software projects.
• Top-down approach to estimate cost, effort and schedule of software
projects, based on size and complexity of projects.
• Assumptions:
• Derivability of effort by comparing finished projects (“COCOMO database”).
• System requirements do not change during development.
• Exclusion of some efforts (for example administration, training, rollout,
integration).
COCOMO (COnstructive COst MOdel)
• Divides software product developments into three (3)
categories:
• Organic : If the team size required is adequately small, the problem is
well understood and has been solved in the past and also the team
members have a nominal experience regarding the problem.
• Semidetached
• Project team consists of a mixture of experienced and inexperienced staff.
• Embedded
• The software is strongly coupled to complex hardware, or real-time systems.
COCOMO (COnstructive COst MOdel)
• For each of the three product categories:
• From size estimation (in KLOC), Boehm provides equations to predict:
• project duration in months
• effort in programmer-months
Effort 18 Months
14 Months
30K 60K
Size Size
Basic COCOMO Model
• Development time does not increase linearly with product size:
• For larger products more parallel activities can be identified:
• can be carried out simultaneously by a number of engineers.
• Development time is roughly the same for all the three categories
of products:
• For example, a 60 KLOC program can be developed in approximately 18
months
• regardless of whether it is of organic, semi-detached, or embedded type.
• There is more scope for parallel activities for system and application
programs,
• than utility programs.
Example
• The size of an organic software product has been estimated to
be 32,000 lines of source code.
• Effort = 2.4*(32)1.05 = 91 PM
• Nominal development time = 2.5*(91)0.38 = 14 months
Intermediate COCOMO
• Basic COCOMO model assumes
• effort and development time depend on product size alone.
• However, several parameters affect effort and development time:
• Reliability requirements
• Availability of CASE tools and modern facilities to the developers
• Size of data to be handled
Organic :
a = 3.2 || b= m(x) = multiply of all
1.05
Semi-detached: cost drivers factors
a = 3.0 || b=
1.12
Embedded:
a = 2.8 || b=
1.20
Shortcomings of both models
• Both models:
• consider a software product as a single homogeneous entity:
• However, most large systems are made up of several smaller sub-
systems.
• Some sub-systems may be considered as organic type, some may be
considered embedded, etc.
• for some the reliability requirements may be high, and so on.
Complete COCOMO
• Cost of each sub-system is estimated separately.
• Costs of the sub-systems are added to obtain total cost.
• Reduces the margin of error in the final estimate.
• For Example:
• A Management Information System (MIS) for an organization having offices at several
places across the country:
• Database part (semi-detached)
• Graphical User Interface (GUI) part (organic)
• Communication part (embedded)
• Costs of the components are estimated separately:
• summed up to give the overall cost of the system.
COCOMO II
• Revision of COCOMO I in 1997
• Provides three models of increasing detail
• Application Composition Model
• Estimates for prototypes based on GUI builder tools and existing components
• Similar goal as for Function Point analysis
• Based on counting Object Points (instead of function points)
• Early Design Model
• Estimates before software architecture is defined
• For system design phase, closest to original COCOMO, uses function points as size
estimation
• Post Architecture Model
• Estimates once architecture is defined ; Most detailed
• For actual development phase and maintenance; Uses FPs or SLOC as size measure
• Estimator selects one of the three models based on current state of the project.
COCOMO II
• Targeted for iterative software lifecycle models
• Boehm’s spiral model
• COCOMO I assumed a waterfall model
• 30% design; 30% coding; 40% integration and test
260
Design
• Dr. Dobbs Journal said:
• Good software design should exhibit:
• Firmness: A program should not have any bugs that inhibit
its function.
• Commodity: A program should be suitable for the purposes
for which it was intended.
• Delight: The experience of using the program should be
pleasurable one.
261
Analysis Model -> Design Model
Co m p o n e n t -
sc e na r i o- ba se d f l ow- or i e nt e d L e v e l D e sig n
e l e m e nt s e l e m e nt s
use-cases - text data flow diagrams
use-case diagrams control-flow diagrams
activity diagrams processing narratives
swim lane diagrams
In t e r f a c e D e sig n
Analysis Model
A r c h it e c t u r a l D e sig n
c l a ss- ba se d be ha v i or a l
e l e m e nt s e l e m e nt s
class diagrams state diagrams
analysis packages sequence diagrams
CRC models D a t a / Cla ss D e sig n
collaboration diagrams
Design Model
262
Design and Quality
the design must implement all of the explicit requirements
contained in the analysis model, and it must accommodate all
of the implicit requirements desired by the customer.
263
Quality Guidelines
• A design should exhibit an architecture that (1) has been created using recognizable
architectural styles or patterns, (2) is composed of components that exhibit good design
characteristics and (3) can be implemented in an evolutionary fashion
• For smaller systems, design can sometimes be developed linearly.
• A design should be modular; that is, the software should be logically partitioned into
elements or subsystems
• A design should contain distinct representations of data, architecture, interfaces, and
components.
• A design should lead to data structures that are appropriate for the classes to be
implemented and are drawn from recognizable data patterns.
• A design should lead to components that exhibit independent functional characteristics.
• A design should lead to interfaces that reduce the complexity of connections between
components and with the external environment.
• A design should be derived using a repeatable method that is driven by information obtained
during software requirements analysis.
• A design should be represented using a notation that effectively communicates its meaning.
264
Design Principles
• The design process should not suffer from ‘tunnel vision.’
• The design should be traceable to the analysis model.
• The design should not reinvent the wheel.
• The design should “minimize the intellectual distance” [DAV95] between the
software and the problem as it exists in the real world.
• The design should exhibit uniformity and integration.
• The design should be structured to accommodate change.
• The design should be structured to degrade gently, even when aberrant
data, events, or operating conditions are encountered.
• Design is not coding, coding is not design.
• The design should be assessed for quality as it is being created, not after the
fact.
• The design should be reviewed to minimize conceptual (semantic) errors.
265
Fundamental Concepts
• Abstraction—data, procedure, control
• Architecture—the overall structure of the software
• Patterns—”conveys the essence” of a proven design solution
• Separation of concerns—any complex problem can be more easily
handled if it is subdivided into pieces
• Modularity—compartmentalization of data and function
• Hiding—controlled interfaces
• Functional independence—single-minded function and low coupling
• Refinement—elaboration of detail for all abstractions
• Aspects—a mechanism for understanding how global requirements
affect design
• Refactoring—a reorganization technique that simplifies the design
• OO design concepts—Appendix II
• Design Classes—provide design detail that will enable analysis classes
to be implemented
266
Data Abstraction
door
manufacturer
model number
type
swing direction
inserts
lights
type
number
weight
opening mechanism
267
Procedural Abstraction
open
details of enter
algorithm
268
Architecture
“The overall structure of the software and the ways in which that structure
provides conceptual integrity for a system.”
Structural properties. This aspect of the architectural design representation defines the
components of a system (e.g., modules, objects, filters) and the manner in which those
components are packaged and interact with one another. For example, objects are
packaged to encapsulate both data and the processing that manipulates the data and
interact via the invocation of methods.
Families of related systems. The architectural design should draw upon repeatable
patterns that are commonly encountered in the design of families of similar systems. In
essence, the design should have the ability to reuse architectural building blocks.
269
Patterns
Design Pattern Template
Pattern name—describes the essence of the pattern in a short but expressive name
Intent—describes the pattern and what it does
Also-known-as—lists any synonyms for the pattern
Motivation—provides an example of the problem
Applicability—notes specific design situations in which the pattern is applicable
Structure—describes the classes that are required to implement the pattern
Participants—describes the responsibilities of the classes that are required to
implement the pattern
Collaborations—describes how the participants collaborate to carry out their
responsibilities
Consequences—describes the “design forces” that affect the pattern and the potential
trade-offs that must be considered when the pattern is implemented
Related patterns—cross-references related design patterns
270
Modularity
• "Modularity is the single attribute of software that allows a
program to be intellectually manageable" [Mye78].
• Monolithic software (i.e., a large program composed of a
single module) cannot be easily grasped by a software
engineer.
• The number of control paths, span of reference, number of variables,
and overall complexity would make understanding close to
impossible.
• In almost all instances, you should break the design into
many modules, hoping to make understanding easier and as a
consequence, reduce the cost required to build the software.
271
Modularity: Trade-offs
cost of
software
module
integration
cost
module
• algorithm
controlled
interface • data structure
clients
"secret"
273
Why Information Hiding?
274
Stepwise Refinement
open
walk to door;
reach for knob;
275
Sizing Modules: Two Views
MODULE
276
Functional Independence
277
Aspects
• Consider two requirements, A and B. Requirement A crosscuts
requirement B “if a software decomposition [refinement] has been
chosen in which B cannot be satisfied without taking A into account.
278
Aspects—An Example
279
Refactoring
Fowler defines refactoring in the following manner:
"Refactoring is the process of changing a software system in such a way
that it does not alter the external behavior of the code [design] yet
improves its internal structure.”
280
OO Design Concepts
• Design classes
• Entity classes
• Boundary classes
• Controller classes
• Inheritance—all responsibilities of a superclass is
immediately inherited by all subclasses
• Messages—stimulate some behavior to occur in the
receiving object
• Polymorphism—a characteristic that greatly reduces the
effort required to extend the design
281
Design Classes
• Analysis classes are refined during design to become entity
classes
• Boundary classes are developed during design to create
the interface (e.g., interactive screen or printed reports)
that the user sees and interacts with as the software is
used.
• Boundary classes are designed with the responsibility of
managing the way entity objects are represented to users.
• Controller classes are designed to manage
• the creation or update of entity objects;
• the instantiation of boundary objects as they obtain
information from entity objects;
• complex communication between sets of objects;
• validation of data communicated between objects or
between the user and the application.
282
The Design Model
high
a na ly sis m ode l
class diagrams
analysis packages
use-cases - t ext class diagrams
Requirement s:
CRC models use-case diagrams const raint s
analysis packages
collaborat ion diagrams
act ivit y diagrams CRC models int eroperabilit y
dat a f low diagrams sw im lane diagrams collaborat ion diagrams t arget s and
cont rol-f low diagrams collaborat ion diagrams dat a f low diagrams
processing narrat ives st at e diagrams cont rol-f low diagrams
conf igurat ion
sequence diagrams processing narrat ives
st at e diagrams
sequence diagrams
process dimension
283
Design Model Elements
• Data elements
• Data model --> data structures
• Data model --> database architecture
• Architectural elements
• Application domain
• Analysis classes, their relationships, collaborations and
behaviors are transformed into design realizations
• Patterns and “styles”
• Interface elements
• the user interface (UI)
• external interfaces to other systems, devices, networks
or other producers or consumers of information
• internal interfaces between various design components.
• Component elements
• Deployment elements
284
Architectural Elements
285
Interface Elements
Mo b ile Ph o n e
W ire le ssPDA
Co n t ro lPa n e l
LCDdi s pl ay
LEDi ndi c at or s
k ey PadChar ac t er i s t i c s K e y Pa d
s peak er
wi r el es s Int er f ac e
r eadK ey St r ok e( )
dec odeK ey ( )
di s pl ay St at us ( )
l i ght LEDs ( )
s endCont r ol Ms g( )
r eadKey s t r ok e( )
dec odeK ey ( )
Fig u re 9 . 6 UML in t e rf a c e re p re se n t a t io n f o r Co n t r o l P a n e l
286
Component Elements
SensorManagement
Sensor
287
Deployment Elements
Cont rol Panel CPI serv er
Security homeownerAccess
externalAccess
Security Surveillance
homeManagement communication
288
Why Architecture?
290
Architectural Descriptions
• The IEEE Computer Society has proposed IEEE-Std-1471-2000, Recommended Practice for
Architectural Description of Software-Intensive System, [IEE00]
• to establish a conceptual framework and vocabulary for use during the design of software architecture,
• to provide detailed guidelines for representing an architectural description, and
• to encourage sound architectural design practices.
• The IEEE Standard defines an architectural description (AD) as a “a collection of products to document
an architecture.”
• The description itself is represented using multiple views, where each view is “a representation of a whole system
from the perspective of a related set of [stakeholder] concerns.”
291
Architectural Genres
292
Architectural Styles
Each style describes a system category that encompasses: (1) a
set of components (e.g., a database, computational modules)
that perform a function required by a system, (2) a set of
connectors that enable “communication, coordination and
cooperation” among components, (3) constraints that define
how components can be integrated to form the system, and
(4) semantic models that enable a designer to understand the
overall properties of a system by analyzing the known
properties of its constituent parts.
• Data-centered architectures
• Data flow architectures
• Call and return architectures
• Object-oriented architectures
• Layered architectures
293
Data-Centered Architecture
294
Data Flow Architecture
295
Call and Return Architecture
296
Layered Architecture
297
Architectural Patterns
• Concurrency—applications must handle multiple tasks in a
manner that simulates parallelism
• operating system process management pattern
• task scheduler pattern
• Persistence—Data persists if it survives past the execution of the
process that created it. Two patterns are common:
• a database management system pattern that applies the storage
and retrieval capability of a DBMS to the application architecture
• an application level persistence pattern that builds persistence
features into the application architecture
• Distribution— the manner in which systems or components
within systems communicate with one another in a distributed
environment
• A broker acts as a ‘middle-man’ between the client component and
a server component.
298
Architectural Design
• The software must be placed into context
• the design should define the external entities (other systems, devices,
people) that the software interacts with and the nature of the interaction
• A set of architectural archetypes should be identified
• An archetype is an abstraction (similar to a class) that represents one
element of system behavior
• The designer specifies the structure of the system by defining and
refining software components that implement each archetype
299
Architectural Context
Safehome Internet-based
Product system
control
panel target system: surveillance
Security Function function
uses
homeowner peers
uses
uses
sensors sensors
300
Archetypes
Cont roller
communicat es wit h
Node
Figure 10.7 UML relat ionships f or Saf eHome securit y f unct ion archet ypes
(adapt ed f rom [ BOS00] ) 301
Component Structure
SafeHome
Execut ive
Funct ion
select ion
Ext ernal
Communicat ion
Management
302
Refined Component Structure
SafeHome
Executive
Ext ernal
Communicat ion
Management
Security
GUI Internet
Interface
Key pad
processing phone
scheduler
com m unicat ion
CP display
funct ions
alarm
sensor
sensor
sensor
sensor
sensor
sensor
sensor
sensor
sensor
303
Analyzing Architectural Design
1. Collect scenarios.
2. Elicit requirements, constraints, and environment description.
3. Describe the architectural styles/patterns that have been chosen
to address the scenarios and requirements:
• module view
• process view
• data flow view
4. Evaluate quality attributes by considered each attribute in
isolation.
5. Identify the sensitivity of quality attributes to various
architectural attributes for a specific architectural style.
6. Critique candidate architectures (developed in step 3) using the
sensitivity analysis conducted in step 5.
304
Architectural Complexity
• the overall complexity of a proposed architecture is assessed by
considering the dependencies between components within the
architecture [Zha98]
• Sharing dependencies represent dependence relationships among consumers
who use the same resource or producers who produce for the same
consumers.
• Flow dependencies represent dependence relationships between producers
and consumers of resources.
• Constrained dependencies represent constraints on the relative flow of control
among a set of activities.
305
ADL
306
An Architectural Design Method
customer requirements
"four bedrooms, three baths,
lots of glass ..."
architectural design
307
Deriving Program Architecture
Program
Architecture
308
Partitioning the Architecture
• “horizontal” and “vertical”
partitioning are required
309
Horizontal Partitioning
• define separate branches of the module
hierarchy for each major function
• use control modules to coordinate
communication
function 1 betweenfunction
functions
3
function 2
310
Vertical Partitioning: Factoring
• design so that decision making and
work are stratified
• decision making modules should
reside at the top of the architecture
decision-makers
workers
311
Why Partitioned Architecture?
312
Structured Design
• objective: to derive a program
architecture that is partitioned
• approach:
• a DFD is mapped into a program
architecture
• the PSPEC and STD are used to
indicate the content of each module
• notation: structure chart
313
Flow Characteristics
Transform flow
This edition of
SEPA does not
cover transaction
mapping. For a
detailed
discussion see the
SEPA website
Transaction
flow
314
General Mapping Approach
isolate incoming and outgoing flow
boundaries; for transaction flows, isolate
the transaction center
315
Software Quality
• In 2005, ComputerWorld [Hil05] lamented that
• “bad software plagues nearly every organization that uses computers, causing lost work hours during computer
downtime, lost or corrupted data, missed sales opportunities, high IT support and maintenance costs, and low
customer satisfaction.
• A year later, InfoWorld [Fos06] wrote about the
• “the sorry state of software quality” reporting that the quality problem had not gotten any better.
• A useful product delivers the content, functions, and features that the
end-user desires
• But as important, it delivers these assets in a reliable, error free way.
• A useful product always satisfies those requirements that have been
explicitly stated by stakeholders.
• In addition, it satisfies a set of implicit requirements (e.g., ease of
use) that are expected of all high quality software.
Adding Value
• By adding value for both the producer and user of a software product, high quality
software provides benefits for the software organization and the end-user
community.
• The software organization gains added value because high quality software
requires less maintenance effort, fewer bug fixes, and reduced customer
support.
• The user community gains added value because the application provides a
useful capability in a way that expedites some business process.
• The end result is:
• (1) greater software product revenue,
• (2) better profitability when an application supports a business process, and/or
• (3) improved availability of information that is crucial for the business.
Quality Dimensions
• David Garvin [Gar87]:
• Performance Quality. Does the software deliver all content, functions, and features
that are specified as part of the requirements model in a way that provides value to
the end-user?
• Feature quality. Does the software provide features that surprise and delight first-
time end-users?
• Reliability. Does the software deliver all features and capability without failure? Is
it available when it is needed? Does it deliver functionality that is error free?
• Conformance. Does the software conform to local and external software standards
that are relevant to the application? Does it conform to de facto design and coding
conventions? For example, does the user interface conform to accepted design rules
for menu selection or data input?
Quality Dimensions
• Durability. Can the software be maintained (changed) or corrected (debugged)
without the inadvertent generation of unintended side effects? Will changes cause
the error rate or reliability to degrade with time?
• Serviceability. Can the software be maintained (changed) or corrected (debugged)
in an acceptably short time period. Can support staff acquire all information they
need to make changes or correct defects?
• Aesthetics. Most of us would agree that an aesthetic entity has a certain elegance, a unique
flow, and an obvious “presence” that are hard to quantify but evident nonetheless.
• Perception. In some situations, you have a set of prejudices that will influence your
perception of quality.
Other Views