INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

39
INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1

Transcript of INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

Page 1: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

1

INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWAREBruce Reynolds, November 2015

Page 2: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

2

Outline

Cosmic Definition Functional Size Measurement Functional User Requirements Non-Functional Requirements COSMIC Approach In-Class Exercise COSMIC—a Real World example Conclusion

Page 3: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

3

COSMIC Definition

COSMIC stands for the Common Software Measurement International Consortium. COSMIC is a voluntary organization that has defined an open, ISO standard functional size measurement (FSM1) method, based on fundamental software engineering principles.

The International Standards Organization (ISO) FSM standards are:

COSMIC (ISO, ISO/IEC 19761)IFPUG (ISO, ISO/IEC 20926)Mark-II (ISO, ISO/IEC 20968)NESMA (ISO, ISO/IEC 24570)FiSMA (ISO, ISO/IEC 29881)

Page 4: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

4

What is Functional Size Measurement (FSM2)?

An FSM method defines a process to measure a size of the Functional User Requirements (FUR) of software in units of ‘function points’.

Functional sizes are independent of the technology used to develop the software, and they can be used as a basis to:

1. Control requirements (AKA scope creep)

2. Measure productivity (= size/effort) of completed projects3. Compare productivity across projects (e.g., waterfall vs.

agile)4. Measure defect density for operational systems5. Estimate effort for new projects

Page 5: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

5

A functional requirement specifies what the software must do in terms of the services it provides to its users.

The users of the software being measured, as defined in the FUR, may be: Humans (typical for business applications) Hardware devices (e.g., sensors, actuators

typical for real-time software) Other pieces of software (all software

domains)

What are Functional User Requirements (FUR3, 6)?

Page 6: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

6

The quality of the FUR determines the quality of the functional size measurements (and whether the developers can deliver what the user wants!)

COSMIC has approximate sizing approaches for use early in a project before requirements are known in detail.

COSMIC concepts map with UML concepts; size measurement of UML sequence diagrams has been automated.

Measurement of COSMIC sizes of designs in Simulink has been automated.

COSMIC matches perfectly with Agile for sizing User Stories, Iterations, etc., at all levels of aggregation.

Page 7: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

7

Software size is the biggest driver of project effort

SLOC16: Can’t estimate until software is designed Technology-dependent, no standards Accounts for all requirements

Functional size: International standard methods: What about Non-Functional

Requirements?

UCP, OOP, SP No reliable standards (So no publicly-available benchmarks)

Sizing method options:

Other sizing methods:

Page 8: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

8

Serious project effort estimation needs a measure of software size and data on past performance

Development Productivity =

Software Size

Effort

Estimated development effort for “New-Project”

=Est. Soft. Size for “New-

Project”Past Productivity

Adjustments for “New-Project”

X

How big is it?

Page 9: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

9

Once upon a time (i.e. last century), software size measurement was easy

Whole business applications

Real-time software systems

Measure Functional

Requirements

Measure Non-Functional

Requirements

(Example NFR)

Albrecht/IFPUG

Function Point

Analysis

Value Adjustment

Factor

(Mainly on-line vs batch

processing)

(orSLOC

)

SLOC

(Mainly timing

constraints)

Waterfall

Page 10: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

10

Nowadays, the measurement challenge is greater

Business Systems, Real-time systems, Infrastructure software

Measure Functional

andNon-

FunctionalRequirement

s

(Example NFR)

Whole, distributed,Multi-layer

Big Data

SOA

Waterfall & Agile

Embedded

Model-based development

Internet of things

Systems of systems

UML(UC Pts)

Usability, Portability, 24/7 Availability, Security, Privacy, Maintainability, Dependability, Safety, Reusability,

Architecture, etc.

BYO Device

(Function Pts. Story Pts)

OO(Obj Pts)

(SNAP)

(SLOC)

COSMI

C

Page 11: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

11

Why use COSMIC when I can use the IFPUG method?

The IFPUG method Is recognized as the first FSM

method (1979) Is primarily designed to

measure business applications

Is difficult to apply to the following systems: Real-Time systems Distributed systems Mobile applications

Does not fit well with modern development methods (Agile, UML, etc.)

The COSMIC method Is a second generation method based on fundamental software engineering principles

Is applicable to business, real-time and infrastructure software

Fits perfectly with agile, component-based development methods

Is ‘Open’ All documentation is freely

available Is easy to understand (100

versus IFPUG’s 500 pages of basic rules, examples, etc.)

Page 12: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

12

The advantage of open source, a real world example, Microsoft Encarta17 versus Wikipedia

2001 2002 2003 2004 2005 2006 2007 2008 2009 20100%

10%20%30%40%50%60%70%80%90%

100%

Percentage* of website visits from 2001 to 2010

Encarta (annual subscription) Wikipedia (open source)

The same can be said for COSMIC versus other FSM methods!

Page 13: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

13

The COSMIC approach to NFR

The measurement of NFR is integrated into the COSMIC approach, versus having a separate method [e.g., IFPUG’s General Systems Characteristics (GSC19), and the Software Non-functional Assessment Process (SNAP20)].

Software FunctionalUser Requirements

(FUR)

QualityRequirement

s

Requirements for aSoftware System

Project

System and Software

Non-FunctionalRequirements (NFR)

System EnvironmentRequirements

Project Requirementsand Constraints

(PRC)

TechnicalRequirement

s

Page 14: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

14

NFR typically evolve, wholly or partly, as a project progresses into FUR that COSMIC can measure24

Imple-mentedsoftwaresystem

orsoftwareproduct

ProjectReqts. &Constraints

Require-ments

Analysis

Definition&

Design

Build, Test

&Impleme

nt

Architecture

OutlineFunct--ional

Requts.

OutlineNFR

Approx

Funct--ionalReqts

.

FUR

“True” NFR

may evolve into

Size by analogy or

expert judgement

Approx. COSMIC size

measurement

Precise COSMIC size

measurement

Page 15: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

15

The three phases of the COSMIC functional size measurement process4

Definition of each piece ofsoftware to be measured andof the required measurement

Input from measurementsponsor

Software Context Model

FUR

Phase 1Measurement

Strategy5

Phase 2Mapping9

Phase

FUR

Generic Software Model12

FUR in the formof the GenericSoftware Model

Phase 3Measurement

Phase

Functional sizeof the softwarein units of CFP

Page 16: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

16

Three possible Software Layer Structures25

A software architecture may exhibit different layers13 depending on the view of the architecture

Application‘A’

UserInterface

Component

BusinessRules

Component

DataServices

Component

Application Layer

Orchestration Layer

Utility Layer

Application Layer

View of application ‘A’ as

a whole

Application ‘A’ components in a

3-layer architecture

Layers for SOA components of Business Rules

Page 17: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

17

Phase 2—Mapping9, Part 1

The four main principles of the COSMIC Generic Software Model12

Software functionality consists of functional processes

The task of each functional process is to respond to an event that has happened in the world of the software’s functional users.

Functional processes consist of sub-processes Data movement sub-processes (Entries, Exits, Reads and

Writes) move data describing a single object of interest. Each data movement accounts for the associated data

manipulation. Each data movement is measured as 1 CFP (COSMIC

Function Point).

Page 18: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

18

Phase 2—Mapping9, Part 2

The relationship between events, functional users and functional processes7

causes Functional

User

to generate adata group

that is movedinto a FP by

the FP’sTriggering Entry

Boundary

FunctionalProcess

TriggeringEvent

Page 19: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

19

Phase 2—Mapping, Part 3

The four types of data movements8

Entries

Boundary

Hardware devices Other software Humans

Functional Users

Exits

Softwarebeing

measured

WritesReads

PersistentStorage

Page 20: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

20

Phase 3—Measurement Phase11, Part 1

The COSMIC measurement principle10

The functional size of a piece of software is equal to the number of its data movements.

A functional size is measured in units of ‘COSMIC Function Points’, abbreviated as ‘CFP’. 1 CFP is defined by convention as the size of a single data Movement (Entry, Exit, Read or Write).

A way of recording the results of an analysis of measuring functional processes using the Generic Software Model matrix12.

Data Group Names Number of Data Movements

Personnel SystemFunctional Processes

Em

ploy

ee B

ase

Dat

a

Em

ploy

ee I

D

Em

ploy

ee S

alar

y H

isto

ry

Err

or/C

onfir

mat

ion

Mes

sage

End

of

mon

th 'c

lock

tic

k'

Em

ploy

ee C

urre

nt

sala

ry

Em

ploy

ee T

otal

s

Ent

ries

Exi

ts

Rea

ds

Writ

es

To

tal

Create Employee E, R, W E, W X 2 1 1 2 6Read Employee data R, X E R, X X 1 3 2 6Update Employee data E, W E, W X 2 1 2 5End of month report R R E X X 1 2 2 5

Totals for Personnel System: 6 7 5 4 22

Page 21: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

21

Calculating the software size with COSMIC14

The size of a functional process is the count of its Entries, Exits, Reads and Writes.

The size of the FUR of a piece of software is the sum of the sizes of its functional processes.

The size of a change to a piece of software is the sum of the changed (added, modified and deleted) data movements.

The minimum size of a functional process is 2 CFP (1 Entry + 1 Write or 1 Exit).

There is no upper limit to the size of a functional process.

Page 22: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

22

Once I have calculated the data movements, how can I estimate the software development effort?

The following estimating tools accept COSMIC sizes as input KnowledgePlan (Software Productivity Research) PRICE TruePlanning (Price Systems) ProjectIT (Telmaco, UK) SEER (Galorath) SLIM (QSM)

In addition, the above tools will provide the estimator with all aspects of estimating the cost of the software project, not just the software development.

You can develop a COSMIC benchmarking database consisting of successfully completed projects which has: Output in CFP (A) Number of work hours (B) A ÷ B = Benchmark Productivity

A practical example follows…

Page 23: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

23

A practical example of calculating software size and effort with COSMIC

IN-CLASS EXERCISE

Page 24: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

24

Calculating the software sizewith COSMIC

First, take the Functional User Requirements, then determine the application boundary.

C-RegistrationSystem

Student schedule

Mail system

Billing system

Course CatalogSystem

Wylie College Users(Students, Professors,

Course Registrar)

Application Boundary

IN-CLASS EXERCISE

E – Entry

X – Exit

R – Read

W – Write

Legend:

E

E

X

X

X

X

Page 25: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

25

Calculating the software size with COSMIC

Second, build a sub-functional process matrix (below), then identify the data movements.Process

descriptionsTriggering

eventSub-process Description

Data Group

Data movement

TypeCFP ƩCFP

Add a student

Registrar selects “add

student”

Registrar enters student data

Student data

E 1

The system validates the data

and checks if a student of the same name

already exists

Student data

R 1

The system creates a new

student

Student data

W 1

Display error message

Messages X 1

4

IN-CLASS EXERCISE

E – Entry

X – Exit

R – Read

W – Write

Legend:

In our in-class exercise example, we have 1 Entry, 1 Read, 1 Write, and 1 Exit, for a total of 4 data movements, or COSMIC Function Points.

Page 26: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

26

Calculating the software sizewith COSMIC

Third, document all of the data movements by creating a consolidation table, such as the Generic Software Model Matrix below.

Data Group Names Number of Data Movements

C-Registration SystemFunctional Processes

Stu

dent

dat

a

Mes

sage

s

Ent

ries

Exi

ts

Rea

ds

Writ

es

To

tal

Add a Student E, R, W X 1 1 1 1 4000

Totals for System: 1 1 1 1 4

IN-CLASS EXERCISE

Translating the COSMIC function points into effort in hours and dollars follows…

COSMICfunction

points

Page 27: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

27

Calculating the effortin hours and dollars

IN-CLASS EXERCISE

Fourth, use an estimating tool, such as SEER (Galorath), or Price True Planning, then input the COSMIC function points into this tool in order to calculate the hours and dollars.

PRICE TruePlanningestimating tool,Version 14.2:

Size Units: COSMICLanguage: JavaDevelopment Process: AgileAll other variables: set to thedefault values

The PRICE TruePlanning modelthen calculates theeffort in hoursand dollars.

Input 4 COSMICFunctionPoints

Description Hours DollarsProject Initiation and Planning for Development

0.7 109$

Project Management and Control for Development

13.3 2,489$

Quality Assurance Management for Development

2.6 319$

Configuration Management for Development

2.6 292$

Documentation for Development 11.3 1,632$ Requirements Definition and Analysis 9.6 1,548$ System Design 5.7 845$ Software Integration and Test 68.2 8,506$ Hardware Software Integration and Test

11.1 1,367$

Operational Test and Evaluation 9.9 1,494$ Software Requirements Analysis 15.5 2,511$ Software Design 78.5 11,983$ Code and Unit Test 91.0 11,446$ Software Qualification Test 29.0 3,777$ Total 349.1 48,318$

Page 28: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

28

COSMIC—a Real World example

Page 29: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

29

Problem or challenge:Renault was unable to predict its software costs early for the Electronic Control Unit (ECU) software in cars

Renault selected the COSMIC FSM standard for measuring the size of real-time embedded software and for estimating project costs.

Apply the COSMIC method to develop an automated measurement tool using the Simulink21 model and the MATLAB22 programming language.

Solution:

Page 30: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

30

Outcome:

ECU software costs are now automatically calculated with dramatically reduced measurement times.

By using the AUTOSAR*23 architecture, ECU software reuse is now possible for different hardware targets. This enables software enhancements to be used instead of new software development.

Based on the results from the automated tool, productivity models are prepared and then leveraged to negotiate with suppliers to obtain the best value in supplier costs.

COSMIC is also used to predict the memory size needed for embedded software. Once the memory size is predicted, this enables Renault to anticipate the needed margin associated with the start of production milestone.*(AUTomotive Open System ARchitecture)

Page 31: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

31

In conclusion, Renault18 uses CFP sizing to control the development and enhancement of Electronic Control Units (ECU)

Tracks progress of ECU specification teams…

who create designs in Matlab Simulink… which are automatically measured in CFP

Motivation for automation: speed and accuracy of measurement

Page 32: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

32

… achieving remarkable cost estimation accuracy from the designs

Cost vs. size (CFP)

Memory size vs.

software size (CFP)

Page 33: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

33

COSMIC is easier to understand and use versus other FSM methods.

COSMIC is an open source method.

COSMIC can be used to estimate: Business applications Real-Time applications Distributed systems COTS tools or systems Mobile applications

Many tools are available that accept COSMIC sizes as input.

Cosmic is Based on fundamental

software engineering principles, which makes the method future-proof.

Used around the world, and the Measurement Manual has been translated into 12 languages besides English.

Most importantly: All of the COSMIC

documentation is available for free on the internet at:

Conclusion

www.cosmic-sizing.org

Page 34: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

34

Questions?

Page 35: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

35

References

Page 36: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

36

References

[1] http://en.wikipedia.org/wiki/Function_point[2] http://en.wikipedia.org/wiki/Software_sizing[3] S. Robertson, J. Robertson, Mastering the Requirements Process,

Getting Requirements Right, Addison-Wesley, Boston, MA, 2013, p. 223.

[4] The COSMIC Functional Size Measurement Method Version 4.0, Introduction to the COSMIC method of measuring software, Version 1.0, May 2014, p. 15, Figure 4.1.

[5] The COSMIC Functional Size Measurement Method Version 4.0.1, Measurement Manual, April 2015, p. 20, Figure 2.0.

[6] The COSMIC Functional Size Measurement Method Version 4.0, Introduction to the COSMIC method of measuring software, Version 1.0, May 2014, p. 16.

[7] The COSMIC Functional Size Measurement Method Version 4.0, Introduction to the COSMIC method of measuring software, Version 1.0, May 2014, p. 22, Figure 6.1.

[8] The COSMIC Functional Size Measurement Method Version 4.0, Introduction to the COSMIC method of measuring software, Version 1.0, May 2014, p. 16.

Page 37: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

37

References

[9] The COSMIC Functional Size Measurement Method Version 4.0.1, Measurement Manual, April 2015, p. 37, Figure 3.0.

[10] The COSMIC Functional Size Measurement Method Version 4.0, Introduction to the COSMIC method of measuring software, Version 1.0, May 2014, p. 31.

[11] The COSMIC Functional Size Measurement Method Version 4.0.1, Measurement Manual, April 2015, p. 64, Figure 4.0.

[12] The COSMIC Functional Size Measurement Method Version 4.0.1, Measurement Manual, April 2015, Appendix A, p. 74.

[13] The COSMIC Functional Size Measurement Method Version 4.0.1, Measurement Manual, April 2015, p. 25, Figure 2.2.

[14] Software Functional Size with ISO 19761:2003 COSMIC-FFP Measurement Method, C-Registration System, Updated: February 23, 2008.

[15] ICEAA Cost Estimating Body of Knowledge (CEBoK), Unit IV – Module 12, page 17.

[16] ICEAA Cost Estimating Body of Knowledge (CEBoK), Unit IV – Module 12, page 19.

Page 38: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

38

References[17] N. Cohen, Microsoft Encarta Dies After Long Battle with

Wikipedia, The New York Times, March 30, 2009.[18] Alexandre Oriou et al, Manage the automotive embedded

software development cost & productivity with the automation of a Functional Size Measurement Method (COSMIC), IWSM 2014, Rotterdam, www.ieeexplore.org.

[19] International Function Point Users Group (IFPUG), Function Point Counting Practices Manual, Part 5, Appendix C.

[20] International Function Point Users Group (IFPUG), Software Non-functional Assessment Process (SNAP), Assessment Practices Manual, Release 2.1.

[21] https://en.wikipedia.org/wiki/Simulink [22] https://en.wikipedia.org/wiki/MATLAB [23] https://en.wikipedia.org/wiki/AUTOSAR[24] The COSMIC Functional Size Measurement Method Version 4.0.1,

Guideline on Non-Functional & Project Requirements, VERSION 1.0, November 2015.

[25] The COSMIC Functional Size Measurement Method Version 4.0.1 Measurement Manual, page 26, Figure 2.4.

Page 39: INTRODUCTION TO THE COSMIC METHOD OF MEASURING SOFTWARE Bruce Reynolds, November 2015 1.

www.cosmic-sizing.org