Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
10 external
26 programmers
11 grads
16 internal
Mohsen Vakilian
5 interns
E-mail: mvakili2@illinois.edu
Prior studies found an underutilization rate of about 90% [Murphy-Hill et al., ICSE 2009].
Refactorings
Extract Constant, Local Variable, or Method
Inline Constant, Local Variable, or Method
Pull Up
Push Down
Performed Count
821
283
9
8
Twitter: @MohsenVakilian
Eclipse-based data collectors
Semi-structured interviews
In addition to being fast and reliable, automated refactorings should be predictable.
parallelism and concurrency
security
type inference
library migration
FSE'09, ICSE'09, ICSE'11
ESSoS'09
OOPSLA'04, ECOOP'05
OOPSLA'05
The second [compositional] one provides a more stepwise view, giving me more intermediate feedback, as well as an ability to run my tests at each step. This goes a long way to making sure the refactoring is the right decision.
Usually, I’m extracting a common superclass to remove duplication from more than one similar class, so I’d need to be able to select multiple classes.
"Generally, I don't try them if I don't know what they do. I might occasionally try them if I can kind of guess what they do even though I'm not sure, but I don't do that very often."
1. Did you know that Eclipse supported this refactoring?
2. Do you know what this automated refactoring does?
3. Do you ever perform this refactoring manually? Why?
# of survey respondents
2
4
11
7
# of years of programming
1-2
2-5
5-10
> 10
Parasuraman and Riley, "Humans and Automation: Use, Misuse, Disuse, Abuse," J. Human Factors and Ergonomics Soc., 1997
Count
1,499
1,094
281
Count (%)
52
38
10
Complexity
Simple
Moderate
Complex
The data set consists of a total of 112,885 refactorings events from 1,188 active UDC users.
Even though refactoring tools have bugs [FSE'07, OOPSLA'08, bug repositories], they are highly reliable.
of 26 automated refactorings were unknown to the majority of our interviewees, e.g. Move Instance Method.
1. Refactoring Closely Related Entities
2. Adapting Extract Method
3. Backtracking Refactorings
4. Composition-over-configuration
5. Multiple Refactorings on an Entity
University of Illinois at Urbana-Champaign
Programmers refactor frequently [Xing et al., ICSM 2006], [Murphy-Hill et al., ICSE 2009].
"[...] If it affects only one file then I kind of know exactly what the refactoring does and I can look at the result instantly afterwards. [...] If the thing that the [refactoring] tool does is so complicated that it isn't easy to figure out things are alright, I'm kind of discouraged to use the tool."
"To me, whenever you go into these refactorings you have some dialogs and you have to figure out what it's doing [...]"
9
3
0
7
1
4
7
0
5
9
2
1
6
4
2
7
3
2
# of interviewees
lengths of interviews
9
1 hour
duration of the study
duration of programming
# of automated refactorings
3 months
1,268 hours
3,049
We analyzed the UDC data that was collected during 20 months from 195,105 users.
The wizard gives this illusion of just doing everything for you. [...] The downside is that there were a number of options that I read and didn’t quite make sense of, and said I guess I don’t have to care about that. And, of course, I found my sorrow that that wasn’t true. It did things that I completely didn’t expect. [...] And, it doesn’t give control.
of 26 automated refactorings had names unfamiliar to the majority of our interviewees, e.g. Generalize Declared Type.
I was not sure if it [the compositional refactoring tool] was seeing the full picture of the changes. Since it was stepwise [and] I’m doing [each step] one by one, I’m not sure if each of the steps is going to be integrated correctly.
"There is also a notion of not trusting the [refactoring] tool. If the interface of the tool is not good enough, how do I know that the implementation is not sketchy?"
"I know that there are many refactorings. But, many times I think that it's easier to just do something manually than try to learn a very particular refactoring that does something that I don't do very often."
of 26 automated refactorings were known to but underused by the majority of our interviewees, e.g. Extract Class.
94
77
54
83
89
31
13
6
Code modification may not be accurate as affected resource <name> has compile errors.
Found potential matches. Please review changes on the preview page.
Selected statements contain a return statement but not all possible execution flows end in a return. Semantics may not be preserved if you proceed.
A variable with name <name> is already defined in visible scope.
Warning
Error
Error
Warning
"Most of them [the automated refactorings] I know about by using Quick Assist. [...] Quick Assist will tell me if they are applicable in a certain context. [...] It always annoys me when they [automated refactorings] are not available through Quick Assist like Change Method Signature. [...] I really like Quick Assist."
"[...] I admit I don't really enjoy looking at diffs and I prefer to get a sense of the change (if it is local) by undoing/redoing, often several times."
"[...] Doing it [a refactoring] manually gives me a sense of how things have changed as a design review so that I can see the different options and reevaluate my choices."