Deriving Attributes from Google's Java Style Guide and Quantifying Them Using Metrics

Authors

DOI:

https://doi.org/10.24215/15146774e069

Keywords:

source code, measurement, metric, Google Java style guide, tool

Abstract

Software development typically involves large, decentralized teams, making it difficult to create software that is easy to understand and maintain. This situation highlights the need to code software programs following clear and widely recognized style guides for the language used. However, applying these guides can be complex, especially for junior developers or in time-sensitive scenarios. In this sense, it is important to have not only an approach that allows mapping the guides to attributes and these to their metrics, but also a tool that checks and recommends improvements when the code does not adhere to these guides. This paper illustrates the use of a systematic approach that maps programming style guides to attributes and the metrics that quantify them. Additionally, it demonstrates the use of the JavaStyleInspector tool to analyze Java code and generate reports that facilitate rapid code improvement in alignment with the Google Java Style Guide. The tool's application can have a positive impact on the teaching of style guides in computer science-related careers and on the daily work of a software industry professional.

Downloads

References

Somerville, I.: Ingeniería de software. 6ta Edición. Addison Wesley Publishers, (2002)

Pressman, R. S.: Ingeniería del software. Un enfoque práctico. 7ma Edición. Mc Graw Hill Educación, (2010)

ISO/IEC 9126-1: Software Engineering - Software Product Quality - Part 1- Quality Model, Int‟l Org. for Standardization, Geneva, (2001)

ISO/IEC 25010: Systems and Software Engineering– Systems and software product Quality Requirements and Evaluation (SQuaRE)– System and software quality models, (2011)

Avila D., Báez E., Zapata M., López D., Zurita D.: Unreadable Code in Novice Developers. In: Rocha, Á., Adeli, H., Dzemyda, G., Moreira, F., Ramalho Correia, A.M. (eds) Trends and Applications in Information Systems and Technologies. WorldCIST 2021. Advances in Intelligent Systems and Computing, vol 1368. Springer, Cham. https://doi.org/10.1007/978-3-030-72654-6_5, (2021)

Google Java Style Guide, https://google.github.io/styleguide/javaguide.html, último acceso 2025/01/03.

Sosa, D., Papa, M.F., Becker P., Olsina L. Mapeo de Atributos a partir de Guías de Estilo de Programación y Automatización de sus Métricas. In proceedings of ASSE‟24, Argentine Symposium on Software Engineering, Vol: 53 JAIIO, pp. 1-14, Bahia Blanca, Argentina, August 12-16, ISSN: 2451-7593, (2024)

Broekhuis S.: The Importance of Coding Styles within Industries. 35th Twente Student Conference on IT (TScIT 35), pp. 1-8, (2021)

Kernighan, B.W., Plauger, P.J.: The Elements of Programming Style, 1st Edición. McGraw-Hill, New York, (1974)

Sun Microsystems: Java code conventions. https://www.oracle.com/technetwork/java /codeconventions-150003.pdf, último acceso 2024/03/21, (1997)

Reddy, A.: Java™ coding style guide. Sun MicroSystems, (2000)

Guia de desarrollo, https://uniandesdsit.github.io/coding-guidelines/style/ STYLE_GUIDE.html, Universidad de los Andes, Colombia, último acceso 2025/01/03.

Becker, P., Olsina, L., Papa, M.F.: Approach to Improving Java Source Code Considering Non-compliance with a Java Style Guide. In: Pesado, P. (eds) Computer Science – CACIC 2022. CACIC 2022. Communications in Computer and Information Science, vol 1778. Springer, Cham. https://doi.org/10.1007/978-3-031-34147-2_9, (2023).

Documentación de google-java-format, https://github.com/google/google-java-format, último acceso 2025/01/03

Olsina, L.: The Foundational Ontology ThingFO: Architectural Aspects, Concepts, and Applicability. In: Fred, A., Aveiro, D., Dietz, J., Bernardino, J., Masciari, E., Filipe, J. (eds.) Knowledge Discovery, Knowledge Engineering and Knowledge Management. IC3K 2021. Communications in Computer and Information Science, Vol 1718, Springer. Chapter 5, pp. 73–99, (2023).

Olsina, L., Papa, M.F., Becker, P.: NFRsTDO v1.2's Terms, Properties, and Relationships -- A Top-Domain Non-Functional Requirements Ontology, pp. 1–9, https://doi.org/10.48550/arXiv.2302.01096, (2023)

Becker, P., Olsina, L., Papa, M.F.: Especificación de Métricas de Mantenibilidad para Mejorar Código Java: Caso Aplicado en un Curso Avanzado de Ingeniería en Sistemas. Actas del 11vo Congreso Nacional de Ingeniería Informática / Sistemas de Información (CoNaIISI), 2-3 de noviembre, Tucumán, Argentina, pp. 1-15. (2023)

Molina, H., Olsina L. Diseñando la Evaluación de Calidad en Uso de una Herramienta Didáctica para Crear Interfaces Gráficas en JavaTM, In: XV Argentine Symposium on Software Engineering, (ASSE2014), 43 JAIIO, CABA, Argentina, pp. 51-65. (2014).

Published

2025-04-01