A Model-Driven Approach for the Management and Enforcement of Coding Conventions

Coding conventions are a means to improve the reliability of software systems, and they are especially useful to avoid the introduction of known bugs or security flaws. However, coding rules typically come in the form of text written in natural language, which makes them hard to manage and to enforc...

Full description

Bibliographic Details
Main Authors: Elder Rodrigues, Jose D'Abruzzo Pereira, Leonardo Montecchi
Format: Article
Language:English
Published: IEEE 2023-01-01
Series:IEEE Access
Subjects:
Online Access:https://ieeexplore.ieee.org/document/10068210/
_version_ 1827986628764762112
author Elder Rodrigues
Jose D'Abruzzo Pereira
Leonardo Montecchi
author_facet Elder Rodrigues
Jose D'Abruzzo Pereira
Leonardo Montecchi
author_sort Elder Rodrigues
collection DOAJ
description Coding conventions are a means to improve the reliability of software systems, and they are especially useful to avoid the introduction of known bugs or security flaws. However, coding rules typically come in the form of text written in natural language, which makes them hard to manage and to enforce. Following the model-driven engineering principles, in this paper we propose an approach for the management and enforcement of coding conventions using structured models. We define the Coding Conventions Specification Language (CCSL), a language to define coding rules as structured specifications, from which checkers are derived automatically by code generation. To evaluate our approach, we run a thorough experiment on 8 real open-source projects and 77 coding rules for the Java language, comparing the violations identified by our checkers with those reported by the PMD static analysis tool. The obtained results are promising and confirm the feasibility of the approach. The experiment also revealed that textual coding rules rarely document all the necessary information to write a reliable checker.
first_indexed 2024-04-09T23:34:30Z
format Article
id doaj.art-d44ddcfb5a9b49f3a3046cbc24e4a095
institution Directory Open Access Journal
issn 2169-3536
language English
last_indexed 2024-04-09T23:34:30Z
publishDate 2023-01-01
publisher IEEE
record_format Article
series IEEE Access
spelling doaj.art-d44ddcfb5a9b49f3a3046cbc24e4a0952023-03-20T23:00:07ZengIEEEIEEE Access2169-35362023-01-0111257352575410.1109/ACCESS.2023.325688610068210A Model-Driven Approach for the Management and Enforcement of Coding ConventionsElder Rodrigues0Jose D'Abruzzo Pereira1https://orcid.org/0000-0003-0717-3396Leonardo Montecchi2https://orcid.org/0000-0002-7603-9695Institute of Computing, University of Campinas, São Paulo, Campinas, BrazilDepartment of Informatics Engineering, University of Coimbra, Centre for Informatics and Systems of the University of Coimbra, Coimbra, PortugalInstitute of Computing, University of Campinas, São Paulo, Campinas, BrazilCoding conventions are a means to improve the reliability of software systems, and they are especially useful to avoid the introduction of known bugs or security flaws. However, coding rules typically come in the form of text written in natural language, which makes them hard to manage and to enforce. Following the model-driven engineering principles, in this paper we propose an approach for the management and enforcement of coding conventions using structured models. We define the Coding Conventions Specification Language (CCSL), a language to define coding rules as structured specifications, from which checkers are derived automatically by code generation. To evaluate our approach, we run a thorough experiment on 8 real open-source projects and 77 coding rules for the Java language, comparing the violations identified by our checkers with those reported by the PMD static analysis tool. The obtained results are promising and confirm the feasibility of the approach. The experiment also revealed that textual coding rules rarely document all the necessary information to write a reliable checker.https://ieeexplore.ieee.org/document/10068210/Coding standardscoding conventionsmodel-driven engineeringdomain-specific languagesstatic analysis
spellingShingle Elder Rodrigues
Jose D'Abruzzo Pereira
Leonardo Montecchi
A Model-Driven Approach for the Management and Enforcement of Coding Conventions
IEEE Access
Coding standards
coding conventions
model-driven engineering
domain-specific languages
static analysis
title A Model-Driven Approach for the Management and Enforcement of Coding Conventions
title_full A Model-Driven Approach for the Management and Enforcement of Coding Conventions
title_fullStr A Model-Driven Approach for the Management and Enforcement of Coding Conventions
title_full_unstemmed A Model-Driven Approach for the Management and Enforcement of Coding Conventions
title_short A Model-Driven Approach for the Management and Enforcement of Coding Conventions
title_sort model driven approach for the management and enforcement of coding conventions
topic Coding standards
coding conventions
model-driven engineering
domain-specific languages
static analysis
url https://ieeexplore.ieee.org/document/10068210/
work_keys_str_mv AT elderrodrigues amodeldrivenapproachforthemanagementandenforcementofcodingconventions
AT josedabruzzopereira amodeldrivenapproachforthemanagementandenforcementofcodingconventions
AT leonardomontecchi amodeldrivenapproachforthemanagementandenforcementofcodingconventions
AT elderrodrigues modeldrivenapproachforthemanagementandenforcementofcodingconventions
AT josedabruzzopereira modeldrivenapproachforthemanagementandenforcementofcodingconventions
AT leonardomontecchi modeldrivenapproachforthemanagementandenforcementofcodingconventions