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

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

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

51Testing软件测试网|'i M4RS_ H9{E

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

I7d j @A|E.v&?0一、需求文档分析51Testing软件测试网'G|%Sx7t
通过分析需求文档的章节排版和内容格式,将需求分解成一个个Feature、Sub Feature、case的描述。51Testing软件测试网k;C u v9^8J
比如例1:51Testing软件测试网{f8c4|SBo
***********************************************
3fx E-e-eP4Lf01 Place a call .................................Feature151Testing软件测试网~%X5g1{R
1.1 Dialling........................................Sub Feature1
:]?6kS lr0Phone number: “0~9”51Testing软件测试网q l)g+{ ^Q
Case 1
v,Z1SL4ep}nc s0Tap 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软件测试网YRXQ {(T!\F`
*Interface image*51Testing软件测试网 n#J9yz {/M7Nc
Case 2
&W\1F@ D0Tap the “End call” button……
y\2H+b{a1LA01.2 Incoming Call...................................Sub Feature2
*rqgU5X^,I01.3 XX..........................................Sub Feature351Testing软件测试网s4{^8Y9G3^ W
2 Calendar reminder.....................Feature251Testing软件测试网rJ)F6~t;j Gl u
3 XX.............................................Feature3
|x9X!\X sp#IF0***********************************************51Testing软件测试网3J$U7G:Q}7u nZ

51Testing软件测试网&ix Q1ZiF'`c

产生出以下的编号和子功能 case描述:
(AjG{ZB1M0Data format:Phone number[0~9]
:?8`zl8T/o1{'h0F1_SF1_C1 :
2]*Lg~;n:Y-nxx/h0Tap 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:
5a1W3nm\0*Interface image*51Testing软件测试网.e"q rE_{l
F1_SF1_C2 :
y$i LKsdG0Tap the “End call” button……51Testing软件测试网(T(l+~UWZ
F1_SF2........:51Testing软件测试网.{+ERS1Ej

,@ @9oh u X0

O \ A,UH-[0二、测试需求分析

'F'v.N UcV"aD `0

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

n:^Z-\M!iK0

XL3C%]s}q(y0举例如下:(个人观点,仅供参考,讲得不对也请指出来)51Testing软件测试网9ko2A6U(d } ]
1、 将子功能Case描述中的逻辑关键字提取出来,如:或\或者(or)、和(and)、与(and)、并且(and)、然后(and)、否(not)、不(not)、非(not)、反之(not)、当(if)、如果(if)等,建立起步骤间的逻辑关系。
{| l-egw:x f$K02、 将子功能Case描述中的句法和语义进行分析,将条件、动作和结果分别识别出来。
d&W3P${/@2D0比如,F1_SF1_C1就可以被分解成:
.wdybP"Z0<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.
r)L;[4W2m%Hkj-Q h`{0根据例1,可以画出测试步骤逻辑关系。
y+A fJd PZJ0  因为例一较简单,所涉及的逻辑层次只有两层,对于有三层以上的情况,将会有更加复杂的逻辑关系图。51Testing软件测试网n'\x O?9d

51Testing软件测试网xi&P(lh e`.a

用例设计
.XymJ$rC`.I4H ^H r0根据

-ey2DI]7y'Z w^#u t3q051Testing软件测试网&z8_eq.}V3D?

功能

-YrJ{+WV0

子功能51Testing软件测试网5n0au(PRzS/G

用例编号

OO2u q.QagWi0

测试输入

6k;C6d'z%I)}&Ta'g_0

测试预期结果51Testing软件测试网{^ EO7h`

Place a call51Testing软件测试网 i?p&N-c

Dialling51Testing软件测试网6M+hnL:K6L7P%@e

PC_D_001

]h1Ng\.R4G0

Tap the key board, and input phone number:

:@#p)}'tIb1Oog'i0

139XXXXXXXX51Testing软件测试网2rP']"m/o3yr'o5]

159XXXXXXXX

;NbW@#l H,S0_-y0

…….. , and tap the Dial button

5M R?@ `aI'd_0

Can make a call

K-l6rRPx/O0

PC_D_00251Testing软件测试网9g clR:}3V[

Tap the contact edit,and slide the contact list up, and select the contacter, and tap the Dial button51Testing软件测试网0\ ]V,@ k0U

PC_D_003

_'C BDZqAwF0

Tap the call history……51Testing软件测试网^SZ4L!g$@-n.o;bH

 

;`$} I9P~8eE"{0

'pU q#lp)H0
相关阅读:

TAG: 测试方法探讨

 

评分:0

我来说两句

日历

« 2024-04-28  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

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

RSS订阅

Open Toolbar