Managing Software Evolution Through Semantic History Slicing
Yi Li
University of Toronto, 2018
Abstract: Software change histories are results of incremental updates made by developers. As a byproduct of the software development process, change history is surprisingly useful for understanding, maintaining and reusing software. However, traditional commit-based sequential organization of version histories lacks semantic structure and thus is insufficient for many development tasks that require high-level, semantic understanding of program functionality. In this dissertation, we propose a new semantics-based view of software version histories, where a set of related changes satisfying a common high level property (also known as slicing criteria) is recognized as a semantic history slice. As one concrete instantiation, test cases exercising a software functionality can be used as slicing criteria to identify changes implementing the particular functionality. Specifically, we present a family of automated techniques which analyze the semantics of historical changes and assist developers in many practical software evolution tasks. First, we introduce CSlicer, an efficient static history slicing algorithm which requires only a one-time effort for compilation and test execution. It mostly relies on static analysis of dependencies between change sets and is therefore inexpensive in terms of running time but can be imprecise. Second, we present Definer, a dynamic history slicing algorithm based on delta refinement. It executes tests multiple times and observes the test results while attempting to shorten the history slices iteratively. The semantic slices found by the dynamic approach are guaranteed to be minimal, but the running time can be much longer. Finally, we describe the design and implementation of a Web-based semantic slicing framework CSlicerCloud which aims to find balance between performance and precision, unifies different history slicing algorithms and provides software developers a flexible and ready-to-use environment for various evolution management tasks. We have successfully applied the history slicing techniques in many development tasks including creating focused pull requests, back-porting bug fixes, locating feature implementations and building feature models to assist evolution understanding. For validation, we evaluate our approaches on a benchmark of developer-annotated version history instances obtained from real-world open-source software projects from GitHub.