Home | Publications

Patanamon Thongtanunam, Chanathip Pornprasit, Chakkrit Tantithamthavorn

The International Conference on Software Engineering

Code review is effective, but human-intensive (e.g., developers need to manually modify source code until it is approved). Recently, prior work proposed a Neural Machine Translation (NMT) approach to automatically transform source code to the version that has been reviewed and approved (i.e., the after version). Yet, its performance is still sub-optimal when the after version has new identifiers or literals (e.g., renamed variables) or has many code tokens. To address these limitations, we proposed AutoTransform which leverages a Byte-Pair Encoding (BPE) approach to handle new tokens and a Transformer-based NMT architecture to handle long sequences. We evaluated our approach based on 147,553 changed methods with and without new tokens for both small and medium sizes. The results showed that our AutoTransform can correctly transform 34-526 changed methods, which is at least 262% higher than the prior work, highlighting the substantial improvement of our approach for code transformation in the context of code review. This work contributes towards automated code transform for code reviews, which could help developers reduce their effort in modifying source code during the code review process