How Often Is Necessary Code Missing? — A Controlled Experiment —
- Cite this paper as:
- Ishihara T., Higo Y., Kusumoto S. (2014) How Often Is Necessary Code Missing? — A Controlled Experiment —. In: Schaefer I., Stamelos I. (eds) Software Reuse for Dynamic Systems in the Cloud and Beyond. ICSR 2015. Lecture Notes in Computer Science, vol 8919. Springer, Cham
Code completion is one of the techniques used for realizing efficient code implementations. Code completion means adding the lacking code required for finishing a given task. Recently, some researchers have proposed code completion techniques that are intended to support code reuse. However, these existing techniques are designed to support the following programming steps. They cannot add necessary code in already-implemented code lines. In this research, we first investigate how often developers forget to write the necessary code in their programming tasks. We also investigate the extent to which opportunities of code reuse are increased by considering middle code completion. To investigate middle code completion, we propose a new technique that leverages type-3 clone detection techniques. We conducted a controlled experiment with nine research participants. As a result, we found that the participants had forgotten to write the necessary code in 41 of 51 (80%) programming tasks. We also found that the proposed technique was able to suggest useful code by middle code completion in 10 of 41 (24%) programming tasks for which the participants had forgotten to write the necessary code.
KeywordsCode completion Clone detection Static analysis
Unable to display preview. Download preview PDF.