CN114238117A - Software function testing method and device based on causal graph and storage medium - Google Patents

Software function testing method and device based on causal graph and storage medium Download PDF

Info

Publication number
CN114238117A
CN114238117A CN202111555956.4A CN202111555956A CN114238117A CN 114238117 A CN114238117 A CN 114238117A CN 202111555956 A CN202111555956 A CN 202111555956A CN 114238117 A CN114238117 A CN 114238117A
Authority
CN
China
Prior art keywords
input
output
analyzing
combination
conditions
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111555956.4A
Other languages
Chinese (zh)
Inventor
岳丽丽
关建杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XCMG Hanyun Technologies Co Ltd
Original Assignee
XCMG Hanyun Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XCMG Hanyun Technologies Co Ltd filed Critical XCMG Hanyun Technologies Co Ltd
Priority to CN202111555956.4A priority Critical patent/CN114238117A/en
Publication of CN114238117A publication Critical patent/CN114238117A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a software function testing method, a device and a storage medium based on a causal graph, wherein the method comprises the steps of obtaining all input conditions analyzed by software requirements and determining all output results; analyzing each input condition, acquiring the restriction relation and the combination relation of all the input conditions, and acquiring an input condition group; analyzing and confirming all output results, analyzing the restriction and association relation among the output results, and acquiring an output result group; analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output, and verifying whether the design is complete and reasonable again; the invention can effectively reduce the number of test cases, the test workload and the input cost, ensure the test quality, reduce the risk of the software product after the online, and improve the satisfaction degree of users to the software product.

Description

Software function testing method and device based on causal graph and storage medium
Technical Field
The invention relates to a software function testing method and device based on a causal graph and a storage medium, and belongs to the technical field of software project testing.
Background
In order to deliver high-quality software products to users and improve the satisfaction degree of the users, strict software tests are required before software development and delivery, and the importance of the software tests is reflected. One successful software testing process is to find out the defects in the software as much as possible, and reduce the release of serious defects to the production environment. The software testing method used in the testing process plays a very critical role in the quality of the software testing.
At present, common methods for software function testing mainly comprise an equivalence class division method, a boundary value analysis method and the like, wherein the methods mainly consider input conditions, lack of consideration on combination and restriction relation of the input conditions, and have the advantages that various input conditions can make mistakes when tested, but the condition that a plurality of input conditions can make mistakes when combined is ignored; the causal graph method is mainly used for describing the combination relationship between input and output of the tested object and the dependency relationship between the input and the output so as to find out the main reasons influencing the quality and make up the defects of the equivalence class division method.
The causal graph method needs to fully understand software requirements to obtain input and output relationships, but it is difficult to obtain necessary information from the specification of the software requirements in the early stage, even after the causal relationships are obtained, the complex input condition combination relationships or causal relationships result in huge causal graphs and test cases, which not only increases the difficulty and workload of software testing, but also increases the risk of software testing.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides a software function testing method, a device and a storage medium based on a causal graph, which can effectively reduce the number of test cases, the testing workload and the input cost, ensure the testing quality, reduce the online risk of software products and improve the satisfaction degree of users on the software products.
In order to achieve the purpose, the invention is realized by adopting the following technical scheme:
in a first aspect, the invention provides a software function testing method based on a causal graph, which comprises the following steps:
acquiring all input conditions subjected to software requirement analysis and determining all output results;
analyzing each input condition to obtain the restriction relation and the combination relation of all the input conditions, and sorting and summarizing all the obtained combination relation sequences of the input conditions to obtain an input condition group;
analyzing and confirming all output results, analyzing the restriction and association relation between the output results, numbering and sorting the results which cannot be combined together and the results which can be simultaneously output to obtain an output result group;
analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output, and verifying whether the design is complete and reasonable again;
and analyzing the paired combination, and removing the repeated value to obtain the final input and output combination for software testing.
Further, the input conditions obtained through the software requirement analysis include: and listing input and output conditions of each function according to a function list and an actual business process in the requirement specification, and finding out all input conditions.
Further, the analyzing each input condition to obtain the restriction relationship and the combination relationship of all the input conditions, and sorting and summarizing all the obtained combination relationship sequences of the input conditions to obtain the input condition group includes:
numbering each input condition, analyzing the feasibility and the necessity of each input condition to obtain normal and abnormal input conditions, analyzing the restriction relationship and the combination relationship among all the input conditions, sorting and summarizing all the combination relationship sequences of the obtained input conditions to obtain an input condition group.
In a second aspect, the present invention provides a software function testing apparatus based on a causal graph, including:
the acquisition unit is used for acquiring all input conditions subjected to software requirement analysis and determining all output results;
the first analysis unit is used for analyzing each input condition, acquiring the restriction relationship and the combination relationship of all the input conditions, sorting and summarizing all the obtained combination relationship sequences of the input conditions, and acquiring an input condition group;
the second analysis unit is used for analyzing and confirming all output results, analyzing the restriction and association relation among the output results, numbering and sorting the results which cannot be combined together and the results which can be output simultaneously, and acquiring an output result group;
the third analysis unit is used for analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output and verifying whether the design is complete and reasonable again;
and the fourth analysis unit is used for analyzing the combined combination after the pairing, removing the repeated value, obtaining the final input and output combination and using the final input and output combination for software testing.
Further, the acquiring unit includes: and listing input and output conditions of each function according to a function list and an actual business process in the requirement specification, and finding out all input conditions.
Further, the first analysis unit includes: numbering each input condition, analyzing the feasibility and the necessity of each input condition to obtain normal and abnormal input conditions, analyzing the restriction relationship and the combination relationship among all the input conditions, sorting and summarizing all the combination relationship sequences of the obtained input conditions to obtain an input condition group.
In a third aspect, the invention provides a software function testing device based on a causal graph, which comprises a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to any of the above.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods described above.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a software function testing method, a device and a storage medium based on a causal graph, which can realize the arraying and combining of various complex input and output conditions to form a test case by combining the software requirement characteristics, thereby improving the test coverage rate; meanwhile, the method can effectively reduce the number of test cases, the test workload and the input cost, ensure the test quality, reduce the risk of the software product after the software product is online and improve the satisfaction degree of a user on the software product.
Drawings
FIG. 1 is a flow chart of a design function test using a cause and effect diagram in an embodiment of the present invention;
fig. 2 is a schematic diagram of a prior art system architecture.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
Example 1
The embodiment introduces a software function testing method based on a causal graph, which comprises the following steps:
acquiring all input conditions subjected to software requirement analysis and determining all output results;
analyzing each input condition to obtain the restriction relation and the combination relation of all the input conditions, and sorting and summarizing all the obtained combination relation sequences of the input conditions to obtain an input condition group;
analyzing and confirming all output results, analyzing the restriction and association relation between the output results, numbering and sorting the results which cannot be combined together and the results which can be simultaneously output to obtain an output result group;
analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output, and verifying whether the design is complete and reasonable again;
and analyzing the paired combination, and removing the repeated value to obtain the final input and output combination for software testing.
This method not only ensures that each combination is tested, but that each combination is tested the same number of times. In all pairs testing, a combination is a pair of variables in a state, such that each variable in each state is paired at least once with some other variable in each state. Fig. 1 is a flowchart of designing a function test by using a cause-and-effect diagram in an embodiment, and an application process of the software function test method based on the cause-and-effect diagram provided in the embodiment specifically involves the following steps:
and S1, analyzing the software requirement. Software testing is not exhaustive, and to achieve maximum benefit in terms of manpower, time, and cost, the software needs to be analyzed first. According to the function list and the actual business process in the requirement specification, the input and output conditions of each function are listed, all the input conditions are found, and all the output results are determined.
And S2, analyzing and designing each input condition, numbering the input conditions, analyzing the feasibility and the necessity of each input condition, and obtaining normal and abnormal input conditions. And analyzing each input condition which is already clear in detail, and analyzing constraint relationships and combination relationships among all conditions, such as which conditions are mutually exclusive relationships and which conditions are or relationships. And sorting and summarizing all the obtained combination relation sequences of the input conditions.
And S3, analyzing and confirming all output results, analyzing the restriction and association relation among the output results, and numbering the results which cannot be combined together and the results which can be output simultaneously.
And S4, analyzing the logic relation between input and output by taking the functional module as a whole, analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output, and verifying whether the design is complete and reasonable again.
And S5, analyzing the paired combination, and removing the repeated value to obtain the final input and output combination for software testing.
As shown in fig. 1, if the software program has 3 different input parameters, each parameter has 2 different input values, and the obtained combinations are 8, with the software test design method, only 4 combinations are needed to cover the pairwise combinations of all the parameters. If the software program has 4 different input parameters, each parameter has 3 different input values, and the obtained combinations are 81, the software test design method can cover the pairwise combination of all the parameters by only 9 combinations.
When a test cell has 3 different parameters A, B, C, each with 2 input values (a1, a2, b1, b2, c1, c2), all combinations of input conditions are (a1, b1, c1) (a1, b1, c2) (a1, b1, c1), starting from the last group, if the two combination values of the group can be found in other combinations, the combination can be deleted, according to which the final combination of input values is (a1, b1, c1) (a1, b1, c1) (a1, c1, b1, c1) (a1, c 1).
The invention is suitable for complex software systems with multiple input conditions, complex logic relation between the input conditions and multiple judgment of output results, and can use a conventional test method aiming at a single simple input and output model. Before testing software with complex business logic, each test scenario to be tested needs to be fully analyzed, different scenarios have respective input and output conditions, and the logicality or relevance between input and between input and output needs to be considered so as to prevent missing. The following procedure can be followed:
step 1: the WBS splitting is carried out on the software product, the software product is divided into the minimum test units, the data flow direction of each test unit is arranged, in order to prevent the software requirement document from lacking the description of the service function, a product manager and a client can be invited to organize the requirement review meeting together when necessary, the service scenes to be realized by the system are listed clearly, and the coverage rate of the software test scenes is improved.
Step 2: after the data flow direction of the test units is analyzed, the data flow direction can be sorted in an input and output mode, then the input and output of each test unit are sorted and analyzed, when the input conditions are analyzed, an equivalence class dividing method can be used, a proper amount of representative data can be selected from a large number of test points to be numbered, and the comprehensiveness of the output results is noticed when the output results are analyzed.
And step 3: and analyzing various combinations of the input conditions and the output conditions, removing repeated values and invalid values, and finally sequentially verifying the coverage rate of the combinations according to the sequence of the flow so that all branches of the flow can be reached.
By adopting the software testing method and combining the software requirement characteristics, the invention can realize the arraying and combining of various complicated input and output conditions to form a test case, thereby improving the test coverage rate; meanwhile, the method can effectively reduce the number of test cases, the test workload and the input cost, ensure the test quality, reduce the risk of the software product after the software product is online and improve the satisfaction degree of a user on the software product.
Example 2
The embodiment provides a software function testing device based on a causal graph, which comprises:
the acquisition unit is used for acquiring all input conditions subjected to software requirement analysis and determining all output results;
the first analysis unit is used for analyzing each input condition, acquiring the restriction relationship and the combination relationship of all the input conditions, sorting and summarizing all the obtained combination relationship sequences of the input conditions, and acquiring an input condition group;
the second analysis unit is used for analyzing and confirming all output results, analyzing the restriction and association relation among the output results, numbering and sorting the results which cannot be combined together and the results which can be output simultaneously, and acquiring an output result group;
the third analysis unit is used for analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output and verifying whether the design is complete and reasonable again;
and the fourth analysis unit is used for analyzing the combined combination after the pairing, removing the repeated value, obtaining the final input and output combination and using the final input and output combination for software testing.
Further, the acquiring unit includes: and listing input and output conditions of each function according to a function list and an actual business process in the requirement specification, and finding out all input conditions.
Further, the first analysis unit includes: numbering each input condition, analyzing the feasibility and the necessity of each input condition to obtain normal and abnormal input conditions, analyzing the restriction relationship and the combination relationship among all the input conditions, sorting and summarizing all the combination relationship sequences of the obtained input conditions to obtain an input condition group.
Example 3
The embodiment provides a software function testing device based on a causal graph, which comprises a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to any one of:
acquiring all input conditions subjected to software requirement analysis and determining all output results;
analyzing each input condition to obtain the restriction relation and the combination relation of all the input conditions, and sorting and summarizing all the obtained combination relation sequences of the input conditions to obtain an input condition group;
analyzing and confirming all output results, analyzing the restriction and association relation between the output results, numbering and sorting the results which cannot be combined together and the results which can be simultaneously output to obtain an output result group;
analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output, and verifying whether the design is complete and reasonable again;
and analyzing the paired combination, and removing the repeated value to obtain the final input and output combination for software testing.
Example 4
The present embodiments provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of any of the methods:
acquiring all input conditions subjected to software requirement analysis and determining all output results;
analyzing each input condition to obtain the restriction relation and the combination relation of all the input conditions, and sorting and summarizing all the obtained combination relation sequences of the input conditions to obtain an input condition group;
analyzing and confirming all output results, analyzing the restriction and association relation between the output results, numbering and sorting the results which cannot be combined together and the results which can be simultaneously output to obtain an output result group;
analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output, and verifying whether the design is complete and reasonable again;
and analyzing the paired combination, and removing the repeated value to obtain the final input and output combination for software testing.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

Claims (8)

1. A software function testing method based on a causal graph is characterized by comprising the following steps:
acquiring all input conditions subjected to software requirement analysis and determining all output results;
analyzing each input condition to obtain the restriction relation and the combination relation of all the input conditions, and sorting and summarizing all the obtained combination relation sequences of the input conditions to obtain an input condition group;
analyzing and confirming all output results, analyzing the restriction and association relation between the output results, numbering and sorting the results which cannot be combined together and the results which can be simultaneously output to obtain an output result group;
analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output, and verifying whether the design is complete and reasonable again;
and analyzing the paired combination, and removing the repeated value to obtain the final input and output combination for software testing.
2. The causal graph-based software functional test method of claim 1, wherein: the input conditions obtained through software requirement analysis comprise: and listing input and output conditions of each function according to a function list and an actual business process in the requirement specification, and finding out all input conditions.
3. The causal graph-based software functional test method of claim 1, wherein: analyzing each input condition to obtain the restriction relationship and the combination relationship of all the input conditions, sorting and summarizing all the obtained combination relationship sequences of the input conditions to obtain an input condition group, comprising:
numbering each input condition, analyzing the feasibility and the necessity of each input condition to obtain normal and abnormal input conditions, analyzing the restriction relationship and the combination relationship among all the input conditions, sorting and summarizing all the combination relationship sequences of the obtained input conditions to obtain an input condition group.
4. A software function testing device based on a causal graph is characterized by comprising:
the acquisition unit is used for acquiring all input conditions subjected to software requirement analysis and determining all output results;
the first analysis unit is used for analyzing each input condition, acquiring the restriction relationship and the combination relationship of all the input conditions, sorting and summarizing all the obtained combination relationship sequences of the input conditions, and acquiring an input condition group;
the second analysis unit is used for analyzing and confirming all output results, analyzing the restriction and association relation among the output results, numbering and sorting the results which cannot be combined together and the results which can be output simultaneously, and acquiring an output result group;
the third analysis unit is used for analyzing the output result combination corresponding to the input condition group, verifying the coverage rate between input and output and verifying whether the design is complete and reasonable again;
and the fourth analysis unit is used for analyzing the combined combination after the pairing, removing the repeated value, obtaining the final input and output combination and using the final input and output combination for software testing.
5. The causal graph-based software function test arrangement of claim 4, wherein: the acquisition unit includes: and listing input and output conditions of each function according to a function list and an actual business process in the requirement specification, and finding out all input conditions.
6. The causal graph-based software function test arrangement of claim 4, wherein: the first analysis unit includes: numbering each input condition, analyzing the feasibility and the necessity of each input condition to obtain normal and abnormal input conditions, analyzing the restriction relationship and the combination relationship among all the input conditions, sorting and summarizing all the combination relationship sequences of the obtained input conditions to obtain an input condition group.
7. A software function testing device based on a causal graph is characterized in that: comprising a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to any one of claims 1 to 3.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that: the program when executed by a processor implements the steps of the method of any one of claims 1 to 3.
CN202111555956.4A 2021-12-17 2021-12-17 Software function testing method and device based on causal graph and storage medium Pending CN114238117A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111555956.4A CN114238117A (en) 2021-12-17 2021-12-17 Software function testing method and device based on causal graph and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111555956.4A CN114238117A (en) 2021-12-17 2021-12-17 Software function testing method and device based on causal graph and storage medium

Publications (1)

Publication Number Publication Date
CN114238117A true CN114238117A (en) 2022-03-25

Family

ID=80758424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111555956.4A Pending CN114238117A (en) 2021-12-17 2021-12-17 Software function testing method and device based on causal graph and storage medium

Country Status (1)

Country Link
CN (1) CN114238117A (en)

Similar Documents

Publication Publication Date Title
CN106708719B (en) Service function testing method and device
CN106294120B (en) Method, apparatus and computer program product for testing code
CN104252481A (en) Dynamic check method and device for consistency of main and salve databases
CN110569159A (en) Baffle generation method, device, equipment and computer storage medium
CN111401722B (en) Intelligent decision method and intelligent decision system
CN112433944A (en) Service testing method, device, computer equipment and storage medium
US7797590B2 (en) Consensus testing of electronic system
CN111367782B (en) Regression testing data automatic generation method and device
CN113220588A (en) Automatic testing method, device and equipment for data processing and storage medium
CN112306529A (en) System upgrading method, device, equipment and storage medium
CN112559525A (en) Data checking system, method, device and server
CN110188033B (en) Data detection device, method, computer device, and computer-readable storage medium
CN106445812A (en) Regression test system and regression test method
CN116431522A (en) Automatic test method and system for low-code object storage gateway
CN114238117A (en) Software function testing method and device based on causal graph and storage medium
CN111897725B (en) Automatic test method, medium, equipment and system for middle platform service
CN114741300A (en) Test case based test method and device
CN115098401A (en) HTML report verification method and device, electronic equipment and storage medium
CN112131128B (en) Data testing method and device, storage medium and electronic device
CN114676066A (en) Security testing method and device for target application, electronic equipment and storage medium
CN115878448A (en) Database test method, distributed database and storage medium
CN114020635A (en) Data testing method, device, equipment and medium based on scene message queue
WO2016151710A1 (en) Specification configuration device and method
CN112306850A (en) Test case generation method and device and storage medium
CN111290966B (en) Test case decomposition and combination method and system for improving android application test coverage rate

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination