Record 202306¶
记录¶
1. 现有的 Android UI Test 生成工具是如何做的?¶
RecDroid¶
- 首先根据 bug report 生成 reproducing steps;
- 使用 Robotium 和 UIAutomator 爬取 GUI 信息,获取 Activity 等内容,得到 result.xml;
- 然后使用 guided DFS with backtracking 算法获取崩溃重现的路径,得到 run.xml;
- 最后根据 run.xml 使用自动化测试框架 Robotium 和 UIAutomator 执行测试。
本文中的 GUI crawling 基于 dynamic ordered event tree (DOET) representation 实现,使用 Robotium 和 UIAutomator 获取 Android 的 activity 等信息。
现有的 GUI crawling tools → Android UI Test Generation Tools
- 都是生成 model,和自动化测试脚本
- 自动测试脚本可以使用==测试框架(Robotium & UIAutomator)==执行
想法:
根据 model 生成 Instrumentation Test
自动化测试框架¶
2. 如何对 Instrumentation Test 生成覆盖率?¶
工具:
3. Instrumentation Test 调研¶
- 现在有没有工具能自动化生成 android test?
- 目前实际项目中 android test 目的是什么?
- 按照目前的算法,android test 的效果如何?
4. 工具¶
- adb commands
- MockK:常用 Kotlin mock 工具
5. 数据集¶
Idea¶
-
Test doubles in unit test generation
- Generate test cases with test doubles
- Test doubles in SBST
-
Android UI Test Scripts → Instrumentation UI Tests
- test cases readability
- test case reuse by extracting code features
日志¶
6.13¶
Chrome:
articles:
- Mining Android API Usage to Generate Unit Test Cases for Pinpointing Compatibility Issues
- Use of Test Doubles in Android Testing: An In-Depth Investigation
- Droidbotx: Test Case Generation Tool for Android Applications Using Q-Learning
- ReCDroid: Automatically Reproducing Android Application Crashes from Bug Reports
Idea:
- kotsuite-core: coverage
Android UI Testing:
Instumentation Tests:
- Official documentation
- Examples:
search github with @RunWith(AndroidJUnit4::class)
Problem:
- 插桩测试到底用来干啥?什么样的插桩测试才是有意义的?
- 实际项目中的插桩测试是怎样的?对每个public方法做测试?
- 目前 UI 测试的工具原理是怎样的?能不能用于插桩测试生成?
- 如何获取插桩测试覆盖率?
常用 mock 工具:
6.16¶
TO DO:
- 现有的 instrumentation test 覆盖率获取工具
- 其他 android UI 测试生成工具的原理
- 实际项目中 instrumentation test 长什么样
- local test 和 instrumentation test 中测试替身的使用
- instrumentation test 工具链能否打通?测试替身技术、覆盖率获取、生成的测试用例是否有意义
6.20¶
- Use of test doubles ... -> related work (generating test mocks automatically)
论文阅读(mock):
- A framework for automated test mocking of mobile apps
核心问题:
- 测试替身能不能做?
- 插桩测试怎么做?
- 其他测试用例生成算法(边界、等价类、因果图)ROI 如何?
- 不使用测试替身如何生成测试用例?