Computer Science Department
School of Computer Science, Carnegie Mellon University
Automatic Repair of Framework Applications
Developers commonly build framework applications. Developers who use frameworks get a productivity boost from being able to reuse parts of previous applications that have been shown to work in a given domain. However, the reuse provided by frameworks also comes with a variety of challenges. Frameworks impose many assumptions about a framework application on developers and require developers to write applications in a way that conforms to the framework's expectations. To provide the benefits of framework reuse to developers of new applications, frameworks require developers to build applications using programming concepts (such as inversion of control, where the framework calls the unique parts of the framework application only when required, instead of the unique framework application code controlling the execution flow of the application) that either do not occur in other programming situations or occur in a significantly higher frequency in framework development. The different programming concepts that developers encounter when creating framework applications present problems to developers. The goal of this dissertation is to address the problems that framework application developers encounter with tool support.
This dissertation presents a structured process for assisting framework application developers with tool support. First, I identified the challenges that developers faced in the framework application development process. This study demonstrated that an automated repair technique for framework applications would benefit developers. An automated repair technique needs to be able to both identify the problem and then create a possible repair for the problem. The second part of this dissertation discusses a strategy for automatically identifying problems in framework applications while the third part of the dissertation discusses an approach to generate repairs for framework application problems.
As mentioned earlier, the first step in assisting framework application developers was to gain an understanding of the problems that framework application developers encounter in the framework application development process. Online developer sites, like StackOverflow, demonstrated the difficulty that developers have fixing problems in framework applications and leads to the insight that improving the framework application debugging process would benefit developers. Based on these insights, I performed an exploratory study to investigate the framework application debugging process. The exploratory study followed a mixed-methods approach and adapted well-known qualitative research methodologies, such as grounded theory, to the debugging cases of interest. To approach framework application problems in a rigorous manner, I focused on directives, testable and possibly surprising requirements for how a framework application should interact with a framework. Through a preliminary study on framework directives, I found that violating directives can lead to seven different consequences – ways that errors are presented to developers. I then used the set of consequences to guide a debugging study on framework application debugging scenarios. I used directives to guide the problems in the debugging study. From the debugging study, I found that developers encountered challenges, such as understanding how inversion of control would affect objects passed to the framework application. The study also found that developers encountered particular difficulty debugging state-based issues, those where object instance variables contained values that conflicted with method call assumptions.
From this study, I theorized that framework application developers would benefit from an automated repair tool, tailored to fix state-based issues in framework applications. The automated repair tool would need both 1) a way to detect issues in framework applications and 2) to propose possible repairs. I created a static analysis tool to detect issues in framework applications. In this static analysis tool, a person knowledgeable with the framework converts the property to check into an API (Application Programming Interface) call, defined by a specification language I created. These API calls are then converted into composable checks to determine if the application violates the specification. I evaluated the language on a taxonomy of object protocols. I found that the language was able to easily support five out of seven categories. I also ran the checkers on real applications in the F-Droid dataset, which detected bugs in real applications.
The other part of the automated repair tool was the repair generation process. I created a tool, FrameFix, that uses common aspects of framework applications to propose repairs. The repair process includes moving methods to locations where objects may be in the right state and using similarly named methods from applications on GitHub to guide repairs. I found that the tool was able to repair a set of personally-created applications, problems injected into real applications, and problems found in real applications.
These projects were done with the goal that the techniques would apply to a wide variety of frameworks. The debugging study was conducted on two frameworks to ensure that conclusions were not framework-specific. While the static analysis check and the repair tool were built for only one framework (due to implementation limitations), the techniques the tool uses were designed in a way that were not framework-specific. The tools were evaluated over a large number (close to 2,000) real applications to demonstrate that they apply to real framework applications.
Srinivasan Seshan, Head, Computer Science Department
Srinivasan Seshan, Head, Computer Science Department