安卓CTS官方文檔之相容性方案概覽

來源:互聯網
上載者:User

標籤:cts   cdd   相容性測試   

官方英文文檔連結:https://source.android.com/compatibility/overview.html


Compatibility Program Overview

相容性方案概覽

The Android compatibility program makes it easy for mobile device manufacturers to develop compatible Android devices.

安卓的相容性方案讓安卓手機生產商能夠很容易就開發中可相容的安卓裝置(天地會珠海分舵註:可相容什麼呢?就是可以相容標準google提供的安卓系統可以支援的功能,以防手機生產商把開源的安卓系統修改得面目全非後,開發人員開發的應用都安裝不上了,所以才有了CTS來要求手機開發上必須測試通過才能上google play)。

Program goals方案目標

The Android compatibility program works for the benefit of the entire Android community, including users, developers, and device manufacturers.Each group depends on the others. Users want a wide selection of devices and great apps; great apps come from developers motivated by a large market for their apps with many devices in users‘ hands; device manufacturers rely on a wide variety of great apps to increase their products‘ value for consumers.

安卓的相容性方案兼顧了整個安卓社區各個團體的利益,包括使用者,開發人員和手機生產商。其中這些團體之間互相依賴,使用者希望在廣大範圍內對手機類型和優秀應用進行選擇;而優秀的應用的開發人員又會受到一個廣大的市場所激勵而去開發出更多優秀的應用,因為他們的應用可以通過這個廣大的市場到達使用不同類型手機的使用者手上;而裝置生產商又依賴這些廣泛的優秀的應用來提升它們的產品對使用者的價值。(天地會珠海分舵註:其實整一段話google的意義就是想表達我的google play是一個多麼強大的應用市場。你安卓裝置生產商裝置想賺錢,想更多的開發人員可以開發適合你的機型的應用,想更多的使用者使用你的手機,那麼你就要用我的google play,而你要用我的google play,那麼你閹割修改後的安卓作業系統就必須滿足一定的規則,不然使用者在我的google play下載了個應用到你手上竟然用不了就對大家都沒有好處了)

Our goals were designed to benefit each of these groups:

我們的目的是為了讓以下這部分人受惠而設計的:

  • Provide a consistent application and hardware environment to application developers. Without a strong compatibility standard, devices can vary so greatly that developers must design different versions of their applications for different devices. The compatibility program provides a precise definition of what developers can expect from a compatible device in terms of APIs and capabilities. Developers can use this information to make good design decisions, and be confident that their apps will run well on any compatible device.

  • 為應用開發人員提供一個一致的應用開發環境和硬體環境:如果沒有一個相容性標準的話,各種裝置將會五花八門,而開發人員就必須為每個不同的裝置開發不同版本的應用。相容性方案以一套預先規定好的APIs和capabilities(天地會珠海分舵註:capabilities可以理解成手機的一些特性)的形式為開發人員預期能從一個相容性裝置可以獲得的功能提供了一個精準的定義。這樣開發人員就可以利用這些資訊來很好的對如何設計他們的應用做一個決定,且這樣他們就非常有信心他們開發的應用可以在任何相容的裝置上良好的運行。

  • Enable a consistent application experience for consumers. If an application runs well on one compatible Android device, it should run well on any other device that is compatible with the same Android platform version. Android devices will differ in hardware and software capabilities, so the compatibility program also provides the tools needed for distribution systems such as Google Play to implement appropriate filtering. This means users see only the applications they can actually run.

  • 為消費者提供一個一致的應用體驗:如果一個應用在一個相容性裝置上可以很好的運行,那麼它就應該可以在所有同安卓版本的相容性裝置上很好的運行。各種安卓裝置無論在硬體和軟體特性上都會有所不同,所以這個相容方案會為如Google Player等的各種應用分發平台提供相應的工具來開發對應的過濾功能,什麼意思呢?意思就是使用者在該分發平台上只會看到他們的手機可以啟動並執行應用。

  • Enable device manufacturers to differentiate while being compatible. The Android compatibility program focuses on the aspects of Android relevant to running third-party applications, which allows device manufacturers the flexibility to create unique devices that are nonetheless compatible.

  • 讓裝置生產商可以在可相容的同時又可獨樹一幟:安卓的相容性方案關注的方面是安裝在裝置上的安卓系統是否可以很好的運行第三方應用(天地會珠海分舵註:除生產商自己提供的應用外的第三方應用),這就允許裝置生產商在考慮到相容性的同時怎麼建立一個獨特的別具一格的的裝置提供了很大的彈性空間(天地會珠海分舵註:因為手機生產商只需要保證能滿足安卓的相容性方案,那麼就可以對裝置做任何其他的事情了)

  • Minimize costs and overhead associated with compatibility. Ensuring compatibility should be easy and inexpensive to device manufacturers. The testing tool is free, open source, and available for download. It is designed to be used for continuous self-testing during the device development process to eliminate the cost of changing your workflow or sending your device to a third party for testing. Meanwhile, there are no required certifications, and thus no corresponding costs and fees.

  • 最小化相容性所帶來的附加成本:保證裝置的相容性對裝置生產商來說應該是很容易且不昂貴的事情。安卓相容性方案提供的工具是免費的,開源的,可下載的。它設計出來本身就是為了讓裝置生產商在在裝置開發過程中進行持續的自測,這樣裝置生產商就可以消除開發流程變化或者把裝置送到第三方機構進行相容性檢測所帶來的附加成本。同時,安卓相容性方案不需要任何的認證,所以不會產生相應的費用和賬單。

The Android compatibility program consists of three key components:

安卓相容性方案由以下3個關鍵區段組成:

  • The source code to the Android software stack
  • 安卓軟體棧中的原始碼
  • The Compatilbility Definition Document (CDD), representing the "policy" aspect of compatibility
  • 相容性定義文檔(CDD),代表了安卓相容性的“策略"定義
  • The Compatilbility Test Suite (CTS), representing the "mechanism" of compatibility
  • 相容性測試套件(CTS),代表了安卓相容性的”機制“

Just as each version of the Android platform exists in a separate branch in the source code tree, there is a separate CTS and CDD for each version as well. The CDD, CTS, and source code are -- along with your hardware and your software customizations -- everything you need to create a compatible device.

正如不同版本的安卓平台的源碼會從源碼樹中分出不同的對應的分支一樣,不同版本的CTS和CDD也會有不同的分支(天地會珠海分舵註:不同版本的安卓系統會有對應版本的CTS和CDD與其對應)。上面描述的CDD,CTS和源碼,再加上你作為手機生產商提供的自身的硬體和軟體定製,這就是你創造一個相容性裝置所需要的所有東西了。

Compatibility Definition Document相容性定義文檔(CDD)

For each release of the Android platform, a detailed CDD will be provided. The CDD represents the "policy" aspect of Android compatibility.

每當一個安卓作業系統平台發布的時候都會提供一個詳盡的CDD文檔,該文檔代表了安卓相容性的“策略”定義。

No test suite, including CTS, can truly be comprehensive. For instance, the CTS includes a test that checks for the presence and correct behavior of OpenGL graphics APIs, but no software test can verify that the graphics actually appear correctly on the screen. More generally, it‘s impossible to test the presence of hardware features such as keyboards, display density, Wi-Fi, and Bluetooth.

有些情況下,包括CTS在內,是沒有任何測試套件是可以全能的對所有相容性方面都做到詳盡的自動化的測試的。比如,在CTS中有一個測試時用來檢查OpenGL圖形庫APIs在螢幕上的正確呈現和正確行為的,但是沒有任何軟體測試可以驗證對應的圖形是真的呈現在螢幕上的(天地會珠海分舵註:包括該CTS的測試案例也只是調用OpenGL的API而已,而該測試是不能檢測到螢幕是否有顯示對應圖形,只能靠肉眼去觀測。這個也就是在軟體測試行業所共知的不是所有功能都是可以實現測試自動化的)。更通俗的來說,(用測試載入器)去測試硬體呈現方面的功能是不可能的,比如去測試按鍵物理鍵盤(是否可用),螢幕密度,Wi-Fi硬體功能,藍芽硬體功能。

The CDD‘s role is to codify and clarify specific requirements, and eliminate ambiguity. The CDD does not attempt to be comprehensive. Since Android is a single corpus of open-source code, the code itself is the comprehensive "specification" of the platform and its APIs. The CDD acts as a "hub" referencing other content (such as SDK API documentation) that provides a framework in which the Android source code may be used so that the end result is a compatible system.

CDD所處的角色就是去定義和澄清具體的需求,並且消除模稜兩可的有歧義的情況。CDD不會去嘗試做到無所不包含,因為安卓自身就是一個開源的代碼集合,代碼自身就是對安卓平台和它提供的APIs的一個全方位的”說明文檔“(天地會珠海分舵註:瞭解過敏捷開發和重構等相關知識的應該都清楚一個說法--去文檔化,優秀代碼就是最好的文檔)。CDD扮演的就是一個”集線器“角色,(把進來的對相容性的需求)重新分發引用到其他對應的內容(比如SDK API 文檔),該內容提供了一個安卓源碼會用到的架構,這樣整個系統就自然會成為一個相容的系統了。(天地會珠海分舵註:這一段應該有更好的翻譯方式,如果看官有的請提供出來,本人會選擇性採納)

If you want to build a device compatible with a given Android version, start by checking out the source code for that version, and then read the corresponding CDD and stay within its guidelines. For additional details, simply examine the latest CDD.

如果你想在一個已定的安卓版本中建立一個相容性裝置,請從把該版本的安卓系統源碼下載下來開始,然後仔細的閱讀該版本源碼對應的CDD文檔並遵循它的指引。更多額外的相關內容,請查看最近的CDD文檔。

Compatibility Test Suite 相容性測試套件

The CTS is a free, commercial-grade test suite, available for download. The CTS represents the "mechanism" of compatibility.

CTS是一個免費的,商業層級的測試套件,且可供下載。CTS代表了安卓相容性的”機制“。

The CTS runs on a desktop machine and executes test cases directly on attached devices or an emulator. The CTS is a set of unit tests designed to be integrated into the daily workflow (such as via a continuous build system) of the engineers building a device. Its intent is to reveal incompatibilities early on, and ensure that the software remains compatible throughout the development process.

CTS是跑在你的案頭系統上面來驅動串連上案頭系統主機的裝置或者模擬器去運行相應的測試案例(指令碼)的。CTS是一套單元測試的集合,是設計來讓我們來整合到我們的日常工作流程(比如通過整合到我們的持續整合系統構建系統)來協助工程師構建一個安卓裝置系統的。它的本意就是去在早期把不相容的地方給暴露出來,去保證在整個安卓裝置系統開發的流程中該裝置是一直保持相容的。

Compatibility Test Suite Verifier (CTS Verifier)相容性測試套件驗證器

The Compatibility Test Suite Verifier (CTS Verifier) is a supplement to the CTS available for download. CTS Verifier provides tests for APIs and functions that cannot be tested on a stationary device without manual input (e.g. audio quality, accelerometer, etc).

相容性測試套件驗證器(CTS 驗證器)是CTS的一個附件功能(天地會珠海分舵:其實就是一個APK),可以在這裡進行下載。CTS驗證器提供了針對一些在沒有戶輸入等互動動作就完成不了的APIs和功能測試(比如:音頻品質,加速計,等等)

For details on the CTS, consult the CTS introduction.

關於CTS的詳細資料,請查詢”CTS簡介“。

Item

Description

Warning

Author

天地會珠海分舵

轉載請註明出處!

更多精彩文章請查看本人部落格!

Blog Address

http://blog.csdn.net/zhubaitian



安卓CTS官方文檔之相容性方案概覽

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.