Black box test (5) --- orthogonal test method

Source: Internet
Author: User
I. Basic Concept: the causal relationship between the reason used as the input condition and the output result when the test case is designed using the causal relationship is sometimes difficult to obtain from the Software Specification Description, in addition, even for software of medium and small sizes, the cause and effect may be very large, so that the number of test cases obtained by the cause can reach an astonishing level, this puts a heavy burden on software testing. In order to effectively and reasonably reduce the cost of testing, we can design test cases using orthogonal experiments that are effective in actual life. The so-called orthogonal experiment is an experiment design method that selects a proper number of representative points from a large number of experiments and applies the orthogonal table derived from galova theory to reasonably arrange the experiment. By using this method, all factors and levels can be evenly distributed and matched in the experiment, and the variation of the uniform law can be achieved. In orthogonal experiment design, the criteria for determining the merits and demerits of experimental results are usually called experimental indicators, and the conditions that may affect experimental indicators are called factors, which affect experimental factors, it is called the level (or State) of a factor ). During the experiment optimization design, reasonable experimental indicators and reasonable benchmarks are required to select the experimental factors and their corresponding levels in order to achieve a clear purpose.
  • L orthogonal test is a scientific design method that selects appropriate and representative points from a large amount of data and rationally arranges the test.
  • L orthogonal test method is a method to arrange the experiment and analyze the data using the created orthogonal table.
  • L it is easy to use and computation tables, and has good applicability.
2. Steps for designing test cases using orthogonal experiments: 1. Extract function description, construction factor-state table
The conditions that affect the experiment indicators are called factors. the condition that affects the experimental factor is called the factor state. when using orthogonal experiment design to design test cases, we first need to identify the operation objects and external factors that affect the function implementation according to the specification of the tested software, and regard them as factors, the value of each factor is regarded as the State. define the functional requirements in the Software Requirement Specification Description, and separate and expand the overall functional requirements into specific basic functional requirements with relative independence. in this way, all the factors in the tested software can be determined, and a reference can be provided for determining the weight of each factor. determining Factors and States is the key to designing test cases. therefore, it is necessary to determine the values as comprehensively and correctly as possible to ensure that the design of the test case is complete and effective.
2. Weighted filtering, generating a factor analysis table
The selection of factors and States can be weighted based on their importance. The weights can be determined based on the magnitude of each factor and State, the occurrence frequency, and the test requirements.
3. Construct test data sets using orthogonal tables
The derivation of the orthogonal table is based on Galois theory (this is omitted here. It can be used to query mathematical statistics textbooks when necessary ).
Using orthogonal experiment design methods to design test cases, such as equivalence classification, boundary value analysis, and cause/effect analysis has the following advantages: Saving test work hours and controlling the number of generated test cases; test cases have a certain coverage rate.
4. common orthogonal tables. Description: L4 (2 ^ 3)
  • L: represents an orthogonal table.
  • 4: Number of table rows.
  • 2: horizontal number of factors.
  • 3: Number of columns.
Common examples L4 (2 ^ 3 )? /P>
  1 2 3
1 1 1 1
2 1 2 2
3 2 1 2
4 2 2 1
L8 (2 ^ 7 )? /P>
  1 2 3 4 5 6 7
1 1 1 1 1 1 1 1
2 1 1 1 2 2 2 2
3 1 2 2 1 1 2 2
4 1 2 2 2 2 1 1
5 2 1 2 1 2 1 2
6 2 1 2 2 1 2 1
7 2 2 1 1 2 2 1
8 2 2 1 2 1 1 2
9 (3 ^ 4 )? /P>
  1 2 3 4
1 1 1 1 1
2 1 2 2 2
3 1 3 3 3
4 2 1 2 3
5 2 2 3 1
6 2 3 1 2
7 3 1 3 2
8 3 2 1 3
9 3 3 2 1
V. Example 1. in order to improve the conversion rate of a chemical product, three related factors were selected for the conditional test, the reaction temperature (A), the reaction time (B) with Alkali Amount (c ), their test scope is determined as follows:
A: 80--90 ℃;
B: 90--150 minutes;
C: 5% -- 7%.
Solution: The purpose of the experiment is to find out the effects of factor A, factor B, and factor C on the conversion rate, which are the primary and secondary factors, so as to determine the optimal production conditions, that is, the conversion rate can be high only when the temperature, time, and alkali usage are different. Develop a test plan.
Here, for factor A, three levels are selected in the test scope; for factor B and C, three levels are also selected:
A: Al = 80 ℃, a2 = 85 ℃, A3 = 90 ℃
B: BL = 90, b2 = 120, B3 = 150
C: CL = 5%, C2 = 6%, C3 = 7%
Of course, in orthogonal design, factors can be quantitative or qualitative. The distance between quantitative factors can be equal or not equal.
There are usually two methods for this tri-factor and tri-level conditional test: (I) Take the combination of all three-factor levels, that is, alblc1, a1blc2, a1b2c1 ,......, A3b3c3, total
33 = 27 times
Test. The graph shows 27 nodes in the cube in Figure 1. This test is called a comprehensive test.
The relationships between various factors and indicators are clearly analyzed in the comprehensive test. However, the number of tests is too large. Especially when the number of factors is large, the number of levels of each factor is also large. The experiment volume is astonishing. If you select six factors and each factor has five levels of water, if you want to perform a comprehensive test, 56 = 15625 tests are required. This is actually impossible. If orthogonal experiment is applied, only 25 tests are performed. In a sense, these 25 trials represent 15625.
(Ii) simple comparison method, that is, to change one factor and to fix other factors, such as first fixing B, c in BL, CL to change:
A1
B1c1 → A2
A3 (good results)
If the result A3 is the best, set a TO A3, C to Cl to change B:
B1
A3c1 → B2 (good results)
B3
If B2 is the best result, B is invariably set to B2, A is set to A3, and C is changed:
C1
A3B2 → C2 (good results)
C3
The test results are as follows: C2 is the best. Therefore, the best process condition is a3b2c2.
This method also has some effect, but there are many disadvantages. First of all, this method has very poor representativeness. For example, the test points are completely distributed on an angle, but not within a large range. Therefore, this test method is not comprehensive, and the chosen process condition a3b2c2 is not necessarily the best of the 27 combinations. Secondly, when we use this method to compare conditions, we use a single test data for a simple comparison of values. The test data must contain the error components, therefore, the simplicity of a single data cannot eliminate the interference of errors, which will inevitably lead to unstable conclusions.
The biggest advantage of the simple comparison method is that the number of tests is small. For example, a six-factor and five-level test only uses 5 + (6-1) × (5-1) = 5 + 5x4 = 25 tests. (Iii) taking into account the advantages of the two test methods, the typical and representative points are selected from the comprehensive test points, so that the test points are evenly distributed within the test scope, it can reflect the overall situation. However, we also hope that the test site should be as few as possible, so we need to consider some specific issues.
In the preceding example, A has three planes (Al, A2, and A3), and B and C have three planes, with a total of nine planes. Then there should be as many test points on the nine planes, that is, each level of each factor should be treated equally. Specifically, each plane has three rows and three columns, requiring as many points as each row and column. In this way, make the design shown in 2, and the test point is expressed in ⊙. We can see that in the nine planes, each plane has exactly three points, and each row in each plane has a point, and there is only one point, a total of nine points. In this test scheme, the distribution of test points is very uniform and the number of tests is not large.
When the number of factors and the number of levels are not too large, we can still use a plot to select a test point with a very uniform distribution. However, if the number of factors and the number of levels are too large, the plotting method will not work.
In their long-term work, the experimental staff summed up a set of methods to create the so-called orthogonal table. Experiments are arranged according to the orthogonal table, which can make the test points evenly distributed and reduce the number of tests. Moreover, the computation and analysis are simple, and the relationship between the test conditions and indicators can be clearly clarified. Orthogonal test design method is called orthogonal test design method. (Iv) orthogonal table

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.