Swift 中 Flaky 测试的词汇特征研究
原标题:The Vocabulary of Flaky Tests in Swift
AI 摘要
该研究首次将基于词汇的 flaky test 预测方法应用于 Swift 生态。作者从 15 个开源 Swift 项目中收集了 91 个 flaky 测试和 22,349 个稳定测试,训练五种分类器,其中随机森林表现最佳(Precision=0.92,F1=0.86,AUC=0.95)。信息增益分析发现,flakiness 标记主要与并发原语(async、await)、期望同步(expectation、fulfill)、错误传播(throws)和显式时间依赖(timeout、wait、now)相关,而稳定性标记主要是同步测试的断言词汇。
正文节选
The Vocabulary of Flaky Tests in Swift Abstract. Flaky tests produce non-deterministic outcomes without code change, eroding CI confidence and delaying deliveries. While vocabulary-based machine learning prediction has proven effective for Java and JavaScript, no study has evaluated it for Swift, a language whose testing style is dominated by UI and asynchronous code. We collect 91 flaky and 22,349 stable tests from 15 open-source Swift projects via re-execution and commit-history mining, then t