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.
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.