Detailed explanation of functional testing of software testing

1. Overview of functional testing

1) Functional testing is to verify each function of the product. According to the functional test cases, test one by one to check whether the product meets the functions required by the user.

2) Functional testing, based on product features, operation descriptions and user scenarios, tests the features and operable behaviors of a product to determine that they meet the design requirements. Functional testing of localized software to verify that an application or website works correctly for target users. Use appropriate platforms, browsers, and test scripts to guarantee that the experience for your target users will be good enough, as if the app was developed specifically for that market. Functional testing is the testing of software according to functional requirements to ensure that the program runs in the expected manner. It tests all features and functions of a system to ensure compliance with requirements and specifications.

3) Functional testing, also known as behavioral testing, tests the features and operable behaviors of a product to ensure that they meet design requirements based on product features, operation descriptions and user scenarios. Functional testing of localized software to verify that an application or website works correctly for target users. Use appropriate platforms, browsers, and test scripts to guarantee that the experience for your target users will be good enough, as if the app was developed specifically for that market.

4) Functional testing is the testing of software according to functional requirements to ensure that the program runs in the expected manner. It tests all features and functions of a system to ensure compliance with requirements and specifications.

5) Functional testing is also called black box testing or data-driven testing. It only needs to consider each function that needs to be tested, and does not need to consider the internal structure and code of the entire software. Generally, tests are written based on the interface and architecture of the software product based on the requirements. Use cases, input data to evaluate between expected results and actual results, and then propose further requirements for making the product meet user requirements.

6) Black-box Testing (also known as functional testing or data-driven testing) treats the test object as a black box. When using the black box testing method for dynamic testing, the functions of the software product need to be tested, and the internal structure and processing process of the software product do not need to be tested.

At the same time, I have also prepared a software testing video tutorial for everyone (including interviews, interfaces, automation, performance testing, etc.), which is below. If you need it, you can watch it directly, or you can directly click on the small card at the end of the article to get the information document for free.

Where to watch software testing video tutorials:

Bilibili Fengshen’s interface testing tutorial, complete 70 projects in 30 days (including automated testing and performance testing), you will be employed immediately after completing the course, and you will be free of charge forever!

2. Black box design method

Black box test case design methods mainly include equivalence class division method, boundary value analysis method, error speculation method, cause-and-effect diagram method, decision table driven method, orthogonal experimental design method, function diagram method, etc.

1. Equivalence class division method

The equivalence class division method is to divide the input domain of the program into several parts, and then select a small number of representative data from each part as test cases. The representative data for each category plays an equal role in the test as the other values ​​in that category.

1) Application scenarios:

A certain program stipulates: "Input three integers a, b, c as the side lengths of the three sides to form a triangle. The program determines the type of triangle formed. When the triangle is a general triangle, an isosceles triangle and an equilateral triangle, Calculate separately..." Use the equivalence class division method to design test cases for this program.

2) Analyze the requirements for input conditions given and implicit in the question:

⑴Integer  

⑵Three numbers  

⑶Non-zero number  

⑷Positive number  

⑸The sum of two sides is greater than the third side  

⑹Isosceles  

⑺Equilateral

3) If a, b, and c meet conditions 1-4, enter one of the following four situations:

①If condition 5 is not met, the output is rendered as "non-triangle"

② If the three sides are equal, which means condition 7 is met, the output will be an "equilateral triangle"

③If only two sides are equal, that is, condition 6 is met, the output will be an "isosceles triangle"

④If the three sides are not equal, the program output is "general triangle"

4) Test cases covering valid equivalence classes:

  a b c covers equivalent class number

  3      4      5               1-7

  4      4      5               1-7,8

  4      4      5               1-7,9

  5      4      5               1-7,10

  4      4      4               1-7,11

5) Test cases covering invalid equivalence classes:

2. Boundary value analysis method

1) The boundary value analysis method is a black box testing method that tests the boundary value of the input fire output. The same-city boundary value analysis method is a supplement to the equivalence class division method.

2) When using the boundary value analysis method to design test cases, you should first determine the boundary conditions. Usually the boundaries of the input and output equivalence classes are the boundary conditions that should be focused on testing. You should choose a value that is exactly equal to, just greater than, or just smaller than the boundary as a test data.

3) Normally, there are several types of boundary tests included in software testing: numbers, characters, position, weight, size, speed, orientation, size, space, etc. Correspondingly, the boundary values ​​of the above types should be: maximum/minimum , use boundary values ​​as test data in the first/last position, top/bottom, fastest/slowest, highest/lowest, shortest/longest, empty/full, etc.

4) Application scenarios

Boundary value analysis test case for NextDate function 

In the NextDate function, it is implicitly specified that the value range of the variable mouth and the variable day is 1≤mouth≤12 and 1≤day≤31, and the value range of the variable year is set to 1912≤year≤2050 

3. Error inference method

  Based on experience and intuition, we can speculate on all possible errors in the program, and then design test cases in a targeted manner.

4. Cause and effect diagram method

 Cause-and-effect diagram master is a method that uses graphical methods to analyze various combinations of inputs to design test cases.

 Steps to design test cases using cause-and-effect diagram method:

  ① Analyze what are the causes (i.e., input conditions or equivalent classes of input conditions) and which are the results (i.e., output conditions) in the software specification description, and assign an identifier to each cause and result.

  ② Analyze the semantics in the software specification description, find out the corresponding relationships between causes and results, and between causes and causes, and draw a cause-and-effect diagram based on these relationships.

  ③ Due to grammatical or environmental restrictions, some combinations between causes and causes and between causes and results are impossible to occur. To indicate these special situations, some symbols are used on the cause-and-effect diagram to indicate constraints or limiting conditions.

  ④ Convert the cause-and-effect diagram into a decision table

  ⑤ Take out each column of the judgment table as a basis to design test cases.

5. Decision table driven method

1) The judgment table usually consists of 4 parts

  ① Condition pile: Lists all conditions of the problem. It is generally considered that the order of listed conditions does not matter

  ② Action pile: Lists possible actions specified by the problem. There is no restriction on the order of these actions.

  ③ Conditional item: Lists the values ​​​​for the condition on its left column. True and false values ​​​​in all possible situations.

  ④ Action item: List the actions that should be taken under various values ​​of the condition item.

2) Steps to establish the judgment table

  ① Determine the number of rules. Add n conditions. Each condition has two values ​​(0,1), so there are 2n kinds of rules.

  ② List all condition piles and action piles

  ③ Fill in the conditional items

  ④ Fill in the action items. Wait until the initial judgment table

  ⑤ Simplify and merge similar rules

3) Application scenarios:

The question requires: "...Machines with power greater than 50 horsepower, machines with incomplete maintenance records, or machines that have been in operation for more than 10 years should be given priority for maintenance..." It is assumed here that "maintenance records are incomplete" and "priority "Maintenance treatment" has been more strictly defined elsewhere. Please create a determination table

4) Answer:

  ① Determine the number of rules: There are 3 conditions here, each condition has two values, so there should be 2*2*2=8 rules

  ② List all condition piles and action piles

  ③ Fill in the conditional items. You can start from the last line of conditional items and fill up line by line. For example, the third line is: YNYNYNYN, the second line is: YYNNYYNN, etc.

  ④ Fill in the action piles and action items. This will give you the initial judgment table as shown in the figure.

  ⑤ Simplify and merge similar rules to get the graph

 6. Orthogonal test method

According to the Galois theory, a scientific experiment design method is used to select an appropriate amount of representative points (examples) from a large amount of (experimental) data (test cases) to rationally arrange experiments (tests).

 7.Function diagram method

The function diagram consists of a state transition diagram and a Boolean function. The state transition diagram is described by states and transitions. A state indicates the location (or time) of data input, while the transition indicates the change of state. Colleagues must rely on decision tables or cause-and-effect diagrams to represent logical function.

8. Scenario method

1) The situation when an event is triggered forms a scene, and the different triggering sequences and processing results of the same event form an event flow.

2) Application scenarios

Flowchart of ATM example

3) Scene design:

 4) Use case design:

 5) Data design:

9. Comprehensive strategy for test case design

1) Myers proposes a comprehensive strategy using various testing methods

  ① The boundary value analysis method must be used in any case. Experience shows that using this method to design test cases has the strongest ability to find program errors.

  ② If necessary, use the equivalence class division method to supplement some test cases

  ③ Use the error guessing method to add some more test cases

  ④ Check the logic coverage of the designed test cases against the program logic. If the required coverage standards are not met, sufficient test cases should be added.

  ⑤ If the function description of the program contains the combination of input conditions, the cause-and-effect diagram method can be used from the beginning

2) Design steps of test cases

  ① Construct basic functional test cases derived from more design specifications

  ② Boundary value test cases

  ③ State transition test case

  ④ Wrong guessing test cases

  ⑤ Abnormal test cases

  ⑥ Performance test cases

  ⑦ Stress test cases

3) Methods to optimize test cases

  ① Use the 8 methods of designing test cases to continuously decompose and merge test cases

  ② Use genetic algorithm theory to evolve test cases

  ③ Use divergent thinking to construct test cases during testing

3. Types of errors discovered by black box testing

(1) Functional errors or omissions
(2) Interface errors
(3) Data structure or external database access errors
(4) Performance errors
(5) Initialization and termination errors

4. Test case design method

(1) Equivalence class division method
(2) Boundary value analysis method
(3) Error speculation method
(4) Cause and effect diagram method
(5) Decision table driven analysis method (
6) Orthogonal experimental design method
(7) Functional diagram analysis method

5. Summary

PS: Here is a collection of self-study tutorials for software testing. It should be very helpful for those who are developing in the testing industry. In addition to basic introductory resources, bloggers also collect a lot of advanced automation resources. From theory to practice, only by integrating knowledge and action can you truly master it. The full set of content has been packaged on the network disk, and the total content is close to 500 G.

☑ 240 episodes - a complete set of video courses from zero to mastery
☑ [Courseware + Source Code] - complete supporting tutorials
☑ 18 sets - source code of practical testing projects
☑ 37 sets - testing tool software package
☑ 268 - real interview questions
☑ 200 templates - Interview resume template, test plan template, software test report template, test analysis template, test plan template, performance test report, performance test report, performance test script case template (complete information)

These materials should be the most comprehensive and complete preparation warehouse for friends who do [software testing]. This warehouse has also accompanied me through the most difficult journey. I hope it can also help you! Everything must be done early, especially in the technical industry, where technical skills must be improved.

Guess you like

Origin blog.csdn.net/huace3852/article/details/133029893