- By plain JUnit
- By Instrumentation (Android's JUnit extension)
- 建立 Android Test Project,要有 package name / application name 等 (依據不同的測試目的,Superclass 會不同)。官網提供的資料,可以測試
- Activity
- Service
- Content Provider
- 需要指定 Test Target (待測軟體的 Name)。Step1 & 2 需要在 AndroidManifest.xml 裡面增加宣告。然後 Test project 的 JAVA source code 裡面要 import 待測程式的 package name
- 程式結構
- Activity test:
- 建立 Constructor。進行 instantiate。 (Android testing framework 的要求)
- Override setUp() or tearDown()。用於 initialize 變數和環境,也可以記錄 DUT 的初始狀態。若要進行 keystroke 操作,要宣告 setActivityInitialTouchMode(false);
- 實作 testPreconditions()。Initialize DUT 是否正確。
- 實作測試主體。(Component 解析與測試、Keystroke & touch event 操作、UI test、State management)
- 執行測試
- By Eclipse (JUnit tab)
- By am
- 可指定測試範圍 (All / Package / Class / Method / Size tag)
- 可測試對象 (Function / Unit / Performance)
- 可觀察指標 (Log / Performance value / emma / Debug)
- By Dev. tool
- By 3rd party test framework
- Monkeyrunner / Monkey
- By Sikuli
- Install JRE on PC (Win / Linux)
- Method1: Android device => Install VNC server, then could be controlled by PC
- bMethod2: PC install "androidscreencast" tool. (http://androidscreencast.googlecode.com/svn/trunk/AndroidScreencast/dist/androidscreencast.jnlp)
- Method3: Android device install "droid explorer" (teamviwer / webkey / free and awesome / Remote Control Phone / SL4A)
- By Robotium
- By Robolectric
- By Selenium
- By ASE
- By ADB + Shell script
- By JamoSolution
- By CTS
- By IDE plug-ins (TestDroid, DS-5, ...)
- By commercial framework (Coverity / Codenomicon / QSquare / ...)
Automatic test framework (Open source)
- Autotest
- STAF
- ATF
- Boost
- DejaGnu
- JSystem
- Guitar
- http://www.opensourcetesting.org/functional.php
- http://www.aptest.com/resources.html
- http://www.tigris.org/
- http://code.google.com/p/scirocco/
- ...
參考 URL:
- http://blog.csdn.net/stevenliyong/archive/2010/05/06/5563759.aspx
- http://www.dian.org.cn/ophone/?p=162
- http://www.dotblogs.com.tw/neil/archive/2009/10/03/10898.aspx
- http://www.moandroid.com/?p=1246
- http://www.netmite.com/android/mydroid/development/pdk/docs/instrumentation_testing.html
- http://www.netmite.com/android/mydroid/development/pdk/docs/instrumentation_framework.html
- http://www.lifemichael.com/en/?p=1528
- http://www.qqread.com/soft-engineering/n488000.html
- http://www.nfwin.com/news-243/32180.html
- http://www.iteye.com/topic/484295
- http://www.iteye.com/topic/454916
- http://mars5337.iteye.com/blog/740637
- http://mintelong.iteye.com/blog/460903
- http://blog.sina.com.cn/s/blog_61f4999d0100l6sg.html
- http://sites.google.com/site/mobilewirelesstestautomation/draft-material-on-mobile-wireless/testing-techniques-for-android-applications
沒有留言:
張貼留言