SlideShare a Scribd company logo
Aiding Software Maintenance with Copy-and-Paste Clone-Awareness Patricia Jablonski and Daqing Hou Clarkson University ~ Potsdam, NY USA Friday July 2, 2010 ~ ICPC 2010
Source code is copied and pasted for reuse and then it is modified to fit a specific task The correspondence (similarity) relationship between the clones can be useful information during modification and debugging Having to manually identify and consistently change clones can be difficult over time Cloning increases source code maintenance and can lead to undetected errors in the code Copy, Paste, and Modify
Proactive tracking of copy-and-paste clones upon creation (using abstract syntax trees) Features of CnP tested in this user study CnP clone visualization Shows the programmer where related clones are CReN identifier renaming Assists the programmer in renaming identifiers consistently within clones LexId substring renaming Assists the programmer in renaming substrings consistently within clones The CnP Software Tool
CnP Clone Visualization
Programmers often make small modifications to pasted code (like to its identifier names and literal constants) for it to fit its task CReN is an Eclipse plug-in that uses CnP’s clone tracking and visualization, and groups instances of the same identifier within a clone All instances of the same identifier are renamed together when any one instance is edited by the programmer This helps prevent inconsistencies (errors) CReN Identifier Renaming
LexId is a separate Eclipse plug-in (part of CnP) that adds onto CReN’s functionality LexId groups and renames together common substrings between different identifiers within a clone Recall that CReN renames instances of the same whole identifier name within a clone LexId focuses on inferring the lexical patterns LexId divides identifiers into substrings (standard Java CamelCase is supported) LexId Substring Renaming
CnP Clone Visualization Hypotheses CnP’s clone visualization makes it faster for programmers to find software bugs in copied-and-pasted code than debugging manually or with other tools, when the cloning information is not fresh in their memories. CnP’s clone visualization makes it faster and less error-prone for programmers to make modifications to copied-and-pasted code than modifying without visualization, when the cloning information is not fresh in their memories. User Study – CnP Visualization
CReN Identifier Renaming Hypotheses Using CReN to rename identifier instances consistently in copied-and-pasted code is quicker than performing the same task manually or with other tools CReN prevents such inconsistent renaming errors that can happen otherwise. User Study – CReN Renaming
LexId Substring Renaming Hypotheses Using LexId to rename substring instances consistently in copied-and-pasted code is quicker than performing the same task manually or with other tools. LexId prevents such inconsistent renaming errors that can happen otherwise. User Study – LexId Renaming
Task Descriptions
Recruitment email was sent to all Clarkson University computer science and engineering undergraduate and graduate students 14 male subjects participated in the user study – 8 undergraduate, 6 graduate students Knowledge of Java and Swing were required Familiarity with IDEs, especially Eclipse, was preferred, but not necessary Subjects had different levels of prior experience and knowledge Subject Characteristics
Subjects came one at a time to a user study lab for a session between 1 and 2 hours long Subjects were presented with background about the problems of copy-and-paste clones, the 3 CnP features, and other tools Subjects were shown the source code and graphical Paint program used for the tasks Subjects were encouraged to work efficiently (with accuracy and speed) Subjects were recorded with video/audio Study Procedure
Annotated Paint Program
Before starting a task, the current task’s description was read and questions answered The subject could use the instruction sheet, a sheet with the identifier names labeled, and an online Swing tutorial during the study The Paint program for the task was run for the subject to see the task’s problem visually The subjects were told whether the current task involved CnP, and if not, about some other (optional) tools that they could use Task Descriptions
Similar tasks were paired together Task 1 & 2 – debugging, CnP clone visualization Task 3 & 4 – modification, CnP clone visualization Task 5 & 6 – renaming, CReN identifier renaming Task 7 & 8 – renaming, LexId substring renaming Subjects completed each of the 8 tasks once, alternating with and without the tool Odd-numbered subjects performed the first task in each pair with tool support, while even-numbered subjects performed the first tasks without the tool Tasks were paired rather than pairing the subjects Task Pairs
For subjects who had CnP support for a task, the clone groups were already highlighted with different colors in PaintWindow.java 5 clone groups considered copy and pastes: Red (r), green (g), blue (b), thickness (t) slider/panel Color panel and thickness panel Tool panel and clear/undo panel The UI constraints for each of the four panels The declaration of the two change listeners Subjects without CnP could use CCFinderX CnP Visualization Tasks
Task 1: Moving the blue slider does not change the pixel color. Debugging Tasks – Task 1 rSlider should be bSlider (on line 120)
Task 2: Moving the thickness slider does not change the pixel thickness. Debugging Tasks – Task 2 colorChangeListener should be thicknessChangeListener (on line 142)
Task 3: Add a titled border to colorPanel and to thicknessPanel. Modification Tasks – Task 3
Modification Tasks – Task 3
Task 4: Add color to the label of each color slider – red, green, and blue. Modification Tasks – Task 4
Modification Tasks – Task 4
Task 5: Rename colorPanel to thicknessPanel and rPanel to tPanel within the clone. Renaming Tasks (with CReN)
Task 6: Rename toolPanel to clearUndoPanel, pencilButton to clearButton, and eraserButton to undoButton within the clone. Renaming Tasks (with CReN)
Task 7: Rename rPanel to gPanel and rSlider to gSlider in the green slider clone (shown), and rPanel to bPanel and rSlider to bSlider in the blue slider clone. Renaming Tasks (with LexId)
Task 8: Rename bPanel to tPanel and bSlider to tSlider in the thickness slider clone. Renaming Tasks (with LexId)
Results – Time per Task The time (in minutes) to complete each pair of tasks.
Results – Time per Task Statistical hypothesis testing on the paired time data.
Results – Solution Correctness Correct states when running the program or when finished.
Results – Completion Method Number of subjects who used each location and inspection method for debugging and modification tasks.
Results – Completion Method Number of times each renaming method was used for renaming tasks.
Confounding factors for clone visualization Clone visualization is not forced on the user Subjects would have produced correct solutions to Task 3 if they had made use of cloning information Varying levels of subjects’ prior experience Threats to validity Some subjects had more knowledge/experience Tasks close to real-world GUI programming tasks Tool design Need to further improve the clone visualization Need to tell programmers exactly what is renamed Discussion
Clone visualization Some other tools use colored bars, markers, rulers Many others use separate views that programmers need to invoke or relatively complex graphs that they need to learn and understand Related tools Find & Replace Rename Refactoring Linked Renaming Rename Type Refactoring Vaci Related Work
User study tested CnP’s clone visualization and renaming features (CReN and LexId) CReN and LexId both perform statistically quicker than without them on similar tasks CReN and LexId both help prevent inconsistent renaming that otherwise happens Since CnP’s clone visualization was not forced on the user, some subjects may not have used it even when it was present during a particular debugging or modification task Cloning information may be more useful to people without significant prior knowledge/experience Conclusion
Questions?

More Related Content

What's hot

Expressive And Modular Predicate Dispatch In Java
Expressive And Modular Predicate Dispatch In JavaExpressive And Modular Predicate Dispatch In Java
Expressive And Modular Predicate Dispatch In Java
Dr Anjan Krishnamurthy
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
Ahmed Za'anin
 
Java training
Java trainingJava training
Java training
Ducat Education
 
Polymorphism and interface in vb.net
Polymorphism and interface in vb.netPolymorphism and interface in vb.net
Polymorphism and interface in vb.net
KarthigaGunasekaran1
 
Oop
OopOop
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
nirajmandaliya
 
CLTL: Description of web services and sofware. Nijmegen 2013
CLTL: Description of web services and sofware. Nijmegen 2013CLTL: Description of web services and sofware. Nijmegen 2013
CLTL: Description of web services and sofware. Nijmegen 2013
Rubén Izquierdo Beviá
 
Reverse-engineering: Using GDB on Linux
Reverse-engineering: Using GDB on LinuxReverse-engineering: Using GDB on Linux
Reverse-engineering: Using GDB on Linux
Rick Harris
 
Object-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism UnleashedObject-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism Unleashed
Naresh Chintalcheru
 
Python inheritance
Python inheritancePython inheritance
Python inheritance
ISREducations
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
1 2 java development
1 2 java development1 2 java development
1 2 java development
Ken Kretsch
 
Object oriented concepts ppt
Object oriented concepts pptObject oriented concepts ppt
Object oriented concepts ppt
Prof. Dr. K. Adisesha
 
Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)
indiangarg
 
Basics java programing
Basics java programingBasics java programing
Basics java programing
Darshan Gohel
 
How to Learn Java Programming
How to Learn Java ProgrammingHow to Learn Java Programming
How to Learn Java Programming
Java2Blog
 
OOP - Polymorphism
OOP - PolymorphismOOP - Polymorphism
OOP - Polymorphism
Mudasir Qazi
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
Greg Sohl
 
Introduction to programing languages part 2
Introduction to programing languages   part 2Introduction to programing languages   part 2
Introduction to programing languages part 2
university of education,Lahore
 

What's hot (19)

Expressive And Modular Predicate Dispatch In Java
Expressive And Modular Predicate Dispatch In JavaExpressive And Modular Predicate Dispatch In Java
Expressive And Modular Predicate Dispatch In Java
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Java training
Java trainingJava training
Java training
 
Polymorphism and interface in vb.net
Polymorphism and interface in vb.netPolymorphism and interface in vb.net
Polymorphism and interface in vb.net
 
Oop
OopOop
Oop
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
 
CLTL: Description of web services and sofware. Nijmegen 2013
CLTL: Description of web services and sofware. Nijmegen 2013CLTL: Description of web services and sofware. Nijmegen 2013
CLTL: Description of web services and sofware. Nijmegen 2013
 
Reverse-engineering: Using GDB on Linux
Reverse-engineering: Using GDB on LinuxReverse-engineering: Using GDB on Linux
Reverse-engineering: Using GDB on Linux
 
Object-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism UnleashedObject-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism Unleashed
 
Python inheritance
Python inheritancePython inheritance
Python inheritance
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
 
1 2 java development
1 2 java development1 2 java development
1 2 java development
 
Object oriented concepts ppt
Object oriented concepts pptObject oriented concepts ppt
Object oriented concepts ppt
 
Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)
 
Basics java programing
Basics java programingBasics java programing
Basics java programing
 
How to Learn Java Programming
How to Learn Java ProgrammingHow to Learn Java Programming
How to Learn Java Programming
 
OOP - Polymorphism
OOP - PolymorphismOOP - Polymorphism
OOP - Polymorphism
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
Introduction to programing languages part 2
Introduction to programing languages   part 2Introduction to programing languages   part 2
Introduction to programing languages part 2
 

Similar to ICPC

PhD Proposal
PhD ProposalPhD Proposal
PhD Proposal
Patricia Deshane
 
ETX
ETXETX
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docx
honey725342
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
the_wumberlog
 
Graphql
GraphqlGraphql
Siguccs20101026
Siguccs20101026Siguccs20101026
Siguccs20101026
Takashi Yamanoue
 
Chapter 10
Chapter 10 Chapter 10
10tait
10tait10tait
Re-implementing Thrift using MDE
Re-implementing Thrift using MDERe-implementing Thrift using MDE
Re-implementing Thrift using MDE
Sina Madani
 
Thesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptThesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.ppt
Ptidej Team
 
C# c# for beginners crash course master c# programming fast and easy today
C# c# for beginners crash course master c# programming fast and easy todayC# c# for beginners crash course master c# programming fast and easy today
C# c# for beginners crash course master c# programming fast and easy today
Afonso Macedo
 
Chapter -1.ppt
Chapter -1.pptChapter -1.ppt
Chapter -1.ppt
DrFatimaSabir
 
Unit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptxUnit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptx
Asst.prof M.Gokilavani
 
3rd presentation
3rd presentation3rd presentation
3rd presentation
Olabode Ajayi
 
From Conventional Machine Learning to Deep Learning and Beyond.pptx
From Conventional Machine Learning to Deep Learning and Beyond.pptxFrom Conventional Machine Learning to Deep Learning and Beyond.pptx
From Conventional Machine Learning to Deep Learning and Beyond.pptx
Chun-Hao Chang
 
Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual
Abdul Hannan
 
A novel approach based on topic
A novel approach based on topicA novel approach based on topic
A novel approach based on topic
csandit
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5
Kunal Bangar
 
Software development slides
Software development slidesSoftware development slides
Software development slides
iarthur
 
66781291 java-lab-manual
66781291 java-lab-manual66781291 java-lab-manual
66781291 java-lab-manual
Laura Popovici
 

Similar to ICPC (20)

PhD Proposal
PhD ProposalPhD Proposal
PhD Proposal
 
ETX
ETXETX
ETX
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docx
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
 
Graphql
GraphqlGraphql
Graphql
 
Siguccs20101026
Siguccs20101026Siguccs20101026
Siguccs20101026
 
Chapter 10
Chapter 10 Chapter 10
Chapter 10
 
10tait
10tait10tait
10tait
 
Re-implementing Thrift using MDE
Re-implementing Thrift using MDERe-implementing Thrift using MDE
Re-implementing Thrift using MDE
 
Thesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptThesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.ppt
 
C# c# for beginners crash course master c# programming fast and easy today
C# c# for beginners crash course master c# programming fast and easy todayC# c# for beginners crash course master c# programming fast and easy today
C# c# for beginners crash course master c# programming fast and easy today
 
Chapter -1.ppt
Chapter -1.pptChapter -1.ppt
Chapter -1.ppt
 
Unit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptxUnit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptx
 
3rd presentation
3rd presentation3rd presentation
3rd presentation
 
From Conventional Machine Learning to Deep Learning and Beyond.pptx
From Conventional Machine Learning to Deep Learning and Beyond.pptxFrom Conventional Machine Learning to Deep Learning and Beyond.pptx
From Conventional Machine Learning to Deep Learning and Beyond.pptx
 
Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual
 
A novel approach based on topic
A novel approach based on topicA novel approach based on topic
A novel approach based on topic
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 
66781291 java-lab-manual
66781291 java-lab-manual66781291 java-lab-manual
66781291 java-lab-manual
 

Recently uploaded

Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
christinelarrosa
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
LizaNolte
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
Vadym Kazulkin
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 

Recently uploaded (20)

Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 

ICPC

  • 1. Aiding Software Maintenance with Copy-and-Paste Clone-Awareness Patricia Jablonski and Daqing Hou Clarkson University ~ Potsdam, NY USA Friday July 2, 2010 ~ ICPC 2010
  • 2. Source code is copied and pasted for reuse and then it is modified to fit a specific task The correspondence (similarity) relationship between the clones can be useful information during modification and debugging Having to manually identify and consistently change clones can be difficult over time Cloning increases source code maintenance and can lead to undetected errors in the code Copy, Paste, and Modify
  • 3. Proactive tracking of copy-and-paste clones upon creation (using abstract syntax trees) Features of CnP tested in this user study CnP clone visualization Shows the programmer where related clones are CReN identifier renaming Assists the programmer in renaming identifiers consistently within clones LexId substring renaming Assists the programmer in renaming substrings consistently within clones The CnP Software Tool
  • 5. Programmers often make small modifications to pasted code (like to its identifier names and literal constants) for it to fit its task CReN is an Eclipse plug-in that uses CnP’s clone tracking and visualization, and groups instances of the same identifier within a clone All instances of the same identifier are renamed together when any one instance is edited by the programmer This helps prevent inconsistencies (errors) CReN Identifier Renaming
  • 6. LexId is a separate Eclipse plug-in (part of CnP) that adds onto CReN’s functionality LexId groups and renames together common substrings between different identifiers within a clone Recall that CReN renames instances of the same whole identifier name within a clone LexId focuses on inferring the lexical patterns LexId divides identifiers into substrings (standard Java CamelCase is supported) LexId Substring Renaming
  • 7. CnP Clone Visualization Hypotheses CnP’s clone visualization makes it faster for programmers to find software bugs in copied-and-pasted code than debugging manually or with other tools, when the cloning information is not fresh in their memories. CnP’s clone visualization makes it faster and less error-prone for programmers to make modifications to copied-and-pasted code than modifying without visualization, when the cloning information is not fresh in their memories. User Study – CnP Visualization
  • 8. CReN Identifier Renaming Hypotheses Using CReN to rename identifier instances consistently in copied-and-pasted code is quicker than performing the same task manually or with other tools CReN prevents such inconsistent renaming errors that can happen otherwise. User Study – CReN Renaming
  • 9. LexId Substring Renaming Hypotheses Using LexId to rename substring instances consistently in copied-and-pasted code is quicker than performing the same task manually or with other tools. LexId prevents such inconsistent renaming errors that can happen otherwise. User Study – LexId Renaming
  • 11. Recruitment email was sent to all Clarkson University computer science and engineering undergraduate and graduate students 14 male subjects participated in the user study – 8 undergraduate, 6 graduate students Knowledge of Java and Swing were required Familiarity with IDEs, especially Eclipse, was preferred, but not necessary Subjects had different levels of prior experience and knowledge Subject Characteristics
  • 12. Subjects came one at a time to a user study lab for a session between 1 and 2 hours long Subjects were presented with background about the problems of copy-and-paste clones, the 3 CnP features, and other tools Subjects were shown the source code and graphical Paint program used for the tasks Subjects were encouraged to work efficiently (with accuracy and speed) Subjects were recorded with video/audio Study Procedure
  • 14. Before starting a task, the current task’s description was read and questions answered The subject could use the instruction sheet, a sheet with the identifier names labeled, and an online Swing tutorial during the study The Paint program for the task was run for the subject to see the task’s problem visually The subjects were told whether the current task involved CnP, and if not, about some other (optional) tools that they could use Task Descriptions
  • 15. Similar tasks were paired together Task 1 & 2 – debugging, CnP clone visualization Task 3 & 4 – modification, CnP clone visualization Task 5 & 6 – renaming, CReN identifier renaming Task 7 & 8 – renaming, LexId substring renaming Subjects completed each of the 8 tasks once, alternating with and without the tool Odd-numbered subjects performed the first task in each pair with tool support, while even-numbered subjects performed the first tasks without the tool Tasks were paired rather than pairing the subjects Task Pairs
  • 16. For subjects who had CnP support for a task, the clone groups were already highlighted with different colors in PaintWindow.java 5 clone groups considered copy and pastes: Red (r), green (g), blue (b), thickness (t) slider/panel Color panel and thickness panel Tool panel and clear/undo panel The UI constraints for each of the four panels The declaration of the two change listeners Subjects without CnP could use CCFinderX CnP Visualization Tasks
  • 17. Task 1: Moving the blue slider does not change the pixel color. Debugging Tasks – Task 1 rSlider should be bSlider (on line 120)
  • 18. Task 2: Moving the thickness slider does not change the pixel thickness. Debugging Tasks – Task 2 colorChangeListener should be thicknessChangeListener (on line 142)
  • 19. Task 3: Add a titled border to colorPanel and to thicknessPanel. Modification Tasks – Task 3
  • 21. Task 4: Add color to the label of each color slider – red, green, and blue. Modification Tasks – Task 4
  • 23. Task 5: Rename colorPanel to thicknessPanel and rPanel to tPanel within the clone. Renaming Tasks (with CReN)
  • 24. Task 6: Rename toolPanel to clearUndoPanel, pencilButton to clearButton, and eraserButton to undoButton within the clone. Renaming Tasks (with CReN)
  • 25. Task 7: Rename rPanel to gPanel and rSlider to gSlider in the green slider clone (shown), and rPanel to bPanel and rSlider to bSlider in the blue slider clone. Renaming Tasks (with LexId)
  • 26. Task 8: Rename bPanel to tPanel and bSlider to tSlider in the thickness slider clone. Renaming Tasks (with LexId)
  • 27. Results – Time per Task The time (in minutes) to complete each pair of tasks.
  • 28. Results – Time per Task Statistical hypothesis testing on the paired time data.
  • 29. Results – Solution Correctness Correct states when running the program or when finished.
  • 30. Results – Completion Method Number of subjects who used each location and inspection method for debugging and modification tasks.
  • 31. Results – Completion Method Number of times each renaming method was used for renaming tasks.
  • 32. Confounding factors for clone visualization Clone visualization is not forced on the user Subjects would have produced correct solutions to Task 3 if they had made use of cloning information Varying levels of subjects’ prior experience Threats to validity Some subjects had more knowledge/experience Tasks close to real-world GUI programming tasks Tool design Need to further improve the clone visualization Need to tell programmers exactly what is renamed Discussion
  • 33. Clone visualization Some other tools use colored bars, markers, rulers Many others use separate views that programmers need to invoke or relatively complex graphs that they need to learn and understand Related tools Find & Replace Rename Refactoring Linked Renaming Rename Type Refactoring Vaci Related Work
  • 34. User study tested CnP’s clone visualization and renaming features (CReN and LexId) CReN and LexId both perform statistically quicker than without them on similar tasks CReN and LexId both help prevent inconsistent renaming that otherwise happens Since CnP’s clone visualization was not forced on the user, some subjects may not have used it even when it was present during a particular debugging or modification task Cloning information may be more useful to people without significant prior knowledge/experience Conclusion

Editor's Notes

  1. CnP clone visualization has distinction between clone groups and the clone origin and its subsequent pastes. All clones within the same group are colored with the same color of bars (for example, yellow). A different clone group’s bars could be colored red, etc. Each paste’s bar has a slightly darker shade of the color (for example, the origin’s bar is a regular shade of yellow, the first paste has a little darker yellow color for its bar, the second paste has a slightly more grayed yellow bar, etc.).
  2. 7 subjects had a long-time knowledge of both Java and Swing 3 subjects had a long-time knowledge of Java but only recent knowledge of Swing 4 remaining subjects reported having relatively recent knowledge of both Java and Swing (having learned them within the past two years) 7 subjects said that they have written at least 10,000 lines of Java code since they have known the language The other 7 gave a lower estimate when describing their Java programming experience- 10 subjects said that the software that they have written in Java were for courses only = “considered themselves to be knowledgeable about Java and Swing, but not regular users of them”- The other 4 subjects had worked on software projects in industry = “considered themselves to be ‘very experienced’”
  3. We presented background information to the subject about what code clones are and problems that can result from copy-and-paste programming. We then gave the subject a short introduction to our software tool’s three features, explaining how they address the mentioned copy-paste-modify issues, and told them about the other tools that they could use during the experiment when they were doing a task without CnP. We told the subjects that all tasks in the user study would be performed in one file (PaintWindow.java, which is 264 lines of code).- As an incentive to work as efficiently as possible, we told everyone that we would provide extra compensation to the four subjects who completed the eight tasks with the best accuracy and speed. Each task had a time limit that the subject was told about in advance.- We asked that they talk aloud while completing each task, so that we could better understand their thoughts and actions, and we had them announce when they were finished with the task. The subjects were told that their session was being recorded with TechSmith’s Morae software, which captured the activity on the computer screen and recorded the user with video and audio.
  4. Each pair of tasks (Tasks 1 & 2, Tasks 3 & 4, Tasks 5 & 6, and Tasks 7 & 8) was designed to be very similar in terms of difficulty and effort, yet different enough that there would not be a learning effect.- Although odd-numbered subjects always performed the first task in each task pair with tool support, this is not a problem with the experiment design and would not create bias because each task category was unique and unrelated to the previously done pairs.- Our subject sample size was 14, not 7. We paired similar tasks together rather than pairing subjects together for comparison to avoid introducing this variable into the study. The same subject’s performance on one of the tasks in a pair with the tool present was compared with his own performance on the other task in the pair without the tool available, hence we did not need to take into account the subjects’ expertise and experience when establishing the pairs.
  5. The UI constraints for each panel: the tool panel, the color panel, the thickness panel, and the clear/undo panel The declaration of the thickness change listener and the declaration of the color change listener- Using a clone detection tool or manual searching are traditional ways to find the clones without CnP. We chose CCFinderX because its algorithm is token-based, which is known to have high recall. CCFinderX also has a graphical interface, is available for free download, and is easy to install and use. We preinstalled it, showed the subjects how to use it, and provided written instructions that they could refer back to.
  6. Find & Replace in Eclipse allows the programmer to find specified text and replace it with another text. Find & Replace is simply a text-based search and has no knowledge of the structure of the program. It does not infer intent and must be initially requested by the programmer. In addition, Find & Replace is not limited to within a clone code fragment, so the programmer must know where renaming in the clone begins and ends and manually replace only those instances.- The Rename refactoring allows the programmer to rename various program elements. As such, binding is an important condition for it to work, which is not necessary for CReN. Furthermore, Rename is automatically applied to the whole project instead of a clone.- Linked Renaming allows the programmer to rename identifiers within a file scope, while CReN can be applied across multiple files. Furthermore, Linked Renaming neither works with code that does not parse nor renames identifiers only within a clone as CReN does.- Eclipse’s Rename Type Refactoring feature allows similarly named variables and methods within a class to be updated when the class name is renamed. For example, when a class “Bar” is renamed to class “Foo”, the “fBar” variable and “createBar” method (both of type “Bar”) within the class are renamed to “fFoo” and “createFoo” if the programmer checks this option when invoking refactoring in Eclipse. LexId can do this same thing, but does not limit itself to the class scope.- Vaci detects contexts and identifiers, and then forms translation classes that can be used to detect an inconsistency in naming. It uses version control system information to track identifiers over software versions. Although Vaci can detect possible renaming inconsistencies, CReN and LexId instead proactively prevent the inconsistencies from occurring at all.