COMBINATORIAL TESTING

COMBINATORIAL TESTING

-Test note of “Essential Software Test Design”

2015-09-06

Content

16.1 Coverage
16.2 Combination Strategies
16.3 Input Parameter Modeling
  16.3.1 Structural Input Parameter Modeling
  16.3.2 Functional Input Parameter Modeling
16.4 Conflicts in the Input Parameter Model
16.5 Tools

 

The aim of combinatorial testing is to provide a solution to combinatorial explosion.

Example:

1. To illustrate combinatorial explosion during test case selection, consider testing the «classical» function triangle(side1, side2, side3).

2. Combinatorial explosion during configuration identification occurs in a similar manner. Consider testing (a part of) a Web based system which should support several:

  • Different operating systems (Windows, MacOS, Unix, Linux),
  • Different browsers (2 versions of Internet Explorer),
  • Different types of data connections (modem, three ADSL speeds, and fiber optical connection).

                       

Figure 16:1: Input parameter model of triangle example.

16.1 Coverage


 Top

The ability to vary coverage is a central concept in combinatorial testing. Higher coverage will give you better test quality but also more test cases/configurations. Figure 16:2 shows a subsumption hierarchy of the most commonly used coverage criteria used in combinatorial testing. A coverage criterion X subsumes another coverage criterion Y if and only if 100% coverage with respect to X automatically results in 100 % coverage with respect to Y. Subsumption is indicted in the figure by arrows.

 

Figure 16:2: Subsumption hierarchy for combination strategy coverage criteria

The simplest form of coverage used in combinatorial testing is 1-wise coverage. It requires each parameter value of every parameter to be included in at least one combination. Figure 16:3 shows a set of combinations that satisfies 1-wise coverage with respect to the model of the triangle problem in Figure 16:1.

 

Figure 16:3: 1-wise coverage of the triangle example.

A natural extension of 1-wise coverage is 2-wise (pair-wise) coverage. It requires every subcombination of values of any two (pair) of parameters to be included in the set of combinations.

 

Figure 16:4: 2-wise coverage of the triangle example.

Usually test cases containing more than one invalid value are less effective in detecting faults. The main reason is that code for error handling generally checks the input values one at a time and as soon as the first invalid input value is found the error handler is invoked and the execution is terminated.

 

Figure 16:6: 2-wise valid coverage of the triangle example.

 

Figure 16:7: Single error coverage of the triangle example.

The final coverage criterion included in the subsumption hierarchy in Figure 16:2 is called base choice coverage.

  • The first step to satisfy base choice coverage is to identify a base combination. The base combination consists of the base values of each parameter.
  • The tester is free to pick any value as the base value but it is recommended to pick the valid value that is most often used.
  • From the base combination new combinations are derived by altering the values of one parameter at a time such that each value of that parameter is included in at least one combination while keeping the rest of the parameters fixed in their base values.

Figure 16:8 shows a set of combinations that satisfy base choice coverage under the assumption that the base combination is <A2, B2, C2>.

 

Figure 16:8: Base choice coverage of the triangle example.

16.2 Combination Strategies


 Top

Combination strategies are algorithms that select a set of combinations from an input parameter model, such that the selected set of combinations satisfy some coverage criterion. A goal with most combination strategies is to keep the set of combinations as small as possible. This goal is relatively easy to fulfill for simple coverage criteria, such as:

  • 1-wise,
  • base choice,
  • single error,
  • 1-wise valid.

In fact, for all of these coverage criteria it is possible to find minimal sets of combinations. In contrast, for the more complex coverage criteria, such as 2-wise, 2-wise valid and higher, the problem of finding a minimal set of combinations that satisfy the coverage criterion is more difficult.

More than 20 combination strategies exist. Some of the more known are Each Choice (EC) that satisfies 1-wise coverage, Base Choice (BC) that satisfies base choice coverage, Automatic Efficient Test Generator (AETG) ESSENTIAL SOFTWARE TEST DESIGN that satisfies t-wise coverage for t ≥ 2, and Orthogonal Arrays (OA) and In Parameter Order (IPO), both satisfying 2-wise coverage.

16.3 Input Parameter Modeling 


 Top

One of the key success factors of combinatorial testing is input parameter modeling. In most cases it is possible to define several different models for the same test problem. The contents of the model have a direct impact on the quality of the test cases.

 

Figure 16:9: Alternative input parameter model for the triangle problem.

16.3.1 Structural Input Parameter Modeling

In structural input parameter modeling, the parameters in the interface of the test object are mapped one-to-one onto parameters in the input parameter model.

The main advantage with the structured approach is that it is a simple task to create the input parameter model.

The drawback with the structural approach is that there are no guarantees that the resulting test cases will take all aspects of the functionality of the test object into account.

16.3.2 Functional Input Parameter Modeling

In functional input parameter modeling it is not necessary to consider each input parameter in isolation and we are not restricted to only include properties of the input parameters in the model. Instead we can model aspects of the functionality and possibly the state of the test object.

The major advantage with the functional approach is that it generally results in test cases with higher quality than test cases from a structural model.

The two drawbacks are that it may be difficult to identify the input parameter model parameters and it may be difficult to translate a combination into actual inputs of the test case since the values of more than one parameter may affect the same input parameter.

16.4 Conflicts in the Input Parameter Model


 Top

Input parameter modeling sometimes result in models in which some of the sub-combinations are strange or even meaningless. Any impossible or semantically meaningless subcombination is called a conflict. As an example consider the model in Figure 16:9. The meaning of the sub-combination <A3, B1> is unclear.

 

Figure 16:10: The steps to replace conflicting combinations while preserving coverage. Conflicts marked in bold.

16.5 Tools


 Top

When deciding on tools there are several properties to look for:

  1.  Which coverage criteria are supported by the tool.
  2.  To what extent can the tool handle confl icts in the input parameter model?
  3.  Does the tool support predefi ned combinations?
  4.  Can the tool export its results in any known format?
  5.  What infrastructure does the tool require?
  6.  What does the tool cost?

combinatorial testing, which contains, among other things links to more than 20 different tool suppliers.

PICT is a free Perl-based tool from Microsoft supporting t-wise coverage as well as 2-wise valid coverage, single error coverage, and variable strength coverage. It supports conflicts and pre-selection of test cases. Despite the rather crude user interface this is probably the most powerful tool at the moment.

Telcordia offers a Web commercial, based service in which the user enters an input parameter model in a Web interface and a resulting set of combinations is returned to the user. This service is based on the AETG combination strategy, which means that there is support for t-wise testing for t≥2. There is also support for handling conflicts in the input parameter model.

 

转载于:https://www.cnblogs.com/Ming8006/p/4784698.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Traditional testing faces significant complexity issues due to the increasing number of data, paths, combinations, permutations, and so on. Various testing methods have been proposed and used to improve the quality and reliability of software. As one branch of software testing, combinatorial testing (CT) is one black-box testing method to identify faults caused by the interaction of a few components. CT is considered a hard problem due to its exponential complexity: A system with 30 choice items may need to explore 230 combinations and this is time- and effort-consuming. Many approaches have been proposed in the last 40 years using various theo- retical models or techniques such as Latin square, orthogonal array, covering array, machine learning. In the past 20 years, the evolutionary solutions of combinatorial testing, such as AETG, IPO, have been proposed to generate a small set of test cases that achieves 100% test coverage. However, in spite of significant progress, it is still difficult to apply CT for a system of moderate sizes such as 100 choice items. These solutions mainly focus on test coverage and not much work on fault identification. This book proposes a computational approach to address the CT problem; instead of general purpose machine learning algorithms to learn from cases, it explores the CT structure to eliminate combinations for consideration, and the exploration can be done in a parallel manner, and the process can be done in a cloud environment where parallel processing is a standard feature. This approach allows performing CT for a system with size of 240, with 2240 combinations to consider. Thus, effectively, CT can run on a large system. This book intends to propose a faulty location analysis solution of CT as well as review existing CT solutions. Chapter 1 reviews existing combinatorial designs and CT solutions of test case generation. Chapter 2 discusses CT practical application in cloud computing and compares existing faulty location analysis solutions in CT. Chapter 3 introduces adaptive reasoning (AR) algorithm in multi-tenancy Software-as-a-Service (SaaS) system. In the next three chapters, it describes the formal definitions of test algebra (TA), discusses the related optimizations of TA, and simulates TA in cloud environment. The last three chapters propose an v vi Preface integrated Testing-as-a-Service (TaaS) design with AR and TA, discuss the related testing strategies, and simulate the proposed TaaS design to solve a large-scale CT problem in cloud environment. This book can serve as reference text for graduate students and researchers who work in combinatorial testing area. It should also be interesting to those who work in fault identification, fault location, and other related fields in testing. Practitioners may be inspired by this book in testing plan design. Due to the limitation of our knowledge, we could not provide more details in relationship between existing faults and potential faults now. But our research moves forward in fault location analysis step-by-step. You are welcome to contact us, if you have any comments and suggestions. This work is built on many outstanding CT work in the past, and their contri- butions are greatly appreciated. Prof. Charles Colbourn of Arizona State University, a leading expert on CT, was a co-author of some of research papers published. Prof. Wenjun Wu of Beihang University provided the initial computing environment for us to perform computational experiments, and our great friend Tony provided 40 large servers for us to perform CT experiments on a system of 250 choice items. By the way, the data generated by the 250 is so large that it will take months just to transfer data. The editors at Springer, Celine Chang and Jane Li, are always helpful. We are grateful to them for their constructive suggestions and patience. Finally, we are also indebted to our family members who suffered through the writing of this work that seems to last forever.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值