Managing Duplicated Code with Linked Editing - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Managing Duplicated Code with Linked Editing

Description:

Visual Languages and Human-Centric Computing September 9, 2004 ... Spreadsheets, web sites, music scores, these PowerPoint s... 17. Contributions ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 19
Provided by: michael997
Category:

less

Transcript and Presenter's Notes

Title: Managing Duplicated Code with Linked Editing


1
Managing Duplicated Codewith Linked Editing
  • Michael Toomim, Andrew Begel and Susan L. Graham
  • Harmonia Research Group
  • University of California at Berkeley

Visual Languages and Human-Centric Computing
September 9, 2004
2
Duplicated Code
is
Bad
3
The simplest system must contain
no duplicate code
Kent Beck
Extreme Programming Explained
4
1 in the stink parade is
duplicated code.
Martin Fowler
Refactoring
5
DRY Dont Repeat Yourself
Andrew Hunt and David Thomas
The Pragmatic Programmer
6
Duplicated Code is Bad
  • Causes verbosity/bloat, viscous edits,
    inconsistency, difficult maintainability
  • But it will always exist
  • Linked Editing makes it easy to work with

7
How do they manage it?
Abstraction.
The solution to duplication.
8
50 Years of Abstraction
  • Functions, macros, objects, templates, aspects,
    generative programs, traits
  • Language abstractions since Fortran
  • Tools to help programmers find and refactor
    duplication
  • 16 duplication finding algorithms published in
    last 14 years
  • Refactoring supported in mainstream IDEs

9
Duplication is Everywhere
10
Why We Duplicate Code
  • Abstractions have usability problems
  • Difficult to create
  • Can make code worse
  • Can be impossible to express
  • Programmers have no other alternative

11
Solution Linked Editing
  • Editor provides enhanced interaction
  • Visualization, navigation, simultaneous editing
    of duplication
  • Addresses the problems of duplication without the
    costs of abstraction
  • Implemented in editor called Codelink

12
User Study
  • 13 subjects (novice to expert)
  • Programming tasks with both Codelink and
    functional abstraction
  • Measurements
  • Time to abstract or link duplicated code
  • Benefits of the abstraction or link during
    programming tasks (rated by subjects)

13
Results Creating a Link
  • Mean abstraction time 1306 minutes
  • Mean link time 0022 seconds

!
14
Working with Linked Code
Rated benefits of abstraction and Codelink over
duplicated code
Much Better
Moderately Better
Slightly Better
Same
Slightly Worse
Speed
Effort
Changeability
Maintainability
Understandability
15
Linked Editing Worked
  • Provided benefits comparable to abstraction
  • but required very little programming time

16
Future Research Directions
  • Improved difference analysis
  • Integrate with refactoring systems
  • Find duplicated code automatically
  • Refactor linked code automatically
  • Linked Editing of other digital documents
  • Spreadsheets, web sites, music scores, these
    PowerPoint slides

17
Contributions
  • Linked Editing
  • Manages duplicated code effectively
  • Easy to learn and use
  • Applicable in many domains

18
Michael Toomimtoomim_at_cs.berkeley.edu
Write a Comment
User Comments (0)
About PowerShow.com