Changes in source code are an inevitable part of software development. They are the results of indispensable activities such as fixing bugs or improving functionality. Descriptions for code changes (commit messages) help people better understand the changes. However, due to a lack of motivation and time pressure, writing high-quality commit messages remains reluctantly considered. Several methods have been proposed with the aim of automated commit message generation. However, the existing methods are still limited because they only utilise either the changed code or the changed code combined with surrounding statements. This paper proposes a method to represent code changes by combining the changed code and the unchanged code which have program dependence on the changed code. This method overcomes the limitations of current representations while improving the performance of 5/6 of state-of-the-art commit message generation methods by up to 15% in METEOR, 14% in ROUGE-L, and 10% in BLEU-4.
翻译:源代码变更是软件开发过程中不可避免的一部分,它们是修复缺陷或改进功能等必要活动的结果。代码变更的描述(提交信息)有助于人们更好地理解这些变更。然而,由于缺乏动力和时间压力,编写高质量的提交信息仍然令人望而却步。目前已提出多种方法旨在实现自动提交信息生成。然而,现有方法仍存在局限性,因为它们仅利用了变更代码本身,或仅将变更代码与周围语句相结合。本文提出了一种方法,通过将变更代码与对变更代码存在程序依赖关系的未变更代码相结合来表征代码变更。该方法克服了当前表示方式的局限性,同时使5/6的现有最先进提交信息生成方法在METEOR、ROUGE-L和BLEU-4指标上的性能分别提升了高达15%、14%和10%。