Back to search

Schulich School of Engineering

Domain Adaptation for Automated Program Repair

Abstract

dc:description.abstract

Automated Program Repair (APR) is defined as the process of fixing a bug/defect in the source code by an automated tool. APR methods have recently experienced promising results by leveraging state-of-the-art Neural Language Processing (NLP) techniques. APR tools such as TFix and CodeXGLUE that combine text-to-text transformers with software-specific techniques are outperforming alternatives these days. However, all these methods are limited with respect to Domain Shift. In other words, APR models are trained and tested on the same set of projects (i.e., when fixing a bug from project A, the model has already seen example fixed bugs from project A in the training set). However, in the real world, APR models are meant to be generalizable to new and different projects. Therefore, there is a potential threat that the proposed APR models with high effectiveness, reported in the studies, perform poorly when the characteristics of the new project or its bugs are different (domain shift). In this study, we first define the problem of domain shift in software engineering and automated program repair. Next we measure the potential damage of domain shift on two state-of-the-art APR methods (TFix and CodeXGLUE). Based on this observation, we then propose a domain adaptation framework that can adapt an APR method for a given target project. We conduct an empirical study with three domain adaptation methods and two APR models on 611 bugs from 19 projects. The results show that our proposed framework can improve the effectiveness of TFix by 13.05% and CodeXGLUE by 23.4%, in terms of “Exact Match”. Through experiments, we also show that the framework provides high efficiency and reliability (in terms of exposure bias). Another contribution of this study is the proposal of a data synthesis method to address the lack of labeled data in APR (bugs and their fixes). We leverage transformers to create a bug generator model. We use the generated synthetic data to domain adapt TFix and CodeXGLUE on the projects with no data (Zero-shot learning), which results in an average improvement of 5.76% and 24.42% for TFix and CodeXGLUE, respectively.

Degree

thesis:*
Name thesis:degree_name
Master of Science (MSc)
Discipline thesis:degree_discipline
Engineering – Electrical & Computer
Grantor dc:publisher.institution
Schulich School of Engineering
Year dc:date.issued
2022

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Zirak, Armin
Advisor dc:contributor.advisor
  • Hemmati, Hadi
Committee members dc:contributor.committeemember
  • Pinheiro Bento, Mariana
  • Moshirpour, Mohammad

Subjects

dc:subject × 5

Rights

dc:rights
Statement dc:rights
  • University of Calgary graduate students retain copyright ownership and moral rights for their thesis. You may use this material in any way that is permitted by the Copyright Act or through licensing that has been assigned to the document. For uses that are not allowable under copyright legislation or licensing, you are required to seek permission.
Language dc:language.iso
eng

Identifiers

dc:identifier.*
Dc Identifier Citation
Zirak, A. (2022). Domain adaptation for Automated Program Repair (Master's thesis, University of Calgary, Calgary, Canada). Retrieved from https://prism.ucalgary.ca.

Chain of custody

source
Harvested from
University of Calgary
Base URL
ucalgary.scholaris.ca/server/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
citation

Zirak, Armin. Domain Adaptation for Automated Program Repair. Schulich School of Engineering, 2022. http://hdl.handle.net/1880/115167