CC2Vec: Distributed Representations of Code Changes

Thong Hoang, Hong Jin Kang, Julia Lawall, David Lo
3/12/2020
cs.SE

Official code: CC2Vec/CC2Vec (51 stars, last commit 2022-12-03).

Abstract

Existing work on software patches often use features specific to a single task. These works often rely on manually identified features, and human effort is required to identify these features for each task. In this work, we propose CC2Vec, a neural network model that learns a representation of code changes guided by their accompanying log messages, which represent the semantic intent of the code changes. CC2Vec models the hierarchical structure of a code change with the help of the attention mechanism and uses multiple comparison functions to identify the differences between the removed and added code. To evaluate if CC2Vec can produce a distributed representation of code changes that is general and useful for multiple tasks on software patches, we use the vectors produced by CC2Vec for three tasks: log message generation, bug fixing patch identification, and just-in-time defect prediction. In all tasks, the models using CC2Vec outperform the state-of-the-art techniques.

View on arXivView PDF

Code Implementations(1)

CC2Vec/CC2VecOfficial100%
5121PythonAug 24, 20193 years ago

Similar Papers

Cite this paper

@article{hoang2020ccvec,
  title  = {CC2Vec: Distributed Representations of Code Changes},
  author = {Thong Hoang and Hong Jin Kang and Julia Lawall and David Lo},
  year   = {2020},
  eprint = {2003.05620},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2003.05620}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2003.05620.svg)](https://codeofpaper.com/paper/2003.05620)

Discussion