Print Email Facebook Twitter The last line effect explained Title The last line effect explained Author Beller, M.M. (TU Delft Software Engineering) Zaidman, A.E. (TU Delft Software Engineering) Karpov, Andrey (OOO 'Program Verification Systems') Zwaan, Rolf A. (Erasmus Universiteit Rotterdam) Date 2017-06 Abstract Micro-clones are tiny duplicated pieces of code; they typically comprise only few statements or lines. In this paper, we study the “Last Line Effect,” the phenomenon that the last line or statement in a micro-clone is much more likely to contain an error than the previous lines or statements. We do this by analyzing 219 open source projects and reporting on 263 faulty micro-clones and interviewing six authors of real-world faulty micro-clones. In an interdisciplinary collaboration, we examine the underlying psychological mechanisms for the presence of these relatively trivial errors. Based on the interviews and further technical analyses, we suggest that so-called “action slips” play a pivotal role for the existence of the last line effect: Developers’ attention shifts away at the end of a micro-clone creation task due to noise and the routine nature of the task. Moreover, all micro-clones whose origin we could determine were introduced in unusually large commits. Practitioners benefit from this knowledge twofold: 1) They can spot situations in which they are likely to introduce a faulty micro-clone and 2) they can use PVS-Studio, our automated micro-clone detector, to help find erroneous micro-clones. Subject Clone detectionCode clonesInterdisciplinary workLast line effectMicro-clonesPsychology To reference this document use: http://resolver.tudelft.nl/uuid:9f43b6df-e66b-4f06-8a65-a71de350a859 DOI https://doi.org/10.1007/s10664-016-9489-6 ISSN 1382-3256 Source Empirical Software Engineering, 22 (3), 1508-1536 Part of collection Institutional Repository Document type journal article Rights © 2017 M.M. Beller, A.E. Zaidman, Andrey Karpov, Rolf A. Zwaan Files PDF llee.pdf 2.55 MB Close viewer /islandora/object/uuid:9f43b6df-e66b-4f06-8a65-a71de350a859/datastream/OBJ/view