Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Eclipse, http://www.eclipse.org
Intellij idea, http://www.jetbrains.com/idea/
Intellisense, http://msdn.microsoft.com/en-us/library/hcw1s69b.aspx
Bellon, S., Koschke, R., Antoniol, G., Krinke, J., Merlo, E.: Comparison and Evaluation of Clone Detection Tools. IEEE TSE 33(9), 577–591 (2007)
Göde, N., Koschke, R.: Frequency and risks of changes to clones. In: Proc. of ICSE, pp. 311–320 (2011)
Higo, Y., Kusumoto, S.: How Often Do Unintended Inconsistencies Happened? –Deriving Modification Patterns and Detecting Overlooked Code Fragments–. In: Proc. of ICSM, pp. 222–231 (2012)
Hill, R., Rideout, J.: Automatic method completion. In: Proc. of ASE, pp. 228–235 (2004)
Holmes, R., Walker, R.J.: Systematizing pragmatic software reuse. ACM TOSEM 21(4), 1–44 (2012)
Hotta, K., Sano, Y., Higo, Y., Kusumoto, S.: Is duplicate code more frequently modified than non-duplicate code in software evolution?: An empirical study on open source software. In: Proc. of ERCIM/IWPSE, pp. 73–82 (2010)
Inoue, K., Higo, Y., Yoshida, N., Choi, E., Kusumoto, S., Kim, K., Park, W., Lee, E.: Experience of finding inconsistently-changed bugs in code clones of mobile software. In: Proc. of IWSC, pp. 94–95 (2012)
Kapser, C.J., Godfrey, M.W.: “cloning considered harmful” considered harmful: Patterns of cloning in software. ESE 13(6), 645–692 (2008)
Li, Z., Lu, S., Myagmar, S., Zhou, Y.: CP-Miner: Finding Copy-Paste and Related Bugs in Large-Scale Software Code. IEEE TSE, 176–192 (2006)
Murphy, G.C., Kersten, M., Findlater, L.: How Are Java Software Developers Using the Eclipse IDE? IEEE Software 23(4), 76–83 (2006)
Nguyen, A.T., Nguyen, T.T., Nguyen, H.A., Tamrawi, A., Nguyen, H.V., Al-Kofahi, J., Nguyen, T.N.: Graph-based pattern-oriented, context-sensitive source code completion. In: Proc. of ICSE, pp. 69–79 (2012)
Yamamoto, T., Yoshida, N., Higo, Y.: Seamless Code Reuse Using Source Code Corpus. In: Proc. of IWESEP, pp. 31–36 (2013)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this paper
Cite this paper
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. https://doi.org/10.1007/978-3-319-14130-5_11
Download citation
DOI: https://doi.org/10.1007/978-3-319-14130-5_11
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-14129-9
Online ISBN: 978-3-319-14130-5
eBook Packages: Computer ScienceComputer Science (R0)