CompSize: Automated Size Estimation of ... - Semantic Scholar

2 downloads 0 Views 1MB Size Report
Saab Automobile AB/Chalmers University of Technology. Rogardt Heldal, Tony Heimdahl. Chalmers University of Technology. Tigran Harutyunyan. University of ...
CompSize: Automated Size Estimation of Embedded Software Components Kenneth Lind S bA Saab Automobile t bil AB/Ch AB/Chalmers l U University i it off T Technology h l Rogardt Heldal, Tony Heimdahl Chalmers University of Technology Tigran Harutyunyan University of Gothenburg

Motivation No of computers in highend cars; Ebert, C, Jones, C, ”Embedded Software: F t Figures, Facts, Fi and d Future”, IEEE Computer, Apr. p 2009, pp pp. 42-52 New car prices; US Bureau of Labor Statistics, Statistics Consumer Price Index (http://www.bls.gov/cpi/)

Background ECU

ECU

Communication network 20 – 80 ECUs ECU

Piece cost: 20 – 50 USD Design cost: ~1 MUSD

• Flexibility for future requirements obtained through spare resources like processor capacity and memory space.

Background Too much spare resources => Unnecessary piece cost

Too little spare resources => Premature redesign

Need for decision support!

Background •



Memory size in ECU estimated based on requirement specifications and historical data. COSMIC Function Points measured from Component Diagrams and textual requirements.

USERS

BOUNDARY

ENTRIES I/O Hardware OR SOFTWARE OR ENGINEERED DEVICES

EXITS

READS SOFTWARE COMPCOMP ONENT

Storage Hardware WRITES

Black-box

Background



Categorization based on factors like (in our domain) – Functionalityy type yp – Quality constraints – Methods & tools Memory size in ECU estimated within 15% accuracy before application software is available.

Experiment data 6000

Software code e size (bytes)



5000 Series 1 Series 3 Series 2 Series 4

4000 3000 2000 1000 0 0

20

CFP

40

60

80

Publications This presentation is based on two publications:



Lind, K Lind K., Heldal Heldal, R R., Harutyunyan, Harutyunyan T., T and Heimdahl, Heimdahl T.: T: CompSize: Automated Size Estimation of Embedded Software Components, Intl. Workshop on Software Measurement (IWSM), Japan, November 3-4, 3 4, (2011)



Lind, K., and Heldal, R.: A Model-Based and Automated Approach to Size Estimation of Embedded Software Components, ACM/IEEE 14th Intl. Conf. on Model Driven Engineering Languages and Systems (MoDELS), New Zealand, ( ) October 16-21,, (2011)

Problem Manual estimation approach Software design & implementation

Domain expert

Architect

Requirement definition

Example p

Decomposition into components

Software engineer Communication definition & implementation

Component Diagram g & Textual Specification

Textual Specification

Example

Identify input for COSMIC Activity

Artifact

Serial data engineer

E Example l

Functional Size measurement

Code Size estimation COSMIC Function Points

Interfaces, Parameters, Categorization

Bytes

Measurement engineer

Requires 2,5 man years in effort for the complete application software in a car!

Problem

• RQ1: “How can UML support pp in modeling g all

information needed for automated estimation of Software Code Size?”

• RQ2: “How much manual effort can be saved by modeling all information needed for automated estimation of Software Code Size?”

Solution Proposed p estimation approach pp Enhanced Component Diagram

Architect

Domain expert

Decomposition p into enhanced components

Requirement definition

Measurement engineer

CompSize

Model-based & automated measurement & estimation Bytes

Textual Specification

Introduced in this work!

Evaluation

RQ1: “How can UML support in modeling all information needed for automated estimation off Software S ft Code C d Size?” Si ?” IInteriorLightStatus_rsp InteriorLightStatus_rsp LGT_ControlTruckBedCargoLamp

5x

CFP=7! USERS

ENTRIES I/O Hardware OR SOFTWARE OR ENGINEERED DEVICES

EXITS

READS SOFTWARE COMPONENT

Storage g Hardware WRITES

Categorization factors functionality = Comf & Conv constraints = no decomposition_level = Distributable granularity_level = Textual spec. …

Direction = in IPickupBedCargoLamp osg IPickupBedCargoLamp_osg PickupBedCargoLamp_osg

BOUNDARY

Variables CARGO LAMP PRESENT:Boolean

Evaluation

IInteriorLightStatus_rsp InteriorLightStatus_rsp LGT_ControlTruckBedCargoLamp

functionality = Comf & Conv constraints = no decomposition_level = Distributable granularity_level = Textual spec. …

Direction = in IPickupBedCargoLamp_osg PickupBedCargoLamp_osg

Variables CARGO LAMP PRESENT:Boolean

Component name

Evaluation

COSMIC data movementt types t

CFP

Categorization factors

Evaluation RQ2: “How How much manual effort can be saved by modeling all information needed for automated estimation of Software Code Size?” Comparison of measurement result

Case study conducted by Master students • Our manual estimations was replicated using the UML Profile

Implemented Co ode Size (Bytes)

2500

2000 R² = 0,99 1500 Author measurement

1000

Student measurement

500

R² = 0,80 0 0

10

20 CFP

30



0,5 man years (instead of 2,5!) to estimate the size of the complete application software in a car

Results

• We have defined a UML Profile capturing the • •

information needed for memory size estimation estimation. We have developed a tool that can import the information captured in the UML Profile. Profile Using the UML Profile requires 0,5 man years (instead of 2 2,5 5 man years!) to estimate the size of the complete application software in a car.

Backup

Textual Specification The feature Shall be enabled when the calibration CARGO LAMP PRESENT is set true. If the vehicle p power mode is “OFF”,, and the cargo g lights g are illuminated, the SYSTEM Shall keep the cargo lamps active as long as Inadvertent Load Control power is active. CUSTOMER “ACTION”

INTERIOR ILLUMINATION Lamps Switch On and Vehicle Parked.

CUSTOMER PERCEIVABLE “OUTPUT”

Cargo Lamp Illuminates

MAXIMUM LATENCY “ACTION” to “OUTPUT” 100 ms

Back to Manual Estimation approach

Component Diagram «Interface» I t f

IInteriorLightStatus_rsp «Signal»

InteriorLightStatus_rsp

«use»

«Interface»

IVehicleMovementState_rsp «Signal»

VehicleMovementState_rsp

«use»

«Interface»

IIndvLoadProtectionILS_rsp «Signal»

IndvLoadProtectionILS_rsp

«use»

«Distributable» LGT_ControlTruckBedCargoLamp

«Interface»

IWritePickupBedCargoLamp_osg

Back to Manual Estimation approach

Functional Size Measurement «Interface»

IInteriorLightStatus_rsp «Signal»

InteriorLightStatus_rsp

«use»

«Interface»

IVehicleMovementState_rsp «Signal»

VehicleMovementState_rsp

«use»

«Interface»

IIndvLoadProtectionILS_rsp «Signal»

IndvLoadProtectionILS_rsp

The feature Shall be enabled when the calibration CARGO LAMP PRESENT is set true.

«use»

If the vehicle power mode is “OFF”, and the cargo lights are illuminated, the SYSTEM Shall keep the cargo lamps active as long as Inadvertent Load Control power is active.

«Distributable» LGT_ControlTruckBedCargoLamp _ g p

USERS

BOUNDARY

ENTRIES

«Interface»

IWritePickupBedCargoLamp_osg

CUSTOMER “ACTION”

INTERIOR ILLUMINATION Lamps S it h O Switch On and dV Vehicle hi l Parked.

CUSTOMER PERCEIVABLE “OUTPUT”

Cargo Lamp Illuminates

MAXIMUM LATENCY “ACTION” to “OUTPUT” 100 ms

I/O Hardware OR SOFTWARE OR ENGINEERED DEVICES

EXITS

CFP=7!

READS SOFTWARE COMPONENT

Storage Hardware WRITES

Back to Manual Estimation approach

UML Profile

USERS

ENTRIES

Already in use at Saab

I/O Hardware OR SOFTWARE OR ENGINEERED DEVICES



BOUNDARY

Component



EXITS

CompSizeComponent functionality: String decomposition_level: String granularity_level: String …



p y Property

Back to Proposed Estimation approach

p p y CompSizeProperty

SOFTWARE COMPONENT

Storage Hardware WRITES

Categorization factors

Name of Component



READS

direction in out inout

Components

CompSize

COSMIC data movement types

CFP

Real Code Size

Categorization factors

CompSi e CompSize

Back to Proposed Estimation approach

Estimated Code Size