Reconstructing a method's change history efficiently and accurately is critical for many software engineering tasks, including maintenance, refactoring, and comprehension. Despite the availability of method history generation tools such as CodeShovel and CodeTracker, existing evaluations of their effectiveness are limited by inaccuracies in the ground truth oracles used. In this study, we systematically construct two new oracles -- the corrected CodeShovel oracle and a newly developed HistoryFinder oracle -- by combining automated analysis with expert-guided manual validation. We also introduce HistoryFinder, a new method history generation tool designed to improve not only the accuracy and completeness of method change histories but also to offer competitive runtime performance. Through extensive evaluation across 400 methods from 40 open-source repositories, we show that HistoryFinder consistently outperforms CodeShovel, CodeTracker, IntelliJ, and Git-based baselines in terms of precision, recall, and F1 score. Moreover, HistoryFinder achieves competitive runtime performance, offering the lowest mean and median execution times among all the research-based tools. While Git-based tools exhibit the fastest runtimes, this efficiency comes at the cost of significantly lower precision and recall -- leaving HistoryFinder as the best overall choice when both accuracy and efficiency are important. To facilitate adoption, we provide a web interface, CLI, and Java library for flexible usage.
翻译:高效且准确地重构方法变更历史对于软件维护、重构与理解等众多软件工程任务至关重要。尽管存在CodeShovel和CodeTracker等方法历史生成工具,现有对其有效性的评估受限于所使用基准预言机的不准确性。本研究通过结合自动化分析与专家指导的手动验证,系统构建了两个新预言机——修正的CodeShovel预言机与新开发的HistoryFinder预言机。同时,我们提出HistoryFinder这一新型方法历史生成工具,其设计目标不仅在于提升方法变更历史的准确性与完整性,还致力于提供具有竞争力的运行时性能。通过对来自40个开源仓库的400个方法进行广泛评估,我们证明HistoryFinder在精确率、召回率与F1分数上持续优于CodeShovel、CodeTracker、IntelliJ及基于Git的基线方法。此外,HistoryFinder实现了具有竞争力的运行时性能,在所有研究型工具中展现出最低的平均与中位执行时间。虽然基于Git的工具运行速度最快,但这种效率是以显著降低的精确率与召回率为代价的——当准确性与效率同等重要时,HistoryFinder仍是最佳综合选择。为促进工具采纳,我们提供了Web界面、命令行接口与Java库以实现灵活使用。