移動app中斷測試之來電中斷
智能設備功能的日益強大和用戶使用場景的多樣性,使一款APP在移動設備端中斷操作非常頻繁,APP在中斷場景的表現直接影響用戶體驗,中斷測試是APP功能測試的必測內容。
說到手機的中斷測試,來電中斷是大家最容易想到的,常規的測試包括呼叫和通話中斷,如下圖。

貼近智能手機的用戶應用場景,我們發現打電話已經不局限於使用運營商網絡,常用的社交軟件如QQ、微信都支持語音和視頻電話。這些軟件使用網絡進行通話或者視頻,與運營商電話網絡形式不同,所以非常有必要做中斷測試。來電中斷的測試場景添加如下圖。
中斷測試要點
中斷指軟件在工作中被其他的任務或意外事件等情況終止推出,相應的測試即為中斷測試,中斷測試有人為中斷、新任務中斷以及意外中斷等幾種情況
中斷詳細包括以下:
一. 來電中斷:呼叫掛斷、被呼叫掛斷、通話掛斷、通話被掛斷
二:短信中斷:接收短信、查看短信
三:其他中斷:藍牙、鬧鍾、插拔數據線、手機鎖定、手機斷電、手機問題(系統死機、重啟)
中斷場景:
在以下場景介入外部事件(來電、短信、插拔數據線等)
1. 登陸界面load時交互信息數據
2. 讀取好友列表界面load時交互信息數據(最密好友列表刷新、好友列表刷新)
3. 好友列表界面load時交互信息數據(添加、刪除好友時)
4. 查詢個人資料界面load時交互信息數據
5. 查詢排行榜界面load時交互信息數據
6. 查詢游戲戰績界面load時交互信息數據
7. 查詢財務界面load時交互信息數據
8. 游戲積分上傳界面load時交互信息數據
游戲中斷 :
在游戲運行的過程中,對游戲進行停止動作,例如短信,來電等,使游戲暫停。從而驗證游戲的穩定性。 中斷操作:
在游戲從開始起,一直到游戲完全退出,都算游戲過程,此過程中,游戲中的任何一屏,都應該可以中斷,平且正常返回,且不會出現任何問題。游戲在中斷后,應該會顯示出一個暫停屏,此屏一般為黑底,提示信息為:“press center/5 key to continue” 或“按中心鍵/5鍵繼續”。按中心鍵后游戲繼續運行
舉一個中斷測試的案例:
最近一個項目,大量用到時間中斷,也經常出現各種
bug
,為了查找原因,特意做了幾個小
test
1 using UnityEngine;
2 using System.Collections;
3
4 public class test : MonoBehaviour {
5
6 // Use this for initialization
7 IEnumerator Start () {
8
9 InvokeRepeating("test1",0f,1f);
10 //yield return new WaitForSeconds(1f);
11 CancelInvoke("test1");
12 yield return null;
13 }
14
15 // Update is called once per frame
16 void Update () {
17
18 }
19
20 void test1()
21 {
22 Debug.Log(Time.time);
23 Debug.Log("haha");
24 }
25 }
什么都不輸出
如果把
name="code" class="csharp">yieldreturn new WaitForSeconds(1f);
加上
輸出為: <ignore_js_op>

下面這段代碼,就
canel
不掉,真他媽的坑爹啊
1 using UnityEngine;
2 using System.Collections;
3
4
5 public class test : MonoBehaviour {
6
7
8 // Use this for initialization
9 void Start () {
10
11 StartCoroutine("createstart");
12 }
13
14 // Update is called once per frame
15 void Update () {
16
17 }
18
19 IEnumerator createstart()
20 {
21 int i=0;
22 while(true)
23 {
24 InvokeRepeating("test1",0f,1f);
25 yield return new WaitForSeconds(5f);
26 CancelInvoke("test1");
27 print("ok i ge");
28 yield return null;
29
30 }
31 }
32
33 void test1()
34 {
35 Debug.Log(Time.time);
36 Debug.Log("haha");
37 }
38 }
<ignore_js_op>

1 using UnityEngine;
2 using System.Collections;
3
4 public class test : MonoBehaviour {
5
6 public bool isok=true;
7 // Use this for initialization
8 void Start () {
9
10 StartCoroutine("createstart");
11 }
12
13 // Update is called once per frame
14 void Update () {
15
16 }
17
18 IEnumerator createstart()
19 {
20 int i=0;
21 while(isok)
22 {
23 InvokeRepeating("test1",0f,1f);
24 yield return new WaitForSeconds(5f);
25 isok=false;
26 CancelInvoke("test1");
27 print("ok i ge");
28 yield return null;
29
30 }
31 }
32
33 void test1()
34 {
35 Debug.Log(Time.time);
36 Debug.Log("haha");
37 }
}
目前能做中斷測試的一些公司,我知道的有TestFlight、TestFairy、TestBird、GooglePlay等等。