Developers often need to examine program changes during code reviews. However, it is difficult for developers to inspect systematic changes—similar, related changes that are scattered across multiple files. Developers cannot easily answer questions such as “what other code locations changed similar to this change?” and “are there any other locations that are similar to this code but are not updated?” Critics assists developers by (1) allows developers to customize a context-aware change template, (2) searches for systematic changes using the template, and (3) detects missing or inconsistent edits. Developers can interactively refine the customized change template to see corresponding search results. Critics has potential to improve developer productivity in inspecting large, scattered edits during code reviews. Critics is instantiated as Eclipse plug-in and is currently maintained by Tianyi Zhang and Myoungkyu Song.[pdf][demo][website]
Developers often package changes from multiple programming tasks to a single code review, resulting in large and loosely related changes. Such changes are usually interleaved with each other, making it hard to understand during cod review. During the summer internship in 2016, I worked with my mentors at MSR and the TSE group to build a customized CodeFlow client to allow developers to untangle, manage, and annotate program changes for the ease of change comprehension during peer code reviews. The CodeFlow client has been instrumented to gather telemetry data and has been deployed internally at Microsoft. The project is still ongoing and we'd like to see whether developers have less jumping-back-and-forth when understanding a program change and whether they spend less time on code review tasks with the assistance of our customized CodeFlow client.
Code reuse via copying and pasting is commonly practiced in software development. However, developers often find it difficult to check for behavioral consistency of the reused code due to a lack of test cases. In this project, we build the first test reuse and differential testing framework that reuses test cases from the original program and cross-checks runtime behaviors of reused code via differential testing. The test reuse problem is challenging due to variations of program source structures and calling contexts. Hereby we introduce a novel code transplantation technique to identify such variations and adapt the code for test reuse. We have evaluated this technique on 52 pairs of similar code (i.e., clones) in real-world projects and demonstrated its usefulness by detecting 2X more seeded faults compared with a static cloning bug finder.
GitHub has accumulated millions of open-source projects and the number of projects is still counting. The tremendous amount of code enables many potential code reuse scenarios that was not possible before. Prior research has been focusing on mining software repositories to retrieve API usage examples for functionality reuse. However, open-source code repositories capture not only functional code but also valuable assets such as test cases, specifications (often as annotations), and bug fixes. The goal of this project is to exploit large-scale code repositories to support code reuse in various domains, e.g., automated test generation, specification inference, bug detection, and automated repair. This project will investigate methods to (1) support various query modalities to accommodate different code reuse scenarios and (2) automatically generalize retrieved assets to reusable templates that can be applied to a target program.