基于混合调用图的JavaScript程序bug预测提升
软件工程
2024-05-14 v1
摘要
Bug prediction旨在寻找软件系统中可能包含缺陷的代码元素。通过了解程序中最易出错的部分,人们可以有效地分配有限的测试和代码审查资源。因此,bug prediction对软件维护和演化具有极大的支持作用。在本文中,我们提出了一个基于静态源代码度量的JavaScript函数级别bug预测模型,加入了基于混合(静态和动态)代码分析的函数调用数量度量(HNII和HNOI)。我们的动机是,JavaScript是一种高度动态的脚本语言,静态代码分析可能非常不精确;因此,使用纯静态源代码特征进行bug预测可能不够。在我们从公开的BugsJS数据集中提取824个有缺陷和1943个无缺陷函数用于ESLint JavaScript项目的研究中,我们确认了混合代码度量对机器学习模型预测性能的积极影响。 Depending on the ML algorithm, applied hyper-parameters, and target measures we consider, hybrid invocation metrics bring a 2-10% increase in model performances (i.e., precision, recall, F-measure). Interestingly, replacing static NOI and NII metrics with their hybrid counterparts HNOI and HNII in itself improves model performances; however, using them all together yields the best results.
引用
@article{arxiv.2405.07244,
title = {Enhanced Bug Prediction in JavaScript Programs with Hybrid Call-Graph Based Invocation Metrics},
author = {Gábor Antal and Zoltán Tóth and Péter Hegedűs and Rudolf Ferenc},
journal= {arXiv preprint arXiv:2405.07244},
year = {2024}
}