资源描述
Autorenew功能测试
一、案例分享
1. 功能概述
在做印度项目的时候,遇到客户有这样的需求,就是用户订购产品到期后能通过短信的方式续订产品,这个需求涉及到了crm,信管,帐处和信控。帐处这边要关注的地方就是产品扣费提醒这一块。分为产品扣费成功提醒,产品扣费失败提醒和产品扣费前提醒。
2. 测试案例设计
测试要点罗列:
在设计测试场景和编写测试用例的时候,为了不遗漏我们的测试要点,我们可以把我们要测试的点用表格或则列表的方式列出来,这样可以清楚知道我们要覆盖的测试点。
测试点
枚举值
账户类型
预付费
后付费
产品类型
autorenew
非autorenew
提醒类型
扣费成功
扣费失败
扣费前
测试场景和测试用例设计:
按照上面罗列出来的测试点进行单个覆盖,设计测试场景如下
编号
测试场景
测试用例
1
预付费用户订购非autorenew产品,产品到期,发送扣费前提醒
2
预付费用户订购非autorenew产品,产品扣费成功,发送提醒
3
预付费用户订购非autorenew产品,产品扣费失败,发送提醒
4
预付费用户订购autorenew产品,产品到期,发送扣费前提醒
5
预付费用户订购autorenew产品,产品扣费成功,发送提醒
6
预付费用户订购autorenew产品,产品扣费失败,发送提醒
7
后付费用户订购非autorenew产品,产品到期,发送扣费前提醒
8
后付费用户订购非autorenew产品,产品扣费成功,发送提醒
9
预付费用户订购非autorenew产品,产品扣费失败,发送提醒
10
后付费用户订购autorenew产品,产品到期,发送扣费前提醒
11
后付费用户订购autorenew产品,产品扣费成功,发送提醒
12
后付费用户订购autorenew产品,产品扣费失败,发送提醒
这样场景设计出来后,发现要设计出来的测试用例至少有12个。如果再包含异常场景的话,那就会变得更多。由于当时项目很紧,测试时间有限。如果用例太多的话可能会影响测试进度,最后导致功能测试不完整,于是我就压缩了下测试用例的数目,但为了又能完全覆盖测试要点,于是采用了交叉覆盖的方式设计了测试用例。交叉覆盖就是一个用例覆盖多个测试点,同时相同的测试场景和相似的测试用例,可以进行不同点的覆盖。
下面是设计的交叉覆盖用例:
编号
测试场景
测试用例
1
预付费用户订购非autorenew产品,产品到期,发送扣费前提醒
2
预付费用户订购非autorenew产品,产品扣费成功,发送提醒
3
后付费用户订购非autorenew产品,产品扣费失败,发送提醒
4
后付费用户订购autorenew产品,产品到期,发送扣费前提醒
5
后付费用户订购autorenew产品,产品扣费成功,发送提醒
6
预付费用户订购autorenew产品,产品扣费失败,发送提醒
主要测试步骤:
1) 信管开户,查看账户信息
2) 跑日帐,查看日志
3) 查看提醒数据,有相应数据生成
3. 测试用例执行
测试执行的主要过程是信管开户和产品扣费,产品首次扣费通过产品订购来实现,之后的扣费是通过帐处的日帐扣费来实现。由于每个测试用例都有信管开户是第一步,这时候我就想到了,如果每个测试用例都要新开户,这样的话垃圾账户数据可能太多,于是我就想到能不能减少开户数据。这样有两个好处,一个是减少垃圾数据,另外也可以提高我们的测试效率。后来我发现在正常的情况下,我们开户出来就可以验证扣费成功这个提醒,然后在生成下次扣费时间的时候,可以验证产品的到期提醒也就是扣费前的提醒。最后我们在构造余额不足的情况下,即可以验证扣费失败的提醒。由于我们是有两种账户,一个预付费和一个后付费,这样我们只要开出来两个账户就可以验证完所有的测试用例。
主要测试数据
按照上面的测试计划,我们预后付费的测试用例的执行顺序是:
验证扣费成功提醒-----验证扣费前提醒-----验证扣费失败提醒
下面是后付费测试的相关数据
1) 后付费扣费成功提醒
U2P_AR_BI_001_008
帐处扣费,发送提醒
业务需求
Autorenew= Y产品,扣费成功
目标
帐处扣费成功,提醒发出
Pre-requisites
1.后付费产品:7000589
2.账户:104115
Post-requisites
none
测试参数
Step 1: 开户,查看三户信息
v_SO_NBR====256487
serv_id====4114
acct_id====104115
cust_id====20004116
mdb>> select * from CPromCharValue where m_llObjectId = 4114;
_oid, m_llObjectId m_llPromNo m_nObjectType m_nSpecCharId m_szValue m_llGroupId m_dValidDate m_dExpireDate
645, 4114, 40000256487, 0, 22, '1', 6282, 20151014203134, 20180710203134
Step 2: 查看开户扣费日志,有相应打印
product_offering_id = 7000589 ,notify_type = 4 ,notify_mode = 0 ,offset_cycle_type = 0 ,offset_cycle_unit = 0 ,cycle_count = 0 ,cycle_unit = 0 ,cycle_type = 0 ,notification_id = 0 ,mode_type = 0 ,billing_type = 1,channel_id = 4
2015-10-16 13:26:19.793581 0 [47202228762368] -2608996366028145610 [trace] loaddbinfo.cpp 127
======================prodOfferNotifyInner===================================
product_offering_id = 7000589 ,notify_type = 4 ,notify_mode = 1 ,offset_cycle_type = 0 ,offset_cycle_unit = 0 ,cycle_count = 0 ,cycle_unit = 0 ,cycle_type = 0 ,notification_id = 2050104 ,mode_type = 1 ,billing_type = 1,channel_id = -1
2015-10-16 13:26:19.794077 0 [47202228762368] -2608996366028145610 [trace] recurringnotify.cpp 927
===========================recurring prod deducted notify in para===========================
sNotifyIntfList
notification_id = 2050104, region_code = 0, so_nbr = 0, so_date = 00000000000000+0000, cust_id = 0, acct_id = 104115, serv_id = 4114, teland_id = 1
>>>>>>list_param
param_id = 8010, param_value = 7000589, measure_id = 0
param_id = 3042, param_value = 100000, measure_id = 12903
param_id = 9010, param_value = 200000, measure_id = 12903
param_id = 1081, param_value = 31, measure_id = 0
param_id = 8002, param_value = 20160114, measure_id = 0
param_id = 7000, param_value = 0, measure_id = 0
param_id = 3054, param_value = 104115, measure_id = 0
param_id = 3004, param_value = 7303004114, measure_id = 0
param_id = 9002, param_value = postpaid4114, measure_id = 0
param_id = 3043, param_value = 20151214000000, measure_id = 0
param_id = 9015, param_value = 1, measure_id = 0
>>>>>>list_phone
obbs:J:1.3:{
"list_0_MNotificationDef::SPhoneIntfList_size" : 0,
Step 3: 查看提醒工单和短信表,有数据生成
Test Result
Pass
Tester: yangshankun
Date: 2015/10/20
2) 后付费到期提醒
U2P_AR_BI_001_009
帐处扣费,发送提醒
业务需求
Autorenew= Y产品,不扣费
目标
帐处不扣费,扣费前提醒发出
Pre-requisites
1.后付费stack产品:7000589
2.账户:104115
Post-requisites
none
测试参数
Step 1: 开户,查看三户信息
v_SO_NBR====256487
serv_id====4114
acct_id====104115
cust_id====20004116
mdb>> select * from CPromCharValue where m_llObjectId = 4114;
_oid, m_llObjectId m_llPromNo m_nObjectType m_nSpecCharId m_szValue m_llGroupId m_dValidDate m_dExpireDate
645, 4114, 40000256487, 0, 22, '1', 6282, 20151014203134, 20180710203134
Step 2: 跑下次扣费前3天日帐(可配置)查看日志,有相应打印
2015-10-14 21:31:43.666131 0 [47379261957888] -1901616020072943109 [trace] loaddbinfo.cpp 108
======================prodOfferNoti===================================
product_offering_id = 7000589 ,notify_type = 6 ,notify_mode = 0 ,offset_cycle_type = 0 ,offset_cycle_unit = 0 ,cycle_count = 0 ,cycle_unit = 0 ,cycle_type = 0 ,notification_id = 0 ,mode_type = 0 ,billing_type = 0,channel_id = 0
2015-10-14 21:31:43.666196 0 [47379261957888] -1901616020072943109 [trace] loaddbinfo.cpp 127
======================prodOfferNotifyInner===================================
product_offering_id = 7000589 ,notify_type = 4 ,notify_mode = 1 ,offset_cycle_type = 0 ,offset_cycle_unit = 0 ,cycle_count = 0 ,cycle_unit = 0 ,cycle_type = 0 ,notification_id = 2050104 ,mode_type = 1 ,billing_type = 1,channel_id = -1
2015-10-14 21:31:43.666282 0 [47379261957888] -1901616020072943109 [trace] loaddbinfo.cpp 127
======================prodOfferNotifyInner===================================
product_offering_id = 7000589 ,notify_type = 5 ,notify_mode = 1 ,offset_cycle_type = 0 ,offset_cycle_unit = 0 ,cycle_count = 0 ,cycle_unit = 0 ,cycle_type = 0 ,notification_id = 2050106 ,mode_type = 1 ,billing_type = 1,channel_id = -1
2015-10-14 21:31:43.666330 0 [47379261957888] -1901616020072943109 [trace] loaddbinfo.cpp 127
======================prodOfferNotifyInner===================================
product_offering_id = 7000589 ,notify_type = 6 ,notify_mode = 1 ,offset_cycle_type = 1 ,offset_cycle_unit = 3 ,cycle_count = 0 ,cycle_unit = 0 ,cycle_type = 0 ,notification_id = 2060101 ,mode_type = 1 ,billing_type = 1,channel_id = -1
2015-10-14 21:31:43.666353 0 [47379261957888] -1901616020072943109 [trace] recurringnotify.cpp 467 proc_prodDeductNotify llProdId=40000256487
2015-10-14 21:31:43.666373 0 [47379261957888] -1901616020072943109 [trace] recurringnotify.cpp 468 get_prodNotify iRet=0
2015-10-14 21:31:43.666392 0 [47379261957888] -1901616020072943109 [trace] recurringnotify.cpp 469 get_prodNotify bExist=1
2015-10-14 21:31:43.666469 0 [47379261957888] -1901616020072943109 [trace] recurringnotify.cpp 482 dealTime = 20151111000000+0800,end_date = 20151114000000,iSpanDay = 3
2015-10-14 21:31:43.667017 0 [47379261957888] -1901616020072943109 [trace] recurringnotify.cpp 934
===========================recurring prod deduct notify in para===========================
sNotifyIntfList
_date = 20151114000000,iSpanDay = 3
2015-10-14 21:31:43.667017 0 [47379261957888] -1901616020072943109 [trace] recurringnotify.cpp 934
===========================recurring prod deduct notify in para===========================
sNotifyIntfList
notification_id = 2060101, region_code = 0, so_nbr = 0, so_date = 20151111000000+0800, cust_id = 0, acct_id = 104115, serv_id = 4114, teland_id = 1
>>>>>>list_param
param_id = 1072, param_value = 3, measure_id = 0
param_id = 8010, param_value = 7000589, measure_id = 0
param_id = 9015, param_value = 1, measure_id = 0
param_id = 9014, param_value = 1, measure_id = 0
param_id = 8004, param_value = 20180710203134, measure_id = 0
>>>>>>list_phone
obbs:J:1.3:{
"list_0_MNotificationDef::SPhoneIntfList_size" : 0,
"list_0_MNotificationDef::SPhoneIntfList" : null
}
>>>>>>list_email
obbs:J:1.3:{
"list_0_MNotificationDef::SEmailIntfList_size" : 0,
"list_0_MNotificationDef::SEmailIntfList" : null
}
Step 3: 查看提醒工单和短信表,有数据生成
Test Result
Pass
Tester: yangshankun
Date: 2015/10/20
3) 后付费扣费失败提醒
U2P_AR_BI_001_010
帐处扣费,发送提醒
业务需求
Autorenew= N产品,扣费失败
目标
扣费失败,提醒发出
Pre-requisites
1.后付费stack产品:7000589
2.账户:104115
Post-requisites
none
测试参数
Step 1: 开户,查看三户信息
v_SO_NBR====256487
serv_id====4114
acct_id====104115
cust_id====20004116
mdb>> select * from CPromCharValue where m_llObjectId = 4114;
_oid, m_llObjectId m_llPromNo m_nObjectType m_nSpecCharId m_szValue m_llGroupId m_dValidDate m_dExpireDate
645, 4114, 40000256487, 0, 22, '0', 6282, 20151014203134, 20180710203134
Step 2: 跑日帐查看日志,有相应打印
======================prodOfferNoti===================================
product_offering_id = 7000589 ,notify_type = 5 ,notify_mode = 0 ,offset_cycle_type = 0 ,offset_cycle_unit = 0 ,cycle_count = 0 ,cycle_unit = 0 ,cycle_type = 0 ,notification_id = 0 ,mode_type = 0 ,billing_type = 1,channel_id = 4
2015-10-14 21:42:07.363032 0 [47574347425536] -1024120965688527477 [trace] loaddbinfo.cpp 127
======================prodOfferNotifyInner===================================
product_offering_id = 7000589 ,notify_type = 4 ,notify_mode = 1 ,offset_cycle_type = 0 ,offset_cycle_unit = 0 ,cycle_count = 0 ,cycle_unit = 0 ,cycle_type = 0 ,notification_id = 2050104 ,mode_type = 1 ,billing_type = 1,channel_id = -1
2015-10-14 21:42:07.363044 0 [47574347425536] -1024120965688527477 [trace] loaddbinfo.cpp 127
======================prodOfferNotifyInner===================================
product_offering_id = 7000589 ,notify_type = 5 ,notify_mode = 1 ,offset_cycle_type = 0 ,offset_cycle_unit = 0 ,cycle_count = 0 ,cycle_unit = 0 ,cycle_type = 0 ,notification_id = 2050106 ,mode_type = 1 ,billing_type = 1,channel_id = -1
2015-10-14 21:42:07.363380 0 [47574347425536] -1024120965688527477 [trace] recurringnotify.cpp 928
===========================recurring prod deducted notify in para===========================
sNotifyIntfList
notification_id = 2050106, region_code = 0, so_nbr = 0, so_date = 00000000000000+0000, cust_id = 0, acct_id = 104115, serv_id = 4114, teland_id = 1
>>>>>>list_param
param_id = 8010, param_value = 7000589, measure_id = 0
param_id = 3042, param_value = 100000, measure_id = 12903
param_id = 9010, param_value = 0, measure_id = 12903
param_id = 1081, param_value = -1, measure_id = 0
param_id = 8002, param_value = 20151214, measure_id = 0
param_id = 7000, param_value = 300426, measure_id = 0
param_id = 3054, param_value = 104115, measure_id = 0
param_id = 3004, param_value = 7303004114, measure_id = 0
param_id = 9002, param_value = postpaid4114, measure_id = 0
param_id = 9015, param_value = 1, measure_id = 0
Step 3: 查看提醒工单和短信表,有数据生成
Test Result
Pass
Tester: yangshankun
Date: 2015/10/20
二、总结
1. 高质量案例设计
经过上面的测试案例设计和测试执行。个人感觉高质量的测试案例设计和高效率的测试执行是测试过程中必不可少的。测试案例覆盖所有测试场景和测试点是重要的,但是测试场景的数量和质量也是需要关注的。不能为了覆盖所有测试点,设计出来的场景数量太多,导致测试人员不能有效的完成测试任务。这样产品的质量就不能得到保证这个在项目时间紧和测试时间不足的情况下尤其重要。可以采用上面的交叉覆盖或则别的方法来减少测试场景和测试用例。
2. 高效率用例执行
另外测试人员如何高效率的完成测试执行,也是考验测试人员对功能的理解和对基本知识的掌握,当拿到测试用例的时候,测试人员首先要了解自己应该关注的测试点是什么,然后评估下测试用例的数量,自己能不能在规定的时间内完成测试执行,输出相关测试报告。所以这时候高效率的测试执行就显的尤其重要。当然高效率的测试执行包含了很多东西,比如测试用例的执行顺序,测试步骤的安排和先关模块的配合。所以这个也是对测试人员的综合能力的体现。
3. 个人体会
最后感谢公司领导和同事的信任和帮助,让我有幸参加印度这个项目。让我在这个项目中收获很多,让我对测试工作有了很多的新认识。知道测试不仅仅只是简单的完成领导交给的测试任务,更多的是从项目的整个计划和角度去思考问题。合理的规划手上的任务和事情,在不影响进度和测试的情况下,多去学习不同模块的基本知识。这样个人能力才能得到很好的提升。
展开阅读全文