一句话:提出 MARBLE,从 API 客户端代码库自动挖掘样板代码候选,以发现 API 可用性问题。
API 可用性设计对开发者生产力和软件质量至关重要,但预测 API 使用障碍很困难,且缺乏大规模挖掘可用性数据的自动化方法。本文聚焦开发者反复抱怨的“样板代码”,考察何种代码算作样板代码、其成因以及如何减少需求,并提出 MARBLE:一种从 API 客户端代码仓库中自动挖掘样板代码候选的方法。MARBLE 融合了 API 使用挖掘算法、AST 比较算法和图划分算法。作者在 13 个 Java API 上评估该方法,结果表明其能成功识别已知和新的 API 相关样板代码实例,从而帮助发现 API 可用性问题。
Designing usable APIs is critical to developers' productivity and software quality, but is quite difficult. One of the challenges is that anticipating API usability barriers and real-world usage is difficult, due to a lack of automated approaches to mine usability data at scale. In this paper, we focus on one particular grievance that developers repeatedly express in online discussions about APIs: "boilerplate code." We investigate what properties make code count as boilerplate, the reasons for boilerplate, and how programmers can reduce the need for it. We then present MARBLE, a novel approach to automatically mine boilerplate code candidates from API client code repositories. MARBLE adapts existing techniques, including an API usage mining algorithm, an AST comparison algorithm, and a graph partitioning algorithm. We evaluate MARBLE with 13 Java APIs, and show that our approach successfully identifies both already-known and new API-related boilerplate code instances.
DOI 原文 ·
@inproceedings{paperbot5287,
title = {MARBLE: Mining for Boilerplate Code to Identify API Usability Problems},
author = {Daye Nam and Amber Horvath and Andrew Macvean and Brad Myers and Bogdan Vasilescu},
booktitle = {ASE},
year = {2019},
doi = {10.1109/ase.2019.00063}
}