COMET: Generating Commit Messages using Delta Graph Context Representation
Abstract: Commit messages explain code changes in a commit and facilitate collaboration among developers. Several commit message generation approaches have been proposed; however, they exhibit limited success in capturing the context of code changes. We propose Comet (Context-Aware Commit Message Generation), a novel approach that captures context of code changes using a graph-based representation and leverages a transformer-based model to generate high-quality commit messages. Our proposed method utilizes delta graph that we developed to effectively represent code differences. We also introduce a customizable quality assurance module to identify optimal messages, mitigating subjectivity in commit messages. Experiments show that Comet outperforms state-of-the-art techniques in terms of bleu-norm and meteor metrics while being comparable in terms of rogue-l. Additionally, we compare the proposed approach with the popular gpt-3.5-turbo model, along with gpt-4-turbo; the most capable GPT model, over zero-shot, one-shot, and multi-shot settings. We found Comet outperforming the GPT models, on five and four metrics respectively and provide competitive results with the two other metrics. The study has implications for researchers, tool developers, and software developers. Software developers may utilize Comet to generate context-aware commit messages. Researchers and tool developers can apply the proposed delta graph technique in similar contexts, like code review summarization.
- Kapil Agrawal, Sadika Amreen and Audris Mockus “Commit quality in five high performance computing projects” In 2015 IEEE/ACM 1st International Workshop on Software Engineering for High Performance Computing in Science, 2015, pp. 24–29 IEEE
- “METEOR: An Automatic Metric for MT Evaluation with Improved Correlation with Human Judgments” In Proceedings of the ACL Workshop on Intrinsic and Extrinsic Evaluation Measures for Machine Translation and/or Summarization Ann Arbor, Michigan: Association for Computational Linguistics, 2005, pp. 65–72 URL: https://aclanthology.org/W05-0909
- “The relationship between commit message detail and defect proneness in java projects on github” In Proceedings of the 13th International Conference on Mining Software Repositories, 2016, pp. 496–499
- “Language models are few-shot learners” In Advances in neural information processing systems 33, 2020, pp. 1877–1901
- Raymond P.L. Buse and Westley R. Weimer “Automatically Documenting Program Changes” In Proceedings of the 25th IEEE/ACM International Conference on Automated Software Engineering, ASE ’10 Antwerp, Belgium: Association for Computing Machinery, 2010, pp. 33–42 DOI: 10.1145/1858996.1859005
- “Comet Models” Zenodo, 2023 DOI: 10.5281/zenodo.7902315
- Wikipedia Contributors “GPT-4” In Wikipedia Wikimedia Foundation, 2024 URL: https://en.wikipedia.org/wiki/GPT-4
- “On automatically generating commit messages via summarization of source code changes” In 2014 IEEE 14th International Working Conference on Source Code Analysis and Manipulation, 2014, pp. 275–284 IEEE
- “REMS: Recommending Extract Method Refactoring Opportunities via Multi-view Representation of Code Property Graph” In 2023 IEEE/ACM 31st International Conference on Program Comprehension (ICPC), 2023, pp. 191–202 DOI: 10.1109/ICPC58990.2023.00034
- Smart Dalhousie university “COMET repository”, 2023 URL: https://github.com/SMART-Dal/Comet
- “Evaluating commit message generation: to BLEU or not to BLEU?” In Proceedings of the ACM/IEEE 44th International Conference on Software Engineering: New Ideas and Emerging Results, 2022, pp. 31–35
- “FIRA: fine-grained graph-based code change representation for automated commit message generation” In Proceedings of the 44th International Conference on Software Engineering, 2022, pp. 970–981
- ““So what if ChatGPT wrote it?” Multidisciplinary perspectives on opportunities, challenges and implications of generative conversational AI for research, practice and policy” In International Journal of Information Management 71 Elsevier, 2023, pp. 102642
- “Codebert: A pre-trained model for programming and natural languages” In arXiv preprint arXiv:2002.08155, 2020
- “Deep API learning” In Proceedings of the 2016 24th ACM SIGSOFT international symposium on foundations of software engineering, 2016, pp. 631–642
- “GraphCodeBERT: Pre-training Code Representations with Data Flow”, 2021 arXiv:2009.08366 [cs.SE]
- S.R.P. Hal, M. Post and K. Wendel “Generating Commit Messages from Git Diffs”, 2019 arXiv:1911.11690 [cs.SE]
- Ahmed E Hassan “Automated classification of change messages in open source projects” In Proceedings of the 2008 ACM symposium on Applied computing, 2008, pp. 837–841
- “Automatic classication of large changes into maintenance categories” In 2009 IEEE 17th International Conference on Program Comprehension, 2009, pp. 30–39 DOI: 10.1109/ICPC.2009.5090025
- “A probabilistic neural network-based approach for related software changes detection” In 2014 21st Asia-Pacific Software Engineering Conference 1, 2014, pp. 279–286 IEEE
- “Learning human-written commit messages to document code changes” In Journal of Computer Science and Technology 35 Springer, 2020, pp. 1258–1277
- Huggingface “Trainer - transformers 4.2.0 documentation” Accessed: May 3, 2023 In Trainer - transformers 4.2.0 documentation, https://huggingface.co/transformers/v4.2.2/main_classes/trainer.html, 2022
- “Codesearchnet challenge: Evaluating the state of semantic code search” In arXiv preprint arXiv:1909.09436, 2019
- “Javadoc tool” In Oracle.com, 2019 URL: https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
- Siyuan Jiang, Ameer Armaly and Collin McMillan “Automatically generating commit messages from diffs using neural machine translation” In 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE), 2017, pp. 135–146 IEEE
- Tae-Hwan Jung “Commitbert: Commit message generation using pre-trained programming language model” In arXiv preprint arXiv:2105.14242, 2021
- Thomas N Kipf and Max Welling “Semi-supervised classification with graph convolutional networks” In arXiv preprint arXiv:1609.02907, 2016
- “A Systematic Study and Comprehensive Evaluation of ChatGPT on Benchmark Datasets” In arXiv preprint arXiv:2305.18486, 2023
- “Boosting automatic commit classification into maintenance activities by utilizing source code changes” In Proceedings of the 13th International Conference on Predictive Models and Data Analytics in Software Engineering, 2017, pp. 97–106
- Qimai Li, Zhichao Han and Xiao-Ming Wu “Deeper insights into graph convolutional networks for semi-supervised learning” In Proceedings of the AAAI conference on artificial intelligence 32.1, 2018
- Chin-Yew Lin “Rouge: A package for automatic evaluation of summaries” In Text summarization branches out, 2004, pp. 74–81
- “Changescribe: A tool for automatically generating commit messages” In 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering 2, 2015, pp. 709–712 IEEE
- “Lost in the Middle: How Language Models Use Long Contexts” In arXiv preprint arXiv:2307.03172, 2023
- “ATOM: Commit message generation based on abstract syntax tree and hybrid ranking” In IEEE Transactions on Software Engineering 48.5 IEEE, 2020, pp. 1800–1817
- “Neural-Machine-Translation-Based Commit Message Generation: How Far Are We?” In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, ASE ’18 Montpellier, France: Association for Computing Machinery, 2018, pp. 373–384 DOI: 10.1145/3238147.3238190
- “Decoupled weight decay regularization” In arXiv preprint arXiv:1711.05101, 2017
- “Content aware source code change description generation” In Proceedings of the 11th International Conference on Natural Language Generation, 2018, pp. 119–128
- Pablo Loyola, Edison Marrese-Taylor and Yutaka Matsuo “A Neural Architecture for Generating Natural Language Descriptions from Source Code Changes”, 2017 arXiv:1704.04856 [cs.CL]
- “The Stanford CoreNLP natural language processing toolkit” In Proceedings of 52nd annual meeting of the association for computational linguistics: system demonstrations, 2014, pp. 55–60
- “ARENA: An Approach for the Automated Generation of Release Notes” In IEEE Transactions on Software Engineering 43.2, 2017, pp. 106–127 DOI: 10.1109/TSE.2016.2591536
- “Coregen: contextualized code representation learning for commit message generation” In Neurocomputing 459 Elsevier, 2021, pp. 97–107
- OpenAI “Introducing chatgpt” Accessed: May 3, 2023 In Introducing ChatGPT, https://openai.com/blog/chatgpt, 2022
- “Bleu: a method for automatic evaluation of machine translation” In Proceedings of the 40th annual meeting of the Association for Computational Linguistics, 2002, pp. 311–318
- OpenAI Platform “GPT best practices”, 2023 URL: https://platform.openai.com/docs/guides/gpt-best-practices
- qoomon “git-conventional-commits” Accessed: May 1, 2023 GitHub, https://github.com/qoomon/git-conventional-commits, 2023
- “Language models are unsupervised multitask learners” In OpenAI blog 1.8, 2019, pp. 9
- “Sequence Level Training with Recurrent Neural Networks”, 2016 arXiv:1511.06732 [cs.LG]
- Sarah Rastkar and Gail C. Murphy “Why did this code change?” In 2013 35th International Conference on Software Engineering (ICSE), 2013, pp. 1193–1196 DOI: 10.1109/ICSE.2013.6606676
- “Recommending refactorings via commit message analysis” In Information and Software Technology 126 Elsevier, 2020, pp. 106332
- Joern Documentation Blog RSS “Code property graph: Joern Documentation” Accessed: May 1, 2023, https://docs.joern.io/code-property-graph, 2023
- “Garbage in, garbage out: how purportedly great ML models can be screwed up by bad data” In Proceedings of Blackhat 2017, 2017
- “Bloom: A 176b-parameter open-access multilingual language model” In arXiv preprint arXiv:2211.05100, 2022
- “A survey on machine learning techniques applied to source code” In Journal of Systems and Software 209, 2024, pp. 111934 DOI: https://doi.org/10.1016/j.jss.2023.111934
- “RACE: Retrieval-augmented Commit Message Generation” In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, 2022, pp. 5520–5530
- Jonathan Sillito, Gail C Murphy and Kris De Volder “Asking and answering questions during a programming change task” In IEEE Transactions on Software Engineering 34.4 IEEE, 2008, pp. 434–451
- The Conventional Commits Specification “Conventional Commits” Accessed: May 1, 2023, https://www.conventionalcommits.org/, 2023
- “On the evaluation of commit message generation models: an experimental study” In 2021 IEEE International Conference on Software Maintenance and Evolution (ICSME), 2021, pp. 126–136 IEEE
- “How do software engineers understand code changes? An exploratory study in industry” In Proceedings of the ACM SIGSOFT 20th International symposium on the foundations of software engineering, 2012, pp. 1–11
- “Is ChatGPT the Ultimate Programming Assistant–How far is it?” In arXiv preprint arXiv:2304.11938, 2023
- “What makes a good commit message?” In Proceedings of the 44th International Conference on Software Engineering, 2022, pp. 2389–2401
- “Attention is All you Need” In Advances in Neural Information Processing Systems 30 Curran Associates, Inc., 2017 URL: https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf
- “Quality Assurance for Automated Commit Message Generation” In 2021 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER), 2021, pp. 260–271 DOI: 10.1109/SANER50967.2021.00032
- “Codet5: Identifier-aware unified pre-trained encoder-decoder models for code understanding and generation” In arXiv preprint arXiv:2109.00859, 2021
- “Chain-of-thought prompting elicits reasoning in large language models” In Advances in Neural Information Processing Systems 35, 2022, pp. 24824–24837
- “A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT”, 2023 arXiv:2302.11382 [cs.SE]
- “HuggingFace’s Transformers: State-of-the-art Natural Language Processing”, 2020 arXiv:1910.03771 [cs.CL]
- “BLOOM: A 176B-Parameter Open-Access Multilingual Language Model”, 2023 arXiv:2211.05100 [cs.CL]
- “CPGVA: Code Property Graph based Vulnerability Analysis by Deep Learning” In 2018 10th International Conference on Advanced Infocomm Technology (ICAIT), 2018, pp. 184–188 DOI: 10.1109/ICAIT.2018.8686548
- “Commit Message Generation for Source Code Changes” In IJCAI DOI: 10.24963/ijcai.2019/552
- “Modeling and discovering vulnerabilities with code property graphs” In 2014 IEEE Symposium on Security and Privacy, 2014, pp. 590–604 IEEE
- “Clustering Commits for Understanding the Intents of Implementation” In 2014 IEEE International Conference on Software Maintenance and Evolution, 2014, pp. 406–410 DOI: 10.1109/ICSME.2014.63
- “Automatically classifying software changes via discriminative topic model: Supporting multi-category and cross-project” In Journal of Systems and Software 113 Elsevier, 2016, pp. 296–308
- “OPT: Open Pre-trained Transformer Language Models”, 2022 arXiv:2205.01068 [cs.CL]
- “Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks” In Advances in neural information processing systems 32, 2019
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.