Font Size: a A A

Improving Tool Support for Software Developers through Refactoring Detection

Posted on:2016-09-02Degree:Ph.DType:Dissertation
University:North Carolina State UniversityCandidate:Ge, XiFull Text:PDF
GTID:1478390017967056Subject:Computer Science
Abstract/Summary:
With changing software requirements, developers need to maintain the source code of software systems to ensure their continuous usefulness. Maintaining software involves both the functional and nonfunctional improvements of the codebase. The functional improvements, such as adding new features and fixing defects, benefits external clients by enhancing or correcting the behavior of software systems. On the other hand, the nonfunctional improvements enhance the internal quality of the codebase, therefore increasing the longevity of the software under maintenance.;The nonfunctional improvements of codebase are also called refactoring. Existing studies show that refactoring improves the maintainability, testability and reusability of software systems. Therefore, refactoring becomes an essential and frequent activity of software developers. Developers can refactor their codebase manually. However, refactoring manually is both error-prone and time-consuming. To improve the correctness and efficiency of manual refactoring, researchers and developers implemented multiple refactoring tools. In addition, almost every mainstream Integrated Development Environment (IDE) integrates refactoring tools, exposing these tools to a large population of developers working in various programming languages.;However, refactoring tools are underused. Existing studies suggest that about 90% of refactorings were performed manually even though refactoring tools are available. To investigate the reason for this underuse problem, I conducted a formative study on 12 developers and found out that a developer sometimes starts manual refactoring without realizing so, thus missing the chance of invoking refactoring tools. To solve this late awareness problem, I integrate refactoring detection algorithms into the conventional refactoring engines, proposing a novel refactoring tool called BeneFactor that detects the start of a manual refactoring, reminds the developer that automated refactoring is available and finally finishes the started refactoring automatically.;Another reason for the underuse problem of refactoring tools is developers' lack of trust on the changes that refactoring tools apply on their codebases. To solve this problem, I combined the refactoring detection technique with a static analysis technique to delegate refactoring support to the error messages in IDEs. The proof-of-concept tool, called GhostFactor, detects manual refactorings, checks conditions retrospectively and notifies the developer if it finds an error in the performed refactoring. A controlled study with eight developers shows that GhostFactor improves the correctness of manual refactorings significantly.;Beyond helping developers refactor correctly and efficiently, the refactoring detection technique can also improve change comprehension. Code review is a commonly adopted activity among developers working on the same project. By examining each others' code changes, code review can detect defects, correct bad programming practices and transfer project-specific knowledge among team members. However, during code review, developers have the different concerns about the refactoring and nonrefactoring changes. To understand such a difference, I conducted a survey study among Gerrit developers, finding that refactoring changes slow down code review and make correct review harder. To solve this problem, I designed a refactoring-aware code review tool that allows developers to review the refactoring and non-refactoring part in a given change separately.;In summary, this dissertation presents the application of the refactoring detection technique on several existing tools for software developers. I show that refactoring detection techniques can improve the usability of refactoring tools, enhance IDE error messages, and help code reviewers understand code changes.
Keywords/Search Tags:Refactoring, Developers, Software, Code, Changes
Related items