How Often Is Necessary Code Missing? — A Controlled Experiment —

  • Tomoya Ishihara
  • Yoshiki Higo
  • Shinji Kusumoto
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8919)

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.

Keywords

Code completion Clone detection Static analysis 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
  2. 2.
  3. 3.
  4. 4.
    Bellon, S., Koschke, R., Antoniol, G., Krinke, J., Merlo, E.: Comparison and Evaluation of Clone Detection Tools. IEEE TSE 33(9), 577–591 (2007)Google Scholar
  5. 5.
    Göde, N., Koschke, R.: Frequency and risks of changes to clones. In: Proc. of ICSE, pp. 311–320 (2011)Google Scholar
  6. 6.
    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)Google Scholar
  7. 7.
    Hill, R., Rideout, J.: Automatic method completion. In: Proc. of ASE, pp. 228–235 (2004)Google Scholar
  8. 8.
    Holmes, R., Walker, R.J.: Systematizing pragmatic software reuse. ACM TOSEM 21(4), 1–44 (2012)CrossRefGoogle Scholar
  9. 9.
    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)Google Scholar
  10. 10.
    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)Google Scholar
  11. 11.
    Kapser, C.J., Godfrey, M.W.: “cloning considered harmful” considered harmful: Patterns of cloning in software. ESE 13(6), 645–692 (2008)Google Scholar
  12. 12.
    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)Google Scholar
  13. 13.
    Murphy, G.C., Kersten, M., Findlater, L.: How Are Java Software Developers Using the Eclipse IDE? IEEE Software 23(4), 76–83 (2006)CrossRefGoogle Scholar
  14. 14.
    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)Google Scholar
  15. 15.
    Yamamoto, T., Yoshida, N., Higo, Y.: Seamless Code Reuse Using Source Code Corpus. In: Proc. of IWESEP, pp. 31–36 (2013)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Tomoya Ishihara
    • 1
  • Yoshiki Higo
    • 1
  • Shinji Kusumoto
    • 1
  1. 1.Graduate School of Information Science and TechnologyOsaka UniversitySuitaJapan

Personalised recommendations