arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2204.05929cs.SE
收藏

一种确定npm软件包版本语义类型的机器学习方法

A Machine Learning Approach to Determine the Semantic Versioning Type of npm Packages Releases

Rabe Abdalkareem, Md Atique Reza Chowdhury, Emad Shihab

摘要:

语义版本控制策略被广泛用于指示软件包发布中的更改级别。不幸的是,在许多情况下,开发人员不尊重语义版本策略,导致依赖应用程序的破坏。为了减少这种情况,我们提出使用机器学习(ML)技术来有效地预测新的发布类型,即,补丁、次要、主要,以便正确地确定语义版本化类型。为了执行我们的预测,我们挖掘并使用了关于发布的许多特性,例如更改代码的复杂性,更改类型和开发活动。然后我们使用了四个ML分类器。为了评估所提出的ML分类器的性能,我们对31个JavaScript包进行了实证研究,这些包总共包含大约6,260个版本。我们首先从包的源代码和存储库的历史数据中提取了41个发布级别的特性。然后,我们使用了四个机器学习分类器,即XGBoost,随机森林,决策树和Logistic回归。我们发现XGBoost分类器表现最好,主要、次要和补丁释放的中位ROC AUC值分别为0.78、0.69和0.74。我们还发现,在确定语义版本控制类型时,与版本中的更改类型相关的功能是功能组的最佳预测因子。最后,我们研究了通过应用跨包验证确定语义版本类型的通用性。我们的研究结果表明,一般分类器实现的主要,次要和补丁释放的中位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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑