




已阅读5页,还剩14页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Android CTS 调研报告目录版本历史41 Android CTS 简介52 为什么需要兼容性测试53 CTS 工作原理54 CTS 工作流程55 基本概念65.1 测试用例的类型65.2 测试覆盖65.2.1 Android 4.0.375.2.2 Android 2.285.2.3 Test Plan Vs Test Packages Mapping table86 测试环境配置136.1 安装Ubuntu 虚拟机136.2 下载android-SDK linux136.3 下载android-cts包,下载地址:146.4 下载JDK and Install146.5 将android-sdk和android-cts解压放置在同一个文件夹166.6 设置环境变量166.7 终端测试前准备17l检测手机是否连接上电脑17l终端设置:(不同操作系统版本的手机可能菜单顺序稍有不同,但应该都包含下面的选项)176.8 运行测试181 Android CTS 简介CTS 全称 Compatibility Test Suite 兼容性测试工具。当产品开发出来以后,并定制了自己的 Android 系统后,必须要通过最新的 CTS 检测,以保证标准的 Android Application 能运行在该平台下。通过了 CTS 验证,需要将测试报告提交给 Google,已取得 androidmarket的认证。CTS 是一款通过命令行操作的工具。目前CTS没有提供 windows 版本,只能在 Linux 下测试。2 为什么需要兼容性测试l 让APP提供更好的用户体验。用户可以选择更多的适合自己设备的APP。让APP更稳定。l 让开发者设计更高质量的APP。l 充分利用Android market(Google Play Store), 通过CTS的设备可以进入Android market。3 CTS 工作原理4 CTS 工作流程l Download编译好的CTS 从网站/compatibility/downloads.htmll 安装配置CTSl 把手机设备连接到PC上。l 运行CTS。CTS会把相应的测试用例(APK文件)传送到设备上并通过instrumentation运行,然后记录运行结果。l 测试完成以后,删除测试用例。所有的测试用例执行完毕后,可以参照测试结果重新调整或优化系统。然后继续运行CTS测试。l 你可以把CTS生成的结果(就是result下面那个以测试时间命名的.zip文件, xml 和截图)提交给。5 基本概念l TestPlan(Plan):测试计划,Testpackage 的集合,每个 Plan 中都包含若干个测试包l TestPackage(Package):测试包,Testcase的集合l Testcase:测试用例,Test 的集合l Test:测试,每一个测试对应一个或者多个 InstrumentationTestl InstrumentationTest:Instrumentation和Activity有点类似,只不过Activity是需要一个界面的,而Instrumentation并不是这样的,我们可以将它理解为一种没有图形界面的,具有启动能力的,用于监控其他类(用Target Package声明)的工具类。Android 测试环境的核心是一个 Instrumentation 框架,在这个框架下,你的测试应用程序可以精确控制应用程序。使用 Instrumentation,你可以在主程序启动之前,创建模拟的系统对象,如 Context;控制应用程序的多个生命周期;发送 UI 事件给应用程序;在执行期间检查程序状态。Instrumentation 框架通过将主程序和测试程序运行在同一个进程来实现这些功能。关于测试用例5.1 测试用例的类型CTS包含下面三种级别:l 单元级: 测试Android平台上的代码单元。比如,一个java.util.HashMap这样的类。l 功能级: 多个API组合而成的一个更高级的功能。对应CTS的test packagel 程序级: 通过运行一个简单的APP来执行一个API集合和Android运行时服务。对应CTS的 test plan未来版本还会包含下面的类型:l 强度测试: 测试系统在高CPU运算之下的稳定性。l 性能测试: 比如每秒渲染的帧数。5.2 测试覆盖目前,为了确保兼容,测试用例覆盖了下面的这些范围.5.2.1 Android 4.0.3总共包含8个Test plan, 55 个test package.l CTS:这些测试用例是检验兼容性必须的.l CTS-TF: 实际包含的测试包与CTS是相同的, 当测试时,如果输入CTS, 实际上执行的是CTS-TF。更多信息请参考下面的内容。下面的内容来自/p/android/issues/detail?id=24507 android4.0 what is the difference between CTS test plan and CTS-TF test planThere shouldnt be any difference between CTS and CTS-TF plans. I believe the test runner will actuallyrun CTS-TF if you enter CTS. TF stands for Trade Federation which is the new test runner used by CTS. The CTS-TF plan was createdso that TF vm-tests specific enhancements could be made while the old CTS runner was still being used.There have been some fixes to the vm-tests which did not get back to the CTS plan, but this shouldnt matter since the test runner detects when the CTS plan is used and redirects the runner to use the CTS-TF plan.l Signature:包含所有针对公有APIs的署名测试l Android:包含针对android APIs的所有测试l Java:包含所有针对Java核心library的测试l VM-TF:包含对虚拟机的所有测试l RefApp:包含针对参与应用程序的所有测试,随版本的更新,本测试计划也会更新l AppSerurity:针对Application安全性的测试5.2.2 Android 2.2l CTS:包含2万多个测试用例,这些测试用例是检验兼容性必须的,性能测试不包含在本计划中,随版本的更新,本测试计划也会更新。l Signature:包含所有针对公有APIs的署名测试l Android:包含针对android APIs的所有测试l Java:包含所有针对Java核心library的测试l VM:包含对虚拟机的所有测试l RefApp:包含针对参与应用程序的所有测试,随版本的更新,本测试计划也会更新l Performance:包含所有针对性能的测试,随版本的更新,本测试计划也会更新l AppSerurity:针对Application安全性的测试5.2.3 Test Plan Vs Test Packages Mapping tablel CTS: (53)1 android.apidemos.cts2 android.acceleration3 android.accessibilityservice4 android.accounts5 android.admin6 android.animation7 android.app8 android.bluetooth9 android.content10 android.database11 android.dpi12 android.dpi213 android.drm14 android.example15 android.gesture16 android.graphics217 android.graphics18 android.hardware19 android.holo20 android.jni21 android.location22 android.mediastress23 android.media24 android.nativemedia25 android.ndef26 27 android.openglperf28 android.os29 android.permission230 android.permission31 android.preference232 android.preference33 vider34 android.renderscript35 android.sax36 android.security37 android.speech38 android.telephony39 android.text40 android.textureview41 android.util42 android.view43 android.webkit44 android.widget45 android.tests.sigtest46 47 android.core.tests.libcore.package.dalvik48 android.core.tests.libcore.package.libcore49 50 android.core.tests.libcore.package.sun51 android.core.tests.libcore.package.tests52 android.core.vm-tests-tf53 android.tests.appsecurityl VM-TF: 1 android.core.vm-tests-tfl Signature:1 android.tests.sigtestl Android : (45 package)1 android.apidemos.cts2 android.acceleration3 android.accessibilityservice4 android.accounts5 android.admin6 android.animation7 android.app8 android.bluetooth9 android.content10 android.database11 android.dpi12 android.dpi213 android.drm14 android.example15 android.gesture16 android.graphics217 android.graphics18 android.hardware19 android.holo20 android.jni21 android.location22 android.mediastress23 android.media24 android.nativemedia25 android.ndef26 27 android.openglperf28 android.os29 android.permission230 android.permission31 android.preference232 android.preference33 vider34 android.renderscript35 android.sax36 android.security37 android.speech38 android.telephony39 android.text40 android.textureview41 android.util42 android.view43 android.webkit44 android.widget45 android.tests.appsecurityl AppSecurity1 android.tests.appsecurityl Java(6)1 2 android.core.tests.libcore.package.dalvik3 android.core.tests.libcore.package.libcore4 5 android.core.tests.libcore.package.sun6 android.core.tests.libcore.package.testsl RefApp1 android.apidemos.cts下面的信息来自用户手册l Signature对每个Android产品,都有一些XML文件来描述所有的公开API。CTS包含了一个工具来检测这些API签名中包含的API是否都在系统中被支持。For each Android release, there are XML files describing the signatures of all public APIs contained in the release. The CTS contains a utility to check those API signatures against the APIs available on the device. The results from signature checking are recorded in the test result XML file.l Platform API 测试SDK文档中描述的平台API,比如core libraries,Android Application Framework等。要求这些API可以提供:正确的类、属性、方法签名、方法行为、错误参数处理方式Test the platform (core libraries and Android ApplicationFramework) APIs as documented in the SDK Class Index to ensureAPI correctness: correct class, attribute and method signatures correct method behavior negative tests to ensure expected behavior for incorrect parameter handlingl Dalvik VM专门针对Dalvik Vm的测试。The tests focus on testing the Dalvik VMl Platform Data Model平台通过ContentProvider提供给开发者使用的数据,比如:Contacts,Browser,Settings等。The CTS tests the core platform data model as exposed toapplication developers through content providers, as documented inthe SDK vider package: contacts browserGoogle Confidential settings more.l Platform Intents平台提供的用于核心功能的Intent。The CTS tests the core platform intents, as documented in the SDKAvailable Intents.l Platform permission平台提供的一些重要APP权限The CTS tests the core platform permissions, as documented in the SDK Available Permissions.l Platform Resources平台提供的一些重要的resource type6 测试环境配置6.1 安装Ubuntu 虚拟机/ubuntu/guide/201010277752.html6.2 下载android-SDK linux/sdk/index.htmlNOTES:如果你运行的android-cts 2.2 或者更早的版本, SDK需要安装android-sdk_r06-linux_86版本,否则测试不能正常进行。你能从下面的download r6版本。/f/9796963.html6.3 下载android-cts包,下载地址:/compatibility/downloads.html根据手机系统版本下载对应版本的cts包,否则将无法运行测试6.4 下载JDK and Install/technetwork/java/javase/downloads/jdk-6u26-download-400750.html1. 创建安装目录,在/usr/java下建立安装路径,并将文件考到该路径下:$ mkdir /usr/java2. jdk-6u26-linux-i586.bin 这个是自解压的文件,执行下面的命令3. $ chmod 755 jdk-6u26-linux-i586.bin$ ./jdk-6u26-linux-i586.bin (注意,这个步骤一定要在jdk-6u26-linux-i586.bin所在目录下)在按提示输入yes后,jdk被解压。稍后出现Do you aggree to the above license terms? yes or no,输入YES除此以外,你也可下载jdk-6u26-linux-i586-rpm.bin若是用jdk-6u26-linux-i586-rpm.bin 这个也是一个自解压文件,不过解压后的文件是jdk-6u26-linux-i586-rpm 包,执行rpm命令装到linux上就可以了。安装如下:$ chmod 755 ./jdk-6u26-linux-i586-rpm $ ./jdk-6u11-linux-i586-rpm .bin$ rpm -ivh jdk-6u11-linux-i586-rpm6.5 将android-sdk和android-cts解压放置在同一个文件夹6.6 设置环境变量进入你的工作目录,比如/home/sxu, 然后编辑文件 .bashrc$ cd /home/sxu$ vim .bashrc添加下面的环境变量根据你自己实际的情况export JAVA_HOME=/usr/java/jdk1.6.0_26export JAVA_BIN=/usr/java/jdk1.6.0_26/binexport PATH=$PATH:$JAVA_HOME/bin:/home/sxu/cts/android-sdk-linux/tools:/home/sxu/cts/androidsdklinux/platformtools:/home/sxu/cts/androidcts/tools:/home/sxu/cts/android-sdk-linux/platform-tools:/home/sxu/cts/android-cts4/toolsexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport JAVA_HOME JAVA_BIN PATH CLASSPATH红色部分是为SDK 和CTS。保存后,运行下面的命令$source .bashrc然后你能运行下面的命令,检查是否上面的命令是否生效6.7 终端测试前准备l 检测手机是否连接上电脑打开终端输入命令:adb devices ,连接上这会显示设备ID,如果未连接上则会以?代替,此时可以通过输入以下命令进行连接$ adb kill-server$ sudo adb start-server$ adb devicesl 终端设置:(不同操作系统版本的手机可能菜单顺序稍有不同,但应该都包含下面的选项)1. 语言设置为English 2. 去掉锁屏(Settings Personal Security Screen security screen locknone )3. 设置屏幕超时为最长时间30分钟(SettingsDevice DisplayScreen timeout30minutes)4. 设置唤醒状态(SettingsApplicationsDevelopmentStay awake)5. 设置虚拟地点(Settings Application Development Allow mock locations is set)6. 运行时让屏幕是home主界面上7. 运行过程中不要触摸屏幕及按钮8. 手机时间设置正确9. 有SD卡并是清空10. 设置USB debugging (Settings Application Development USB debugging)11. 对于全智达手机12. 全智达手机要copy file sxusxu-virtual-machine:/cts/android-sdk-linux/platform
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 护理核心制度解读及案例
- 代运营合同范本 鉴于
- 劳务派遣合同范本2003
- 托管装修服务合同范本
- 清酒代理合同范本
- 工程设施购买合同范本
- 德邦加盟合同范本
- 拆迁分户合同范本
- 主力摄影合同范本
- 广告制作合同范本2017
- 2024年度软件即服务(SaaS)平台租赁合同3篇
- 网络攻防原理与技术 第3版 教案 -第12讲 网络防火墙
- 2024年新课标培训2022年小学英语新课标学习培训课件
- 2024小学语文教学及说课课件:二年级上册《田家四季歌》
- 2024至2030年中国聚脲涂料行业市场发展调研及投资前景分析报告
- 1.1 鸦片战争 课件 2024-2025学年统编版八年级历史上册
- 2024至2030年中国演播室行业市场调查研究及发展战略规划报告
- DB11∕T 420-2019 电梯安装、改造、重大修理和维护保养自检规则
- 国旗台施工合同
- 总代理授权书
- 医疗器械售后服务能力证明资料模板
评论
0/150
提交评论