journal article·2018-10-12Open access

Towards a Reliable Identification of Deficient Code with a Combination of Software Metrics

Tina Beranič, Vili Podgorelec, Marjan Heričko

Applied Sciences· Volume 8· Issue 10

Abstract

Different challenges arise while detecting deficient software source code. Usually a large number of potentially problematic entities are identified when an individual software metric or individual quality aspect is used for the identification of deficient program entities. Additionally, a lot of these entities quite often turn out to be false positives, i.e., the metrics indicate poor quality whereas experienced developers do not consider program entities as problematic. The number of entities identified as potentially deficient does not decrease significantly when the identification of deficient entities is carried out by applying code smell detection rules. Moreover, the intersection of entities identified as allegedly deficient among different code smell detection tools is small, which suggests that the implementation of code smell detection rules are not consistent and uniform. To address these challenges, we present a novel approach for identifying deficient entities that is based on applying the majority function on the combination of software metrics. Program entities are assessed according to selected quality aspects that are evaluated with a set of software metrics and corresponding threshold values derived from benchmark data, considering the statistical distributions of software metrics values. The proposed approach was implemented and validated on projects developed in Java, C++ and C#. The validation of the proposed approach was done with expert judgment, where software developers and architects with multiple years of experiences assessed the quality of the software classes. Using a combination of software metrics as the criteria for the identification of deficient source code, the number of potentially deficient object-oriented program entities proved to be reduced. The results show the correctness of quality ratings determined by the proposed identification approach, and most importantly, confirm the absence of false positive entities.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Software Engineering Research · Software Reliability and Analysis Research · Software System Performance and Reliability

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Faculty of Electrical Engineering and Computer Science, University of Maribor, Koroška cesta 46, 2000 Maribor, Slovenia

References (59)

Show source-provided references
1. Improving the Quality of Software Development Process by Introducing a New Methodology-AZ-Model10.1109/ACCESS.2017.2787981 ↗
2. Kan, S.H. (2002). Metrics and Models in Software Quality Engineering, Addison-Wesley Longman Publishing Co., Inc.. [2nd ed.].
3. Fowler, M., Beck, K., Brant, J., Opdyke, W., and Roberts, D. (1999). Refactoring: Improving the Design of Existing Code, Addison-Wesley.
4. How developers perceive smells in source code: A replicated study10.1016/j.infsof.2017.08.008 ↗
5. Singh, S., and Kaur, S. (2017). A systematic literature review: Refactoring for disclosing code smells in object oriented software. Ain Shams Eng. J., in press.10.1016/j.asej.2017.03.002 ↗
6. Mathur, N., and Reddy, Y.R. (December, January 30). Correctness of Semantic Code Smell Detection Tools. Proceedings of the 3rd International Workshop on Quantitative Approaches to Software Quality (QuASoQ 2015), New Delhi, India.
7. A survey on software smells10.1016/j.jss.2017.12.034 ↗
8. Fontana, F.A., Ferme, V., Zanoni, M., and Yamashita, A. (2015, January 16–24). Automatic Metric Thresholds Derivation for Code Smell Detection. Proceedings of the IEEE/ACM 6th International Workshop on Emerging Trends in Software Metrics, Florence/Firenze, Italy.
9. Fontana, F.A., Ferme, V., Zanoni, M., and Roveda, R. (2015, January 2). Towards a prioritization of code debt: A code smell Intensity Index. Proceedings of the 2015 IEEE 7th International Workshop on Managing Technical Debt (MTD), Bremen, Germany.10.1109/MTD.2015.7332620 ↗
10. Vale, G.A.D., and Figueiredo, E.M.L. (2015, January 21–26). A Method to Derive Metric Thresholds for Software Product Lines. Proceedings of the 2015 29th Brazilian Symposium on Software Engineering, Belo Horizonte, Brazil.10.1109/SBES.2015.9 ↗
11. Are you smelling it? Investigating how similar developers detect code smells10.1016/j.infsof.2017.09.002 ↗
12. Beranič, T., Rednjak, Z., and Heričko, M. (2017, January 9–13). Code smell detection: A tool comparison. Proceedings of the Collaboration, Software and Services in Information Society: 20th International Multiconference Information Society—IS 2017, Ljubljana, Slovenia.
13. (2012, October 11). IEEE Std 1061. IEEE Standard for a Software Quality Metrics Methodology, 1998. Available online: https://standards.ieee.org/standard/1061-1998.html.
14. A Framework for Software Defect Prediction and Metric Selection10.1109/ACCESS.2017.2785445 ↗
15. Fenton, N.E., and Neil, M. (2000, January 4–11). Software Metrics: Roadmap. Proceedings of the Conference on The Future of Software Engineering, Limerick, Ireland.10.1145/336512.336588 ↗
16. Lanza, M., and Marinescu, R. (2006). Object-Oriented Metrics in Practice: Using Software Metrics To Characterize, Evaluate, and Improve the Design of Object-Oriented Systems, Springer-Verlag.
17. A Suite of Object Oriented Cognitive Complexity Metrics10.1109/ACCESS.2018.2791344 ↗
18. Identifying thresholds for object-oriented software metrics10.1016/j.jss.2011.05.044 ↗
19. Source code metrics: A systematic mapping study10.1016/j.jss.2017.03.044 ↗
20. Foucault, M., Palyart, M., Falleri, J.R., and Blanc, X. (2014, January 24–28). Computing Contextual Metric Thresholds. Proceedings of the 29th Annual ACM Symposium on Applied Computing, Gyeongju, Korea.10.1145/2554850.2554997 ↗
21. Erni, K., and Lewerentz, C. (1996, January 25–26). Applying design-metrics to object-oriented frameworks. Proceedings of the 3rd International Software Metrics Symposium, Berlin, Germany.
22. Benlarbi, S., Emam, K.E., Goel, N., and Rai, S. (2000, January 8–11). Thresholds for object-oriented measures. Proceedings of the 11th International Symposium on Software Reliability Engineering (ISSRE 2000), San Jose, CA, USA.
23. A Quantitative Investigation of the Acceptable Risk Levels of Object-Oriented Metrics in Open-Source Systems10.1109/TSE.2010.9 ↗
24. Deriving thresholds of software metrics to predict faults on open source software: Replicated case studies10.1016/j.eswa.2016.05.018 ↗
25. An empirical analysis of the effectiveness of software metrics and fault prediction model for identifying faulty classes10.1016/j.csi.2017.02.003 ↗
26. Hussain, S., Keung, J., Khan, A.A., and Bennin, K.E. (2016, January 1–3). Detection of Fault-Prone Classes Using Logistic Regression Based Object-Oriented Metrics Thresholds. Proceedings of the 2016 IEEE International Conference on Software Quality, Reliability and Security Companion (QRS-C), Vienna, Austria.10.1109/QRS-C.2016.16 ↗
27. Boucher, A., and Badri, M. (2016, January 12–14). Using Software Metrics Thresholds to Predict Fault-Prone Classes in Object-Oriented Software. Proceedings of the 2016 4th International Conference on Applied Computing and Information Technology/3rd International Conference on Computational Science/Intelligence and Applied Informatics/1st International Conference on Big Data, Cloud Computing, Data Science Engineering (ACIT-CSII-BCD), Las Vegas, NV, USA.10.1109/ACIT-CSII-BCD.2016.042 ↗
28. Oliveira, P., Valente, M.T., and Lima, F.P. (2014, January 3–6). Extracting relative thresholds for source code metrics. Proceedings of the 2014 Software Evolution Week—IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE), Antwerp, Belgium.10.1109/CSMR-WCRE.2014.6747177 ↗
29. Lavazza, L., and Morasca, S. (2016, January 8–9). Identifying Thresholds for Software Faultiness via Optimistic and Pessimistic Estimations. Proceedings of the 10th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, Ciudad Real, Spain.10.1145/2961111.2962595 ↗
30. Alves, T.L., Ypma, C., and Visser, J. (2010, January 12–18). Deriving metric thresholds from benchmark data. Proceedings of the 2010 IEEE International Conference on Software Maintenance, Timișoara, Romania.10.1109/ICSM.2010.5609747 ↗
31. Yamashita, K., Huang, C., Nagappan, M., Kamei, Y., Mockus, A., Hassan, A.E., and Ubayashi, N. (2016, January 1–3). Thresholds for Size and Complexity Metrics: A Case Study from the Perspective of Defect Density. Proceedings of the 2016 IEEE International Conference on Software Quality, Reliability and Security (QRS), Vienna, Austria.10.1109/QRS.2016.31 ↗
32. Detection and Refactoring of Bad Smell Caused by Large Scale
33. Abílio, R., Padilha, J., Figueiredo, E., and Costa, H. (2015, January 10–12). Detecting Code Smells in Software Product Lines—An Exploratory Study. Proceedings of the 2015 12th International Conference on Information Technology—New Generations, Las Vegas, NV, USA.10.1109/ITNG.2015.76 ↗
34. Vidal, S., Vazquez, H., Diaz-Pace, J.A., Marcos, C., Garcia, A., and Oizumi, W. (2015, January 11–13). JSpIRIT: A flexible tool for the analysis of code smells. Proceedings of the 34th International Conference of the Chilean Computer Science Society (SCCC), Santiago, Chile.10.1109/SCCC.2015.7416572 ↗
35. Salehie, M., Li, S., and Tahvildari, L. (2006, January 14–16). A Metric-Based Heuristic Framework to Detect Object-Oriented Design Flaws. Proceedings of the 14th IEEE International Conference on Program Comprehension (ICPC’06), Washington, DC, USA.
36. Fokaefs, M., Tsantalis, N., Stroulia, E., and Chatzigeorgiou, A. (2011, January 14–16). JDeodorant: identification and application of extract class refactorings. Proceedings of the 2011 33rd International Conference on Software Engineering (ICSE), Washington, DC, USA.10.1145/1985793.1985989 ↗
37. Paiva, T., Damasceno, A., Figueiredo, E., and Sant’Anna, C. (2017). On the evaluation of code smells and detection tools. J. Softw. Eng. Res. Dev., 5.10.1186/s40411-017-0041-1 ↗
38. Palomba, F., Bavota, G., Penta, M.D., Oliveto, R., and Lucia, A.D. (October, January 29). Do They Really Smell Bad? A Study on Developers’ Perception of Bad Code Smells. Proceedings of the IEEE International Conference on Software Maintenance and Evolution, Madrid, Spain.
39. Getting What You Measure10.1145/2209249.2209266 ↗
40. Scientific Toolworks Inc. (2012, August 08). Understand™. Available online: https://scitools.com.
41. Lincke, R., Lundberg, J., and Löwe, W. (2008, January 20–24). Comparing Software Metrics Tools. Proceedings of the 2008 International Symposium on Software Testing and Analysis, Seattle, WA, USA.10.1145/1390630.1390648 ↗
42. (2017, November 17). Aivosto Help. Available online: http://www.aivosto.com/project/help/index.html.
43. Lorenz, M., and Kidd, J. (1994). Object-Oriented Software Metrics: A Practical Guide, Prentice-Hall, Inc.
44. Zou, Y., and Kontogiannis, K. (2002, January 3–6). Migration to object oriented platforms: A state transformation approach. Proceedings of the International Conference on Software Maintenance, Montréal, QC, Canada.
45. A metrics suite for object oriented design10.1109/32.295895 ↗
46. Martin, R.C. (2009). Clean Code: A Handbook of Agile Software Craftsmanship, Prentice Hall PTR. [1st ed.].
47. Scientific Toolworks, Inc. (2012, October 11). Understand, User Guide and Refrence Manual, 2017. Available online: https://scitools.com/documents/manuals/pdf/understand.pdf.
48. Filó, T.G.S., da Silva Bigonha, M.A., and Ferreira, K.A.M. (2015, January 19–24). A catalogue of thresholds for object-oriented software metrics. Proceedings of the First International Conference on Advances and Trends in Software Engineering, Barcelona, Spain.
49. (2017, August 16). SourceForge. Available online: https://sourceforge.net.
50. Shatnawi, R., and Althebyan, Q. (2013). An Empirical Study of the Effect of Power Law Distribution on the Interpretation of OO Metrics. ISRN Softw. Eng., 2013.10.1155/2013/198937 ↗
51. Improving the applicability of object-oriented class cohesion metrics10.1016/j.infsof.2011.03.004 ↗
52. (2007, March 02). JHotDraw. Available online: http://www.jhotdraw.org/.
53. Kessentini, M., Vaucher, S., and Sahraoui, H. (2010, January 20–24). Deviance from Perfection is a Better Criterion Than Closeness to Evil when Identifying Risky Code. Proceedings of the IEEE/ACM International Conference on Automated Software Engineering, Antwerp, Belgium.10.1145/1858996.1859015 ↗
54. Seng, O., Stammel, J., and Burkhart, D. (2006, January 8–12). Search-based Determination of Refactorings for Improving the Class Structure of Object-oriented Systems. Proceedings of the 8th Annual Conference on Genetic and Evolutionary Computation, Seattle, WA, USA.10.1145/1143997.1144315 ↗
55. Sammut, C., and Webb, G.I. (2010). Confusion Matrix. Encyclopedia of Machine Learning, Springer.10.1007/978-0-387-30164-8 ↗
56. Sammut, C., and Webb, G.I. (2010). Accuracy. Encyclopedia of Machine Learning, Springer.10.1007/978-0-387-30164-8 ↗
57. Sammut, C., and Webb, G.I. (2010). Precision and Recall. Encyclopedia of Machine Learning, Springer.10.1007/978-0-387-30164-8 ↗
58. Sammut, C., and Webb, G.I. (2010). F-Measure. Encyclopedia of Machine Learning, Springer.10.1007/978-0-387-30164-8 ↗
59. Mantyla, M., Vanhanen, J., and Lassenius, C. (2003, January 22–26). A taxonomy and an initial empirical study of bad smells in code. Proceedings of the International Conference on Software Maintenance (ICSM 2003), Amsterdam, The Netherlands.