| Code comments are crucial for program comprehension and software maintenance.And code comments also require maintenance with code evolution.While developers sometimes neglect to update the corresponding comments when changing the code,bringing the code-comment inconsistent or bad comments.Such code comments are detrimental for software development and maintenance since they may mislead developers and trigger future bugs.Therefore,it is necessary to fix and avoid such bad comments.In order to solve the problem of bad comments from the source and update the comments with code evolution,the just-in-time code comment update was proposed by researchers as a promising way.In this paper,we first classify comment updates into code-indicative and non-code-indicative.And then perform an in-depth empirical analysis on previous studies.According to our study,we found that:(1)current techniques almost can only process code-indicative instances,which occupies 96.6%of the comments that are updated correctly.(2)current techniques are almost based on deep learning techniques,which are incredibly time-consuming.This study investigates the feasibility of designing a two-phase approach to cope with the weakness mentioned above.Specifically,we integrate nine distinctive features identified through our large-scale empirical analysis into a predictive model,which can predict whether the contents of comment update can be found in the corresponding code changes,namely,code-indicative updates.If so,we use a heuristic-based update which is specifically designed for code-indicative;otherwise,we utilize a specially designed deep learning model,which follows the encoder-decoder paradigm and adopts the Abstract Syntax Tree path technique,to infer the new comment based on the old comment and code change.Our evaluation shows that our approach outperforms the state-of-the-art technique by around 90%concerning the correct comments it generates.The evaluation result demonstrates that our approach can reduce developers’ edits required for update comments manually and avoid bad comment from the source.Via our in-depth analysis,we illustrate the rationale of each design decision as well as point out potential directions. |