2009 LearningfromExamplestoImproveCo

From GM-RKB
Jump to navigation Jump to search

Subject Headings: Intelligent Code Completion System; Code Completion System; Frequency-Based Code Completion System; Association Rule Based Code Completion System; Best Matching Neighbors Code Completion System; Eclipse Code Completion System.

Notes

Cited By

Quotes

Abstract

The suggestions made by current IDE's code completion features are based exclusively on static type system of the programming language. As a result, often proposals are made which are irrelevant for a particular working context. Also, these suggestions are ordered alphabetically rather than by their relevance in a particular context. In this paper, we present intelligent code completion systems that learn from existing code repositories. We have implemented three such systems, each using the information contained in repositories in a different way. We perform a large-scale quantitative evaluation of these systems, integrate the best performing one into Eclipse, and evaluate the latter also by a user study. Our experiments give evidence that intelligent code completion systems which learn from examples significantly outperform mainstream code completion systems in terms of the relevance of their suggestions and thus have the potential to enhance developers' productivity]].

1. Introduction

(...)

 In this paper, we propose intelligent code completion systems that learn from existing code repositories by searching for code snippets where a variable of the same type as the variable for which the developer seeks advice is used in a similar context. We have built three prototype code completion engines of this kind, each using the information contained in repositories in different ways. The first prototype uses the frequency of method calls as a metric to decide about their relevance. The second code completion uses association rule mining to search the code repository for frequently occurring method pairs. Finally, the last and most advanced code completion system recommends method calls as a synthesis of the method calls of the closest source snippet found. To build this system, we have modified the k nearest neighbors algorithm [8], a classical and efficient machine learning algorithm, to fit the needs of code completion. We call the resulting algorithm best matching neighbors (BMN) algorithm.

To evaluate our hypothesis we use a large scale evaluation process for recommender systems, sketched in [6] , along with standard information retrieval performance measures. By large scale, we mean that the system is evaluated with a test bed of more than 27,000 test cases. The evaluation results prove the efficiency of the learning code completion engines in general and of the best matching neighbors (BMN) algorithm in particular. In order to demonstrate that the best matching neighbors (BMN) code completion algorithm, which gets the best quantitative evaluation, has the potential to increase developer productivity, we show how it can be seamlessly integrated into the default Eclipse development widgets and evaluate its usefulness by means of a user study.

(...)

2. Example-Based Code Completion

2.1 Three New Code Completion Systems

2.2 The Best Matching Neighbors Completion System

2.2.1 Codebase Variables as Binary Vectors
2.2.2 A Distance Measure for Code Completion
2.2.3 The Selection Mechanism of Nearest Neighbors
2.2.4 Synthesizing Recommendations

3. Evaluation

3.1 Evaluation Data Set

3.2 Evaluation Scenario

3.3 Evaluation Metrics

3.4 Evaluation Results

3.5 Discussion

4. Integrating BMN Into Eclipse

In this section, we present our prototype integration of the BMN engine into the Eclipse IDE. We decided to integrate BMN since it was the engine with the best performance according to the evaluation. The goal for building the prototype was to enable the user study presented in Sec.5 to give us insight on the practical relevance of code completion systems capable of learning from example code. We present the prototype by elaborating on three main differences between of our prototype to the default Eclipse code completion system. Our statements are illustrated by figure 6, which shows a screenshot of our prototype.

Figure 6: Integration of our Intelligent Code Completion into Eclipse.

=== 5. User Study ===

(...)

5.1 Setup

5.2 Results

6. Related Work

7. Conclusion And Future Work

References

;

 AuthorvolumeDate ValuetitletypejournaltitleUrldoinoteyear
2009 LearningfromExamplestoImproveCoMarcel Bruch
Martin Monperrus
Mira Mezini
Learning from Examples to Improve Code Completion Systems10.1145/1595696.15957282009