code, software visualization tools have developed ... Programmers still expect to use software visualization ... intelli
A Study on Guiding Programmers’ Code Navigation with a Graphical Code Recommender Seonah Lee and Sungwon Kang August 10, 2011
Outline 1. Motivation
2. Previous Studies / Approaches 3. Our Study
4. Study Results 5. Summary
SERA 2011
2
1. Motivation To facilitate programmers’ comprehension of
code, software visualization tools have developed as comprehension aids.
Program comprehension is an activity of seeking information
SERA 2011
X
software visualization tools do not responsively provide the relevant information that programmers seek
3
2. Previous Studies / Approaches Previous Studies Previous Approaches Diagrammatic Support : CodeCanvas,
CodeBubble Historical-based Code Recommenders : TeamTracks, Mylyn
SERA 2011
4
Previous Studies Software visualization tools have generally failed
to impact on programmers’ code comprehension [Reiss, 2005] Programmers frequently use diagrams, they
rarely use diagramming tools [Cherubini, 2007] Programmers still expect to use software
visualization tools for their code comprehension [Lee, 2008] SERA 2011
5
Previous Approaches (1/2) Diagrammatic Support for Program Comprehension Provide a full overview of a software system ex. Code Canvas [DeLine, 2010] Incrementally visualize the parts of code base that a
programmer navigates ex. Code Bubble [Bragdon, 2010]
SERA 2011
6
Previous Approaches (2/2) History-based Code Recommenders Recommend those code elements historically
associated with the method that a programmer selects ex. ex. TeamTracks [DeLine, 2005], ROSE [Zimmermann, 2004]
Display a collection of code when a programmer
selects a task ID. ex. Mylyn [Kersten, 2006]
SERA 2011
7
3. Our Study
Research Question Research Approach Our Prototype Study Format Interview Questions
SERA 2011
8
Research Question Problem
The shortcoming of software visualization tools is not to provide the relevant information that programmers seek
Goal
To make a software visualization tool provide informative diagrams
Question
What diagrammatic content programmers want to see and when they want to see it?
SERA 2011
9
Research Approach Wizard of Oz study A research method where participants interact with an
intelligent system, actually operated by an unseen human being—a wizard operator
Use a prototype tool
Interview
Revising the prototype SERA 2011
10
Our Prototype A Graphical Code Recommender (GCR) According to a programmer’s interactions with IDE, it recommends a
diagram in a graphical view
SERA 2011
11
Study Format Participants: 11 professional programmers 5 years of industrial experience 4 years of experience with Java 2.6 years of experience with Eclipse
1~4 programming tasks on the JHotDraw 6.01b 10 minute preparation 1 hour task session 30 minute interview Task 1-Node 2-Arrow 3-Duplicate 4-Size SERA 2011
Description Make a connection from and to the corners of a node Change an arrow tip according to the menu Make a short-cut key for the duplicate command Inform the size of an activity pane in the status bar 12
Study Format Data Collection Taking pictures of the displayed diagram Recording participants’ voice Noting the participants’ comments
Initial Paper Prototype
Structural Information (SI) SERA 2011
Navigational Information (NI) 13
Study Format Iteration
1st iteration
2nd iteration
3rd iteration
SERA 2011
Prototype
Study format
A paper prototype of two types: Controlled by a wizard operator - Structural Information (SI) - Participants: 1a & 1b - Navigational Information (NI) - Tasks: Task 2
An initially computerized prototype
A revised computerized prototype
Partly controlled by a wizard operator - Participants: 2c, 2d & 2e - Tasks: Task 2 & 3
Not controlled by a wizard operator - Participants: 3f, 3g, 3h, 3i, 3j & 3k - Tasks: Task 1, 2, & 3 14
Interview Questions Q1: do programmers find a recommended
view useful when navigating the code? Q2: what diagrammatic contents do
programmers expect to see in the view? Q3: when do programmers expect to see the
diagrammatic contents?
SERA 2011
15
4. Study Results
Revisions through Iterations Q1: do programmers find a recommended
view useful when navigating the code? Q2: what diagrammatic contents do
programmers expect to see in the view? Q3: when do programmers expect to see the
diagrammatic contents?
SERA 2011
16
Revisions through Iterations 1st Iteration: What diagrammatic contents do programmers expect ? Feedback: NI-typed diagrams > SI-typed diagrams
Revision: To show Navigational Information (NI)
2nd Iteration: When do programmers expect to see the diagrammatic contents? Feedback: A participant was given a diagram by a wizard operator after 10 minutes. Revision: To shorten the time intervals from 5~10 to 3~5 minutes
3rd Iteration: do programmers find a recommended view useful when navigating the code base? Feedback: “very good”(3/6), “Good” (2/6), “Fair” (1/6) No Revision, used a questionnaire to rate participants’ preferences SERA 2011
17
Result: Do programmers find a graphical view useful? Many participants (9 of 11: 1a, 1b, 2c, 2e, 3g, 3h, 3i,
3j, 3k) positively evaluated the given graphical view, while a few participants (2 of 11: 2d, 3f) negatively evaluated. The six participants’ rate in the last iteration
SERA 2011
18
Result: Do programmers find a graphical view useful?
2e
3k
SERA 2011
“It helped me find entry points […] I was able to select a method to examine from here.”
“Uh, here are all answers”
3h
“It provides a crucial hint”
“I did not understand how this class view showed up […]”
2d
19
Result: What diagrammatic contents do programmers find useful? Diagrammatic Contents
Participant ID
Task relevant methods
2c, 2e, 3g, 3h, 3k
Relationships among classes
1a, 1b, 2c
A class hierarchy
2d, 3f, 3j
An overview
2c, 2d, 3k
Description of methods
2e, 3i
SERA 2011
20
Result: When do programmers find a graphical view useful? It was difficult to determine an optimal time
interval of view change as it heavily relies on the given programmer’s needs. Though, we found that a graphical view changing in 1~3 minutes on side monitor did not disturb the programmers’ work. Time Interval
Participant ID
5~10 minutes
1b, 2e
3~5 minutes
1a, 2c, 2d
1~3 minutes
3f, 3g, 3h, 3i, 3j, 3k
SERA 2011
21
5. Summary We suggest a graphical code recommender that
instantly recommends new parts of a code base that are pertinent to a programmer’s task as a programmer navigates the code base The participants stated that the graphical view was very helpful, in particular when they were uncertain about where to look while exploring
the code base.
SERA 2011
22
Question?
Seonah Lee
[email protected]
SERA 2011
23