The application of metamorphic testing(MT)on automatic program repair(APR-MT)is used to generate a patch without test oracles by examining whether the input metamorphic relation(MR)is satisfied or not.However,the deli...The application of metamorphic testing(MT)on automatic program repair(APR-MT)is used to generate a patch without test oracles by examining whether the input metamorphic relation(MR)is satisfied or not.However,the delivered patch is plausible since it may satisfy the input MR but violate other MRs.This inspires us to propose an improved approach to enhance the effectiveness of APR-MT with metamorphic relation group.Ourapproach involves three major steps.First,we formally define the repair process of APR-MT by building the model of automatic program repair and metamorphic testing separately.Then,we propose the advanced model of automatic program repair based on metamorphic relation group,named METARO^(3),which takes several MRs as input while only one MR is used in APR-MT.We additionally present two kinds of selection strategies to rank MRs in descending order of the fault detection capability,which helps shorten the repair time of finding a patch.To demonstrate the feasibility and procedure of our approach,an illustration example was conducted.The results show that METARO^(3) can improve the effectiveness of APR-MT significantly.展开更多
In recent years,automatic program repair approaches have developed rapidly in the field of software engineering.However,the existing program repair techniques based on genetic programming suffer from requiring verific...In recent years,automatic program repair approaches have developed rapidly in the field of software engineering.However,the existing program repair techniques based on genetic programming suffer from requiring verification of a large number of candidate patches,which consume a lot of computational resources.In this paper,we propose a random search and code similarity based automatic program repair(RSCSRepair).First,to reduce the verification computation effort for candidate patches,we introduce test filtering to reduce the number of test cases and use test case prioritization techniques to reconstruct a new set of test cases.Second,we use a combination of code similarity and random search for patch generation.Finally,we use a patch overfitting detection method to improve the quality of patches.In order to verify the performance of our approach,we conducted the experiments on the Defects4J benchmark.The experimental results show that RSCSRepair correctly repairs up to 54 bugs,with improvements of 14.3%,8.5%,14.3%and 10.3%for our approach compared with jKali,Nopol,CapGen and Sim Fix,respectively.展开更多
Fault localization techniques are originally proposed to assist in manual debugging by generally producing a rank list of suspicious locations.With the increasing popularity of automated program repair,the fault local...Fault localization techniques are originally proposed to assist in manual debugging by generally producing a rank list of suspicious locations.With the increasing popularity of automated program repair,the fault localization techniques have been introduced to effectively reduce the search space of automated program repair.Unlike developers who mainly focus on the rank information,current automated program repair has two strategies to use the fault localization information:suspiciousness-first algorithm(SFA)based on the suspiciousness accuracy and rank-first algorithm(RFA)relying on the rank accuracy.However,despite the fact that the two different usages are widely adopted by current automated program repair and may result in different repair results,little is known about the impacts of the two strategies on automated program repair.In this paper we empirically compare the performance of SFA and RFA in the context of automated program repair.Specifically,we implement the two strategies and six well-studied fault localization techniques into four state-of-the-art automated program repair tools,and then use these tools to perform repair experiments on 60 real-world bugs from Defects4J.Our study presents a number of interesting findings:RFA outperforms SFA in 70.02%of cases when measured by the number of candidate patches generated before a valid patch is found(NCP),while SFA performs better in parallel repair and patch diversity;the performance of SFA can be improved by increasing the suspiciousness accuracy of fault localization techniques;finally,we use SimFix that deploys SFA to successfully repair four extra Defects4J bugs which cannot be repaired by SimFix originally using RFA.These observations provide a new perspective for future research on the usage and improvement of fault localization in automated program repair.展开更多
软件系统在各行各业中发挥着不可忽视的作用,承载着大规模、高密度的数据,但软件系统中存在的种种缺陷一直以来困扰着系统的开发者,时刻威胁着系统数据要素的安全.自动代码修复(automated program repair,APR)技术旨在帮助开发者在软件...软件系统在各行各业中发挥着不可忽视的作用,承载着大规模、高密度的数据,但软件系统中存在的种种缺陷一直以来困扰着系统的开发者,时刻威胁着系统数据要素的安全.自动代码修复(automated program repair,APR)技术旨在帮助开发者在软件系统的开发过程中自动地修复代码中存在的缺陷,节约软件系统开发和维护成本,提高软件系统中数据要素的保密性、可用性和完整性.随着大语言模型(large language model,LLM)技术的发展,涌现出许多能力强大的代码大语言模型,并且代码LLM在APR领域的应用中表现出了强大的修复能力,弥补了传统方案对于代码理解能力、补丁生成能力方面的不足,进一步提高了代码修复工具的水平.全面调研分析了近年APR相关的高水平论文,总结了APR领域的最新发展,系统归纳了完形填空模式和神经机器翻译模式2类基于LLM的APR技术,并从模型类型、模型规模、修复的缺陷类型、修复的编程语言和修复方案优缺点等角度进行全方位的对比与研讨.同时,对APR数据集和评价APR修复能力的指标进行了梳理和分析,并且对现有的实证研究展开深入探讨.最后,分析了当前APR领域存在的挑战及未来的研究方向.展开更多
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 ...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 f usion model capable of predicting the repair pattern for a reported software bug.To accomplish this task,PatternNet first extracts multiview 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 i nto 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.展开更多
OBJECTIVE: To investigate the factors associated with sensory and motor recovery after the repair of upper limb peripheral nerve injuries. DATA SOURCES: The online PubMed database was searched for English articles d...OBJECTIVE: To investigate the factors associated with sensory and motor recovery after the repair of upper limb peripheral nerve injuries. DATA SOURCES: The online PubMed database was searched for English articles describing outcomes after the repair of median, ulnar, radial, and digital nerve injuries in humans with a publication date between 1 January 1990 and 16 February 2011. STUDY SELECTION: The following types of article were selected: (1) clinical trials describ- ing the repair of median, ulnar, radial, and digital nerve injuries published in English; and (2) studies that reported sufficient patient information, including age, mechanism of injury, nerve injured, injury location, defect length, repair time, repair method, and repair materials. SPSS 13.0 software was used to perform univariate and multivariate logistic regression analyses and to in- vestigate the patient and intervention factors associated with outcomes. MAIN OUTCOME MEASURES: Sensory function was assessed using the Mackinnon-Dellon scale and motor function was assessed using the manual muscle test. Satisfactory motor recovery was defined as grade M4 or M5, and satisfactory sensory recovery was defined as grade S3+ or S4. RESULTS: Seventy-one articles were included in this study. Univariate and multivariate logistic regression analyses showed that repair time, repair materials, and nerve injured were inde- pendent predictors of outcome after the repair of nerve injuries (P 〈 0.05), and that the nerve injured was the main factor affecting the rate of good to excellent recovery. CONCLUSION: Predictors of outcome after the repair of peripheral nerve injuries include age, gender, repair time, repair materials, nerve injured, defect length, and duration of follow-up.展开更多
基金The work was supported by a grant from National Natural Science Foundation of China(No.61772423).
文摘The application of metamorphic testing(MT)on automatic program repair(APR-MT)is used to generate a patch without test oracles by examining whether the input metamorphic relation(MR)is satisfied or not.However,the delivered patch is plausible since it may satisfy the input MR but violate other MRs.This inspires us to propose an improved approach to enhance the effectiveness of APR-MT with metamorphic relation group.Ourapproach involves three major steps.First,we formally define the repair process of APR-MT by building the model of automatic program repair and metamorphic testing separately.Then,we propose the advanced model of automatic program repair based on metamorphic relation group,named METARO^(3),which takes several MRs as input while only one MR is used in APR-MT.We additionally present two kinds of selection strategies to rank MRs in descending order of the fault detection capability,which helps shorten the repair time of finding a patch.To demonstrate the feasibility and procedure of our approach,an illustration example was conducted.The results show that METARO^(3) can improve the effectiveness of APR-MT significantly.
基金the Cultivation Programme for Young Backbone Teachers in Henan University of Technology,the Key Scientific Research Project of Colleges and Universities in Henan Province(No.22A520024)the Major Public Welfare Project of Henan Province(No.201300311200)the National Natural Science Foundation of China(Nos.61602154 and 61340037)。
文摘In recent years,automatic program repair approaches have developed rapidly in the field of software engineering.However,the existing program repair techniques based on genetic programming suffer from requiring verification of a large number of candidate patches,which consume a lot of computational resources.In this paper,we propose a random search and code similarity based automatic program repair(RSCSRepair).First,to reduce the verification computation effort for candidate patches,we introduce test filtering to reduce the number of test cases and use test case prioritization techniques to reconstruct a new set of test cases.Second,we use a combination of code similarity and random search for patch generation.Finally,we use a patch overfitting detection method to improve the quality of patches.In order to verify the performance of our approach,we conducted the experiments on the Defects4J benchmark.The experimental results show that RSCSRepair correctly repairs up to 54 bugs,with improvements of 14.3%,8.5%,14.3%and 10.3%for our approach compared with jKali,Nopol,CapGen and Sim Fix,respectively.
基金This research was supported in part by the National Natural Science Foundation of China(Grant Nos.61672529,61379054,61602504,61502015)the Fundamental Research Funds for the Central Universities(2019CDXYRJ0011)National Defense Science Foundation of China(3001010).
文摘Fault localization techniques are originally proposed to assist in manual debugging by generally producing a rank list of suspicious locations.With the increasing popularity of automated program repair,the fault localization techniques have been introduced to effectively reduce the search space of automated program repair.Unlike developers who mainly focus on the rank information,current automated program repair has two strategies to use the fault localization information:suspiciousness-first algorithm(SFA)based on the suspiciousness accuracy and rank-first algorithm(RFA)relying on the rank accuracy.However,despite the fact that the two different usages are widely adopted by current automated program repair and may result in different repair results,little is known about the impacts of the two strategies on automated program repair.In this paper we empirically compare the performance of SFA and RFA in the context of automated program repair.Specifically,we implement the two strategies and six well-studied fault localization techniques into four state-of-the-art automated program repair tools,and then use these tools to perform repair experiments on 60 real-world bugs from Defects4J.Our study presents a number of interesting findings:RFA outperforms SFA in 70.02%of cases when measured by the number of candidate patches generated before a valid patch is found(NCP),while SFA performs better in parallel repair and patch diversity;the performance of SFA can be improved by increasing the suspiciousness accuracy of fault localization techniques;finally,we use SimFix that deploys SFA to successfully repair four extra Defects4J bugs which cannot be repaired by SimFix originally using RFA.These observations provide a new perspective for future research on the usage and improvement of fault localization in automated program repair.
文摘软件系统在各行各业中发挥着不可忽视的作用,承载着大规模、高密度的数据,但软件系统中存在的种种缺陷一直以来困扰着系统的开发者,时刻威胁着系统数据要素的安全.自动代码修复(automated program repair,APR)技术旨在帮助开发者在软件系统的开发过程中自动地修复代码中存在的缺陷,节约软件系统开发和维护成本,提高软件系统中数据要素的保密性、可用性和完整性.随着大语言模型(large language model,LLM)技术的发展,涌现出许多能力强大的代码大语言模型,并且代码LLM在APR领域的应用中表现出了强大的修复能力,弥补了传统方案对于代码理解能力、补丁生成能力方面的不足,进一步提高了代码修复工具的水平.全面调研分析了近年APR相关的高水平论文,总结了APR领域的最新发展,系统归纳了完形填空模式和神经机器翻译模式2类基于LLM的APR技术,并从模型类型、模型规模、修复的缺陷类型、修复的编程语言和修复方案优缺点等角度进行全方位的对比与研讨.同时,对APR数据集和评价APR修复能力的指标进行了梳理和分析,并且对现有的实证研究展开深入探讨.最后,分析了当前APR领域存在的挑战及未来的研究方向.
基金Partially supported by the National Natural Science Foundation of China(61802350)。
文摘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 f usion model capable of predicting the repair pattern for a reported software bug.To accomplish this task,PatternNet first extracts multiview 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 i nto 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.
基金supported by the National High-Technology Research and Development Program of China(863 Program),No.2012A A020507985 Program of Sun Yat-sen University,No.90035-3283312+1 种基金Specialized Research Fund for the Doctoral Program of Higher Education,No.20120171120075Doctoral Start-up Project of the Natural Science Foundation of Guangdong Province,No.S201204006336
文摘OBJECTIVE: To investigate the factors associated with sensory and motor recovery after the repair of upper limb peripheral nerve injuries. DATA SOURCES: The online PubMed database was searched for English articles describing outcomes after the repair of median, ulnar, radial, and digital nerve injuries in humans with a publication date between 1 January 1990 and 16 February 2011. STUDY SELECTION: The following types of article were selected: (1) clinical trials describ- ing the repair of median, ulnar, radial, and digital nerve injuries published in English; and (2) studies that reported sufficient patient information, including age, mechanism of injury, nerve injured, injury location, defect length, repair time, repair method, and repair materials. SPSS 13.0 software was used to perform univariate and multivariate logistic regression analyses and to in- vestigate the patient and intervention factors associated with outcomes. MAIN OUTCOME MEASURES: Sensory function was assessed using the Mackinnon-Dellon scale and motor function was assessed using the manual muscle test. Satisfactory motor recovery was defined as grade M4 or M5, and satisfactory sensory recovery was defined as grade S3+ or S4. RESULTS: Seventy-one articles were included in this study. Univariate and multivariate logistic regression analyses showed that repair time, repair materials, and nerve injured were inde- pendent predictors of outcome after the repair of nerve injuries (P 〈 0.05), and that the nerve injured was the main factor affecting the rate of good to excellent recovery. CONCLUSION: Predictors of outcome after the repair of peripheral nerve injuries include age, gender, repair time, repair materials, nerve injured, defect length, and duration of follow-up.