Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The Last Line Effect

935 views

Published on

Micro-clones are tiny duplicated pieces of code; they typically comprise only a few statements or lines. In this paper, we expose 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 208 open source projects and reporting on 202 faulty micro-clones

Published in: Software
  • Be the first to comment

The Last Line Effect

  1. 1. The Last Line Effect Moritz Beller @Inventitech Andy Zaidman Andrey Karpov
  2. 2. TrinityCore Example Last Line Effect
  3. 3. TrinityCore Example Last Line Effect
  4. 4. TrinityCore Example Last Line Effect
  5. 5. Chromium Example Last Statement Effect
  6. 6. Chromium Example Last Statement Effect
  7. 7. Chromium Example Last Statement Effect
  8. 8. Chromium Example Last Statement Effect
  9. 9. Chromium Example Last Statement Effect
  10. 10. Chromium Example
  11. 11. Chromium Example
  12. 12. Chromium Example
  13. 13. Chromium Example
  14. 14. Chromium Example
  15. 15. Chromium Example
  16. 16. Chromium Example Clone Class
  17. 17. Chromium Example Clone Class AST-Node1
  18. 18. Chromium Example Clone Class AST-Node 1 1
  19. 19. Chromium Example Clone Class AST-Node 1 2 1
  20. 20. Chromium Example Clone Class AST-Node 1 2 3 1
  21. 21. Chromium Example Clone Class AST-Node 1 2 3 4 1
  22. 22. Chromium Example Clone Class AST-Node 1 2 3 4 5 1
  23. 23. Chromium Example Clone Class AST-Node 1 2 3 4 5 1
  24. 24. Chromium Example Clone Class AST-Node 1 2 3 4 5 1 Type 2 Clone: “syntactically identical cop[ies]; only variable, type, or function identifiers have […] changed.” Koschke, 2007.
  25. 25. Chromium Example Clone Class AST-Node 1 2 3 4 5 1 Type 2 Clone: “syntactically identical cop[ies]; only variable, type, or function identifiers have […] changed.” Koschke, 2007. Very Short Type 2-Clone: Micro-Clone
  26. 26. Very Short Clones: Micro-Clones
  27. 27. Shortcut: Identical Subexpressions
  28. 28. Shortcut: Identical Subexpressions
  29. 29. Shortcut: Identical Subexpressions
  30. 30. Shortcut: Identical Subexpressions
  31. 31. Shortcut: Identical Subexpressions
  32. 32. Shortcut: Identical Subexpressions Shortcut to Faulty Micro-Clones
  33. 33. PVS-Studio
  34. 34. PVS-Studio
  35. 35. 208 OSS projectsPVS-Studio
  36. 36. 208 OSS projectsPVS-Studio
  37. 37. 208 OSS projectsPVS-Studio
  38. 38. 208 OSS projectsPVS-Studio 202 Faulty Micro-Clones
  39. 39. 208 OSS projectsPVS-Studio 202 Faulty Micro-Clones
  40. 40. Error Distribution for Micro-Clones > 1 Line
  41. 41. Error Distribution for Micro-Clones Within 1 Line
  42. 42. What We Do Not Know (Yet) ...
  43. 43. ● Why did we find so few faulty micro-clones? What We Do Not Know (Yet) ...
  44. 44. ● Why did we find so few faulty micro-clones? What We Do Not Know (Yet) ...
  45. 45. ● Why did we find so few faulty micro-clones? What We Do Not Know (Yet) ...
  46. 46. ● Why did we find so few faulty micro-clones? What We Do Not Know (Yet) ... ● Are faulty micro-clones common among micro-clones?
  47. 47. ● Why did we find so few faulty micro-clones? What We Do Not Know (Yet) ... ● Are faulty micro-clones common among micro-clones?
  48. 48. ● Why did we find so few faulty micro-clones? What We Do Not Know (Yet) ... ● Are faulty micro-clones common among micro-clones?
  49. 49. ● Why did we find so few faulty micro-clones? What We Do Not Know (Yet) ... ● Are faulty micro-clones common among micro-clones? ● How are micro-clones created and evolved?
  50. 50. ● Why did we find so few faulty micro-clones? What We Do Not Know (Yet) ... ● Are faulty micro-clones common among micro-clones? ● How are micro-clones created and evolved?
  51. 51. @Inventitech Moritz Beller, TU Delft The Last Line Effect
  52. 52. @Inventitech Moritz Beller, TU Delft The Last Line Effect
  53. 53. @Inventitech Moritz Beller, TU Delft The Last Line Effect
  54. 54. @Inventitech Moritz Beller, TU Delft The Last Line Effect > code.|

×