Abstract

Many search-based Automatic Program Repair (APR) techniques employ a set of repair patterns to generate candidate patches. Regarding repair pattern selection, existing search-based APR techniques either randomly select a repair pattern from the repair pattern set to apply or prioritize all repair patterns based on the bug's context information. In this paper, we introduce PatternNet, a multi-view feature fusion model capable of predicting the repair pattern for a reported software bug. To accomplish this task, PatternNet first extracts multi-view features from the pair of buggy code and bug report using different models. Specifically, a transformer-based model (i.e., UniXcoder) is utilized to obtain the bimodal feature representation of the buggy code and bug report. Additionally, an Abstract Syntax Tree (AST)-based neural model (i.e., ASTNN) is employed to learn the feature representation of the buggy code. Second, a co-attention mechanism is adopted to capture the dependencies between the statement trees in the AST of the buggy code and the textual tokens of the reported bug, resulting in co-attentive features between statement trees and reported bug's textual tokens. Finally, these multi-view features are combined into a unified representation using a feature fusion network. We quantitatively demonstrate the effectiveness of PatternNet and the feature fusion network for predicting software bug repair patterns.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call