Context: Recent research has used data mining to develop techniques that can guide developers through source code changes. To the best of our knowledge, very few studies have investigated data mining techniques and--or compared their results with other algorithms or a baseline. Objectives: This paper proposes an automatic method for recommending source code changes using four data mining algorithms. We not only use these algorithms to recommend source code changes, but we also conduct an empirical evaluation. Methods: Our investigation includes seven open-source projects from which we extracted source change history at the file level. We used four widely data mining algorithms \ie{} Apriori, FP-Growth, Eclat, and Relim to compare the algorithms in terms of performance (Precision, Recall and F-measure) and execution time. Results: Our findings provide empirical evidence that while some Frequent Pattern Mining algorithms, such as Apriori may outperform other algorithms in some cases, the results are not consistent throughout all the software projects, which is more likely due to the nature and characteristics of the studied projects, in particular their change history. Conclusion: Apriori seems appropriate for large-scale projects, whereas Eclat appears to be suitable for small-scale projects. Moreover, FP-Growth seems an efficient approach in terms of execution time.
翻译:上下文:近期研究利用数据挖掘开发了能指导开发者进行源代码变更的技术。据我们所知,仅有极少研究对数据挖掘技术本身进行探讨,或将其结果与其他算法或基线进行比较。目标:本文提出一种利用四种数据挖掘算法自动推荐源代码变更的方法。我们不仅使用这些算法推荐源代码变更,还进行了实证评估。方法:研究涵盖七个开源项目,我们从文件层面提取了其源代码变更历史。采用四种广泛使用的数据挖掘算法,即Apriori、FP-Growth、Eclat和Relim,从性能(精确率、召回率和F值)和执行时间两方面对算法进行比较。结果:研究发现提供了实证证据表明,尽管某些频繁模式挖掘算法(如Apriori)在部分案例中表现优于其他算法,但这种优势并非在所有软件项目中保持一致,这更可能源于所研究项目的性质与特征,特别是其变更历史。结论:Apriori适合大规模项目,而Eclat适用于小规模项目。此外,FP-Growth在执行时间方面展现出高效性。