Quantifying the benefits of code hints for refactoring deprecated Java APIs

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: David, Cristina, Kesseli, Pascal, Kroening, Daniel, Zhang, Hanliang
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866913800678014976
author David, Cristina
Kesseli, Pascal
Kroening, Daniel
Zhang, Hanliang
author_facet David, Cristina
Kesseli, Pascal
Kroening, Daniel
Zhang, Hanliang
contents When done manually, refactoring legacy code in order to eliminate uses of deprecated APIs is an error-prone and time-consuming process. In this paper, we investigate to which degree refactorings for deprecated Java APIs can be automated, and quantify the benefit of Javadoc code hints for this task. To this end, we build a symbolic and a neural engine for the automatic refactoring of deprecated APIs. The former is based on type-directed and component-based program synthesis, whereas the latter uses LLMs. We applied our engines to refactor the deprecated methods in the Oracle JDK 15. Our experiments show that code hints are enabling for the automation of this task: even the worst engine correctly refactors 71% of the tasks with code hints, which drops to at best 14% on tasks without. Adding more code hints to Javadoc can hence boost the refactoring of code that uses deprecated APIs.
format Preprint
id arxiv_https___arxiv_org_abs_2412_08041
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Quantifying the benefits of code hints for refactoring deprecated Java APIs
David, Cristina
Kesseli, Pascal
Kroening, Daniel
Zhang, Hanliang
Software Engineering
When done manually, refactoring legacy code in order to eliminate uses of deprecated APIs is an error-prone and time-consuming process. In this paper, we investigate to which degree refactorings for deprecated Java APIs can be automated, and quantify the benefit of Javadoc code hints for this task. To this end, we build a symbolic and a neural engine for the automatic refactoring of deprecated APIs. The former is based on type-directed and component-based program synthesis, whereas the latter uses LLMs. We applied our engines to refactor the deprecated methods in the Oracle JDK 15. Our experiments show that code hints are enabling for the automation of this task: even the worst engine correctly refactors 71% of the tasks with code hints, which drops to at best 14% on tasks without. Adding more code hints to Javadoc can hence boost the refactoring of code that uses deprecated APIs.
title Quantifying the benefits of code hints for refactoring deprecated Java APIs
topic Software Engineering
url https://arxiv.org/abs/2412.08041