Black box testing method:
Black box testing is also called functional testing and data-driven testing. It treats the software under test as a black box that cannot be opened, and designs test cases and tests mainly based on functional requirements. Think of the product software as a black box with only an exit and an entrance. During the testing process, you only need to know what to input into the black box and what results the black box will produce.
The main black box testing methods include equivalence class partitioning, boundary value analysis, causal diagram, error speculation, etc., which are mainly used for software verification testing. The "black box" method focuses on the external structure of the program, does not consider the internal logical structure, and is aimed at testing the software interface and software functions. The "black box" method is an exhaustive input test. Only when all possible inputs are used as test conditions can all errors in the program be detected in this way. In fact, there are countless test cases. People should not only test all legal inputs, but also those illegal but possible inputs.
advantage:
Independent of software implementation
Test cases can be run simultaneously with software implementation
Based on the manual, you know what functions the software implements, which facilitates automated testing.
shortcoming:
Cannot cover all codes, cover conditions
Low reusability of automated tests
Equivalence classification method:
The principle of equivalence classification method:
Divide the input domain of the program into several parts, and then select a few representative data from each part as test cases
The role of representative data of each category in testing is equivalent to other values in this category. If an example in a certain category finds an error, other examples in this equivalent category can also find the same error.
Conversely, if an example in a class does not find an error, then other examples in the class will not find an error either.
Three principles for designing test cases using the equivalence class method:
Assign a unique number to each equivalence class;
Design a new test case to cover as many valid equivalence classes as possible that have not been covered. Repeat this step until all valid equivalence classes are covered.
Design a new test case to cover only one invalid equivalence class that has not been covered yet, and repeat this step until all invalid equivalence classes are covered.
Valid equivalence classes:
It refers to a set of input data that is reasonable and meaningful for the program specification. The valid equivalence class can be used to verify whether the program has achieved the functions and performance specified in the specification. "Software Quality and Testing"
That is: comply with procedural requirements, reasonable and meaningful
Invalid equivalence class:
It refers to a set of input data that is unreasonable and meaningless to the program specification. Invalid equivalence classes can be used to verify whether the program has achieved the functions and performance specified in the specification. "Software Quality and Testing"
That is: not meeting the requirements, not reasonable and not meaningful
Design steps of equivalence partitioning method
Principles for determining equivalence classes When the input condition specifies the range of values or the number of values, one valid equivalence class and two invalid equivalence classes can be established.
When the input condition specifies a set of input values or a "must be" condition, a valid equivalence class and an invalid equivalence class can be established.
When the input condition is a Boolean value, one valid equivalence class and one invalid equivalence class can be determined. When a set of input data values (assuming n) is specified and the program processes each input value separately, n valid equivalence classes and one invalid equivalence class can be established.
When the rules that the input data must comply with are specified, a valid equivalence class (those that comply with the rules) and several invalid equivalence classes (those that violate the rules from different perspectives) can be established.
If it is known that the elements in the equivalence class are processed differently in the program, the equivalence class should be further divided into smaller equivalence classes.
If a test data in an equivalence class cannot capture a defect, then selecting other test data in the equivalence class will not capture the defect; similarly, if a test data in an equivalence class can capture a defect, then selecting other data tests in the equivalence class can also capture the defect.
Note: When looking for equivalent partitions, consider grouping together the software with similar inputs, similar outputs, and similar operations. These groups are equivalent partitions.
If you over-divide equivalence classes in order to reduce the number of test cases, you run the risk of missing tests that may reveal software defects.
====================================================================
Boundary Value Analysis:
Boundary value analysis is to select test cases at the boundaries of equivalence classes. Boundary value analysis not only pays attention to the boundaries of input conditions, but also must consider the boundaries of output domains. It is a supplement to the equivalence class division method. "Software Quality and Testing"
That is: testing the input or output boundaries of the software as a supplementary test of the equivalence class partitioning method
A boundary value is just a specific data.
For example, a text box requires 6 to 18 characters to be entered.
The boundary values are:
6 characters
18 characters
Sub-boundary. The value near the boundary, according to the unit or calculation method specified by the system, is a difference in data.
For example, a character is just one character, there is no such thing as a half character; the minimum unit of RMB amount is 0.01 yuan (1 cent), and the minimum unit of ATM withdrawals and deposits is 100 yuan, which can only be an integer multiple of 100 yuan.
## Principles for selecting boundary values:
If the input condition specifies a range of values, the value that just reaches the boundary of this range and the value that just exceeds the boundary of this range should be taken as the test input data.
If the input condition specifies the number of values, the maximum number, minimum number, number less than the minimum number by 1, and number more than the maximum number by 1 are used as test data.
According to each output condition in the specification, use the previous principle ①
Apply the previous principle ② to each output condition in the specification.
If the input or output domain given in the program specification is an ordered set, the first and last elements of the set should be selected as test cases.
If an internal data structure is used in the program, values on the boundary of this internal data structure should be selected as test cases.
The equivalence class partitioning method and the boundary value analysis method focus on the input conditions, without considering the various combinations of input conditions or the mutual constraints between the input conditions.
=======================================================================================
Cause and effect diagram method:
It is a test method suitable for describing multiple input condition combinations.
According to the combination of input conditions, constraint relationships and causal relationships of output conditions, various combinations of input conditions are analyzed to design test cases.
It is suitable for checking various combinations of program input conditions.
3. Constraints between results: if the result is true, it is represented by 1; if it is false, it is represented by 0.
Block. Result A will appear between the results, but result B will not appear. When you receive a successful registration notification, you will not receive a notification that the data is filled in incorrectly.
=======================================================================================
Decision table method: (decision table method)
It is a tool for analyzing and expressing situations where different operations are performed under multiple logical conditions. It consists of the following:
Condition Stub: Lists all the conditions of the problem. It is generally considered that the order in which the conditions are listed does not matter.
Action Stub: Lists the possible actions that can be taken according to the problem. There is no restriction on the order in which these actions can be arranged.
Condition Entry: Lists the possible values for the condition to its left. True or false values in all possible cases.
Action Entry: Lists the actions that should be taken under various conditions.
Application scenarios: Mainly suitable for multi-condition content combination and result analysis.
Composition: It consists of four parts: condition item, action item, condition pile and action pile.
Conditions of use: The positions and order of all condition piles in the table do not affect each other; the order of all action piles will not be different due to the specialization of spare parts order.
=======================================================================================
Orthogonal experimental design method:
Basic idea:
In an experiment, the amount that affects the test results is called the test factor, or simply factor. During the experiment, each factor can be in different states or conditions. The state or condition of the factor is called the level of the factor, or simply level.
The number of different numbers in each column is equal. This feature indicates that the probability of each level of each factor participating in the experiment is exactly the same as that of each level of other factors, which can effectively compare the test results and find the optimal test conditions.
Previous article:Some basic testing methods
Next article:Performance testing, load testing, stress testing, stability testing
- Popular Resources
- Popular amplifiers
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Live broadcast on May 9] Discussing solutions to reduce downtime in the new manufacturing era, ADI live broadcast expert Zhao Yanhui is here again
- MOS tube isolation drive circuit, if we drive high voltage MOS tube, we need to use transformer drive and integrated...
- Watch NXP LPC55S69 live broadcast and get the book "Embedded Security Processor Application and Practice" for free
- EEWORLD University ---- SimpleLink Academy: Develop your Bluetooth? Low Energy project
- dsPIC33EP32MC204PWM current limiting function problem
- Do you have any recommendations for low-power encryption products? I am using this on a smart device and have strict requirements on power consumption.
- Microcontroller port input problem?
- Operation of EEPROM inside PIC microcontroller
- Will the voice signal remain the original sound after being processed in this way?
- STMicroelectronics' STM32MP1 is coming. What do you think of this chip?