Top Banner
Numerical Signatures of Antipatterns An Approach based on B-Splines An Approach based on B-Splines Rocco Oliveto * , Foutse Khomh + , Giuliano Antoniol + , and Yann-Gaël Guéhéneuc + * University of Salerno, Italy, [email protected] + Ecole Polytechnique de Montréal, QC, Canada, [email protected] , {giuliano.antoniol, yann-gael.gueheneuc}@polymtl.ca Presented by Fatemeh Asadi Ecole Polytechnique de Montréal, QC, Canada
13
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CSMR10d.ppt

Numerical Signatures of Antipatterns

An Approach based on B-SplinesAn Approach based on B-Splines

Rocco Oliveto*, Foutse Khomh+, Giuliano Antoniol+, and Yann-Gaël

Guéhéneuc+

* University of Salerno, Italy, [email protected]

+ Ecole Polytechnique de Montréal, QC, Canada, [email protected],{giuliano.antoniol, yann-gael.gueheneuc}@polymtl.ca

Presented by

Fatemeh AsadiEcole Polytechnique de Montréal, QC, Canada

Page 2: CSMR10d.ppt

Outline

• Context and motivations

• Antipattern identification

• Limitations of previously approaches

• A novel approach based on numerical analysis• A novel approach based on numerical analysis

• Lessons learned from a preliminary evaluation

• Conclusion and future work

Page 3: CSMR10d.ppt

Context and Motivations• Antipatterns: poor solutions to recurring design problems

• Introduced by developers when designing and implementing classes

• Negatively impact the quality of a system

• Antipattern identification is a crucial activity in software

maintenancemaintenance

• Important for researchers as well as for practitioners

• Various approaches have been proposed

• Exploit quality metrics

• DECOR and Bayesian Beliefs Networks (BBNs)

Page 4: CSMR10d.ppt

Limitations of Previous Approaches

• DECOR: identification based on fixed threshold

• Yes, it is an antipattern - No, it is not an antipattern

• Inaccurate information for borderline classes

• Submarine effect: several classes may be very close to be identified • Submarine effect: several classes may be very close to be identified

as antipatterns but remain under the threshold during their evolution

• BBN: probabilities of classes to be antipatterns

• Expensive (time and knowledge) tuning by experts for accuracy

• Incomplete experts’ knowledge cause false positives

• Models not generalisable to other contexts

Page 5: CSMR10d.ppt

The Proposed Approach

• ABS (Antipattern identification using B-Splines)

• ABS builds signatures of classes based on quality metrics

• A class is modelled using specific interpolation curves (i.e., B-

splines) of plots mapping metrics and their values for the class

Page 6: CSMR10d.ppt

ABS: Identification of Antipatterns

• Given a set of classes identified as antipatterns A and a set of classes classified as good classes G, the godlinessof a class ci is based on (i) the similarity between the

curves representing the antipatterns and ci; and (ii) the distance between the curves representing the good

classes and ciclasses and ci

• The higher the similarity with the antipatterns (the lower

the distance with the good classes) the higher is the likelihood that the class is an antipattern too

godl iness(ci ; A; G) =

pX

j = 1

wA i ; j¢simi lar i ty(ci ; aj ) ¡

qX

k= 1

wG i ; k¢simi lar i ty(ci ; gk )

Page 7: CSMR10d.ppt

ABS: Distance Computation

• ABS abstracts the signature (i.e., curve) of the antipatterns and good classes

• The obtained signature is used to derive the likelihood that a given

class is an antipattern too

• The likelihood is based on distance between the curves • The likelihood is based on distance between the curves

representing the antipatterns (or good classes) and the class,

respectively

The lower the distance, the higher

the similarity-in terms

of quality measures-between the compared

classes!

Page 8: CSMR10d.ppt

Why ABS?• ABS vs. DECOR

• ABS returns the probability of classes to be an antipattern (not true/false)

• ABS does not suffer of the submarine effect

• ABS vs. BBN

• ABS requires a training corpus as well as BBS

• ABS does not need experts’ knowledge to define a learning structure

• ABS reduces the bias introduced in BBNs by the experts’ subjectivity when

structuring the BBNs of the antipatterns

• ABS is portable: a model build in a context can be used in other contexts

Page 9: CSMR10d.ppt

SIGN-O-METER

The similarity between the class

under development and an

antipattern using the godliness

metric scaled in [0, 100]

A plot of three B-spline curves representing, respectively, the

current signature of the class, the signature of the previous

version of the class, and the signature of an ideal antipattern,

defined as the average signature of the previously classified

antipatterns

Page 10: CSMR10d.ppt

Preliminary Evaluation: Design• ABS was used to identify the Blob antipattern

• Accuracy of ABS was compared with DECOR and BBN

• Case study conducted on two medium size open-source Java systems

• Two experimental scenarios

• Intra-system identification: where historical data (i.e., correctly identified Blobs) are available for a given system and this data are used to identify other Blobs in the same system

• Extra-system identification: where a quality analyst has access to the historical data from one system and uses it to identify Blobs in another system

• Accuracy evaluated through recall and precision

Page 11: CSMR10d.ppt

Preliminary Evaluation: Results

• ABS generally outperforms BBN and DECOR in precision and recall

• In few explainable cases, ABS has lower precision or recall than

previous approaches, when the training set to build the signature is

too small

• ABS is more portable than BBN and DECOR

• ABS is more attractive in practice thanks to its speed and

ease to generate and interpret the signatures.

Page 12: CSMR10d.ppt

Conclusion and Future Work

• A novel approach (ABS) is proposed to identify occurrences of antipatterns

• The approach uses B-splines to abstract the signature of classes

• The extracted signature is used to compare a class with classes

previously classified as blobs or good classes previously classified as blobs or good classes

• ABS outperforms both BBN and DECOR

• Future work

• Replicating the evaluation of ABS on other antipatterns

• Analysing whether the use of “Sign-o-meter” during software

development impacts the quality of the produced classes

Page 13: CSMR10d.ppt

THANK YOU!

QUESTIONS

and–or

COMMENTS?