14. 開發架構
▸ MVP pattern
▸ View
▸ activity, fragment, dialog fragment, dialog, custom view
(with android framework)
▸ Presenter
▸ pure java class / flow control / error handling
▸ Model
▸ Repository pattern abstract outer dependency
(network, sqlite, file, hardware, disk cache)
▸ business logic
15. 測試
▸ 使⽤用者測試
▸ ⼈人⼯工測試
▸ 使⽤用者回報 app | email | google play report
▸ fabric crash report
▸ end to end test (UI test)
▸ calabash & cucumber
▸ integration test
▸ network api test
▸ unit test
▸ with android framework (androidTest)
▸ pure java class (test)
16. UI TEST
▸ Calabash (UI testing framework cross platform)
▸ 環境安裝
▸ ⽤用來來操作 app 的步驟
▸ 提供 irb 介⾯面 debug
Feature
Test Server
Calabash Device
adb
Instrumentation
Server
Application
17. TEST CASE
▸ Cucumber
▸ ⽤用來來描述需求的步驟的語法
▸ 可以透過步驟產⽣生 step definition
▸ 新增付款信⽤用卡步驟如下
Scenario: Add payment credit card
Given I login phone "0900000100" email "tkalu+100"
When I open MyWallet
When I press view with id "addCardContainer"
When I enter text "4910 0411 1111 1113" into field with id "cardNumber"
When I enter text "0222" into field with id "cardDate"
When I enter text "222" into field with id "cardCVC"
When I wait for a second
When I press view with id "complete"
Then I wait to see "新增成功"
And I take a screenshot
22. 測試⽤用的 API SERVER
▸ 使⽤用 Docker 建立 mock api server
▸ 每次都是乾淨的環境
▸ 保持與正式環境⼀一樣的版本
▸ 後⾨門程式僅在 docker server 上運⾏行行,避免奇怪的漏洞洞在
正視環境上裸奔
23. UI TEST WITH DOCKER
產⽣生 Docker container
DockerFile 建立測試 Server
將測試 server end point 修改⾄至程式碼
產⽣生連結測試 server 的 apk
UI 測試
24. 發布/上架
▸ api 環境
▸ development (debug)
▸ staging (debug)
▸ production (release)
▸ build type
▸ debug / release (with proguard)
▸ production flavors
▸ dev (mini sdk version 21)
▸ general (mini sdk version 16)
▸ build variants
▸ devDebug (fabric 測試版)
▸ generalRelease (fabric 正式版 / google play 上架版)