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 Texting(2)Testing Fundamentals 测试基础篇的更多相关文章

  1. 【Android Api 翻译1】Android Texting(2)Testing Fundamentals 测试基础篇

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

  2. [Android 性能优化系列]内存之基础篇--Android怎样管理内存

    大家假设喜欢我的博客,请关注一下我的微博,请点击这里(http://weibo.com/kifile),谢谢 转载请标明出处(http://blog.csdn.net/kifile),再次感谢 原文地 ...

  3. Android 使用dagger2进行依赖注入(基础篇)

    0. 前言 Dagger2是首个使用生成代码实现完整依赖注入的框架,极大减少了使用者的编码负担,本文主要介绍如何使用dagger2进行依赖注入.如果你不还不了解依赖注入,请看这一篇. 1. 简单的依赖 ...

  4. Shell编程-条件测试 | 基础篇

    什么是Shell Shell是一个命令解释器,它会解释并执行命令行提示符下输入的命令.除此之外,Shell还有另一个功能,如果要执行多条命令,它可以将这组命令存放在一个文件中,然后可以像执行Linux ...

  5. Android测试(二):Android测试基础

    原文地址:https://developer.android.com/training/testing/fundamentals.html 用户在不同的级别上与你的应用产生交互.从按下按钮到将信息下载 ...

  6. [Android 性能优化系列]内存之提升篇--应用应该怎样管理内存

    大家假设喜欢我的博客,请关注一下我的微博,请点击这里(http://weibo.com/kifile),谢谢 转载请标明出处(http://blog.csdn.net/kifile),再次感谢 原文地 ...

  7. 深入理解gradle编译-Android基础篇

    深入理解gradle编译-Android基础篇 导读 Gradle基于Groovy的特定领域语言(DSL)编写的一种自动化建构工具,Groovy作为一种高级语言由Java代码实现,本文将对Gradle ...

  8. android滑动基础篇 - 触屏显示信息

    效果图: 代码部分: activity类代码: package com.TouchView; /* * android滑动基础篇 * */ import android.app.Activity; i ...

  9. ESA2GJK1DH1K基础篇: Android实现MQTT封装源码使用说明

    说明 这一节说明一下基础篇APP源码里面MyMqttCilent.java这个文件的使用 新建工程 安装MQTT的jar包 implementation 'org.eclipse.paho:org.e ...

随机推荐

  1. uva 11134 - Fabled Rooks(问题转换+优先队列)

    题目链接:uva 11134 - Fabled Rooks 题目大意:给出n,表示要在n*n的矩阵上放置n个车,并且保证第i辆车在第i个区间上,每个区间给出左上角和右小角的坐标.另要求任意两个车之间不 ...

  2. 用Dart开发Android应用(sky应用)

    此文运用的是优雅的Markdown而书 流弊的Google公司,为了解决Android的卡顿问题,为此下了是不少的决心,这不最新研发的Sky移动应用UI框架,在用户界面和高质量的UI交互设计,很是让人 ...

  3. PHP冒泡排序法

    冒泡排序(Bubble Sort),是一种计算机科学领域的较简单的排序算法.法如其名,就是像冒泡一样,每次从数组当中 冒一个最大的数出来. 冒泡排序它重复地走访过要排序的数列,一次比较两个元素,如果他 ...

  4. 手机SIM卡介绍 三类不同标准的SIM卡

    SIM卡的全称是Subscriber Identity Module,翻译过来也叫客户识别模块,也叫做智能卡.用户身份识别卡.这块小小的芯片可以存储用户的号码.信息,以及一定数量的联系人数据,配合我们 ...

  5. QT 判断当前焦点是否在某控件上(使用hasFocus函数,毕竟QT是DIRECTUI,所以这个Focus到底代表了什么呢?)

    ui->pushButtonhasFocus()->hasFocus(); ui->treeWidget->hasFocus();   http://blog.csdn.net ...

  6. HDU 3415 Max Sum of Max-K-sub-sequence

    题目大意:找长度不超过k的最大字段和. 题解:单调队列维护之前k的最小值,思想是对于每一个入队的新元素,如果队尾元素比其大则一直删减,然后插入新元素,对于队首的元素若与当前枚举两相差超过k则直接删去. ...

  7. Hat’s Words(字典树)

    Hat’s Words Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

  8. android 中文 api (72) —— BluetoothSocket[蓝牙]

    前言 本章内容是   android.bluetooth.BluetoothSocket,为Android蓝牙部分的章节翻译.蓝牙通讯套接字,代表了与远端设备的连接点,使用socket本地程序可以通过 ...

  9. 理解SQL SERVER中的分区表

    转自:http://www.cnblogs.com/sienpower/archive/2011/12/31/2308741.html 简介 分区表是在SQL SERVER2005之后的版本引入的特性 ...

  10. iOS开发常识

    一.NSString 创建字符串.  NSString *astring = @"This is a String!"; 创建空字符串,给予赋值.  NSString *astri ...