记录我的学习。。。。。。

(收藏)测试用例设计方法:因果法

上一篇 / 下一篇  2012-05-09 08:55:23 / 个人分类:软件测试

原题:Test Case Design Technique: Cause-Effect

  ABSTRACT - In order to perform. full coverage on sub system testing, Cause and Effect (CE) Technique is being used to design test cases. In this technique, the functional specifications are transformed into cause and effect matrices. The matrix contains a row for each cause (inputs stimulus) and effect (output response). Each column of the matrix containing 0’s, 1’s and blanks specifies a test case which is a combination of the causes and effects. The CE technique is highly recommended as it traces the requirements to the test cases in a matrix form. This technique is suitable for black box testing, and as far as coverage is concerned, this technique will guarantee more than 80% coverage.

  摘要:

  为了使子系统测试能够完全被覆盖,可以使用因果法(Cause and Effect,CE)来设计测试用例。这种方法将功能说明书转换为因果矩阵。该矩阵中,每一行由原因(输入激励)和结果(输出应答)组成,而每一列则是由一些0、1或者空位组成,它们对应着由一系列原因和结果组合而来的测试用例。因果法之所以受到推崇,其原因是它以一种矩阵的形式跟踪着测试用例的需求。该方法十分适合于黑盒测试,并且在测试覆盖方面,它能保证80%以上的覆盖率。

  1. Introduction

  1. 简介

  Software testing is part of software development process. The ultimate aim of the system testing on a deliverable product, is to achieve Motorola’s fundamental goals of six sigma quality, total customer satisfaction and 5NINES availability. One of the questions that has always been in the mind of software system test engineer is that whether he/she has thoroughly tested the software. One of the main factors that determine the coverage of system is the technique used in designing test cases.

  软件测试是软件开发工程的重要组成部分。对可交付产品的系统测试的最终目标就是要达到摩托罗拉公司(Motorola)提出的基本质量目标:6σ质量品质、完全顾客满意度以及5NINES有效性。在软件系统测试工程师心里总是存在着一个疑问,即他/她到底能否彻底地对软件进行测试。而决定系统的测试覆盖率的主要因素之一就是设计测试用例时所使用的方法。

  Even though there are numerous test case design techniques available in current software development world, the most important ingredients of any test design are experience and common sense. Test designers should not let any of the given techniques obstruct the application of experience and common sense. The design of the test cases has to be driven by the specification of the software.

  尽管现在的软件开发中正使用着众多的测试用例设计方法,然而最重要的测试用例设计因素却是经验和常识。测试用例设计不应该让任何给定的方法阻碍经验和常识的应用。因此,必须由软件说明书来驱动测试用例的开发。

  Traditionally , test cases are derived by studying the requirements. Most system testers approach this derivation based on their intuition and experiences. They normally do not follow any systematic process to derive test cases. These tests do not guarantee substantial coverage of requirements. At Singapore Software Centre (SSC), we used the Cause-Effect (CE) Technique to derive our test cases for sub-system testing of Network Management Agent software for Cellular Networks.

  传统上,测试用例生成于对需求的研究。大部分的系统测试者是基于他们的直觉和经验实践着这种做法。他们通常不会遵循任何条条框框来生成测试用例。这种测试无法确保对需求的完全覆盖。而在新加坡软件中心(Singapore Software Centre,,SSC),我们使用因果法为蜂窝网络的网络管理代理软件的子系统生成测试用例。

  This paper outlines the use of CE approach in test case design in order to achieve the required levels of coverage. The bottom line of this effort is to be able to investigate the most likely and costly types ofdefects on a risk priority basis so as to increase our confidence in system readiness for use. This test case design technique has been practiced in one of the on-going projects, called OMC-R Agent Release8.1, in SSC. The OMC-R Agent team has many new features added in each release and this technique has been applied to a case-study on one of the features (Feature 1171: GSD and Status Display) in the OMC-R Agent R8.1.

  本文论述了为到达所需的覆盖率而在测试用例设计中使用因果法的过程。其实,本次工作是为了研究基于风险优先级的情况下,可能性最大且成本最大的缺陷类型,进而增加我们对系统准备工作的信心。因果法已经在新加坡软件中心的一个正在进行的项目中得到应用,该项目名称是OMC-R Agent 发行版本号8.1。OMC-R Agent的团队在每个新的版本中都加入了很多新的内容,而因果法则是应用在OMC-R Agent R8.1其中一个新特性(特性1171: GSD及状态显示)的用例研究中。

  2. OMC-R Agent Sub-System Testing

  2. OMC-R Agent子系统测试

  2.1 Software Life Cycle

  2.1 软件生命周期

  The life-cycle for software development includes requirements gathering, requirements analysis, high/low level design, coding,unit testing, integration testing and sub-system testing (SST). Figure 1 shows the V-shaped software life-cycle which is used in the OMC-R Agent development work in SSC. After the component testing (Unit testing) and Integration testing the code is handed over for the sub-system testing.

  软件开发的生命周期包括需求搜集、需求分析、高/低端设计、编码、单元测试集成测试以及子系统测试(sub-system testing ,SST)。图1显示了在SSC的OMC-R Agent开发工作中使用的V形软件开发模型。在组件测试(单元测试)和集成测试之后,代码便移交给子系统测试。

  

  图1:V形软件开发模型

  Our SST phase consists of a number of stages which progressively elaborates the design of tests from initial high level strategy to detailed test procedures. The stages involved in system testing done at SSC are test strategy, test planning, test case design and developing new test procedures. The SST performed on the OMC-R Agent products has always been a Black-box testing to make sure the software product meets the requirements. Full regression testing are performed whenever changes are made

  子系统测试阶段划分为一些更小的阶段。它们把测试设计逐步细化,使其从最初的高端测试策略演变成详细的测试程序。这些子系统测试涉及到的更小的阶段分别是测试策略、测试计划、测试用例设计以及开发新的测试程序。为OMC-R Agent的产品进行的子系统测试通常是黑盒测试,以此来保证软件产品符合软件需求。而不论何时,只要有变化产生,都要进行回归测试

  Black-box test design treats the system as a "black-box", so it doesn’t explicitly use knowledge of the internal structure. The black box is not an alternative to white box testing which is usually performed early in the software development process (unit testing). Black-box test design is usually focused on testing with sets of inputs that will fully exercise all the functional requirements of a system.

  黑盒测试把系统视为一个“黑盒子”,因此它就不会接触到内部结构。这个黑盒不能替代早期在软件开发过程的单元测试中经常使用的白盒测试。黑盒测试的设计往往集中用一组能完全启动系统功能的输入来测试。

  2.2 Network Management Overview

  2.2 网络管理概述

  In a cellular network, a managing system such as Universal Network Operations (UNO) manager, provides a single platform. for centralized monitoring and control of devices. The ITU (X.730/X.740) defines the standard management function such as configuration management, fault management, security management, accounting management, and performance management.

  在蜂窝网络中,像通用网络系统(Universal Network Operations,UNO)管理者这样的管理系统为设备的集中监控提供了一个简单的CC%A8" target=_blank>平台。国际电信联盟(International Telecommunications Union,ITU)X.730/X.740定义了例如配置管理、错误管理、安全管理、计费管理以及性能管理这样的标准管理功能。

  Figure 2 shows the relationship between managing processes and managed processes. The managing system communicates with it’s managed objects to carry out the appropriate operation through CMIP agent. The CMIP protocol is an open standard interface that will allow applications to access managed objects in a common way. CMIP agent on OMC-R platform. provides some functions namely:

  图2显示了管理过程与被管理过程之间的关系。管理系统与它管理着的对象进行交互,并通过CMIP代理执行适当的操作。CMIP协议是一个开放标准,它允许各种应用软件以一种公共的方式来访问被管理对象。OMC-R 平台的CMIP代理提供了如下一些功能:

  1. Notifications - events report, object creation/ object deletion, attributes value change, state change.

  1. 通知—事件报告、对象创建/销毁、属性值变更、状态变更

  2. Management Operation- m_set, m_create, m_delete, M-action (enable or disable all the devices).

  2. 管理操作—m_set, m_create, m_delete, M-action(所有设备可用或不可用)

  

  图2 网络管理系统

  2.3 Test Environment/Test Bed

  2.3测试环境/测试床

  Test software/simulators are required to execute the test cases. The two test simulators used are as shown in Figure . CTM is tool that will simulate a network manager which sends and receives messages to and from the CMIP Agent process on the OMC. And HARN is a tool to simulate the events from devices such as alarms, notifications and command responses. Perl scripts are written for automation during SST, automation is done in order to achieve Cycle Time Reduction.

  测试软件/模拟器都会执行一些测试用例。图3中显示了两个测试模拟器,CTM是一个模拟网络管理者的模拟器,它与OMC的CMIP代理程序相互发送信息。HARN模拟器则模拟了从设备发送来的事件,例如警报、通知、命令响应等。在子系统测试中,为使测试自动化我们编写了Perl代码,以到达周期时间缩短的目的。

  

  图3 测试环境

Go to Librarian Desktop Screen

  1

  Model Dialog box showing invalid userId

  1

http://www.mscto.com

  Model Dialog box showing invalid password

  11软件开发网

  UserId Text Field and Password Text Field cleared.

  1

  The help message will be displayed.1

  

  图4 表2中的一个测试用例

  Again, all the other Causes and Effects in the table are dealt with as appropriate. Eventually, not more than n 1 columns, there’s at least one “1” and at least one “0” for each Cause. But there may still be untriggered Effects, for which additional columns may have to be created. So, the tester will then have a minimum set of test requirements, such that each column specifically targets one, and only one, potential bug location in the system. Now tester can consider whether to expand the set with additional tests to explore some otherwise untouched combinations.

  像这样处理表中所有其他的原因和结果。最后,不会多于n 1个列,最少每个原因要对应一个“1”或者一个“0”。但是这样依然会有未触发的结果,需要为它们创建新的列。所以,测试者需要为测试需求构建一个最小集,好让每列都与系统中潜在BUG的位置一一对应。然后,测试者再考虑是否要用新的测试来扩展该集合以开发某些不同的未涉及到的因果组合。

  This technique is also known as Test Requirements Definition technique (as are Control Flow graphing, State Transition Analysis, etc.), rather than test design. At the end of the process, each column expresses the requirements for a potential test case with a specific objective identified by the Cause(s) and Effect(s). The tester still has to design the actual test data values so that each supports the objective. The tester must also take special care with masked Causes, which must still be “1” or “0”, and design a test or tests to best execute the test cases. Due to restriction of paper length there isn’t scope to tell more, or to discuss topics such as subsidiary tables (for handling complicated input validation or output generation), iterations, and feedback loops.

  因果法又被称为测试需求定义方法(控制流图,状态转换分析等等),而并非测试设计。在操作步骤结尾,每列都通过由原因和结果确定的目标为潜在的测试用例描述了需求。测试者依然需要设计实际的测试数据来支持这些目标。同时,他们还必须十分注意那些依然可以是“1”或“0”的被掩盖的原因,并设计一些测试来执行测试用例。由于文章篇幅所限,这里就不再讨论辅助表(用来处理复杂的输入或者输出)、迭代和反馈环等技术了。

  4. Results

  4. 结果软件开发网

  The benefits that have been achieved using this test case design technique on a pilot feature #1171 of OMC-R Agent are:

  在OMC-R Agent的首要特性1171中用到的测试用例设计方法取得了如下效果:

  Helps to achieve a better test coverage of the testing. A chived “six sigma” quality for the Feature #1171 on which this CE technique has been piloted. There is no post-release defects have been found for this feature. Please refer to the Q-data (Figure 6), and there are few reported defects. But none of them are from Feature# 1171.

/*500*200,创建于2012-2-8*/ var cpro_id = 'u761459';-得到了更好的测试覆盖率。通过在1171特性中的因果法的应用,到达了“6σ”的质量品质,使得该特性不存在后发缺陷。请参考图6中的Q数据,其中只有很少缺陷被报告,但没有一个存在于1171特性中。

  Optimization in developing test cases (i.e., it is easy to avoid any duplication of test cases in a CE table by identifying the “masking” precedece as explained in Section 3.).

  测试用例的优化。(例如,根据经过掩盖优先处理过的因果图设计的测试用例很容易避免测试用例的重复)

  Easily understandable matrix format of test cases by reviewers/inspectors and quality assurance professionals.

  复查/审核人员及质量保证专家更容易理解矩阵形式的测试用例。

  Helps gain a deeper understanding of the requirements.http://www.mscto.com

  对需求有更深刻的理解。http://www.mscto.com

  Helps to identify ambiguous requirements and to improve on requirement specifications.软件开发网

  更好的确定不明确的需求并且改进需求说明书

  Ease of traceability to requirements.

  容易对需求进行跟踪

  

  图5 表3中的测试用例

  5. Conclusion

  5. 结论

  Software should be tested against what it is specified to do, not against what it actually observed to do. Software can be tested at various stages of the development cycle and with various degrees of rigor.

  软件需要被测试它被指定做的事情,而不是实际上看到的做的事情。软件能够基于各种不同严格程度在开发周期的不同阶段被测试。

  In practice, using CE technique, the design of each level of system testing has been developed through a number of layers, each adding more detail to the tests. This technique in some cases will also help clear the ambiguity in requirements while extracting the “Causes” and “Effects” from requirements for the matrix.

  实际上,通过因果法,每一层次的系统测试设计可以若干级来开发,每一级增加新的测试内容。这种方法在一些情况下还能帮助理清不明确的需求,因为它从需求中把抽取“原因”与“结果”的放置到矩阵中。http://www.mscto.com

  During the review/inspection of the system test cases, the matrix can also be used to trace the requirement/ specification of the product to the test cases.

  在系统测试用例的复查/审核过程中,矩阵还能用来检查产品的需求说明书与测试用例的一致性。

  The effectiveness of testing effort can be maximized by using CE technique together with appropriate use of automated test execution tools such as Script. Execution Test Tool (SETT) and TestExpert.

  测试工作的效率可以通过因果法配合合适的自动化测试工具,例如脚本执行测试工具(Script. Execution Test Tool,SETT)和TestExpert,得到最大化。

http://www.mscto.com

  The net result of the CE technique will be an increase in quality and a decrease in costs, both of which can be beneficial to ABC’s software development cycle. This will help ABC to meet quality

  使用因果法带来的结果将提升产品质量并降低成本,这对于ABC软件开发周期是很有益的。它能帮助ABC提升产品质量。

原文地址:http://www.ltesting.net/html/21/n-141821.html

http://www.mscto.com/testing/200811219326_3.html


TAG:

 

评分:0

我来说两句

Open Toolbar