Various studies indicate that having concise and consistent identifiers improves the quality of the source code and hence impacts positively source code understanding and maintenance. In order to write concise and consistent identifiers, however, developers need to have some knowledge about the concepts captured in the source code and how they are named. Acquiring such knowledge from the source code might be feasible only for small systems, while it is not viable for large systems. In this paper, we propose an automated approach which exploits concepts and relations automatically extracted from the source code to suggest identifiers. The suggestion is ranked based on the context in which a new identifier is introduced and it can be used either to complete the identifier being written or to replace it with a more appropriate one. To validate the proposed approach, we have conducted a case study by simulating the activities of a developer in naming identifiers. The results of the study show that in the majority of the cases our approach provides completion suggestions which match the identifiers actually used by the developers.

Automated Identifier Completion and Replacement

Abebe, Surafel Lemma;Tonella, Paolo
2013-01-01

Abstract

Various studies indicate that having concise and consistent identifiers improves the quality of the source code and hence impacts positively source code understanding and maintenance. In order to write concise and consistent identifiers, however, developers need to have some knowledge about the concepts captured in the source code and how they are named. Acquiring such knowledge from the source code might be feasible only for small systems, while it is not viable for large systems. In this paper, we propose an automated approach which exploits concepts and relations automatically extracted from the source code to suggest identifiers. The suggestion is ranked based on the context in which a new identifier is introduced and it can be used either to complete the identifier being written or to replace it with a more appropriate one. To validate the proposed approach, we have conducted a case study by simulating the activities of a developer in naming identifiers. The results of the study show that in the majority of the cases our approach provides completion suggestions which match the identifiers actually used by the developers.
2013
9780769549484
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11582/146001
 Attenzione

Attenzione! I dati visualizzati non sono stati sottoposti a validazione da parte dell'ateneo

Citazioni
  • ???jsp.display-item.citation.pmc??? ND
social impact