当前位置:网站首页>Acts: efficient test design (with an excellent test design tool)

Acts: efficient test design (with an excellent test design tool)

2022-06-11 04:31:00 KerryZhu

First, let's play a popular crossword puzzle in the last six months Wordle (https://www.nytimes.com/games/wordle/index.html). This game is better than the previous puzzle game Crossword It's much easier , It's more fun to play , Update one word every day , Players need to be within six attempts , Guess the five letter word . Fill in each time 5 Four letter words :

  • If there is no letter in the answer , Just present ;

  • If there is this letter but the position is wrong , It turns yellow *;

  • The letters and their positions are correct , It turns green *;

Players continue to try according to the tips they get , Until you have guessed the right answer or exhausted six chances .

Let's take a look at an example of failure . for the first time , Enter one at will 5 Four letter words , for example RAISE, At this time, the results displayed on the first line of the game interface are as follows , Explain that the words to guess are “I”  and “S”, And “I Of ” The position is also right , But there is no R、A and E.

Because I know there is one in this word S, So guess another word , In the 1、2、5 There is... Somewhere in the S, In order to shrink faster S Location range of , We are the first 1、5 Put... In your position S, So the input soils As the next guess , This produces 3 Green letters :

The next guess naturally comes to skill, There is 4 Green letters , Just leave a space , Close to success .

If the player is very mechanical ( Or select “ Difficulty mode ”, Must be in the rest 3 Used in second guessing 4 Green letters ), Only one letter can be tested at a time . But there are 4 Possible letters need to be tested :T Express STILL, H Express SHILL, P Express SPILL, W Express SWILL. Now it's up to the person to guess the word correctly . If you're not lucky , We'll guess all the answers , And then you get this board ,Game over, Failure .

Now let's consider , If the player is smarter ( Or not playing “ Difficulty mode ”), How will our strategy be different ? Before hypothesis 3 The second guess is the same , And then there were 3 Second chance , To guess an unknown letter , Need to test letters W、H、T and P, But you can't rely on luck , Instead, try to give us the feedback we need at once .

So the first 4 Secondary knock in PHOTO, covers 3 Letters H、T and P, Reach our maximum coverage ( Cover 75% Probability ), Is a very wise choice , Although I lost a chance ( The probability of a single letter being guessed is 25%).

Input PHOTO after , No yellow letters are displayed . that , This is a failure or “ too bad ” Guess ? No , We know that the answer does not include P、H and T, Very valuable . This explanation W It's the last letter , Because in S_ILL In combination , only SWILL, So the first 5 Step by step and you will succeed .

Through the above two different ways of playing , You can see , analysis 、 Try and get as much new information as possible with each guess , This is a Wordle The secret of game success .

Back to test design , We can think of every guess as a test case , Each letter in the alphabet is the test condition of the system under test ( Or parameter value ). From the above example of failure, we can see , From 4 From time to time 6 Second test design , No design skills , The combination changes very little , So there is very little information to get feedback from the system . And successful examples , Its efficiency is much higher , Test design leverages rules , Using flexible techniques , A highly variable test case is designed , Maximizes the difference between it and the rest of the test set ( For example, a new path covering the system under test ), It is likely that a large number of new 、 Useful information . Tests that generate a lot of new information are certainly more effective than tests that do not generate a lot of new information , Better use of test time and resources .

Sum up , This brings us three inspirations for test design :

  • Test analysis is important , Analysis and design are often intertwined , Promote each other ;

  • Every time you design , Cover as many scenarios or code as possible , Improve test efficiency ;

  • Every time the test is carried out, the system should give us as much quality information as possible .

1.  Good test analysis , Good test design

Test design is what we care about most , But test analysis is more important , It is the basis of test design , As shown in the figure below , Test design is based on the results of test analysis , Influenced by test design ideas . Test analysis and test design are often intertwined , Use the same set of methods , Such as structural analysis and design 、 Object oriented analysis and Design 、 Scenario based analysis and design 、 Model based analysis and design, etc , It's easier to do it all at once , Complete the test design , what's more , An analyzed design , We can make the design cover more scenes 、 Path or code, etc , It is also easy to get more information through analysis . for example , Before scenario based test design , The key is the analysis of application scenarios , If the analysis is clear , The design came naturally . Model based test design , It's more about business analysis , Through analysis, it can be abstracted into business features , So we can build a model based on features .

( This mind map also reflects the synchronization of analysis and design )

2.  Efficient test design is to maximize the benefits of testing

Let's start with a simple example :

This design , It seems specially designed , but 3 Test cases only cover 7/20=35% coverage . But here's an example , Again 3 Test cases , Its coverage is much higher (15/20=75%), This is also in line with the inspiration of the previous game , Design highly variable test cases , Maximize the difference between test cases in the test set , Such test cases will be much more efficient .

Test design is trying to find a solution , Meet the requirements of test coverage at the lowest cost , So as to achieve “ Maximize test benefits ” The effect of . Like equivalence class partition method , In fact, it is to replace infinite test data with a limited number of equivalent sample data , The benefits are obvious . Another kind of method is the method of meeting in two groups (Pairwise)、 Orthogonal experiment, etc , Although some test coverage will be sacrificed ( Such as 20% about ), But it can greatly save the cost of testing ( Such as about saving 60%~99% workload ). When we introduced continuous testing , A design method is also mentioned :Linear Expansion( Linear expansion ), You can refer to this article :2020 Software testing Trend Report : Complete continuous testing ( Next ). Like scenario based design methods 、 Design method based on business process , It is often an efficient design method for system test cases , You can refer to 《 Agile testing : Promote continuous delivery with continuous testing 》 Some chapters .

In software testing , Risk based testing strategy   Is the premier testing strategy , It will naturally be used for test analysis and test design , Try to find out what functions in the test analysis 、 Which application scenarios 、 Which inputs / Output data is the most risky , As for how to analyze , You can refer to :ACTS: What is the premier software testing strategy ?, So we can use 20% The cost of testing covers 80% Test risk ( The figure only shows , Ignore values ).

3. Improve the efficiency and visibility of test design with tools

Although we use a lot of testing tools in automated testing , Actually, it serves for test execution , But few tools are used in test design .Excel count , But not specifically for testing , Mind mapping tools ( Such as Xmind) It's really easy to use , But not professional enough . Professional testing tools , For example, cause and effect diagram is supported - Tools for decision tables BenderRBT、 Support combination test (Pairwise、3-3 Combine 、4-4 Combine 、5-5 Combine 、6-6 Combine ) Optimization tool ACTS ( At the end of the article, there are ways of obtaining , notes : Purely coincidental , this ACTS Not the title of the article  ACTS).

( Test design tool based on matrix analysis , Keep track of coverage )

( Based on business process 、 Test design tools for scenarios )

4.  Combinatorial testing tools ACTS Access method

Pay attention to this public number , Input “ battery of tests ” Get download path .

Reference link :

原网站

版权声明
本文为[KerryZhu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206110416037651.html