srcDiff: A syntactic differencing approach to improve the understandability of deltas

An efficient and scalable rule‐based syntactic differencing approach is presented. The tool srcDiff is built upon the srcML infrastructure. srcML adds syntactic information into the code via an XML format. A syntactic difference of srcML documents is then taken. During this process, the differences...

Full description

Saved in:
Bibliographic Details
Published inJournal of software : evolution and process Vol. 32; no. 4
Main Authors Decker, Michael John, Collard, Michael L., Volkert, L. Gwenn, Maletic, Jonathan I.
Format Journal Article
LanguageEnglish
Published Chichester Wiley Subscription Services, Inc 01.04.2020
Subjects
Online AccessGet full text
ISSN2047-7473
2047-7481
DOI10.1002/smr.2226

Cover

More Information
Summary:An efficient and scalable rule‐based syntactic differencing approach is presented. The tool srcDiff is built upon the srcML infrastructure. srcML adds 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.
Bibliography:ObjectType-Article-1
SourceType-Scholarly Journals-1
ObjectType-Feature-2
content type line 14
ISSN:2047-7473
2047-7481
DOI:10.1002/smr.2226