Nothing Special   »   [go: up one dir, main page]

skip to main content
10.5555/2821491.2821501acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Automatic metric thresholds derivation for code smell detection

Published: 16 May 2015 Publication History

Abstract

Code smells are archetypes of design shortcomings in the code that can potentially cause problems during maintenance. One known approach for detecting code smells is via detection rules: a combination of different object-oriented metrics with pre-defined threshold values. The usage of inadequate thresholds when using this approach could lead to either having too few observations (too many false negatives) or too many observations (too many false positives). Furthermore, without a clear methodology for deriving thresholds, one is left with those suggested in literature (or by the tool vendors), which may not necessarily be suitable to the context of analysis. In this paper, we propose a data-driven (i.e., benchmark-based) method to derive threshold values for code metrics, which can be used for implementing detection rules for code smells. Our method is transparent, repeatable and enables the extraction of thresholds that respect the statistical properties of the metric in question (such as scale and distribution). Thus, our approach enables the calibration of code smell detection rules by selecting relevant systems as benchmark data. To illustrate our approach, we generated a benchmark dataset based on 74 systems of the Qualitas Corpus, and extracted the thresholds for five smell detection rules.

References

[1]
M. Fowler, Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999.
[2]
M. Lanza and R. Marinescu, Object-Oriented Metrics in Practice. Springer, 2005.
[3]
E. Tempero, C. Anslow, J. Dietrich, T. Han, J. Li, M. Lumpe, H. Melton, and J. Noble, "The qualitas corpus: A curated collection of java code for empirical studies," in Proceedings of the 17th Asia Pacific Software Engineering Conference. Sydney, NSW, Australia: IEEE Computer Society, December 2010, pp. 336--345.
[4]
T. L. Alves, C. Ypma, and J. Visser, "Deriving metric thresholds from benchmark data," in Proc. IEEE Int'l Conf. Softw. Maintenance (ICSM2010). Timisoara, Romania: IEEE, Sep. 2010, pp. 1--10.
[5]
R. Baggen, J. Correia, K. Schill, and J. Visser, "Standardized code quality benchmarking for improving software maintainability," Software Quality Journal, vol. 20, no. 2, pp. 287--307, 2012.
[6]
R. J. Hyndman and Y. Fan, "Sample quantiles in statistical packages," The American Statistician, vol. 50, no. 4, pp. pp. 361--365, Nov. 1996. {Online}. Available: http://www.jstor.org/stable/2684934
[7]
N. E. Fenton and S. L. Pfleeger, Software Metrics - A Rigorous And Practical Approach. PWS Publishing, 1998.
[8]
D. Coleman, B. Lowther, and P. Oman, "The application of software maintainability models in industrial software systems," Journal of Systems and Software, vol. 29, no. 1, pp. 3--16, 1995.
[9]
T. McCabe, "A complexity measure," IEEE Transactions on Software Engineering, no. 4, pp. 308--320, 1976.
[10]
B. Nejmeh, "NPATH: a measure of execution path complexity and its applications," Communications of the ACM, vol. 31, no. 2, 1988.
[11]
B. Henderson-Seller, Object-oriented Metrics: Measures of Complexity. Prentice Hall, 1996.
[12]
L. Rosemberg, "Metrics for object oriented environment," in Proc. EFAITP/AIE 3rd Annual Software Metrics Conference, 1997.
[13]
L. H. Rosemberg, "Applying and interpreting object oriented metrics," Software Assurance Technology Center at NASA Goddard Space Flight Center, Tech. Rep., 2001.
[14]
R. Shatnawi and W. Li, "Finding software metrics threshold values using ROC curves," Journal of Software Maintenance and Evolution: Research and Practice, vol. 22, no. 1, pp. 1--16, 2010.
[15]
S. Benlarbi, K. El Emam, N. Goel, and S. Rai, "Thresholds for object-oriented measures," in Proc. 11th Int'l Symp. Software Reliability Engineering (ISSRE 2000). San Jose, CA, USA: IEEE, Oct. 2000, pp. 24--38.
[16]
K. Erni and C. Lewerentz, "Applying design-metrics to object-oriented frameworks," in Proc. 3rd Int'l Software Metrics Symposium. Berlin, Germany: IEEE, Mar. 1996, pp. 64--74.
[17]
G. Concas, M. Marchesi, S. Pinna, and N. Serra, "Power-laws in a large object-oriented software system," IEEE Transactions on Software Engineering, vol. 33, no. 10, pp. 687--708, Oct. 2007.
[18]
P. Louridas, D. Spinellis, and V. Vlachos, "Power laws in software," ACM Transactions on Software Engineering and Methodology, vol. 18, no. 1, pp. 1--26, Sep. 2008.
[19]
R. Wheeldon and S. Counsell, "Power law distributions in class relationships," in Proc. 3rd IEEE International Workshop on Source Code Analysis and Manipulation (SCAM 2003). IEEE, 2005, pp. 45--54.
[20]
P. Oliveira, M. Valente, and F. Paim Lima, "Extracting relative thresholds for source code metrics," in Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering and Reverse Engineering (CSMR-WCRE 2014). Antwerp, Belgium: IEEE Computer Society, Feb. 2014, pp. 254--263.
[21]
P. Oliveira, F. Lima, M. Valente, and A. Serebrenik, "RTTool: A tool for extracting relative thresholds for source code metrics," in IEEE International Conference on Software Maintenance and Evolution (ICSME 2014). Victoria, BC, Canada: IEEE Computer Society, Sep. 2014, pp. 629--632.
[22]
K. A. Ferreira, M. A. Bigonha, R. S. Bigonha, L. F. Mendes, and H. C. Almeida, "Identifying thresholds for object-oriented software metrics," Journal of Systems and Software, vol. 85, no. 2, pp. 244--257, 2012.
[23]
M. Foucault, M. Palyart, J.-R. Falleri, and X. Blanc, "Computing contextual metric thresholds," in Proceedings of the 29th Annual ACM Symposium on Applied Computing (SAC'14). Gyeongju, Republic of Korea: ACM, 2014, pp. 1120--1125.
[24]
R. Vasa, M. Lumpe, P. Branch, and O. Nierstrasz, "Comparative analysis of evolving software systems using the gini coefficient," in IEEE International Conference on Software Maintenance (ICSM 2009). Edmonton, AB, Canada: IEEE Computer Society, Sep. 2009, pp. 179--188.
[25]
A. Serebrenik and M. van den Brand, "Theil index for aggregation of software metrics values," in IEEE International Conference on Software Maintenance (ICSM 2010). Timisoara, Romania: IEEE Computer Society, Sep. 2010, pp. 1--9.
[26]
K. Mordal, N. Anquetil, J. Laval, A. Serebrenik, B. Vasilescu, and S. Ducasse, "Software quality metrics aggregation in industry," Journal of Software: Evolution and Process, vol. 25, no. 10, pp. 1117--1135, 2013.
[27]
S. Herbold, J. Grabowski, and S. Waack, "Calculation and optimization of thresholds for sets of software metrics," Empirical Software Engineering, vol. 16, no. 6, pp. 812--841, 2011.
[28]
F. Arcelli Fontana, M. Zanoni, A. Marino, and M. V. Mäntylä, "Code smell detection: towards a machine learning-based approach," in Proc. 29th IEEE International Conference on Software Maintenance (ICSM 2013), ERA Track. Eindhoven, The Netherlands: IEEE, Sep 2013, pp. 396--399.
[29]
F. Arcelli Fontana, P. Braione, and M. Zanoni, "Automatic detection of bad smells in code: An experimental assessment," Journal of Object Technology, vol. 11, no. 2, pp. 5:1--38, Aug. 2012.
[30]
F. Zhang, A. Mockus, Y. Zou, F. Khomh, and A. E. Hassan, "How does context affect the distribution of software maintainability metrics?" in Proceedings of the 29th IEEE International Conference on Software Maintenance (ICSM 2013), Eindhoven, The Netherlands, Sep. 2013, pp. 350--359.
[31]
C. Couto, C. Maffort, R. Garcia, and M. T. Valente, "COMETS: A dataset for empirical research on software evolution using source code metrics and time series analysis," SIGSOFT Softw. Eng. Notes, vol. 38, no. 1, pp. 1--3, Jan. 2013.
[32]
M. Nagappan, T. Zimmermann, and C. Bird, "Representativeness in software engineering research," Microsoft Research, Tech. Rep. MSRTR-2012-93, September 2012.
[33]
M. Lorenzen and J. Kidd, Object-oriented software metrics: a practical guide. PTR Prentice Hall, 146.
[34]
R. Marinescu, "Measurement and Quality in Object Oriented Design," Doctoral Thesis, Politehnica University of Timisoara, 2002.
[35]
S. R. Chidamber and C. F. Kemerer, "A metrics suite for object oriented design," IEEE Transactions on Software Engineering, vol. 20, no. 6, pp. 476--493, 1994.

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
WETSoM '15: Proceedings of the Sixth International Workshop on Emerging Trends in Software Metrics
May 2015
76 pages

Sponsors

Publisher

IEEE Press

Publication History

Published: 16 May 2015

Check for updates

Qualifiers

  • Research-article

Conference

ICSE '15
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)1
Reflects downloads up to 24 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2019)Exploring the suitability of source code metrics for indicating architectural inconsistenciesSoftware Quality Journal10.1007/s11219-018-9404-z27:1(241-274)Online publication date: 1-Mar-2019
  • (2018)Understanding metric-based detectable smells in Python softwareInformation and Software Technology10.5555/3163583.316367094:C(14-29)Online publication date: 1-Feb-2018
  • (2018)Code smells for Model-View-Controller architecturesEmpirical Software Engineering10.1007/s10664-017-9540-223:4(2121-2157)Online publication date: 1-Aug-2018
  • (2017)Applying software metric thresholds for detection of bad smellsProceedings of the 11th Brazilian Symposium on Software Components, Architectures, and Reuse10.1145/3132498.3134268(1-10)Online publication date: 18-Sep-2017
  • (2016)An Empirical Evaluation of Distribution-based Thresholds for Internal Software MeasuresProceedings of the The 12th International Conference on Predictive Models and Data Analytics in Software Engineering10.1145/2972958.2972965(1-10)Online publication date: 9-Sep-2016
  • (2015)Towards assessing software architecture quality by exploiting code smell relationsProceedings of the Second International Workshop on Software Architecture and Metrics10.5555/2821327.2821329(1-7)Online publication date: 16-May-2015

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media