<link rel="stylesheet" href="styles.f3b1fba60ec7970c.css">

Artículo:
Naming Methods with Large Language Models after Refactoring Operations

Cargando...
Miniatura

Editor

Sistedes

Publicado en

Actas de las XXVIII Jornadas de Ingeniería del Software y Bases de Datos (JISBD 2024)

Licencia Creative Commons

Excepto donde se indique lo contrario, la licencia de este ítem se describe como CC BY-NC-ND 4.0

Resumen

In Object-oriented Programming, the Cognitive Complexity (CC) of software is a metric of the difficulty associated with understanding and maintaining the source code. This is usually measured at the method level, taking into account the number of control flow sentences and their nesting level. One way to reduce the CC associated to a method is by extracting code into new methods without altering any existing functionality. However, this involves deciding representative names for the new methods containing the extracted code. This work studies the capability of large language models for assigning names to new extracted methods during the evolution of a code base. Such evolution comprises continuous code extraction operations to study how the semantic of the new methods name evolves. We use the OpenAI Chat API with the textdavinci003 model in order to perform coding tasks. We found the precision of the model to be highly acceptable, achieving in many cases a level similar to that of a human which paves the way for new tooling. However, there are also a few cases in which it fails to provide appropriate names or does not even provide a name inside the indicated standards.

Descripción

Acerca de Recio, Juan Carlos

Citación

Recio Abad, J. C., Saborido, R., Chicano, F.: Naming Methods with Large Language Models after Refactoring Operations. In: Rodríguez Luaces, M. A. (ed.) Actas de las XXVIII Jornadas de Ingeniería del Software y Bases de Datos (JISBD 2024). Sistedes (2024). https://hdl.handle.net/11705/JISBD/2024/29