Testing Fundamentals

The Android testing framework, an integral part of the development environment, provides an architecture and powerful tools that help you test every aspect of your application at every level from unit to framework.

Android测试框架,是Android开发环境的重要组成部分,它提供给我们的“强有力”的工具,来帮我们测试应用程序的各个环节,不管是一个单元,还是整个框架。

The testing framework has these key features:

Android测试框架有一下几个特点:

  • Android test suites are based on JUnit. You can use plain JUnit to test a class that doesn't call the Android API, or Android's JUnit extensions to test Android components. If you're new to Android testing, you can start with general-purpose test case classes such as AndroidTestCase and then go on to use more sophisticated classes.
  • Android测试套件是基于JUnit的。你可以使用普通的JUnit来测试那些不调用Android API的类,或者使用Android的JUnit扩展来测试Android组件。如果对于测试来说,你还是新手,那么你可以先学习一些普通的测试,比如AndroidTestCase,然后在使用更为复杂的类。
  • The Android JUnit extensions provide component-specific test case classes. These classes provide helper methods for creating mock objects and methods that help you control the lifecycle of a component.
  • Android Junit扩展提供了指定组件的测试类,这些类为帮你控制一个组件的生命周期,提供了创建模拟对象和方法的帮助方法,。
  • Test suites are contained in test packages that are similar to main application packages, so you don't need to learn a new set of tools or techniques for designing and building tests.
  • 测试套件包含于测试包中,它类似于主程序包,因此,你不必再为测试学习一套新的工具和技术。
  • The SDK tools for building and tests are available in Eclipse with ADT, and also in command-line form for use with other IDEs. These tools get information from the project of the application under test and use this information to automatically create the build files, manifest file, and directory structure for the test package.
  • 编译测试的SDK,可在带有ADT的eclipse中添加,也可以在其他IDE中使用命令行工具来进行添加。这些工具会获取应用程序的项目信息,以此来自动的创建所需的文件,比如清单文件 manifest file,以及测试包的目录结构。
  • The SDK also provides monkeyrunner, an API for
    testing devices with Python programs, and UI/Application Exerciser Monkey, a command-line tool for stress-testing
    UIs by sending pseudo-random events to a device.
  • SDK还提供了monkeyrunner,这是一个可以用Python程序进行测试的API,以及提供了UI/Application Exerciser Monkey,它是一个命令行工具,可以模拟发送按键,触摸等手势设备中的触摸信号。

This document describes the fundamentals of the Android testing framework, including the structure of tests, the APIs that you use to develop tests, and the tools that you use to run tests and view results. The document assumes you have a basic knowledge of
Android application programming and JUnit testing methodology.

本文档介绍了android测试框架的基础,包括测试的结构,开发测试时使用的API,运行测试以及查看结果时用到的工具,要想了解这些,需要你有一些android应用程序开发和使用JUnit测试的基础。

The following diagram summarizes the testing framework:

下面的图简述测试框架:

【Android Api 翻译1】Android Texting(2)Testing Fundamentals 测试基础篇的更多相关文章

  1. Android Texting(2)Testing Fundamentals 测试基础篇

    Testing Fundamentals The Android testing framework, an integral part of the development environment, ...

  2. 【Android Api 翻译2】Android Testing(1) 浅尝Android测试的奥秘

    ------- 源自梦想.永远是你IT事业的好友.只是勇敢地说出我学到! ---------- 仅供学习和交流使用,翻译不好勿喷,请只摘除不合适的地方 Testing The Android fram ...

  3. 【Android Api 翻译3】android api 完整翻译之Application Fundamentals (学习android必须知道的)

    Android应用程序是用Java编程语言编写的.Android SDK工具把应用程序的代码.数据和资源文件一起编译到一个Android程序包中(这个程序包是以.apk为后缀的归档文件),一个Andr ...

  4. 【Android Api 翻译4】android api 完整翻译之Contacts Provider (学习安卓必知的api,中英文对照)

    Contacts Provider 电话簿(注:联系人,联络人.通信录)提供者 ------------------------------- QUICKVIEW 快速概览 * Android's r ...

  5. android 开发 xml绘制shape与Selector与layer-list 一 基础篇

    首先我们先来了解状态效果 android:state_pressed=["true" | "false"]  按下状态 android:state_focuse ...

  6. Monkey Android API 翻译

      此篇笔记,记录了API中,对monkey用法的说明,基于Android Studio 2.2.3. Monkey是一个运行在Android模拟器或者Android设备上的程序,通过使用monkey ...

  7. Android Api 27 在 Android 8.0 上出现 Only fullscreen opaque activities can request orientation 的解决情况

    刚上班,没有业务开发,对 App 的 Api 由 26 升级到了 27, 结果在 Android 8.0 的设备上会出现 crash . Log 如下: java java.lang.IllegalS ...

  8. Android API level 与version对应关系

    https://www.cnblogs.com/jinglecode/p/7753107.html Platform Version API Level VERSION_CODE 中文名称 Andro ...

  9. Android API 指南

    原文链接:http://android.eoe.cn/topic/android_sdk Android API 指南 - Android API Guides 应用的组成部分 - Applicati ...

随机推荐

  1. LightOJ 1112 Curious Robin Hood (单点更新+区间求和)

    http://lightoj.com/volume_showproblem.php?problem=1112 题目大意: 1 i        将第i个数值输出,并将第i个值清0 2 i v     ...

  2. ecshop二次开发

    模板开发首页参考资料: http://book.ecmoban.com/ http://pan.baidu.com/s/1bnezFUv 自行修改ecshop读写分离设置,请查看另一篇文章,ecsho ...

  3. 【ps】gif动态图白边问题

    (从死了一次又一次终于挂掉的百度空间中抢救出来的,发表日期 2014-08-13) 在制作gif动态图的时候发现有白边问题 网上说可以设成索引,但是这样一整连动画帧都一块丢掉了. 最终解决办法: 将要 ...

  4. Windows 错误代码

    Error Messages for Windows http://www.gregorybraun.com/MSWINERR.ZIP Server 4.0 Error Messages   Code ...

  5. X431 元征诊断枪

    X-431 Diagun是专门为汽车维修技师设计的诊断设备. 小巧的主机.强大的诊断功能.方便快捷的网上升级.一体化多功能接头,都是维修技师的首选.X-431 Diagun 是汽车维修技师的标准装备. ...

  6. A few things to remember while coding in Python.

    A few things to remember while coding in Python. - 17 May 2012 - UPDATE: There has been much discuss ...

  7. Java面试试题

    第一,谈谈final, finally, finalize的区别.最常被问到. 第二,Anonymous Inner Class (匿名内部类) 是否可以extends(继承)其它类,是否可以impl ...

  8. 工作一直没有进步怎么办?试试PDCA法则吧!

    许多人在工作或者学习的时候,总是会发现自己过了一段时间以后,全然没有不论什么进步.或者进步很之少. 而对于每个渴望让自己变得更好的人来说.是一件很令人苦恼的事情,今天我们就来谈一下工作和学习上,可实现 ...

  9. 用NDK编译lua库

    Android.mk是这样的 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := lua LOCAL_SRC_FILE ...

  10. Swift 本地推送通知UILocalNotification

    Notification是智能手机应用开发中常用的信息传递机制,它不用消耗更多资源去不停的检查信息状态,可以非常好的节省资源. 在iOS中分为两种通知:本地.远程.本地的UILocalNotifica ...