一句话:研究样板代码的属性,并提出结合 API 使用挖掘、AST 比较与图划分,从客户端代码中自动挖掘样板以辅助 API 设计评审。
设计可用的 API 对开发者生产力和软件质量至关重要,但十分困难。本文关注“样板代码”(boilerplate)——需要在多处几乎不加修改地重复出现的代码片段,API 设计专家认为它可能指示 API 可用性问题。作者首先考察哪些属性使代码可被视为样板代码,然后提出一种从大量客户端代码中自动挖掘样板代码的新方法。该技术将已有的 API 使用挖掘算法与基于 AST 比较和图划分的新过滤器结合。借助识别出的样板代码候选,作者讨论了该技术如何帮助 API 设计者评审设计决策并发现可用性问题。
Designing usable APIs is critical to developers' productivity and software quality but is quite difficult. In this paper, I focus on "boilerplate" code, sections of code that have to be included in many places with little or no alteration, which many experts in API design have said can be an indicator of API usability problems. I investigate what properties make code count as boilerplate, and present a novel approach to automatically mine boilerplate code from a large set of client code. The technique combines an existing API usage mining algorithm, with novel filters using AST comparison and graph partitioning. With boilerplate candidates identified by the technique, I discuss how this technique could help API designers in reviewing their design decisions and identifying usability issues.
DOI 原文 ·
@inproceedings{paperbot5224,
title = {API Design Implications of Boilerplate Client Code},
author = {Daye Nam},
booktitle = {ASE},
year = {2019},
doi = {10.1109/ase.2019.00153}
}