Software refactoring is the process of changing the structure of software without any alteration in its behavior and functionality. Presuming it is carried out in appropriate opportunities, refactoring enhances software quality characteristics such as maintainability and extensibility. Thus far, various studies have addressed the problem of detecting proper opportunities for refactoring. Most of them are based on human expertise and are prone to error and non-meticulous. Fortunately, in recent efforts, machine learning methods have produced outstanding results in finding appropriate opportunities for refactoring. Sad to say, Machine learning methods mostly need plenty of data and, consequently, long processing time. Furthermore, there needs to be more annotated data for many types of refactoring, and data collection is time-consuming and costly. Accordingly, in this paper, we have formulated the problem of detecting appropriate opportunities for refactoring as a few-shot classification problem. We have utilized model-agnostic meta-learning (MAML), a recognized meta-learning algorithm, to learn a neural network on tasks from high-resource data. The trained model, then, is adapted to a model with high accuracy for tasks from low-resource data. Experimental results revealed 91% accuracy, which illustrates the effectiveness and competitiveness of our proposed meta-learning model.
翻译:软件重组是改变软件结构而不改变其行为和功能的过程,假设它是在适当机会下进行的,再考虑增强软件质量的特性,例如可维持性和可扩展性,到目前为止,各种研究都解决了发现适当再考虑机会的问题,其中多数是基于人的专门知识,容易出错和非遗传性。幸运的是,在近期的努力中,机器学习方法在寻找适当再考虑机会方面产生了突出的结果。令人痛心的是,机器学习方法大多需要大量的数据,因而需要很长的处理时间。此外,还需要为许多类型的再考虑提供附加说明的数据,而数据收集需要花费时间和费用。因此,我们在本文中提出了发现适当再考虑机会的问题,作为一个微小的分类问题。我们利用了模型-数学元学习(MAML),这是一个公认的元学习算法,从高资源数据中学习一个神经网络。因此,经过培训的模型要适应一个具有高度准确性的数据模型,以便从低资源数据中显示的精确度和高精确度学习结果。