测试开发工作流
要将测试集成到平台连续测试服务,它们应该符合本页面中的准则并遵循以下建议流程。
- 使用 Soong 构建系统以实现简单的测试配置。
- 使用 Test Mapping 直接在 Android 源代码树中轻松创建提交前和提交后测试规则。
- 使用 Atest 在本地运行测试。
测试类型
支持的测试类型包括:
功能测试对测试用例进行通过或未通过测试的断言,而指标测试通常重复执行操作以收集时间指标。
采用标准化的输入/输出格式后,不再需要对每个测试进行自定义结果解析和后处理,并且通用自动化测试框架可用于符合惯例的所有测试。如需了解 Android 附带的连续测试框架,请参阅 Trade Federation 概览。
测试用例准则 {guidelines}
通过连续测试服务执行的测试用例应该是封闭测试,也就是说,所有依赖项均已声明并与测试一起提供。如需了解此原则,请参阅 Google Testing Blog 网站上的“Hermetic Servers”一文。简而言之,封闭测试无需:
- 使用 Google 帐号登录
- 配置连接(电话/Wi-Fi/蓝牙/NFC)
- 传入测试参数
- 由自动化测试框架对特定的测试用例执行设置或拆解
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-04-15 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]