Paper:

# Theoretical Explanation of Recent Empirically Successful Code Quality Metrics

## Vladik Kreinovich^{*}, Omar A. Masmali^{*}, Hoang Phuong Nguyen^{**,†}, and Omar Badreddin^{*}

^{*}Department of Computer Science, University of Texas at El Paso

500 West University Avenue, El Paso, Texas 79968, USA

^{**}Division Informatics, Math-Informatics Faculty, Thang Long University

Nghiem Xuan Yem Road, Hoang Mai District, Hanoi, Vietnam

^{†}Corresponding author

Millions of lines of code are written every day, and it is not practically possible to perfectly thoroughly test all this code on all possible situations. In practice, we need to be able to separate codes which are more probable to contain bugs – and which thus need to be tested more thoroughly – from codes which are less probable to contain flaws. Several numerical characteristics – known as *code quality metrics* – have been proposed for this separation. Recently, a new efficient class of code quality metrics have been proposed, based on the idea to assign consequent integers to different levels of complexity and vulnerability: we assign 1 to the simplest level, 2 to the next simplest level, etc. The resulting numbers are then combined – if needed, with appropriate weights. In this paper, we provide a theoretical explanation for the above idea.

*J. Adv. Comput. Intell. Intell. Inform.*, Vol.24, No.5, pp. 604-608, 2020.

- [1] O. Badreddin, R. Khandoker, A. Forward, O. Masmali, and T. C. Lethbridge, “A Decade of Software Design and Modeling: A Survey to Uncover Trends of the Practice,” Proc. of the 21th ACM/IEEE Int. Conf. on Model Driven Engineering Languages and Systems (MODELS’18), pp. 245-255, 2018.
- [2] O. Masmali and O. Badreddin, “Model Driven Security: A Systematic Mapping Study,” Software Engineering, Vol.7, Issue 2. pp. 30-38, 2019.
- [3] O. Masmali and O. Badreddin, “Towards a Model-based Fuzzy Software Quality Metrics,” Proc. of the 8th Int. Conf. on Model-Driven Engineering and Software Development (MODELSWARD 2020), Vol.1, pp. 139-148, 2020.
- [4] E. T. Jaynes (Edited by G. L. Bretthorst), “Probability Theory: The Logic of Science,” Cambridge University Press, 2003.
- [5] D. J. Sheskin, “Handbook of Parametric and Nonparametric Statistical Procedures,” 5th Edition, Chapman & Hall/CRC, 2011.
- [6] M. Ahsanullah, V. B. Nevzorov, and M. Shakil, “An Introduction to Order Statistics,” Atlantis Press, 2013.
- [7] B. C. Arnold, N. Balakrishnan, and H. N. Nagaraja, “A First Course in Order Statistics,” Society of Industrial and Applied Mathematics (SIAM), 2008.
- [8] H. A. David and H. N. Nagaraja, “Order Statistics,” 3rd Edition, Wiley-Interscience, 2003.
- [9] O. Kosheleva, V. Kreinovich, J. Lorkowski, and M. Osegueda, “How to transform partial order between degrees into numerical values,” Proc. of the 2016 IEEE Int. Conf. on Systems, Man, and Cybernetics (SMC), pp. 2489-2494, 2016.
- [10] O. Kosheleva, V. Kreinovich, M. O. Escobar, and K. Kato, “Towards the most robust way of assigning numerical degrees to ordered labels, with possible applications to dark matter and dark energy,” Proc. of the 2016 Annual Conf. of the North American Fuzzy Information Processing Society (NAFIPS), 4pp., 2016.