Traditional test adequacy metrics measure a system's implementation, not whether it adheres to its expected behaviour. While developers rely heavily on code coverage and mutation testing to assess test suite quality, these metrics are fundamentally implementation-centric and cannot detect gaps between what the code is expected to do and what it actually does. Unfortunately, there has been no way to reliably detect these discrepancies; in this paper we introduce an automated proof-of-concept approach to investigate these gaps. The approach extracts expected method-level behaviours from natural language documentation and source code, maps them to existing test cases, and identifies gaps between expected and validated behaviours. We evaluate the approach across ten popular open-source Java libraries comprising 8,922 methods, extracting 20,729 behaviours with 93.1% precision. Our empirical analysis conservatively estimates that 17.5% of detected expected behaviours remain entirely untested, which we term as the test suite's behavioural gap. To determine if these gaps are merely an artifact of human-driven testing, we evaluate state-of-the-art automated test generators (EVOSUITE / ASTER), finding that they similarly fail to validate at least 20.6% / 27.1% of detected expected behaviours. We further demonstrate that behavioural gaps are not predicted by traditional structural metrics: the majority of untested behaviours occur in methods that already have high line coverage, and over half persist in methods with high mutation kill score. These results suggest behavioural coverage acts as an independent dimension of test suite adequacy that can complement traditional structural metrics.


翻译:传统的测试充分性指标衡量的是系统的实现,而非其是否符合预期行为。尽管开发者高度依赖代码覆盖率和变异测试来评估测试套件质量,但这些指标本质上以实现为中心,无法检测代码预期行为与实际行为之间的差距。遗憾的是,目前尚无可靠方法检测这些差异;本文引入了一种自动化概念验证方法以探究这些差距。该方法从自然语言文档和源代码中提取预期的方法级行为,将其映射到现有测试用例,并识别预期行为与已验证行为之间的缺口。我们评估了该方法在十个流行的开源Java库(共包含8,922个方法)上的表现,提取了20,729个行为,精确率为93.1%。实证分析保守估计,17.5%的检测到的预期行为完全未经测试,我们将其定义为测试套件的“行为缺失”。为确定这些缺失是否仅为人工测试的产物,我们评估了最先进的自动化测试生成工具(EVOSUITE/ASTER),发现它们同样未能验证至少20.6%/27.1%的检测到的预期行为。我们进一步证明,行为缺失无法由传统结构指标预测:多数未测试行为出现在已具有高代码行覆盖率的方法中,且超过半数持续存在于高变异得分的方法中。这些结果表明,行为覆盖率作为测试套件充分性的独立维度,可补充传统结构指标。

0
下载
关闭预览

相关内容

《利用视觉问题解答进行异常检测》美陆军实验室报告
专知会员服务
24+阅读 · 2024年5月21日
【博士论文】学习表征以检测新颖性和异常性,72页pdf
专知会员服务
19+阅读 · 2023年9月30日
《基于高斯混合流和入包的异常检测》2023最新57页论文
专知会员服务
29+阅读 · 2023年5月15日
索邦大学121页博士论文《时间序列中的无监督异常检测》
专知会员服务
104+阅读 · 2022年7月25日
异常检测(Anomaly Detection)综述
极市平台
20+阅读 · 2020年10月24日
使用 Keras Tuner 调节超参数
TensorFlow
15+阅读 · 2020年2月6日
异常检测论文大列表:方法、应用、综述
专知
126+阅读 · 2019年7月15日
异常检测的阈值,你怎么选?给你整理好了...
机器学习算法与Python学习
10+阅读 · 2018年9月19日
【机器视觉】表面缺陷检测:机器视觉检测技术
产业智能官
25+阅读 · 2018年5月30日
侦测欺诈交易(异常点检测)
GBASE数据工程部数据团队
20+阅读 · 2017年5月10日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
1+阅读 · 今天14:45
定向能反无人机系统最新发展动态
专知会员服务
5+阅读 · 今天13:50
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
3+阅读 · 今天13:33
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
Top
微信扫码咨询专知VIP会员