paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Use of test doubles in Android testing

Android 测试中测试替身的使用
ICSE Proceedings of the 44th International Conference on Software Engineering2022匹配度 2/10 · 该论文是Android测试中测试替身使用的大规模实证研究,属于软件测试与实证软件工程领域,与用户核心关注的静态分析、LLM/Agent、浮点程序分析和贝叶斯程序分析均无直接关联。虽然涉及测试代码质量与测试坏味,但并非PL/AI交叉或程序分析方向。引用 27 inbox
Mattia Fazzini, Chase Choi, Juan Manuel Copia, Gabriel Lee, Yoshiki Kakehi, Alessandra Gorla, Alessandro Orso
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:通过大规模实证研究揭示 Android 应用中测试替身的创建与使用方式、与 Java 测试替身的差异及潜在测试坏味。

Android 应用与环境交互频繁,测试常出现脆弱、缓慢和难调试问题,开发者常用测试替身(test doubles)在测试执行时替换应用或库类。但人们对其实际使用方式了解有限。本文进行深入实证研究:先分析 1,006 个含公开测试套件的应用,找出创建测试替身最常用的框架与方式;再选取使用这些框架定义测试替身最多的 10 个应用,分析 2,365 个测试替身(共替换 784 个类)。结果揭示了 Android 中测试替身的类型和使用模式,显示其与传统 Java 测试替身存在差异,并发现测试替身可能引入测试坏味甚至测试代码错误。论文最后讨论了这些发现对研究与实践的启示。

问题
Android 应用的测试常因环境交互而脆弱、缓慢、难调试,开发者广泛使用测试替身,但缺乏对其实际创建与使用方式的系统认识。
方法
对 1,006 个含公开测试套件的 Android 应用进行实证分析,识别常用测试替身框架;再深入分析 10 个高使用应用中的 2,365 个测试替身及其替换的 784 个类。
评估
通过大规模实证数据回答研究问题,刻画测试替身的类型与用法,比较 Android 与 Java 测试替身的差异,并识别测试坏味和错误。
原文摘要(Abstract)

Android apps interact with their environment extensively, which can result in flaky, slow, or hard-to-debug tests. Developers often address these problems using test doubles---developer-defined objects that replace app or library classes during test execution. Although test doubles are widely used, there is limited understanding of how they are used in practice. To bridge this gap, we present an in-depth empirical study that aims to shed light on how developers create and use test doubles in Android apps. In our study, we first analyze a dataset of 1,006 apps with publicly available test suites to identify which frameworks and approaches developers most commonly use to create test doubles. We then investigate several research questions by studying how test doubles defined using these popular frameworks are created and used in the ten apps in the dataset that define the highest number of test doubles using these frameworks. Our results, based on the analysis of 2,365 test doubles that replace a total of 784 classes, provide insight into the types of test doubles used within Android apps and how they are utilized. Our results also show that test doubles used in Android apps and traditional Java test doubles differ in at least some respect. Finally, our results show that test doubles can introduce test smells and even mistakes in the test code. In the paper, we also discuss some implications of our findings that can help researchers and practitioners working in this area and guide future research.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{FazziniCCLKGO22,
  title = {Use of test doubles in Android testing},
  author = {Mattia Fazzini and Chase Choi and Juan Manuel Copia and Gabriel Lee and Yoshiki Kakehi and Alessandra Gorla and Alessandro Orso},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3510175}
}