Test case design method: detailed explanation of orthogonal test method!

01. Introduction to Orthogonal Test Method

Orthogonal test method is a kind of test method for studying multi-factors and multi-levels. It uses orthogonal tables to design experiments, replaces comprehensive tests with a small number of tests, and selects from comprehensive tests according to the orthogonality of orthogonal tables. Appropriate and representative points are tested, and these representative points have the characteristics of " evenly dispersed, neat and comparable ". This specification only discusses the orthogonal test method in which each factor is independent of each other. The orthogonal test method in which each factor affects each other is not used when we design test cases, so we will not mention it.

Orthogonal table is a special table, generally represented by Ln(mk), L represents the orthogonal table, n represents the number of trials or the number of rows of the orthogonal table, k represents the number of factors that can affect the index at most or positive The number of columns in the table, m represents the number of levels of each factor, and n=k*(m-1)+1.

02. The reason for using the orthogonal test method

For single-factor or two-factor experiments, because of the small number of factors, the design, implementation and analysis of the experiments are relatively simple. However, in actual work, it is often necessary to examine three or more test factors at the same time. If a comprehensive test is carried out, the scale of the test will be large. Due to time and cost constraints, it is impossible for us to conduct a comprehensive test, but which ones should be selected specifically? We are not sure about the test cases for testing, and we are always worried that some serious defects will be missed by those test cases that are not selected. In order to effectively and reasonably reduce the man-hours and costs of testing, we use the orthogonal test method to design test cases. Orthogonal test method is a high-efficiency test design method for arranging multi-factor tests and seeking the optimal combination of levels.

We use a test example to illustrate the benefits of using the orthogonal test method to design test cases:

Test requirements:

There are 2 classes in the communication department of a certain university. I have just finished a certain course. I want to use the three query conditions of "gender", "class" and "score" to find out the score distribution of this course in the communication department, the ratio of male to female or the proportion of classes. To perform a personnel query:

  • Query based on "gender" = "male, female"
  • Query based on "class" = "class 1, class 2"
  • Query based on "Grade" = "Pass, Fail"

By Traditional Design - All Tested

Analyzing the above test requirements, there are 3 elements to be tested, which we call factors, and each factor has two values, which we call level values, so the number of all test cases is 2*2*2=8 , see the table below

Using the orthogonal table to design test cases, the number of test cases we get is n=3*(2-1)+1=4, for three factors and two levels, there is just an L4(23) orthogonal table that can be applied, so The four test cases obtained by using the orthogonal table test method are as follows:

According to actual needs, some test cases can be supplemented on the basis of using the orthogonal test method to design the use cases. Compared with 4 test cases and 8 test cases, the number of test cases is reduced. The larger the number of factors and the number of levels, the better the benefit of using an orthogonal table.

For example: For a test with four factors and each factor is three levels, if the comprehensive test needs to be carried out 3*3*3*3=81 times. However, if the L9(34) orthogonal table is selected by the orthogonal test method, n=4*(3-1)+1=9 tests can be covered. From this point, it can be shown that using the orthogonal test method can effectively and reasonably reduce test cases and man-hours, and save test costs.

The number of rows in the extended orthogonal table L8 (4×24) is the number of trials in the mn-type orthogonal table (number of rows) = ∑ (number of levels in each column - 1) + 1

Example: Five 3-level factors and one 2-level factor are expressed as 35*21, the number of trials=5*(3-1)+1*(2-1)+1=12, that is, L12 (35*21)

Finally, I would like to thank everyone who has read my article carefully. Seeing the fans’ growth and attention all the way, there is always a need for reciprocity. Although it is not a very valuable thing, if you can use it, you can take it away!

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

Information acquisition method:

Guess you like

Origin blog.csdn.net/jiangjunsss/article/details/132714968
Recommended