论文标题
一种机器学习方法来确定NPM软件包的语义版本管理类型
A Machine Learning Approach to Determine the Semantic Versioning Type of npm Packages Releases
论文作者
论文摘要
语义版本控制策略被广泛用于指示软件包发行版的更改级别。不幸的是,在许多情况下,开发人员不尊重语义版本策略,从而导致依赖应用程序的破坏。为了减少这种情况,我们建议使用机器学习(ML)技术有效预测新的发行类型,即补丁,次要,主要,主要,以正确确定语义版本类型。为了执行我们的预测,我们开采并使用了许多有关发行版的功能,例如更改代码,更改类型和开发活动的复杂性。然后,我们使用了四个ML分类器。为了评估所提出的ML分类器的性能,我们对31个JavaScript包装进行了一项经验研究,其中包含大约6,260个发行版。我们从包装源代码和存储库的历史数据中提取41个发行级功能开始。然后,我们使用了四个机器学习分类器,即XGBoost,随机森林,决策树和逻辑回归。我们发现,XGBoost分类器的主要,次要和斑块释放分别为0.78、0.69和0.74的ROC AUC值的中位数分别实现。我们还发现,发行版中与变更类型相关的功能是确定语义版本类型的最佳预测指标组。最后,我们研究了通过应用交叉包装验证来确定语义版本类型的普遍性。我们的结果表明,通用分类器的主要,次要和斑块释放的ROC AUC值中位数为0.76、0.69和0.75。
Semantic versioning policy is widely used to indicate the level of changes in a package release. Unfortunately, there are many cases where developers do not respect the semantic versioning policy, leading to the breakage of dependent applications. To reduce such cases, we proposed using machine learning (ML) techniques to effectively predict the new release type, i.e., patch, minor, major, in order to properly determine the semantic versioning type. To perform our prediction, we mined and used a number of features about a release, such as the complexity of the changed code, change types, and development activities. We then used four ML classifiers. To evaluate the performance of the proposed ML classifiers, we conducted an empirical study on 31 JavaScript packages containing a total of approximately 6,260 releases. We started by extracting 41 release level features from historical data of packages' source code and repositories. Then, we used four machine learning classifiers, namely XGBoost, Random Forest, Decision Tree, and Logistic Regression. We found that the XGBoost classifiers performed the best, achieving median ROC AUC values of 0.78, 0.69, and 0.74 for major, minor, and patch releases, respectively. We also found that features related to the change types in a release are the best predictors group of features in determining the semantic versioning type. Finally, we studied the generalizability of determining the semantic versioning type by applying cross-package validation. Our results showed that the general classifier achieved median ROC AUC values of 0.76, 0.69, and 0.75 for major, minor, and patch releases.