你可以不成功,但是不能不成长

根据需求文档设计测试用例

上一篇 / 下一篇  2008-08-22 14:22:54 / 个人分类:测试方法探讨

51Testing软件测试网@ r9N!J+@

    测试用例(Test Case)是为某个特殊目标而编制的一组测试输入、执行条件以及预期结果,以便测试某个程序路径或核实是否满足某个特定需求。对软件的每个特定功能或运行操作路径的测试构成了一个个测试用例。51Testing软件测试网Jyd5M&ondN
    目前的功能测试用例都需要首先进行需求理解,再进行用例设计,这些过程都是基于人工实现的。尤其是测试用例的测试输入部分需要人来理解需求并组合测试步骤,测试用例的预期结果业需要人工来提取。人工撰写功能测试用例,不仅耗费大量时间在需求理解阶段,而且也需要花费大量人力和时间撰写。尽管这样,撰写出来的测试用例仍然存在覆盖度不均衡,依赖用例撰写者的经验和能力,以及不能够完全的的复现需求的问题。

7S,E2[6fd051Testing软件测试网.]OQAM

一、需求文档分析51Testing软件测试网`9UY8@n(b
通过分析需求文档的章节排版和内容格式,将需求分解成一个个Feature、Sub Feature、case的描述。51Testing软件测试网S&mf7e \R6}#u"\
比如例1:
`8uoA-QG)l1d'q8W2\0***********************************************
9a @R ]c3K GO/|"RL.r01 Place a call .................................Feature1
a1p\ UaM'n2D K \01.1 Dialling........................................Sub Feature151Testing软件测试网Lrl7L%sn*]*bY"~5A D
Phone number: “0~9”51Testing软件测试网2jWd \.Fk:Nc
Case 151Testing软件测试网i_%d-{G ]}X5~ e
Tap the keyboard then input the correct phone number or select the phone number from contacts or select it from the call history, then tap the “Dial” button, can make a call. The dialing main interface is as below:51Testing软件测试网]$dS jc7WD9`#a6q'z
*Interface image*51Testing软件测试网!o0B:jH(d [ _;B~
Case 251Testing软件测试网"I0` a SS
Tap the “End call” button……
O/ZM3y&Kn3R8z01.2 Incoming Call...................................Sub Feature2
4B3D^ `(W"T(\'Y4F01.3 XX..........................................Sub Feature351Testing软件测试网]2d%|'v3`&c1O a4m
2 Calendar reminder.....................Feature2
\pl%L;Ry]#F03 XX.............................................Feature3
7RGG5Tq+aF-W0***********************************************

s^)C)zz w4b0

zPRRPnn0产生出以下的编号和子功能 case描述:51Testing软件测试网;_1bs%q3`J
Data format:Phone number[0~9]
W8s6Guk3cUn)dOn9U[6~0F1_SF1_C1 :51Testing软件测试网q gi(a Rk,bL:g
Tap the keyboard then input the correct phone number or select the phone number from contacts or select it from the call history, then tap the “Dial” button, can make a call. The dialing main interface is as below:51Testing软件测试网d$kUO `fT
*Interface image*51Testing软件测试网kS@9W4sL
F1_SF1_C2 :51Testing软件测试网F K Co8Pp}
Tap the “End call” button……51Testing软件测试网 IQ.P]+Go ~FgTa }
F1_SF2........:51Testing软件测试网po0Pc-s6JJ$j
51Testing软件测试网n'efa:Z2vV

51Testing软件测试网JjwF*^V~

二、测试需求分析51Testing软件测试网Ko [Sg3g|!ys

;h,Lr?1uIBX0测试需求分析就是将前面提取出来的case描述逻辑词汇识别出来,画出逻辑关系图,再使用决策表或者因果图的用例设计方法,一个功能点尽可能全面的覆盖尽可能多的测试用例:

.k` D A.E)Eha051Testing软件测试网^6H+Z*@ ~t"u&S;N

举例如下:(个人观点,仅供参考,讲得不对也请指出来)
YZp"S*jE01、 将子功能Case描述中的逻辑关键字提取出来,如:或\或者(or)、和(and)、与(and)、并且(and)、然后(and)、否(not)、不(not)、非(not)、反之(not)、当(if)、如果(if)等,建立起步骤间的逻辑关系。
%K n y*~(|2H02、 将子功能Case描述中的句法和语义进行分析,将条件、动作和结果分别识别出来。
d6A7Mn2k6[tC7b(O0比如,F1_SF1_C1就可以被分解成:51Testing软件测试网3XM wP&EP
<Tap> the keyboard (then) <input> the correct phone number (or) <select> the phone number from contacts (or) <select> it from the call history, (then) <tap> the “Dial” button, [can] make a call.
{/h8gb4t6r Nt0根据例1,可以画出测试步骤逻辑关系。
_g `oF+w.AuHz0  因为例一较简单,所涉及的逻辑层次只有两层,对于有三层以上的情况,将会有更加复杂的逻辑关系图。

2_\6k.Yo5c051Testing软件测试网k*F?$d5x^

用例设计
)n1h W d_$V0根据

{"V*w1C4P.v ]:n051Testing软件测试网"]"N&~*CS;w

功能51Testing软件测试网 C$Jk*?T WY&O

子功能

{V J5M|Aa H0

用例编号51Testing软件测试网af!D&V&KzW

测试输入

s9A(Tw:J2_(?'m0

测试预期结果

~A^$^{ Y#NO0

Place a call51Testing软件测试网@ wyLRm)bx%eD4\#i

Dialling51Testing软件测试网 ~3^[@rY8sh B

PC_D_001

+~tprepY0

Tap the key board, and input phone number:51Testing软件测试网4Za0]&]|(oYy-nz

139XXXXXXXX

3o1H2Nx9R2R(Mg!X%I z0

159XXXXXXXX51Testing软件测试网(_ d;H"O1kU

…….. , and tap the Dial button51Testing软件测试网"VLx-vp B4HP*E_L

Can make a call51Testing软件测试网-o'u2Q%v'P

PC_D_00251Testing软件测试网0CMrn jj uC V M'E,c2N

Tap the contact edit,and slide the contact list up, and select the contacter, and tap the Dial button

fGKd)JWL0

PC_D_003

rz7d Q7_4h0

Tap the call history……51Testing软件测试网!q4qa6lT`)J:G

 51Testing软件测试网]4z+V|r8G

51Testing软件测试网o5Nt1S(o,z\ L$A&t


相关阅读:

TAG: 测试方法探讨

 

评分:0

我来说两句

日历

« 2024-05-03  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 38082
  • 日志数: 21
  • 图片数: 3
  • 文件数: 1
  • 建立时间: 2008-08-14
  • 更新时间: 2009-12-03

RSS订阅

Open Toolbar