Mining implicit design templates for actionable code reuse

Yun Lin,Guozhu Meng,Yinxing Xue,Zhenchang Xing,Jun Sun,Xin Peng,Yang Liu,Wenyun Zhao,Jinsong Dong
DOI: https://doi.org/10.1109/ASE.2017.8115652
2017-01-01
Abstract:In this paper, we propose an approach to detecting project-specific recurring designs in code base and abstracting them into design templates as reuse opportunities. The mined templates allow programmers to make further customization for generating new code. The generated code involves the code skeleton of recurring design as well as the semi-implemented code bodies annotated with comments to remind programmers of necessary modification. We implemented our approach as an Eclipse plugin called MICoDe. We evaluated our approach with a reuse simulation experiment and a user study involving 16 participants. The results of our simulation experiment on 10 open source Java projects show that, to create a new similar feature with a design template, (1) on average 69% of the elements in the template can be reused and (2) on average 60% code of the new feature can be adopted from the template. Our user study further shows that, compared to the participants adopting the copy-paste-modify strategy, the ones using MICoDe are more effective to understand a big design picture and more efficient to accomplish the code reuse task.
What problem does this paper attempt to address?