srcDiff: A syntactic differencing approach to improve the understandability of deltas
- 21 October 2019
- journal article
- research article
- Published by Wiley in Journal of Software: Evolution and Process
- Vol. 32 (4)
Abstract
An efficient and scalable rule‐based syntactic differencing approach is presented. The tool srcDiff is built upon the srcML infrastructure. srcML adds abstract syntactic information into the code via an XML format. A syntactic difference of srcML documents is then taken. During this process, the differences are further refined using a set of rules that model typical editing patterns of source code by developers. Thus, the resulting deltas model edits that are programmer centric versus a purely syntactic tree edit view. Other syntactic differencing approaches focus on obtaining an optimal tree edit distance with the assumption that this will produce an accurate difference. While this may work well for small or simple changes, the differences quickly become unreadable for more complex changes. By contrast, the approach presented here purposely deviates from an optimal tree edit difference in order to create a delta that is both easier to understand and better models changes between the original and modified. To evaluate the approach, a comparison user study against a state‐of‐the‐art syntactic differencing approach and two line‐based differencing tools is conducted as an online within‐participant study with about 70 subjects on 14 sample changes. The results provide support that the rule‐based syntactic differencing produces more accurate and understandable deltas.Keywords
Funding Information
- National Science Foundation (CNS 13‐05292/05217)
This publication has 17 references indexed in Scilit:
- Move-optimized source code tree differencing2016
- Fine-grained and accurate source code differencing2014
- srcML: An Infrastructure for the Exploration, Analysis, and Manipulation of Source Code: A Tool Demonstration2013
- RTEDProceedings of the VLDB Endowment, 2011
- Lightweight Transformation and Fact Extraction with the srcML Toolkit2011
- Effects of Questionnaire Length on Participation and Indicators of Response Quality in a Web SurveyPublic Opinion Quarterly, 2009
- JDiff: A differencing technique and tool for object-oriented programsAutomated Software Engineering, 2006
- A differencing algorithm for object-oriented programs2004
- Response Rate and Response Quality of Internet-Based Surveys: An Experimental StudyMarketing Letters, 2004
- AnO(ND) difference algorithm and its variationsAlgorithmica, 1986