Professional Documents
Culture Documents
V-Cycle Development Process: Software Engineering 1
V-Cycle Development Process: Software Engineering 1
Development
Process
Software Engineering Case Study
Speaker
Marco Bozzano
ITC-irst
Automated Reasoning System Division
Formal Methods Group
E-mail: bozzano@irst.itc.it
Overview
"
"
"
"
"
"
"
Some Motivations
Motivating Examples
Waterfall / V-cycle Process
Formal Methods
Case Study
Conclusions
Future
Some Motivations
"
"
"
"
"
"
"
Example 1 - Problem
A simple problem
Ctrl
"
Example 1 - Solution
Solution
System behaviour can be split into two functions: ReadLevel e
ActivateRelais.
"
Example 1 Implementation
(1/3)
Team 1: ReadLevel
Example 1 Implementation
(2/3)
Team 2: ActivateRelais
Example 1 Implementation
(3/3)
Main: Putting All together
// tank is three meters high
#define LMAX 3.0
// we need the tank at least this full
#define LMIN 1.0
main () {
double water_level;
while (water_level = ReadLevel()) {
ActivateRelais(LMAX, LMIN, water_level);
}
}
Example 1 Considerations
(1/2)
September 23, 1999
Mars Climate Orbiter burns out
while approaching Mars
atmosphere.
Mission cost: 156 M$
"We had planned to approach the planet at an altitude of about 150
km. We thought we were doing that, but upon review of the last six to
eight hours of data leading up to arrival, we saw indications that the
actual approach altitude had been much lower. It appear that the
actual altitude was about 60 km.
Richard Cook, project manager Mars Surveyor Project
Software Engineering Case Study
10
Example 1 Considerations
(2/2)
Motivations for mission failure
"
Root cause: Failure to use metric units in the coding of a ground software file,
"Small Forces" used in trajectory models.
Background causes:
Mission Management:
Navigation Team unfamiliar with spacecraft.
Trajectory correction manoeuvre number 5 not performed.
Project Management:
Inadequate communications between project elements.
Inadequate operations Navigation Team staffing.
Inadequate training.
Technical Requirements:
Undetected mismodeling of spacecraft velocity changes.
System engineering process did not adequately address transition
from development to operations.
Verification and validation process did not adequately address
ground software.
11
Software Engineering Case Study
"
"
"
"
"
"
"
"
"
"
"
Example 2
Marketing aspects
Software applications used for the production of systems on a large
scale basis (e.g., embedded systems) have to take into account also
commercial aspects and market issues (time-to-market, development
costs, marketing costs).
Development Time:
Time required to develop a product to
the point it can be sold to customers
Market window:
Period during which the product
would have highest sales
Average time-to-market constraint is
Time (months)
about 8 months.
Revenues ($)
"
12
Example 2
Bugs costs
The cost of bugs is crucial
and increases exponentially
with the development time.
"
Bugs Costs
Development Phases
"
Pentium bug
"
MULTICS
Software Engineering Case Study
13
"
"
"
"
14
"
Waterfall / V-cycle
+
Formal Methods
Software Engineering Case Study
15
De
ve
n
me
lop
HW / SW
Components
Design
Validation
Validation
System
Integration &
Test
Module
Integration &
Test
ng
System
Analysis &
Design
System
Acceptance
Te
sti
Requirements
Analysis
HW / SW
Implementation &
Unit Test
16
V-cycle Processes
Discussion
"
Drawbacks:
System validation begins after implementation.
No particular format is devised for requirements and design
specification, thus allowing for ambiguity and inconsistencies.
"
"
"
"
17
V-cycle Revised
Validation
System
Analysis &
Design
De
Formal V&V
ve
n
me
lop
HW / SW
Components
Design
Formal V&V
Validation
Validation
System
Integration &
Test
Module
Integration &
Test
ng
Formal V&V
System
Acceptance
Te
sti
Requirements
Analysis
HW / SW
Implementation &
Unit Test
Formal V&V
18
Formal Methods
Overview
"
Characteristics:
Formal Notation + Tools =>
Exhaustive analysis
Intensive Simulation
Intermediate effects:
Early validation: requirements and design are validated and debugged
early in the development cycle (when bug fixing is less costly)
Better quality of documents/prototypes => fewer ambiguities, better
communication among the project team
Reduced manual validation phases
Final effects:
Higher quality standards, higher reliability, higher maintainability
Shortened time- to- market
"
"
"
"
"
"
"
"
"
"
19
Formal Methods
Risks
"
"
"
"
"
Can be costly
Can be ineffective (too difficult, application to irrelevant domains)
Can be difficult to introduce
Require training (industrial partner)
Require domain knowledge transferral (formal methods expert)
"
"
20
"
"
"
"
Open source
"
21
NuSMV
"
"
"
22
Case Study
Tank Controller (TC)
"
"
"
"
"
"
"
"
NuSMV implementation
Software Engineering Case Study
23
TC The System
Level_Too_High
Level_High
Level_Middle
Level_Low
Level_Too_Low
24
TC Description
"
"
The tank has inflow from an infinite source and outflow to an end user.
"
"
"
"
Valves are used in case of high level alarms (the water is in the "Level Too High"
portion of the tank for three times in a row) and low level alarms (the water is the
"Level Too Low" portion of the tank for three times in a row).
The tank is subdivided into areas that are used by the the controller to differentiate
its policy.
25
TC Implementation
STEP 1 - Requirements Analyses
We define the System Requirements, i.e. those desired properties that our
system must satisfy
We express such properties both in natural language and using a formal
language (CTL/LTL are the logic formalisms used by NuSMV).
"
"
REQ1. The level always tends to the central portion of the tank
AF ( (Tank.Level < DECREASE_FLOW_IN_LEVEL) &
(Tank.Level > INCREASE_FLOW_IN_LEVEL) )
Always Finally the level of the tank is less than
DECREASE_FLOW_IN_LEVEL and is greater than DECREASE_FLOW_IN_LEVEL
( ! Ctrl.Alarm_low_level )
26
TC Implementation
STEP 2 System Analysis and Design
"
"
"
MODULE main
VAR
V_in : valve_type;
V_out : valve_type;
P_in : pump_type(V_in.Status);
P_out : pump_type(V_out.Status);
Tank : tank_type(P_in.Flow, P_out.Flow);
27
TC Implementation
STEP 3 RequirementsVerification
(STEP1)
Requirement
FSM
NuSMV
Yes
Counterexample
(STEP2)
28
TC Implementation
STEP 4 HW/SW Components Design
"
"
"
We formalize this
representation into a NuSMV
model
NuSMV model = Finite State
Machine (FSM)
ASSIGN
init(Status) :=
case
Level_Low | Level_Too_Low : up;
1 : down;
esac;
next(Status) :=
case
(Status = up) & (Level > DECREASE_FLOW_IN_LEVEL)
: down;
(Status = down) & (Level < INCREASE_FLOW_IN_LEVEL) : up;
1 : Status;
esac;
29
TC Implementation
STEP 5 RequirementsVerification
NuSMV demo
30
TC - V-cycle Perspective
STEP 1
Validation
Requirements
Analysis
System
Acceptance
STEP 2
System
Analysis &
Design
Validation
System
Integration &
Test
STEP 4
n
me
lop
t
STEP 5
Validation
Module
Integration &
Test
ng
ve
HW / SW
Components
Design
Te
sti
De
STEP 3
HW / SW
Implementation &
Unit Test
Formal V&V
31
Conclusions
The V-cycle development process together
with the Formal Methods
addresses the problems
of modern, increasingly complex,
SW applications.
32
Future
Next Step
"
"
"
33