ARIST: An Effective API Argument Recommendation Approach

06/11/2023
by   Son Nguyen, et al.
0

Learning and remembering to use APIs are difficult. Several techniques have been proposed to assist developers in using APIs. Most existing techniques focus on recommending the right API methods to call, but very few techniques focus on recommending API arguments. In this paper, we propose ARIST, a novel automated argument recommendation approach which suggests arguments by predicting developers' expectations when they define and use API methods. To implement this idea in the recommendation process, ARIST combines program analysis (PA), language models (LMs), and several features specialized for the recommendation task which consider the functionality of formal parameters and the positional information of code elements (e.g., variables or method calls) in the given context. In ARIST, the LMs and the recommending features are used to suggest the promising candidates identified by PA. Meanwhile, PA navigates the LMs and the features working on the set of the valid candidates which satisfy syntax, accessibility, and type-compatibility constraints defined by the programming language in use. Our evaluation on a large dataset of real-world projects shows that ARIST improves the state-of-the-art approach by 19 frequently-used libraries. For general argument recommendation task, i.e., recommending arguments for every method call, ARIST outperforms the baseline approaches by up to 125 projects, ARIST achieves more than 60 larger dataset. For working/maintaining projects, with a personalized LM to capture developers' coding practice, ARIST can productively rank the expected arguments at the top-1 position in 7/10 requests.

READ FULL TEXT
research
10/15/2020

Holistic Combination of Structural and Textual Code Information for Context based API Recommendation

Context based API recommendation is an important way to help developers ...
research
02/04/2020

Boosting API Recommendation with Implicit Feedback

Developers often need to use appropriate APIs to program efficiently, bu...
research
05/01/2017

WebAPIRec: Recommending Web APIs to Software Projects via Personalized Ranking

Application programming interfaces (APIs) offer a plethora of functional...
research
02/09/2021

PyART: Python API Recommendation in Real-Time

API recommendation in real-time is challenging for dynamic languages lik...
research
08/18/2019

API Misuse Correction: A Statistical Approach

Modern software development relies heavily on Application Programming In...
research
06/01/2023

Better Context Makes Better Code Language Models: A Case Study on Function Call Argument Completion

Pretrained code language models have enabled great progress towards prog...
research
08/30/2023

A Dataflow Analysis for Comparing and Reordering Predicate Arguments

In this work, which is done in the context of a (moded) logic programmin...

Please sign up or login with your details

Forgot password? Click here to reset