Reuse and Maintenance Estimation Vu Nguyen March 17, 2009

advertisement
University of Southern California
Center for Systems and Software Engineering
Reuse and Maintenance Estimation
Vu Nguyen
March 17, 2009
Center for Systems and Software Engineering
University of Southern California
© 2009, USC-CSSE
1
University of Southern California
Center for Systems and Software Engineering
Reuse and Maintenance
– A Source Code Perspective
Reused Pieces
(Unmodified)
Acquired Pieces
Project Execution
Adapted Pieces
(modified, deleted,
added)
Exiting System’s
Pieces
New Pieces
© 2009, USC-CSSE
2
University of Southern California
Center for Systems and Software Engineering
COCOMO II Reuse and Maintenance
Models
• Reuse Model
Equivalent KSLOC  Adapted KLOC * (1 
AT
) * AAM
100
AAF  0.4 * DM  0.3 * CM  0.3 * IM
 AA  AAF (1  0.02 * SU *UNFM )
, for AAF  50

100
AAM  
AA  AAF  SU *UNFM

, for AAF  50
100

• Maintenance Model
Size = (Size Added + Size Modified) * (1 + SU*UNFM/100)
© 2009, USC-CSSE
3
University of Southern California
Center for Systems and Software Engineering
Limitations
• The two models do not converge although reuse
and maintenance are indistinguishable
• Unclear how to determine the “actual” equivalent
SLOC from a completed system
• Determining the models’ parameters DM, CM, IM,
Adapted SLOC, etc. is difficult
• Difficult to calibrate the models
• Exploratory results
– Smoothed AAM factor
– Revised equivalent SLOC
© 2009, USC-CSSE
4
University of Southern California
Center for Systems and Software Engineering
Adaptation Adjustment Modifier (AAM)
1.60
AAM worse case:
AA = 8
UNFM = 1
SU = 50
1.40
Relative Cost
1.20
New AAM formula
1.00
Old AAM formula
0.80
0.60
Relative # of interfaces checked
0.40
0.20
0.00
0
20
40
60
80
100
120
Relative Amount of Modification (AAF)
New AAM formula:
AAF 2

 AA  AAF  [1  (1  100 ) ] * SU *UNFM

if AAF  100
AAM  
100

AA  AAF  SU *UNFM
if AAF  100

100

© 2009, USC-CSSE
5
University of Southern California
Center for Systems and Software Engineering
Calculating Actual Equivalent SLOC
Based on CodeCount Tool
• Equivalent Adapted KSLOC (EKSLOCadapted)
– Determining “actual” DMadapted, CMadapted, IMadapted
• DMadapted = CMadapted = IMadapted = KSLOCmodified/KSLOCadapted
• AAFadapted = KSLOCmodified/KSLOCadapted
– EKSLOCadapted = KSLOCadapted * AAMadapted
• Equivalent Reused KSLOC (EKSLOCreused)
• DMreused = CMreused = 0 (no modification needed)
• AAMreused = AAFreused = 0.3 * IMreused
– EKSLOCreused = 0.3 KSLOCreused * IMreused
• Total Equivalent KSLOC
EKSLOC = KSLOCadded + EKSLOCadapted + EKSLOCreused
© 2009, USC-CSSE
6
University of Southern California
Center for Systems and Software Engineering
Product Factor
• A product often has multiple releases
– Each release is delivered by a project
• Each release is based on a baseline release
– Unmodified modules are reused
– Modified modules are adapted
– New modules are added
– Some modules are deleted
– Inherit overall software complexity
• Leverage some environments, processes,
personnel, and hence productivity pattern (e.g.,
decrease or increase)
© 2009, USC-CSSE
7
University of Southern California
Center for Systems and Software Engineering
Product Factor (cont’d)
• Calibration with product factor
– Each product has multiple releases
– Each project is corresponding to a release
• Regression equation (2)
log(PMi) – [SFi * log(Sizei) + log(EAFi)]
= [0 + 1*log(Sizei)] *  fi(j)
j
Where
productN

fi(j) = 1 if product(i) = j
j=product1
= 0 otherwise
© 2009, USC-CSSE
8
University of Southern California
Center for Systems and Software Engineering
Validation
• Models
– R1: Use existing COCOMO II Reuse Model, A = 2.94,
and B = 0.91
– R2: Use the modified formulas above and calibrate A
and B values
– R3: Same as R2 plus applying the “product factor” using
the regression equation (2)
• Calculate MMRE, PRED(.25), and PRED(.30) from
the three models
• Use dataset of 29 releases
© 2009, USC-CSSE
9
University of Southern California
Center for Systems and Software Engineering
Dataset
• A dataset from CSSE’s Affiliate
– 6 products
– 29 releases
– Application types
• data processing
• Military – Ground
• Test
Product
No
1
2
3
4
5
6
© 2009, USC-CSSE
# of Releases
8
4
4
6
5
2
10
University of Southern California
Center for Systems and Software Engineering
Results
• Models
– R1: Use existing COCOMO II Reuse Model, A = 2.94, and B = 0.91
– R2: Use the modified formulas above and calibrate A and B values
– R3: Same as R2 plus applying the “product factor” using the
regression equation (2)
Model
R1
R2
R3
MMRE
0.45
0.29
0.15
PRED25
0.31
0.48
0.90
© 2009, USC-CSSE
PRED30
0.34
0.55
0.93
11
University of Southern California
Center for Systems and Software Engineering
Results (cont’d)
• The results suggest that the calibrated model
generates better estimates
• Calibrated model using data from projects for the
same product (Model R3) potentially has best
performance
• Limitations of Model R3
– Calibrated A and B values are unstable, high variant
– Calibrated A and B values are sometimes counterintuitive (e.g., A < 1, B < 0)
© 2009, USC-CSSE
12
University of Southern California
Center for Systems and Software Engineering
Next steps
• Modify the AAM formula
– Apply regression to determine the coefficients for
KSLOCadded, EKSLOCadapted, EKSLOCreused
• Perform Delphi survey to determine the constant
values of SU, UNFM, DM, CM, IM
• Determine the weights of Added, Modified, and
Deleted SLOC in adapted modules
• Collect more data to calibrate COCOMO cost
driver values for maintenance and reuse model
– Explore causes of variation in “product factor”
– May discover an explanatory driver
© 2009, USC-CSSE
13
Download