阅读下列说明,回答下列问题。[说明]某商店为购买不同数量商品的顾客报出不同的价格,其报价规则如表1所示。
如买11件需要支付10×30+1×27=327元,买35件需要支付10×30+10×27+10×25+5×22=930元。现为该商家开发一个软件,输入为商品数C(1<=C<=100),输出为应付的价钱P。
3.1、请采用等价类划分法为该软件设计测试用例(不考虑C为非整数的情况)。3.2、请采用边界值分析法为该软件设计测试用例(不考虑健壮性测试,即不考虑C不在1到100之间或者是非整数的情况)。3.3、列举除了等价类划分法和边界值分析法以外的三种常见的黑盒测试用例设计方法。
正确答案及解析
正确答案
解析
3.1(6分)
3.2(6分)
3.3(3分)
错误推测法,因果图法,判定表驱动法,正交试验法,功能图法。
【解析】
本题考查黑盒测试法及应用。第一小题考查黑盒测试用例设计方法之等价类划分法。等价类划分法是把程序的输入域按规则划分为若干子集,然后从每个子集中选取一个具有代表性的数据作为测试用例。本题中规定了C的取值范围(1<=C<=100),按规则可以划分为一个有效等价类{C|1<=C<=100}和两个无效等价类{C|C<1}、{C|C>100}。表1中对C取不同值有不同的处理,因此上述有效等价类还可以进一步细分为4个等价类{c11<=c<=10}、{C|11<=C<=20}、{C|21<=C<=30}、{C|31<=C<=100}。这样一共得到6个等价类,包括4个有效等价类{C|1<=C<=10}、{C|11<=C<=20}、{C|21<=C<=30}、{C|31<=C<=100}和两个无效等价类{C|C<1}、{C|C>100}。设计用例时从这6个等价类中任选一个代表数据即可。第二小题考查白盒测试用例设计方法之边界值分析法。 边界值分析法作为等价类划分法的一种补充,是把等价类上的边界取值作为测试用例的一种测试方法。题目中要求不考虑健壮性测试,也就是说不用考虑无效等价类的边界取值,剩下4个等价类中有1、10、11、20、2l、30、31、100这8个边界值,然后每个等价类中再取1个任意值,一共得到12个边界值的测试用例。第三小题考查黑盒测试的基本概念。黑盒测试方法除了等价类划分法和边界值分析法之外,还包括错误推测法,因果图法,判定表驱动法,正交试验法,功能图法等。
你可能感兴趣的试题
Advancements in ( )have contributed to the growth of the automotive industry through the creation and evolution of self-driving vehicles.
-
- A.Artificial Intelligence
- B.Cloud Computing
- C.Internet of Things
- D.Big Data
- 查看答案
In project human resource management , ( )is not a source of power for the project manager.
-
- A.referent power
- B.expert power
- C.reward power
- D.audit power
- 查看答案
At the project establishment stage , the feasibility study mainly includes techinical feasibility analysis , ( ), operation environment feasibility analysis and other aspects of feasibility analysis.
-
- A.detail feasibility analysis
- B.opportunity analysis
- C.economic feasibility analysis
- D.risk analysis
- 查看答案
( )is a grid that shows the project resources assigned to each work package.
-
- A.Stakeholder engagement assessment matrix
- B.Requirements traceability matrix
- C.Probability and impact matrix
- D.Responsibility assignment matrix
- 查看答案
Xinhua News Agency reported in January 2022,Chian will further promote the developmet of a digital economy during the 14th Five-Year Plan eriod(2021-2025). The plan also emphasized industrial ( )transformation.
-
- A.digital
- B.networking
- C.intelligentize
- D.informatization
- 查看答案