API Design Implications of Boilerplate Client Code Designing usable APIs is critical to developersu0027 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.

MARBLE: Mining for Boilerplate Code to Identify API Usability Problems Designing usable APIs is critical to developersu0027 productivity and software quality, but is quite difficult. One of the challenges is that anticipating API usability barriers and realworld 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 alreadyknown and new APIrelated boilerplate code instances.