Normal test, abnormal test and semi-normal test

22/01/2020Other topics

Let’s design normal test, abnormal test and semi-normal test for the test

There are two ways to classify tests : normal test and abnormal test . The normal system test is a test to confirm the behavior of the software with respect to the correct input , and the abnormal system test is the test to confirm the behavior of the software with respect to the incorrect input . In addition to this, it is important to test the embedded software to confirm the semi-normal test .

The normal test is relatively easy to understand, so you won’t be so confused even in the test design. However, when it comes to anomalous tests, problems occur as soon as you actually design the test. It often happens that the goal of the test design cannot be seen as to how many kinds of incorrect inputs should be identified and the items of the abnormal test should be identified .

This often happens when there is no clear idea of ​​what to expect as incorrect input . In such a case, it will be easier to understand if the test is designed by dividing the abnormal test into a semi-normal test and a ( true) abnormal test .

In this article, I will introduce what a semi-normal test is as easy as possible by focusing on the difference from the (true) abnormal test. The semi-normal test specific example of the communication protocol , state transition , hardware control because it has been introduced in another article is divided into, there also visit together.

Normal tests can be easily designed according to specifications

The normal test is a test to confirm that the functions of the software are operating correctly when the correct input is given to the software. In other words, it can be said to be a functional test to confirm that the functions of the software are working properly.

For example, consider a software test created with a one-line formula A = B + 10 . Let 's assume that the software specification limits B to an integer from 1 to 3 . As a normal system test , you should confirm that the output A becomes 11, 12, 13 when you put three values ​​of 1, 2, 3 in the input B. Now that we have confirmed that the function of this formula is working properly, the test design of the normal system is complete.

The number of test cases for abnormal test is increasing steadily considering various abnormal inputs.

Now, let’s design a test for abnormal test . What should I assume as incorrect input? For example, if you want to design an incorrect input value using the boundary value analysis method, you can enter 0 and 4, which are the incorrect values ​​of the boundary value of B value. So , is this enough as an item for abnormal  test ?

Unfortunately, there is a possibility that various values will be input to input B when the software is actually used . But also there is also that the value from the other computer in the communication is transmitted if there if a person enters, people mistake somewhere if communication You may also be a communication error would change is part of the value is generated maybe. Assuming such a thing , various input values are assumed to be incorrect . Incorrect integer values ​​such as 100, -300, and 999999999999999999 may be entered. Alternatively, real numbers such as 0.001 or 10.34 may be entered, half-width alphanumeric characters such as “heihei-ho" may be entered, kanji such as “Yuigadokuson" may be entered, or control characters such as Tab may be entered. And, incorrect input values ​​will come out in various ways when you come up with variations .

Correct input is defined in the specifications of the software, so it can be easily identified, but incorrect input can be various inputs depending on the device and software, so when you start identifying it, the types of abnormal input values ​​become more and more abnormal. Will come out. Then, in the abnormal test, how much incorrect input value should be assumed in the test design? If you don’t stop identifying incorrect input values ​​somewhere, you won’t be able to finish the test design for abnormal systems.

Processing of abnormal values ​​built into the software is a semi-normal test

At such times, abnormal test a further semi-normal test and the (true) abnormal test and be divided into, incorrect input one policy to washout and be, the test design of abnormal test  ending in a reasonable range is possible I can do it. So what are semi-normal and (true) abnormal test ?

Simply put, a semi-normal test is a test that confirms the operation when an invalid value assumed by the software designer is input, and a (true) abnormal test  is a software design. It is a test to confirm the operation when an invalid value is input that the person did not expect / could not do. The incorrect values ​​assumed by software designers are very straightforward and clear . This is because the processing for those values ​​is implemented as the source code of the program.

It looks like this when I try to write a pseudo code with a C language switch case statement a little more concretely.

 switch (value of B) {

       The value of case B is an integer between 1 and 3: A = B + 10 is executed

  If the value of case B is an integer less than or equal to 0 or greater than or equal to 4: the input range is 1 to 3, an error is returned.

  Case B value is real: returns an error if the input value is an integer

  default: Record input value error and error log and exit without doing anything

  }

In the first case, the normal processing is written, and in the second and third cases, the incorrect input value assumed by the designer of this software and the input value are not correct . The process is written. The conditions described in the second and third cases are the semi-normal test in this program code .

And it is a semi-normal test to confirm that the processing for the semi-normal test code that this designer has created in the code, that is, the processing for the incorrect input value, is working as the designer thought. Will be. Therefore, the test of the semi-normal test in this case can be covered by inputting the real number 2.15 in addition to -1 and 4 as the abnormal input value.

Processing of abnormal values ​​that are not created in software is a (true) abnormal teet

Then, this software designer writes the code so that this process will continue to operate by executing the process of the default part when other unexpected values ​​are input . And the condition written in the default part is the (true) abnormal test in this program code . You can check the operation of this (true) abnormal test by inputting one kind of abnormal value of “other than" entered in the normal test and the semi-normal test. In this example, if you enter a character string or control code, you can check the processing of the default part, so this is a (true) abnormal test.

Summarizing this, it means that you should consider the input values ​​of the following conditions as a test design.

  • Normal test: Input value is an integer value from 1 to 3
  • Semi-normal test: The input value is an integer less than or equal to 0 or more than 4, or a real value.
  • (True) anomalous test: value of something other than integer or real number (character string or control code)

The idea of semi-normal test can also be used for communication protocol and hardware control

In addition to such simple source code, the idea of semi-normal test and (true) abnormal test is relatively easy to use when designing a test. For example, in the case of communication protocols , some kind of error detection function is usually defined. The processing when a communication error is found by those error detection functions is also clearly defined as a protocol specification. It is a semi-normal test to confirm that these error handling is executed correctly .

On the other hand, even when a data communication error that is not defined in the error detection function of the protocol occurs, the program must continue to operate without hanging . A test in such a state is a (true) anomalous test.

In the same way , even in the test design of the function to control the hardware , the idea of semi-normal test and (true) abnormal test is easy to use. The semi-normal test is to confirm that the process corresponding to the error code defined as the status returned by the hardware is working properly, and the operation when the undefined err-code is returned. What we check is a (true) anomalous test.

Equivalent division plus α for semi-normal test and abnormal test

Considering how to classify semi-normal test and (true) abnormal test in this way, it becomes easier to understand the policy of how much should be identified as incorrect input in the test design of abnormal test . The rest is to decide how many kinds of incorrect input values should be prepared as test data according to each policy .

This will vary depending on the cost and duration of the test and the level of quality required, but in principle, the following ideas are acceptable.

  • Normal test : For the normal range , identify one representative value and the boundary value by boundary value analysis.
  • Semi-normal test : Identify one representative value for each policy based on the concept of equal value division.
  • (True) anomalous test : Identify one representative value based on the concept of equal value division

With this, even for semi-normal test and (true) abnormal test , it is possible to avoid increasing the number of test cases identified without reproduction, and it is possible to identify a relatively feasible and reasonable number of test data . .. Of course, if the required quality is high, or if sufficient cost and test period can be taken, as test data for semi-normal test and (true) abnormal test , values ​​that assume various things other than representative values ​​are used. It’s good to think about it.

The abnormal test and the semi-normal test are also described in the article of test classification.

The normal test, semi-normal test, and abnormal test are introduced a little more concretely in the following articles, so if you are interested, please see them as well.

Test name ・ Normal system, abnormal system and quasi-normal system
Test name / Semi-normal test in communication protocol processing
Semi-normal system test with test name / state transition
Test name / quasi-normal test with hardware control
 Return : other topics