Sie sind auf Seite 1von 33

Empirical Software

Engineering

Ali Idri
Idri,, Ph.D.
ENSIAS, Rabat, Maroc
Maroc
Université
Universit é Mohamed V
E-mail: ali.idri@um5.ac.ma

1 © Ali Idri/ESE/2016-2017
Pré--requis
Pré
Concepts de base du génie logiciel
Cycle de développement et/ou de maintenance
Analyser? Concevoir ? Programmer? Tester?

Analyse de données

2 © Ali Idri/ESE/2016-2017
Objectifs

Approfondir les connaissances en


développement et/ou maintenance de logiciels

Pourquoi contrôler et évaluer le développement


et/ou la maintenance de logiciels?

Comment contrôler et évaluer un projet logiciel?

Estimation des coûts de logiciels

3 © Ali Idri/ESE/2016-2017
References
N. Fenton and S. L. Pfleeger,
Software Metrics: A Rigorous and Practical Approach
International Thomson Computer Press, 1999

Barry W. Boehm,
* Software Engineering Economics
Prentice-Hall, 1981
* Software Cost Estimation with COCOMOII
Hardcover, 2000

4 © Ali Idri/ESE/2016-2017
Historique
1968, « La Crise de Logiciels »
Coûts très élevés
Fiabilité décroissante
Qualité faible
Etc.

Génie Logiciel
Ensemble de méthodes pour le développement et la
maintenance d’un logiciel

* N.B. Pour en savoir plus, www.swebok.org


5 © Ali Idri/ESE/2016-2017
Le problème est-il résolu?

Rapport de la cour des comptes des USA (1979) sur 9


projets logiciels gouvernementaux

Payés mais jamais livrés: B$ 3.2

Livrés mais jamais utilisés : B$ 2.0

Abandonnés ou Recommencés: B$ 1.3

Utilisés après changements : B$ 0.2

Utilisés sans changements : B$ 0.1

6 © Ali Idri/ESE/2016-2017
Software Measurement
DeMarco, 1982:
You cannot control what you cannot measure.

Lord Kelvin :
When you can measure what you are speaking about, and
express it in number, you know some thing about it.

Maxwell:
To measure is to know.

Objectifs
Evaluer pour comprendre

Prédire pour contrôler

7 © Ali Idri/ESE/2016-2017
Related Work

1975, Halstead « Elements of Software Science »


µ1: Nombre d’opérateurs distincts
µ2: Nombre d’opérandes distincts
N1: Nombre total d’utilisation des opérateurs
N2: Nombre total d’utilisation des opérandes

1976, McCabe « A complexity Measure »


V(G): une mesure de la complexité structurelle du
code source
V(G) d’un code source est le nombre cyclomatique du
graphe de flux de contrôle correspondant au code
V(G)= Nb arcs – Nb noueds + 1

8 © Ali Idri/ESE/2016-2017
A
A. input (score)

B. if score < 45 B

C. then print (‘fail’) C D


D. else print (‘pass’)
E
E. if score > 80

F. then print (‘with distinction’)


F
G. end
G

V(G)= 9-7+1=3

9 © Ali Idri/ESE/2016-2017
1979, Albrecht « Function Points -FP- »
FP mesure la taille fonctionnelle (les fonctionnalités)
d’un logiciel

FP peut être appliquée sur les dossiers de


spécifications, conception et/ou code source

Processus de calcul du nombre FP:

Recenser les cinq types d’entité


Inputs, Outputs, Inquiries, Logical Files, Interfaces

Evaluer la complexité de chacune des cinq entités


précédemment identifiées (Simple, Moyen, Complexe)

10 © Ali Idri/ESE/2016-2017
Calculer le nombre UFP (Unadjusted Function
Points)

5 3
UFP=∑∑wij xij
i=1 j =1

Calculer le TCF qui combine les effets de 14


facteurs décrivant les caractéristiques générales de
l’application
Communications de données,
Fonctions distribuées
Performance
etc

Calculer le Nombre FP

FP= UFP ×TCF

11 © Ali Idri/ESE/2016-2017
1981, Barry Boehm «COnstrutive COst MOdel»
1981, Henry and Cafura,
Mesure la complexité d’un module au niveau de la
conception

C(M)=Longueur × (Fan-in × Fan-out)2

Fan-in : flots entrant


Fan-out : flots sortant

1991, Fenton, « Software Metrics »

1997, Fenton and Pfleeger, « Software Metrics, A


rigorous and Practical Approach »

12 © Ali Idri/ESE/2016-2017
Entités Logicielles
Processus : Ce sont les activités effectuées durant le
cycle de vie d’un logiciel: processus de spécification, de
conception, de tests, de codage, etc.

Produit: Les différentes sorties du cycle de vie d’un


logiciel: dossier de spécification, de conception, plan de
test, code source, etc.

Ressources: Les entrées d’un processus: le personnel,


les outils, les méthodes, le matériel, etc.

Relation
Les ressources effectuent (ou utilisées par) un processus pour
obtenir un produit

13 © Ali Idri/ESE/2016-2017
Attributs d’un logiciel
Interne : Il est mesuré uniquement en termes
d’entité à laquelle il est relié et indépendamment de
son environnement

Externe: Il est mesuré dépendamment de


l’environnement de l’entité à laquelle il est associé

Exemples:
LOC: Line Of Code, Attribut = longueur d’un programme

RELY: Software Reliability, Les conséquences d’une


éventuelle défaillance

Productivity of developers

14 © Ali Idri/ESE/2016-2017
LOC RELY

# lignes de code Conséquences d’une


défaillance

Produit Ressource
Produit

Code source Code source Personnel Machine


virtuelle

15 © Ali Idri/ESE/2016-2017
Measurement and Measure
A Measurement is the process by which numbers
or symbols are assigned to an entity in order to
characterize an attribute

A Measure is the output of the measurement


process

Example: McCabe measure

Measurement = mapping the program to the equivalent


flowgraph

Measure = Cyclomatic number V(G)

16 © Ali Idri/ESE/2016-2017
ENTREES PROCESSUS SORTIES

Entité Measurement Measure


Attribut

Instance
Equations,
d’entité Règles, Définitions,
Attribut Hypothèses, Etapes Tables de nombres

17 © Ali Idri/ESE/2016-2017
Direct and Indirect Measure
Direct measure of an attribute involves no other
attributes

Examples
LOC measure

Software Reliability

R = 1- rate of a failure

rate of failure = ∑ ϕ i ( E i )
i

Ei are the program errors, ϕi theirs contributions

R = P(Ti>t)

18 © Ali Idri/ESE/2016-2017
Representation Condition
Representation condition asserts that a measurement
mapping M must map entities into numbers and
empirical relations into numerical relations in such a
way that the empirical relations are preserved by the
numerical ones

Example
Real world
Number system

1.72
1.63

X is taller than Y M(X)>M(Y)


19 © Ali Idri/ESE/2016-2017
1.50 1.90

X is much taller than Y M(X)>M(Y)+0.30

1.95
X is tall M(x)>1.80

20 © Ali Idri/ESE/2016-2017
MA: S×ℜ
×ℜ → P×ℵ
×ℵ

∀(s1, s2,..,sn)∈S n
(s1, s2,..,sn) ∈ R ⇔ (MA(s1), MA(s2),.., MA(sn))∈
∈N

A : The attribute to be measured (reliability, complexity, size, ..)


S : Set of instances of an entity (program, specification process,
staff, ..)
ℜ : Set of empirical relations
ℵ : Set of numerical relations
P : set of symbols (usually IR)

Any measure that satisfies the representation condition is a


valid measure

21 © Ali Idri/ESE/2016-2017
Example
Entity is the software failures, Attribute is the criticality
Initially, we identify three types of failures:
Delayed response
Incorrect output
Data loss
A candidate measure M can be defined as:

Delayed response 6

Incorrect output 4
11
Data loss

Suppose that we have formed a deeper understanding


of failure criticality:
data-loss failure is more critical than both incorrect-response and
Delayed-response failures
Incorrect-response failure is more critical than delayed-response
failure
22 © Ali Idri/ESE/2016-2017
Delayed response 3 10>7>
7 3
Incorrect output
10
Data loss

The difference between the criticality of incorrect-response failure


and the delayed-response failure is the same as that of data-loss
failure and incorrect-response failure.

Delayed response 2
6-4=4-
Incorrect output 4 2
6
Data loss

23 © Ali Idri/ESE/2016-2017
Example of other numerical systems
Entity = Programmer
Attribute = competence
Suppose that we have established only one empirical
relation R that consists of:
Z 12

X Y 4 6

W 2
X and Y are more competent than W
Z is more competent than X and Y

A valid numerical system can be (IN, divide)

24 © Ali Idri/ESE/2016-2017
Existence of numerical systems

For any binary relation R,


If R satisfies :

∀(x, y) ∈ C 2 xRy or y R x
∀(x, y,z) ∈ C3 if xRy then xR z or zRy

∃ an ordinal numerical relation N equivalent to R

25 © Ali Idri/ESE/2016-2017
Exercises : Validation of some software metrics

McCabe complexity measure?

FP measure?

Productivity measure?

26 © Ali Idri/ESE/2016-2017
V(G)=4 V(G)=4

27 © Ali Idri/ESE/2016-2017
Mesure FP

Si on fait deux mesures, une à partir d’une spécification du


système puis une à partir du système réalisé, on doit trouver
le même nombre FP

S1 et S2 sont deux spécifications de deux systèmes P1 et P2,


si P1 a plus de fonctionnalités que P2 alors il faut que
PF(S1)>PF(S2)

28 © Ali Idri/ESE/2016-2017
Productivité d’un programmeur

Prod(p)=#LOC/temps

Définition d’une LOC?


Variations des langages de codage
LOC réutilisés
Qualité du code

Prod(p)=#funtion points/temps

Signification d’un FP
Conversion d’un FP en #LOC

29 © Ali Idri/ESE/2016-2017
Measurement scales and scale types
Measurement scale = (Empirical relations, Mapping,
Numerical relations)

Problem: When we have several different possible


representations (and hence many scales) in the same
numerical system?

It depends on the richness of the empirical relations:


one empirical system is said to be richer than another if all
relations in the second are contained in the first

Scale types
Nominal, Ordinal, Interval, Ratio, Absolute

30 © Ali Idri/ESE/2016-2017
Scale type Admissible Operations Examples
transformation G
Nominal Any one-to-one Distinction Labeling, classifying

Ordinal g strictly increasing Ordering Preference, air


monotonic function quality
Interval G(x)=ax+b, a>0 Size of intervals Relative time,
temperature Celsius
Ratio G(x)=ax, a>0 Ratio Length, temperature
Kelvin
Absolute G(x)=x All Counting entities

The scale type determines:


The meaningful statistical operations to be used with the scale

whether a scale has a unit, and

meaningful statements that make sense with the scale

31 © Ali Idri/ESE/2016-2017
Exercise
Entity is the software failures, Attribute is the criticality

R1 = failure is delayed-response
R2 = failure is incorrect-output
R3 = failure is data-loss

Type of scale associated to the empirical relations (R1, R2, R3)?

R4 = Delayed-response failure is more critical than incorrect-


response and data-loss failures. Incorrect-response failure is more
critical than data-loss failure

Type of scale associated to the empirical relations (R1, R2, R3,


R4)?

R5 = The difference between the criticality of incorrect-response


failure and that of delayed-response failure is the same as that of
data-loss failure and incorrect-response failure.

Type of scale associated to the empirical relations (R1, R2, R3,


R4, R5)?

32 © Ali Idri/ESE/2016-2017
Software Metrics Challenges
Software engineering is still a young science

Compared to other sciences (physics, medicine, civil,


etc.), its level of maturity is low
Most of the attributes are not well-defined
Humans are directly involved in the measurement process

Most of the proposed software measurements are


shallow:
In Medicine, we do not use only the age, the height and the
weight of a person. In Software engineering, we are in the age
where the available software measurements are similar to the
weight and the height of a person. [Fenton, 1999]

Valid measure: How much it will cost ?

33 © Ali Idri/ESE/2016-2017

Das könnte Ihnen auch gefallen