Mining Implicit Design-Level Templates for Actionable Code Reuse

MICoDe (Mining Implicit Code Design) is an eclipse plugin which support detecting duplicated designs and extracting them into design template for further customization and code generation. The source code of MICoDe is available here and a full eclipse version is available here.

A screenshot

MICode visualize design template in a class-diagram-like template editor. Different types of template entities in different status (i.e., class, interface, method, and field) are represented by rectangles with different colors. Double-clicking a template entity opens a wizard dialogue which allows programmers to customize the entity by specifying its detailed information such as class name, package name, parameters, etc. User can delete or add some entities or relations to the template. The newly added entities and relations will be used to generate code in the same way as the template entities mined from the code.

A demo video for configuring template and generating code:

(Please load the subtitles and adjust to high resolution during watching)

Experiment Data:

  • Simulation Experiment

We apply MICoDe on 10 open source Java projects as follows. The table shows the details of the Java open source projects in terms of project profiles (by lines of code, number of classes, methods, and fields), extracted template (by number of extracted templates, number of involved classes, methods, and fields), number of used templates for simulating reuse tasks (#T-Templ), number of trials (#Trials), average precision, and average recall.