Debido al alto tráfico generado por robots, aplicamos límites en el número de peticiones permitidas por cliente y bloqueos por IP automáticos. Si haces un uso legítimo y estás teniendo problemas, avísanos para reevaluar nuestras políticas de bloqueo. Disculpa las molestias.

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

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

Palabras clave

Method Naming, Extract Method Refactoring, Natural Language Processing, Large Language Models, Coding Tasks

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