Professional Documents
Culture Documents
Ivan Marsic
Rutgers University
Course Information
Web: http://www.ece.rutgers.edu/~marsic/Teaching/SE
Lecture Notes:
http://www.ece.rutgers.edu/~marsic/books/SE
Textbooks (see more on the course website)
– Bruegge & Dutoit: Object-Oriented Software Engineering: Using UML, Patterns and
Java, Third Edition, Prentice Hall, 2010. | ISBN 0-13-6061257
– Miles & Hamilton: Learning UML 2.0, O’Reilly Media, 2006. ISBN: 0-596-00982-8
2
Introduction: Software is Complex
Complex complicated
Nailing Painting
Setting posts Cutting wood
[ 2 time units for unpainted; [ 5 time units for uncut wood;
[ 3 time units ] [ 2 time units ]
3 time units otherwise ] 4 time units otherwise ]
[ To answer, we need to bring the day names and the day numbers
into coordination, and for that we may need again a pen and
paper ]
The Frog in Boiling Water
Small problems tolerate complacency
—lack of immediate penalty leads to
inaction
Negative feedback accumulates subtly
and by the time it becomes painful,
the problem is too big to address
Frog in gradually heated water
analogy:
– The problem with little things is that
none of them is big enough to scare
you into action, but they keep
creeping up and by the time you get
alarmed the problem is too difficult to
handle
– Consequently, “design smells”
accumulate, “technical debt” grows,
and the result is “software rot” https://en.wikipedia.org/wiki/Design_smell
https://en.wikipedia.org/wiki/Technical_debt
https://en.wikipedia.org/wiki/Software_rot
6
The Role of Software Engg. (1)
A bridge from customer needs to programming implementation
Customer
Customer
Programmer
System-to-be
(includes hardware)
Problem Domain
Software-to-be
User
8
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
9
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”)
10
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 11
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
12
Software Engineering Blueprints
13
Second Law of Software Engineering
14
Software Development Methods
15
Waterfall Method
Requirements
Design
Implementation
Testing
Waterfall
method Deployment &
Maintenance
doSomething()
doSomethingElse()
Interaction Diagram
doSomethingYetElse()
Online information:
http://www.uml.org
17
How Much Diagramming?
Use informal, ad-hoc, hand-drawn, scruffy diagrams during
early stages and within the development team
– Hand-drawing forces economizing and leads to low emotional
investment
• Economizing focuses on the essential, most important considerations
– Prioritize substance over the form
• Not being invested facilitates critique and suggested modifications
– Always take snapshot to preserve records for future
Use standardized, neat, computer-generated diagrams when
consensus reached and designs have “stabilized”
– Standards like UML facilitate communication with broad range of
stakeholders
– But, invest effort to make neat and polished diagrams only when
there is an agreement about the design, so this effort is worth doing
• Invest in the form, only when the substance is worth such an investment
18
Understanding the Problem Domain
System to be developed
Actors
– Agents external to the system that interact with it
Concepts/ Objects
– Agents working inside the system to make it function
Use Cases
– Scenarios for using the system
19
ATM: Gallery of Players
1
4 2
7 5 3
8 6
0 9
1
4 2
7 5 63 1
8 4 2
0 9 7 5 3
8 6
0 9
D E XYZ
Please take
your cash withdrew
$60
1
4 2
7 5 63
8
0 9
Collecting
cash …
Acknowledged
22
How ATM Machine Works (2)
Domain Model (2)
Solution
Alternative modification
solution
Transaction
How may I record
help you?
Bookkeeper
Speakerphone
Draftsman
Window clerk
Dispenser
Customer
How ATM Machine Works (3)
Domain Model (3)
Alternative Solution
modification
solution
Transaction
How may I record
help you?
Bookkeeper
Speakerphone
Courier
Window clerk
Dispenser
Remote
bank
Customer
Which solution is the best or even feasible?
Rube Goldberg Design
Garage door opener
25
Actual Design
Operator (includes motor and radio control mechanism)
1
2
Remote control transmitter
6
3
5 7 Rail with a belt or chain
4 5
6
8
27
Software Measurement
What to measure?
– Project (developer’s work),
for budgeting and scheduling
– Product,
for quality assessment
28
Formal hedge pruning
29
Work Estimation Strategy
30
Sizing the Problem (1)
Step 1: Divide the problem into small & similar parts
Step 2:
Estimate relative
sizes of all parts
Size( ) = 4
Size( ) = 7
Size( ) = 10
Size( ) = 3
Size( ) = 4
Size( ) = 2
Size( ) = 4
Size( ) = 7
Sizing the Problem (2)
Unfortunately:
Unlike hedges, software is mostly invisible and
does not exist when project is started
The initial estimate hugely depends on experience and imagination
Exponential Cost of Estimation
100%
Estimation accuracy
Estimation cost
Estimation
error Waterfall Method
Estimation
error
Agile Method
Requirements
Design
Implementation Requirements
Design Requirements
Start Implementation Design
Implementation
Project Time
1st iteration completion Completion
2nd iteration completion
Work items
21 days
5 days
List prioritized by the customer Estimated completion date Time
37
Measuring Quality of Work
I
Proposition Concept Relation Concept
have
1. I have friend
2. friend engages in coding friend
program
is
Search the Web for Concept Maps new
39
Case Study: Home Access Control
Alarm bell
System
Light bulb
1
2
3
4
5
X
Y
Alarm bell
System
1
2
3
4
Light bulb
Central
5
X
Y
Computer
Backyard doors:
External &
Internal lock
Front doors:
External &
Internal lock
41
Know Your Problem
Mortise Lock Parts 1 Lock case
1 4 5 2 Latch bolt
6 3 Dead bolt
2 4 Strike plate
9
5 Strike box
6 Protective plate
3
7 Thumb-turn
7 8 Lock cylinder
9 Left hand lever
8
1
2
3
4
5
X
Y
42
Concept Map for Home Access Control
tenant
enters
wishes key
can be
upper bound on failed attempts
causes valid key invalid key
lock opened
can be prevented by enforcing
may signal
43
States and Transition Rules
locked unlocked