Mendel: Source Code Recommendation based on a Genetic Metaphor

About

Mendel is a source code recommendation tool that integrates with the Cincom VisualWorks Smalltalk IDE. Based on the entity the developer currently browses, our tool employs a genetics-inspired metaphor to analyze source-code entities related to the current working context and provides its user with a number of recommended properties (naming conventions, used types, invoked messages, etc.) that the source code entity currently being worked on should exhibit.

Mendel is based on the assumption that source-code entities which are in some way related, for example by hierarchy, are often governed by the same regularities. If a particular trait, that is shared by most of its relatives, is missing from a particular source-code entity, we consider that trait as a suitable candidate for recommendation. In this way, our algorithm differs from most existing coding assistants: it does not aim at predicting suitable messages to be sent, or the next action that a developer needs to take. Rather, it merely focusses on traits that may be missing from the source-code entity, such as which methods should potentially be overridden by some class, which source-code template might be suitable for the currently browsed method, or which calls to methods or referenced types are likely missing from a method.

Screenshot

Below are two annotated screenshots of Mendel. The first screenshot shows Mendel opened on a class; the second opened on a method. In the first screenshot, our tool proposes some recommendations classified as must for the class ExistsManyQuantifier. The second screenshot shows a single may recommendation for the method generateSelector.

Click the images to enlarge them.

Download

If you are experienced with VisualWorks Smalltalk, you can obtain Mendel by downloading the Mendel bundle from our open VisualWork Smalltalk store located at: Alternatively, we offer pre-built Smalltalk images with Mendel loaded. These distributions contain the Mendel tool, and the Pier, Moose, IntensiVE and Seaside systems. You can either use Mendel via the Refactory Browser tool with which it is integrated, or re-run our experiments using the script available in the distribution.

Experimental data

We validated our approach by applying it to the following five Smalltalk systems: Our experimental results can be obtained by downloading the following ZIP archive: experiments.zip.

Contact

For further information, please contact the authors of Mendel.