安卓測試基礎(一)

來源:互聯網
上載者:User

標籤:des   android   style   class   c   code   

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.

安卓測試架構,是開發環境的重要組成部分,提供了架構和強力的工具區去協助你測試應用的各個方面,從單元測試到架構,不同水平的測試.

The testing framework has these key features:

測試架構有下面這些主要功能:

 

  • 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.

  安卓測試套件基於JUnit. 你能使用普通的JUnit區測試不調用安卓API的類.或者安卓的JUnit擴充來測安卓組件,如果你是安卓測試的新手,你能從通用測試案例類,例如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.

     安卓JUnit擴充提供了特定組件的測試案例類. 這些類對建立mock objects 和methods提供了協助,從而幫你控制這些組件的生命週期.

  • 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的構造和測試的工具在Eclipse的ADT中是可用的,並且在其他IDE中的命令列模式下一樣可用.這些工具從被測應用的project中得到資訊並且自動用這些資訊建立,build files,manidest 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.

這個文檔描述了安卓測試架構的基礎,包含了測試結構,提升測試的API, 你做測試和看結果的工具. 這個文檔假設你有安卓程式編程和JUnit測試方法論的基礎.

 

The following diagram summarizes the testing framework:

 總結了測試架構:

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.