Towards Automatically Generating a Personalized Code Formatting Mechanism

Thomas Karanikiotis, Kyriakos Chatzidimitriou, Andreas Symeonidis

2021

Abstract

Source code readability and comprehensibility are continuously gaining interest, due to the wide adoption of component-based software development and the (re)use of software residing in code hosting platforms. Consistent code styling and formatting across a project tend to improve readability, while most code formatting approaches rely on a set of rules defined by experts, that aspire to model a commonly accepted formatting. This approach is usually based on the experts’ expertise, is time-consuming and does not take into account the way a team develops software. Thus, it becomes too intrusive and, in many cases, is not adopted. In this work we present an automated mechanism, that, given a set of source code files, can be trained to recognize the formatting style used across a project and identify deviations, in a completely unsupervised manner. At first, source code is transformed into small meaningful pieces, called tokens, which are used to train the models of our mechanism, in order to predict the probability of a token being wrongly positioned. Preliminary evaluation on various axes indicates that our approach can effectively detect formatting deviations from the project’s code styling and provide actionable recommendations to the developer.

Download


Paper Citation


in Harvard Style

Karanikiotis T., Chatzidimitriou K. and Symeonidis A. (2021). Towards Automatically Generating a Personalized Code Formatting Mechanism. In Proceedings of the 16th International Conference on Software Technologies - Volume 1: ICSOFT, ISBN 978-989-758-523-4, pages 90-101. DOI: 10.5220/0010579900900101


in Bibtex Style

@conference{icsoft21,
author={Thomas Karanikiotis and Kyriakos Chatzidimitriou and Andreas Symeonidis},
title={Towards Automatically Generating a Personalized Code Formatting Mechanism},
booktitle={Proceedings of the 16th International Conference on Software Technologies - Volume 1: ICSOFT,},
year={2021},
pages={90-101},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0010579900900101},
isbn={978-989-758-523-4},
}


in EndNote Style

TY - CONF

JO - Proceedings of the 16th International Conference on Software Technologies - Volume 1: ICSOFT,
TI - Towards Automatically Generating a Personalized Code Formatting Mechanism
SN - 978-989-758-523-4
AU - Karanikiotis T.
AU - Chatzidimitriou K.
AU - Symeonidis A.
PY - 2021
SP - 90
EP - 101
DO - 10.5220/0010579900900101