Sei sulla pagina 1di 42

LECTURE 1: Introduction

Lecture time: 1 hr. 20 min.

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, OReilly Media, 2006. ISBN: 0-596-00982-8

Teaching Assistant:
Swapnil Mhaske <smhaske@eden.rutgers.edu>

2
Team Projects
Form teams of 6 ( 1?) students
DEADLINE: Friday, January 25, 2013
After that, teams assigned randomly
Project Ideas:
http://www.ece.rutgers.edu/~marsic/books/SE/projects
No more than two (2) groups working on the
same project
One (1) new project allowed
Email your project idea ASAP, before proposal is due, for feedback

3
Personal Health Monitoring Devices

Available budget:
$500

To do:
1. Search the Web
for devices and apps
that you would like to
work with
2. Email the components
list with costs+websites

4
Project Deliverables

Item Due date


1. Proposal January 29
2. First report (Specification only)
I Part 1 (Statement of Work & Requirements) February 12
t Part 2 (Functional Requirements Spec & UI) February 18
e Full Report #1 February 22
r
a 3. Second report (Design only)
t. Part 1 (Interaction Diagrams) March 1
#1 Part 2 (Class Diagram and System Architecture) March 8
Full Report #2 March 15
4. First demo April 2 ...
I 5. Third report (All reports collated) April 27
t 6. Second demo May 1 ...
e
r #2 7. Electronic Project Archive May 3

5
Team 1
Team
Team 2
Project
Team 3
Grading
Earned points

30 30 26 21 pts
pts pts 21 p pts
50 pts 12 p
30 35
pts pts

Project grade
100 70 100
Project Member Earned Adjusted Normalized
Team
grade ID points points points
M1,1 30 30 (30/35 * 100) = 86
T1 100% M1,2 30 30 (30/35 * 100) = 86
M1,3 30 30 (30/35 * 100) = 86
M2,1 21 (21 * 0.7) = 14.7 (14.7/35 * 100) = 42
T2 70%
M2,2 50 (50 * 0.7) = 35 100
M3,1 21 21 (19/35 * 100) = 60
M3,2 12 12 (12/35 * 100) = 34
T3 100%
M3,3 35 35 100
Introduction: Software is Complex

Complex complicated

Complex = composed of many simple parts


related to one another

Complicated = not well understood, or explained


Complexity Example:
Scheduling Fence Construction Tasks

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 ]

Setting posts Nailing, Painting


Cutting Nailing

shortest possible completion time = ?

[ simple problem, but hard to solve without a pen and paper ] 8


More Complexity

Suppose today is Tuesday, November 29

What day will be on January 3?

[ 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 Role of Software Engg. (1)
A bridge from customer needs to programming implementation

Customer
Customer
Programmer

First law of software engineering


Software engineer is willing to learn the problem domain
(problem cannot be solved without understanding it first) 10
The Role of Software Engg. (2)
Customer:
Requires a computer system to achieve some business goals
by user interaction or interaction with the environment
in a specified manner

System-to-be

Environment
Software-to-be
User

Software Engineers task:


To understand how the system-to-be needs to interact with
the user or the environment so that customers requirement is met
and design the software-to-be

May be the Programmers task:


same person To implement the software-to-be
designed by the software engineer

11
Example: ATM Machine
Understanding the money-machine problem:

Communication link

Banks
remote
ATM machine
datacenter
Bank
customer
12
How ATM Machine Might Work
Domain model Domain Model
created with help
of domain expert
Transaction
How may I record
help you? Cash

Bookkeeper
Speakerphone Safe
Safe keeper
Phone

Window clerk

Datacenter
liaison

Dispenser

Banks
remote
datacenter 13
Customer
Cartoon Strip : How ATM Machine Works

A Enter B C Verify
account
D
your PIN
XYZ
Verify
this
account

Typing in XYZ valid. Account


PIN number Balance: valid.
$100 Balance:
$100

E How may F Release


G Record
I help $60 $60 less
you?

Withdraw Dispense
H Dispensing!

$60 $60
Please take
your cash

14
Software Engineering Blueprints
Specifying software problems and solutions is
like cartoon strip writing
Unfortunately, most of us are not artists, so
we will use something less exciting:
UML symbols
However

15
Second Law of Software Engineering

Software should be written for people first


( Computers run software, but hardware quickly
becomes outdated )

Useful + good software lives long

To nurture software, people must be able to understand


it

16
Software Development Methods
Method = work strategy
The Feynman Problem-Solving Algorithm:
(i) Write down the problem (ii) think very hard, and (iii) write down
the answer.
Waterfall
Unidirectional, finish this step before moving to the next
Iterative + Incremental
Develop increment of functionality, repeat in a feedback loop
Agile
User feedback essential; feedback loops on several levels of
granularity

17
Waterfall Method
Requirements

Design

Implementation

Testing
Waterfall
method Deployment &
Maintenance

Unidirectional, no way back


finish this step before moving to the next 18
UML Language of Symbols
UML = Unified Modeling Language
interface
Stereotype
BaseInterface
provides
ClassName additional info/
+ operation()
annotation/
# attribute_1 : int explanation
Three common # attribute_2 : boolean
compartments: # attribute_3 : String
1. Classifier name Inheritance
+ operation_1() : void relationship:
+ operation_2() : String Class1Implement Class2Implement
2. Attributes BaseInterface
+ operation_3(arg1 : int) is implemented
+ operation() + operation()
3. Operations by two classes
Software Class
Actor Comment Software Interface Implementation

instance1 : Class1 instance5 : Class2 instance8 : Class3

doSomething()
doSomethingElse()

Interaction Diagram
doSomethingYetElse()
Online information:
http://www.uml.org
19
Understanding the Problem Domain

System to be developed

Actors
Agents external to the system

Concepts/ Objects
Agents working inside the system

Use Cases
Scenarios for using the system

20
ATM: Gallery of Players

Bank customer System Banks remote


(ATM machine) datacenter

Actors (Easy to identify because they are visible!)


21
Gallery of Workers + Things

Window clerk Datacenter Bookkeeper Safe keeper Dispenser


liaison

Speakerphone Telephone Transaction Safe Cash


record

Concepts (Hard to identify because they are invisible/imaginary!)


22
Use Case: Withdraw Cash
A Enter
B Verify
account C How may
your PIN XYZ I help
you?

Typing in XYZ valid. Withdraw


PIN number Balance: $60
$100

D E XYZ
Please take
your cash withdrew
$60

Collecting
cash
Acknowledged

23
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

26
Actual Design

27
Software Measurement
What to measure?
Project (developers work),
for budgeting and scheduling

Product,
for quality assessment

28
Formal hedge pruning

29
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)
Step 3: Estimate the size of the total work

Total size = points-for-section i (i = 1..N)

Step 4: Estimate speed of work (velocity)

Step 5: Estimate the work duration


Path size
Travel duration =
Travel velocity
Sizing the Problem (3)
Advantages:
Velocity estimate may need to be adjusted (based on
observed progress)

However, the total duration can be computed quickly


(provided that the relative size estimates of parts are
accurate easier to achieve if the parts are small and
similar-size)
Exponential Cost of Estimation
100%

Estimation accuracy

Estimation cost

Improving accuracy of estimation beyond a certain point requires huge


cost and effort (known as the law of diminishing returns)
In the beginning of the curve, a modest effort investment yields huge
gains in accuracy
33
Estimation Error Over Time

Estimation
error

Requirements Design Implementation

Start Completion Time

The cone of uncertainty starts high and narrows down to zero


as the project approaches completion.
Agile Project Effort Estimation

Estimated work duration


Work backlog
1) Prune Section 8 3.5 days (7pts)
2) Prune Section 7 2 days (4pts)
Items pulled by the team into an iteration
3) Prune Section 6 1 day (2pts)
4) Prune Section 5 2 days (4pts)

5) Prune Section 4 1.5 days (3p)

6) Prune Section 1

7) Prune Section 2

8) Prune Section 3

Work items
21 days

1st iteration 2nd iteration n-th iteration

5 days
List prioritized by the customer Estimated completion date Time
35
Measuring Quality of Work

Good Shape Poor Shape


(Low branches get sun) (Low branches
shaded from sun) Heading back not Remove dead wood
recommended as
it alters the natural Remove water spouts
shape of the shrub and suckers

Rounded forms, which


Snow accumulates Straight lines require Peaked and rounded tops
follow natures tendency,
on broad flat tops more frequent trimming hinder snow accumulation
require less trimming
36
Concept Maps
Useful tool for problem domain description

SENTENCE: My friend is coding a new program


translated into propositions

I
Proposition Concept Relation Concept
have
1. I have friend
2. friend engages in coding friend

3. coding constructs a program engages in

4. program is new coding


constructs a

program
is
Search the Web for Concept Maps new
37
Case Study: Home Access
Control
Objective: Design an electronic system for:
Home access control
Locks and lighting operation
Intrusion detection and warning

Alarm bell
System

Light bulb
1
2
3
4
5
X
Y

Lock Photosensor Switch


38
Case Study More Details

Alarm bell
System

1
2
3
4
Light bulb
Central
5
X
Y

Computer

Lock Photosensor Switch

Backyard doors:
External &
Internal lock

Front doors:
External &
Internal lock
39
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

40
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

burglar launches dictionary attack

41
States and Transition Rules

IF validKey AND holdOpenInterval THEN unlock

IF validKey THEN unlock

locked unlocked

IF pushLockButton THEN lock

IF timeAfterUnlock max{ autoLockInterval, holdOpenInterval } THEN lock

what seemed a simple problem, now is becoming complex 42

Potrebbero piacerti anche