CN116467176A - Determination method and device of test task, storage medium and electronic device - Google Patents

Determination method and device of test task, storage medium and electronic device Download PDF

Info

Publication number
CN116467176A
CN116467176A CN202310273887.0A CN202310273887A CN116467176A CN 116467176 A CN116467176 A CN 116467176A CN 202310273887 A CN202310273887 A CN 202310273887A CN 116467176 A CN116467176 A CN 116467176A
Authority
CN
China
Prior art keywords
test
determining
program
list
task
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
CN202310273887.0A
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202310273887.0A priority Critical patent/CN116467176A/en
Publication of CN116467176A publication Critical patent/CN116467176A/en
Pending legal-status Critical Current

Links

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/3688Test management for test execution, e.g. scheduling of test suites
    • 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
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/26Discovering frequent patterns
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method and a device for determining a test task, a storage medium and an electronic device, and relates to the technical field of smart families, wherein the method for determining the test task comprises the following steps: determining a first association rule between test programs in a test list, wherein the test list comprises: a test task and a test program set for executing the test task; under the condition that the first test program in the test list has updating operation, determining a second association rule corresponding to the first test program in the first association rule, and determining a second test program according to the second association rule; the target test tasks corresponding to the first test program and the second test program are determined in the test list so as to test the updated first test program.

Description

Determination method and device of test task, storage medium and electronic device
Technical Field
The application relates to the technical field of smart families, in particular to a method and a device for determining a test task, a storage medium and an electronic device.
Background
Items based on black box testing have several common problems during the testing process: the current project based on the black box test has the following common problems in the test process:
(1) The number of the black box test cases is larger than 5w, and the test work is mainly manual and is greatly influenced by subjective artifacts: each time the version is released, a tester determines the influence range of the change on the system according to personal experience, and in general, the test range is either small, so that missed test is caused, or the test range is too large, the cost is too high, so that the project cannot be delivered on schedule.
(2) Code and test have no data measurable: there is no unit test, other types of tests have no measure of code coverage, quality, and no data, for example, we say that the api test coverage is 100%, and most of the data is estimated according to the use case business scenario. The testers can only add more black box tests, and the actual functional test coverage rate increases with time and use cases, so that the coverage rate of the ceilings can be reached, and more repeated ineffective tests are performed.
(3) Automated testing fails to function: for a web/api or app back-end service system, a tester puts a great amount of time and effort on the implementation of api interface test except manual test, as the iteration of projects, automatic use cases accumulate more and more from hundreds to thousands, and when the test stability, the operation time length and a great amount of repeated test scenes and codes are needed to be considered, the whole test enables the input income ratio ROI not to rise along with the increase of the number of the use cases, but rather maintenance and investigation problems become the burden of daily work of the tester, the tester is tired, no effort is applied to more useful exploratory test and analysis work, further bug is caused, the whole team loses trust on automation until the test is abandoned, and the test is one of reasons why the large-scale implementation of agile test cannot be realized in many traditional industries.
Aiming at the problems of more invalid test cases and the like when the system performs the black box test in the related art, no effective solution is proposed yet.
Disclosure of Invention
The embodiment of the application provides a method and a device for determining a test task, a storage medium and an electronic device, which are used for at least solving the problems of more invalid tests and the like when a system performs a black box test in the related art.
According to an embodiment of the present application, there is provided a method for determining a test task, including: determining a first association rule between test programs in a test list, wherein the test list comprises: a test task and a test program set for executing the test task; under the condition that the first test program in the test list has updating operation, determining a second association rule corresponding to the first test program in the first association rule, and determining a second test program according to the second association rule; and determining target test tasks corresponding to the first test program and the second test program in the test list so as to test the updated first test program.
In one exemplary embodiment, determining a first association rule between test programs in a test list includes: determining a frequent item set corresponding to the test list, wherein the frequent item set comprises: a plurality of test programs; and determining a first association rule between test programs in the test list according to the frequent item set.
In an exemplary embodiment, determining a first association rule between test programs in the test list according to the frequent item set includes: determining a plurality of non-empty subsets corresponding to the frequent item sets; determining a confidence level of the test program in the first non-empty subset and the test program in the second non-empty subset, wherein the plurality of non-empty subsets comprises at least: the first non-empty subset and the second non-empty subset; and under the condition that the confidence coefficient is larger than a preset confidence coefficient, determining that the first association rule exists between the test programs in the first non-empty subset and the test programs in the second non-empty subset.
In an exemplary embodiment, determining the frequent item set corresponding to the test list includes: establishing a frequent pattern tree according to the test list; traversing the frequent pattern tree by taking the node corresponding to each test program as the end, and acquiring a prefix path by taking each test program as the end; and determining the frequent item set according to the prefix path ending with each test program.
In one exemplary embodiment, building a frequent pattern tree from the test list includes: the establishing step comprises the following steps: determining whether the branch node corresponding to any test code set and the branch node of the established frequent pattern tree have the same prefix node or not; combining the same prefix node of the branch node corresponding to any test code set with the same prefix node of the branch node of the frequent pattern tree under the condition that the same prefix node exists; generating branches of the frequent pattern tree according to the branch nodes corresponding to any test code set under the condition that the branch nodes corresponding to any test code set and the branch nodes of the frequent pattern tree do not have the same prefix nodes; and circularly executing the establishing step until the frequent pattern tree is established according to a plurality of test code sets.
In an exemplary embodiment, after determining the target test tasks corresponding to the first test program and the second test program in the test list, the method further includes: determining test data for testing the performance of the first test program and the data type of the test data according to the target test task; configuring test parameters for the test data according to the data type; and generating a test case according to the test parameters and the test data so as to test the performance of the first test program through the test case.
In an exemplary embodiment, before determining the first association rule between the test programs in the test list, the method further comprises: recording test program information in the process of executing the test task under the condition that a start instruction for instructing to execute the test task is received; and generating the test list under the condition that an ending instruction for indicating ending executing the test task is received.
According to another embodiment of the embodiments of the present application, there is also provided a device for determining a test task, including: a first determining module, configured to determine a first association rule between test programs in a test list, where the test list includes: a test task and a test program set for executing the test task; the second determining module is used for determining a second association rule corresponding to the first test program in the first association rule and determining the second test program according to the second association rule under the condition that the first test program in the test list has updating operation; and the third determining module is used for determining target test tasks corresponding to the first test program and the second test program in the test list so as to test the updated first test program.
According to yet another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described determination method of test tasks when run.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the method for determining the test task by using the computer program.
In an embodiment of the present application, a first association rule between test programs in a test list is determined, where the test list includes: a test task and a test program set for executing the test task; under the condition that the first test program in the test list has updating operation, determining a second association rule corresponding to the first test program in the first association rule, and determining a second test program according to the second association rule; determining target test tasks corresponding to the first test program and the second test program in the test list so as to test the updated first test program through test cases corresponding to the target test tasks; by adopting the technical scheme, the embodiment of the invention determines the test tasks comprising the first test program and the second test program according to the association rule between the first test program and the second test program, and further tests the updated first test program through the test cases corresponding to the target test task, thereby solving the problems of more invalid test cases and the like when the system performs the black box test, and achieving the technical effect of accurate test.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of a method for determining a test task according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of determining a test task according to an embodiment of the present application;
FIG. 3 is a schematic diagram (one) of a frequent pattern tree, according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a frequent pattern tree (II) according to an embodiment of the present application;
FIG. 5 is a schematic diagram (III) of a frequent pattern tree, according to an embodiment of the present application;
FIG. 6 is a schematic diagram (fourth) of a frequent pattern tree, according to an embodiment of the present application;
FIG. 7 is a schematic diagram (fifth) of a frequent pattern tree, according to an embodiment of the present application;
FIG. 8 is a schematic diagram (sixth) of a frequent pattern tree, according to an embodiment of the present application;
FIG. 9 is a schematic diagram (seventh) of a frequent pattern tree, according to an embodiment of the present application;
FIG. 10 is a schematic diagram (eight) of a frequent pattern tree, according to an embodiment of the present application;
FIG. 11 is a schematic diagram (nine) of a frequent pattern tree, according to an embodiment of the present application;
FIG. 12 is a schematic diagram (ten) of a frequent pattern tree, according to an embodiment of the present application;
fig. 13 is a block diagram of a test task determination apparatus according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, a method for determining a test task is provided. The determination method of the test task is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the above-described determination method of the test task may be applied to a hardware environment constituted by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a method for determining a test task is provided and applied to a computer terminal, and fig. 2 is a flowchart of a method for determining a test task according to an embodiment of the present application, where the flowchart includes the following steps:
step S202, determining a first association rule between test programs in a test list, where the test list includes: a test task and a test program set for executing the test task;
step S204, determining a second association rule corresponding to the first test program in the first association rule and determining a second test program according to the second association rule under the condition that the first test program in the test list has an updating operation;
step S206, determining target test tasks corresponding to the first test program and the second test program in the test list, so as to test the updated first test program.
Through the steps, determining a first association rule between test programs in a test list, wherein the test list comprises: a test task and a test program set for executing the test task; under the condition that the first test program in the test list has updating operation, determining a second association rule corresponding to the first test program in the first association rule, and determining a second test program according to the second association rule; and determining target test tasks corresponding to the first test program and the second test program in the test list so as to test the updated first test program through test cases corresponding to the target test tasks, thereby solving the problems of more invalid tests and the like when the system performs the black box test in the related technology and achieving the technical effect of accurate test.
In one exemplary embodiment, determining a first association rule between test programs in a test list includes: determining a frequent item set corresponding to the test list, wherein the frequent item set comprises: a plurality of test programs; and determining a first association rule between test programs in the test list according to the frequent item set.
It should be noted that the frequent item set may be understood as: a set of items whose support meets a predefined minimum support threshold can be simply understood as a set of items that occur together frequently in a transaction set. Frequent item set mining is the basis for many important data mining tasks such as association rules, correlation analysis, causality, sequence item sets, local periodicity, episode segments, and the like. The goal is to find all item sets that meet the minimum support threshold, which are called frequent item sets. Association rules: the association relation between the plurality of test programs satisfies the minimum support degree and the minimum confidence degree.
The test programs in the frequent item set can understand the test programs which frequently occur together, the association rule in the test programs in the frequent item set can be determined according to the frequent item set, then the test tasks comprising the first test program and the second test program are determined under the condition of determining the association rule between the first test program and the second test program, and further the updated first test program is tested through the test cases corresponding to the target test tasks, so that the problems of more invalid test cases and the like when the system performs the black box test are solved, and the technical effect of accurate test is achieved.
In an exemplary embodiment, determining a first association rule between test programs in the test list according to the frequent item set includes: determining a plurality of non-empty subsets corresponding to the frequent item sets; determining a confidence level of the test program in the first non-empty subset and the test program in the second non-empty subset, wherein the plurality of non-empty subsets comprises at least: the first non-empty subset and the second non-empty subset; and under the condition that the confidence coefficient is larger than a preset confidence coefficient, determining that the first association rule exists between the test programs in the first non-empty subset and the test programs in the second non-empty subset.
For example, let Y be the frequent item set, the association rule may be extracted as follows: dividing the item set Y into two non-empty subsets X and Y-X, so that X- > Y-X meets a confidence threshold;
for example, y= { test procedure 1, test procedure 2, test procedure 3} is a frequent item set, 6 association rules can be generated by Y: { test procedure 1} - > { test procedure 3}, { test procedure 1, test procedure 3} - > { test procedure 2}, { test procedure 2, test procedure 3} - > { test procedure 1}, { test procedure 1} - > { test procedure 2, test procedure 3}, { test procedure 2} - > { test procedure 1, test procedure 3}, { test procedure 3} - > { test procedure 1, test procedure 2}. And determining whether the 6 association rules meet the preset confidence level or not, and determining the first association rule under the condition that the association rules meet the preset confidence level.
In an exemplary embodiment, determining the frequent item set corresponding to the test list includes: establishing a frequent pattern tree according to the test list; traversing the frequent pattern tree by taking the node corresponding to each test program as the end, and acquiring a prefix path by taking each test program as the end; and determining the frequent item set according to the prefix path ending with each test program.
In one exemplary embodiment, building a frequent pattern tree from the test list includes: the establishing step comprises the following steps: determining whether the branch node corresponding to any test code set and the branch node of the established frequent pattern tree have the same prefix node or not; combining the same prefix node of the branch node corresponding to any test code set with the same prefix node of the branch node of the frequent pattern tree under the condition that the same prefix node exists; generating branches of the frequent pattern tree according to the branch nodes corresponding to any test code set under the condition that the branch nodes corresponding to any test code set and the branch nodes of the frequent pattern tree do not have the same prefix nodes; and circularly executing the establishing step until the frequent pattern tree is established according to a plurality of test code sets.
Note that the root node of the frequent pattern tree is null, and does not represent any item. Next, a second scan of the test list is performed, thereby beginning to build the frequent pattern tree: the first test code set [ f, c, a, m, p ] corresponds to the first branch in the frequent pattern tree: [ (f: 1), (c: 1), (a: 1), (m: 1), (p: 1) ]; in the case that the second test code set is [ f, c, a, b, m ], the second test code set and the first test code set have the same prefix [ f, c, a ], so that the support degree of [ f, c, a ] is respectively increased by one, and meanwhile, nodes (b: 1) and (m: 1) are added under the node (a: 2). Therefore, the second branch in the FP-tree is [ (f: 2), (c: 2), (a: 2), (h: 1), (m: 1) ]; and when the third test code set is [ c, b, p ] and the first test code set and the second test code set have no common prefix, adding a third branch [ (c: 1), (b: 1), (p: 1) ] under the root node, and so on until all the test code sets are traversed, and thus building a completed frequent pattern tree.
In an exemplary embodiment, after determining the target test tasks corresponding to the first test program and the second test program in the test list, the method includes: determining test data for testing the performance of the first test program and the data type of the test data according to the target test task; configuring test parameters for the test data according to the data type; and generating a test case according to the test parameters and the test data so as to test the performance of the first test program through the test case.
That is, the embodiment of the invention provides a way for determining the test case, and the specific way is as follows: and determining test data for testing the performance of the first test program and the data type of the test data according to the target test task, and further generating a test case according to the test data and the data type of the test data.
It should be noted that, the test case may be automatically generated by a program, or may be written by a developer, which is not limited in the embodiment of the present invention.
In one exemplary embodiment, before determining the first association rule between the test programs in the test list, it includes: recording test program information in the process of executing the test task under the condition that a start instruction for instructing to execute the test task is received; and generating the test list under the condition that an ending instruction for indicating ending executing the test task is received.
The test list is generated by receiving test program information between a start instruction of a test task and an end instruction of the test task.
In order to better understand the process of the determination method of the test task, the following describes the implementation method flow of the determination of the test task in combination with the alternative embodiment, but is not used for limiting the technical solution of the embodiment of the present application.
For a better understanding of embodiments of the present invention, the following terms are explained:
FP-Tree (corresponding to the frequent pattern Tree in the above embodiment): after each transaction data item in the transaction data table is ordered according to the support degree, the data items in each transaction are sequentially inserted into a tree taking NULL as a root node according to the descending order, and the support degree of the node is recorded at each node.
Conditional mode base: a set of prefix paths in the FP-Tree that occur with the suffix pattern is included.
Condition tree: and forming a new FP-Tree by using the conditional pattern base according to the construction principle of the FP-Tree.
Support (support): support (a→b) =p (a→b), indicating the probability that a and B occur simultaneously.
Confidence (confidence): confidence (a→b) =support (a→b)/support (a), which means the ratio of the probability that a and B occur simultaneously to the probability that a occurs.
Association rules: and the association relation between the minimum support degree and the minimum confidence degree is satisfied. The goal is to extract all high confidence rules, called strong rules, from the set of frequent items found in the previous step.
Item set: a set of items is a collection of items, such as: { bread, milk, egg } this is a 3 item set whose frequency of occurrence is the number of transactions involving the item set, and it is noted as a support count.
Frequent item sets: a set of items whose support meets a predefined minimum support threshold can be simply understood as a set of items that occur together frequently in a transaction set. Frequent item set mining is the basis for many important data mining tasks such as association rules, correlation analysis, causality, sequence item sets, local periodicity, episode segments, and the like. The goal is to find all item sets that meet the minimum support threshold, which are called frequent item sets.
In this embodiment, a method for determining a test task is provided, which specifically includes the following steps:
step 1: constructing FpTree;
the FP-growth algorithm compresses the information in the transaction database by constructing the FP-tree, thereby more efficiently generating frequent item sets. The FP-tree is actually a prefix tree, and the frequent items with higher support are closer to the root node, so that more frequent items can share prefixes. The data base for things is shown in table 1:
TABLE 1
Test task number Program code execution list
1 f,c,a,d,g,i,m,p
2 f,c,a,b,l,m,o
3 f,b,h,j,o
4 c,b,p,k,s
5 f,c,a,m,p,e,m,n
Table 1 shows a transaction database for shopping basket analysis. Wherein a, b..p represents program code for performing test tasks, respectively. First, the transactional database is scanned once, the support of each program code in each row of records is calculated, then the support is arranged in descending order, only frequent item sets are reserved, and in the case of a support threshold of 3, items below the support threshold are removed, so that { (f: 4), (c: 4), (a: 3), (b: 3), (m: 3), (p: 3) } is obtained (since N in the support calculation formula is unchanged, only molecules in the comparison formula are needed). Table 2 shows the results after sorting.
TABLE 2
Test task number Program code execution list
1 f,c,a,m,p
2 f,c,a,b,m
3 f,b,h
4 c,b,p
5 f,c,a,m,p
The root node of the FP-tree is null and does not represent any item. Next, a second scan of the transactional database is performed, thereby starting to build the FP-tree:
the first record < f, c, a, m, p > corresponds to the first branch < (f: 1), (c: 1), (a: 1), (m: 1), (p: 1) >, in the FP-tree, as shown in fig. 3, fig. 3 is a schematic diagram (one) of a frequent pattern tree according to an embodiment of the present application.
Since the second record < f, c, a, b, m > has the same prefix < f, c, a > as the first record, the support of < f, c, a > is respectively increased by one, and simultaneously, nodes (b: 1), (m: 1) are added under the (a: 2) node. Therefore, the second branch in the FP-tree is < (f: 2), (c: 2), (a: 2), (h: 1), (m: 1) >, as shown in FIG. 4, FIG. 4 is a schematic diagram of a frequent pattern tree according to an embodiment of the present application (II).
The third record < f, b > has only one common prefix < f > compared to the first two records, so node < b:1> need only be added at (f: 3), as shown in fig. 5, fig. 5 is a schematic diagram (three) of a frequent pattern tree according to an embodiment of the present application.
The fourth record < c, b, p > has no common prefix with all previous records, so nodes (c: 1), (b: 1), (p: 1) are added under the root node, as shown in FIG. 6, FIG. 6 is a schematic diagram (fourth) of a frequent pattern tree according to an embodiment of the present application.
The fifth record < f, c, a, m, p > and the first record have common prefixes < f, c, a, m, p >, so that the support corresponding to < f, c, a, m, p > is respectively added by one, as shown in fig. 7, fig. 7 is a schematic diagram (fifth) of the frequent pattern tree according to the embodiment of the present application.
Step 2: constructing FpTree threads;
to facilitate traversing the entire tree, a head table (an item header table) of items is built. The first column of this table is the frequent entries in descending order. The second column is a pointer to the node location of the frequent item in the FP-tree. Each node in the FP-tree further has a pointer for pointing to a node with the same name, as shown in fig. 8, fig. 8 is a schematic diagram (sixth) of a frequent pattern tree according to an embodiment of the present application;
step 3: determining a frequent item set;
frequent patterns in the FP-tree are mined from the bottom of the head table. The node chains ending with p in the FP-tree are two in total, respectively < (f: 4), (c: 3), (a: 3), (m: 2), (p: 2) > and < (c: 1), (b: 1), (p: 1) >. It should be noted that although < f, c, a > appears 3 times in the first node chain and a single item < f > appears 4 times, they appear only 2 times together with p, so that < (f: 4), (c: 3), (a: 3), (m: 2), (p: 2) > is noted as < (f: 2), (c: 2), (a: 2), (m: 2), (p: 2) >, in the condition FP-tree. Similarly, the terms < (c: 1), (b: 1), and (p: 1) are referred to as < (c: 1), (b: 1), and (p: 1). The prefix node chains < (f: 2), (c: 2), (a: 2), (m: 2) > and < (c: 1), (b: 1) > of p are referred to as conditional pattern groups (conditional pattern base) of p. Taking a conditional pattern base of p as a new transaction database, storing a prefix node chain of p in each row, calculating the support degree of each program code in each row record according to the process of constructing the FP-tree in the second section, then arranging according to the descending order of the support degree, only retaining frequent item sets, removing items lower than the support degree threshold value, and establishing a new FP-tree, wherein the tree is called a conditional FP-tree of p, and as shown in FIG. 9, FIG. 9 is a schematic diagram (seventh) of the frequent pattern tree according to the embodiment of the application. As can be seen from FIG. 9, the frequent term set ending with p has (p: 3), (cp: 3).
In the FP-tree, there are two node chains ending in m, respectively < (f: 4), (c: 3), (a: 3), (m: 2) > and < (f: 4), (c: 3), (a: 3), (b: 1), (m: 1) >. The conditional mode groups for m are therefore < (f: 2), (c: 2), (a: 2) and < (f: 1), (c: 1), (a: 1), (b: 1). Taking the m conditional pattern base as a new transaction database, storing m prefix node chains in each row, calculating the support degree of each program code in each row record, then arranging according to the descending order of the support degree, only retaining frequent item sets, eliminating items lower than the support degree threshold value, and establishing m conditional FP-tree, as shown in FIG. 10, wherein FIG. 10 is a schematic diagram (eighth) of a frequent pattern tree according to an embodiment of the application.
Unlike p, there are 3 nodes in the m condition FP-tree, so frequent term sets (< (f: 3), (c: 3), (a: 3) | (m: 3) >) need to be recursively mined multiple times. Recursively invoking mine (< (f: 3), (c: 3) |a, m >) in the order of < (a: 3), (c: 3) |c, m >), mine (< (f: 3) |c, m >), mine (null|f, m). Since (m: 3) satisfies the support threshold requirement, the frequent item set ending with m has { (m: 3) }.
As can be seen from FIG. 11, the condition FP-tree of node (a, m) has 2 nodes, requiring further recursive calls for mine (< (f: 3) |c, a, m >) and mine (< null|f, a, m >). Further recursion of mine (< (f: 3) |c, a, m >) generates mine (< null|f, c, a, m >). Thus, frequent sets of items ending with (a, m) have { (am: 3), (fam: 3), (cam: 3), (fcam: 3) }.
As can be seen from FIG. 12, the condition FP-tree of node (c, m) has only 1 node, so only a recursive call of mine (< null|f, c, m >). Thus, the frequent item set ending with (c, m) has { (cm: 3), (fcm: 3) }. Similarly, the frequent item set ending with (f, m) has { (fm: 3) }.
The three node chains ending with b in the FP-tree are < (f: 4), (c: 3), (a: 3), (b: 1) >, < (f: 4), (b: 1) >, and < (c: 1), (b: 1) >, respectively. Since neither the conditional pattern base < (f: 1), (c: 1), (a: 1) >, < (f: 1) >, nor < (c: 1) >, of node b satisfies the support threshold, no recurrence is required. Thus, the frequent item set ending with b is only (b: 3).
Similarly, frequent item sets ending with a { (fa: 3), (ca: 3), (fca: 3), (a: 3) }, frequent item sets ending with c { (fc: 3), (c: 4) }, frequent item sets ending with f { (f: 4) }.
Step 4: determining the association relation between the program codes;
finding the association rules refers to finding out all rules with support degree greater than or equal to minsup and confidence degree greater than or equal to minconf, wherein minsup and minconf are corresponding support degree thresholds and confidence degree thresholds.
Let Y be the frequent item set, the association rule can be extracted as follows: the item set Y is partitioned into two non-empty subsets X and Y-X such that X- > Y-X meets the confidence threshold.
Step 5: under the condition that the program codes are updated, codes with association relation with the updated codes are determined according to association rules, test tasks corresponding to the updated codes and the codes with association relation with the updated codes are determined, and then the test tasks are executed.
The embodiment of the invention solves the problems of more invalid test cases and the like when the system performs the black box test in the related technology, and achieves the technical effect of accurate test.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present application.
FIG. 13 is a block diagram of a determination device of a test task according to an embodiment of the present application; as shown in fig. 13, includes:
a first determining module 1302, configured to determine a first association rule between test programs in a test list, where the test list includes: a test task and a test program set for executing the test task;
a second determining module 1304, configured to determine, in a case where an update operation exists for a first test program in the test list, a second association rule corresponding to the first test program in the first association rules, and determine a second test program according to the second association rule;
a third determining module 1306, configured to determine target test tasks corresponding to the first test program and the second test program in the test list, so as to test the updated first test program.
By the device, the first association rule among the test programs in the test list is determined, wherein the test list comprises: a test task and a test program set for executing the test task; under the condition that the first test program in the test list has updating operation, determining a second association rule corresponding to the first test program in the first association rule, and determining a second test program according to the second association rule; and determining target test tasks corresponding to the first test program and the second test program in the test list so as to test the updated first test program through test cases corresponding to the target test tasks, thereby solving the problems of more invalid tests and the like when the system performs the black box test in the related technology and achieving the technical effect of accurate test.
In an exemplary embodiment, the first determining module 1302 is configured to determine a frequent item set corresponding to the test list, where the frequent item set includes: a plurality of test programs; and determining a first association rule between test programs in the test list according to the frequent item set.
In an exemplary embodiment, a first determining module 1302 is configured to determine a plurality of non-empty subsets corresponding to the frequent item set; determining a confidence level of the test program in the first non-empty subset and the test program in the second non-empty subset, wherein the plurality of non-empty subsets comprises at least: the first non-empty subset and the second non-empty subset; and under the condition that the confidence coefficient is larger than a preset confidence coefficient, determining that the first association rule exists between the test programs in the first non-empty subset and the test programs in the second non-empty subset.
In an exemplary embodiment, a first determining module 1302 is configured to build a frequent pattern tree according to the test list; traversing the frequent pattern tree by taking the node corresponding to each test program as the end, and acquiring a prefix path by taking each test program as the end; and determining the frequent item set according to the prefix path ending with each test program.
In an exemplary embodiment, the first determining module 1302 is configured to perform the establishing step: determining whether the branch node corresponding to any test code set and the branch node of the established frequent pattern tree have the same prefix node or not; combining the same prefix node of the branch node corresponding to any test code set with the same prefix node of the branch node of the frequent pattern tree under the condition that the same prefix node exists; generating branches of the frequent pattern tree according to the branch nodes corresponding to any test code set under the condition that the branch nodes corresponding to any test code set and the branch nodes of the frequent pattern tree do not have the same prefix nodes; and circularly executing the establishing step until the frequent pattern tree is established according to a plurality of test code sets.
In an exemplary embodiment, a third determining module 1306 is configured to determine, according to the target test task, test data for testing performance of the first test program and a data type of the test data; configuring test parameters for the test data according to the data type; and generating a test case according to the test parameters and the test data so as to test the performance of the first test program through the test case.
In an exemplary embodiment, the first determining module 1302 is configured to record, when receiving a start instruction for instructing to execute the test task, test program information during execution of the test task; and generating the test list under the condition that an ending instruction for indicating ending executing the test task is received.
Embodiments of the present application also provide a storage medium including a stored program, wherein the program performs the method of any one of the above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, determining a first association rule between test programs in a test list, wherein the test list comprises: a test task and a test program set for executing the test task;
s2, under the condition that updating operation exists in a first test program in the test list, determining a second association rule corresponding to the first test program in the first association rule, and determining a second test program according to the second association rule;
s3, determining target test tasks corresponding to the first test program and the second test program in the test list so as to test the updated first test program.
Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, determining a first association rule between test programs in a test list, wherein the test list comprises: a test task and a test program set for executing the test task;
s2, under the condition that updating operation exists in a first test program in the test list, determining a second association rule corresponding to the first test program in the first association rule, and determining a second test program according to the second association rule;
s3, determining target test tasks corresponding to the first test program and the second test program in the test list so as to test the updated first test program.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices and, in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be implemented as individual integrated circuit modules, or as individual integrated circuit modules. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method for determining a test task, comprising:
determining a first association rule between test programs in a test list, wherein the test list comprises: a test task and a test program set for executing the test task;
under the condition that the first test program in the test list has updating operation, determining a second association rule corresponding to the first test program in the first association rule, and determining a second test program according to the second association rule;
and determining target test tasks corresponding to the first test program and the second test program in the test list so as to test the updated first test program.
2. The method for determining a test task according to claim 1, wherein determining a first association rule between test programs in a test list comprises:
Determining a frequent item set corresponding to the test list, wherein the frequent item set comprises: a plurality of test programs;
and determining a first association rule between test programs in the test list according to the frequent item set.
3. The method for determining a test task according to claim 2, wherein determining a first association rule between test programs in the test list according to the frequent item set comprises:
determining a plurality of non-empty subsets corresponding to the frequent item sets;
determining a confidence level of the test program in the first non-empty subset and the test program in the second non-empty subset, wherein the plurality of non-empty subsets comprises at least: the first non-empty subset and the second non-empty subset; and under the condition that the confidence coefficient is larger than a preset confidence coefficient, determining that the first association rule exists between the test programs in the first non-empty subset and the test programs in the second non-empty subset.
4. The method for determining a test task according to claim 2, wherein determining the frequent item set corresponding to the test list includes:
establishing a frequent pattern tree according to the test list;
traversing the frequent pattern tree by taking the node corresponding to each test program as the end, and acquiring a prefix path by taking each test program as the end;
And determining the frequent item set according to the prefix path ending with each test program.
5. The method for determining a test task according to claim 4, wherein building a frequent pattern tree from the test list comprises:
the establishing step comprises the following steps: determining whether the branch node corresponding to any test code set and the branch node of the established frequent pattern tree have the same prefix node or not; combining the same prefix node of the branch node corresponding to any test code set with the same prefix node of the branch node of the frequent pattern tree under the condition that the same prefix node exists; generating branches of the frequent pattern tree according to the branch nodes corresponding to any test code set under the condition that the branch nodes corresponding to any test code set and the branch nodes of the frequent pattern tree do not have the same prefix nodes;
and circularly executing the establishing step until the frequent pattern tree is established according to a plurality of test code sets.
6. The method for determining a test task according to claim 1, wherein after determining target test tasks corresponding to the first test program and the second test program in the test list, the method further comprises:
Determining test data for testing the performance of the first test program and the data type of the test data according to the target test task;
configuring test parameters for the test data according to the data type;
and generating a test case according to the test parameters and the test data so as to test the performance of the first test program through the test case.
7. The method of determining a test task of claim 1, wherein prior to determining the first association rule between test programs in the test list, the method further comprises:
recording test program information in the process of executing the test task under the condition that a start instruction for instructing to execute the test task is received;
and generating the test list under the condition that an ending instruction for indicating ending executing the test task is received.
8. A test task determining apparatus, comprising:
a first determining module, configured to determine a first association rule between test programs in a test list, where the test list includes: a test task and a test program set for executing the test task;
the second determining module is used for determining a second association rule corresponding to the first test program in the first association rule and determining the second test program according to the second association rule under the condition that the first test program in the test list has updating operation;
And the third determining module is used for determining target test tasks corresponding to the first test program and the second test program in the test list so as to test the updated first test program.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 7 by means of the computer program.
CN202310273887.0A 2023-03-20 2023-03-20 Determination method and device of test task, storage medium and electronic device Pending CN116467176A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310273887.0A CN116467176A (en) 2023-03-20 2023-03-20 Determination method and device of test task, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310273887.0A CN116467176A (en) 2023-03-20 2023-03-20 Determination method and device of test task, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN116467176A true CN116467176A (en) 2023-07-21

Family

ID=87172579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310273887.0A Pending CN116467176A (en) 2023-03-20 2023-03-20 Determination method and device of test task, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN116467176A (en)

Similar Documents

Publication Publication Date Title
CN111125268B (en) Network alarm analysis model creation method, alarm analysis method and device
CN110147387A (en) A kind of root cause analysis method, apparatus, equipment and storage medium
EP2652909B1 (en) Method and system for carrying out predictive analysis relating to nodes of a communication network
US8972308B2 (en) Combining multivariate time-series prediction with motif discovery
Ostovar et al. Characterizing drift from event streams of business processes
CN110209551B (en) Abnormal equipment identification method and device, electronic equipment and storage medium
CN108322318B (en) Alarm analysis method and equipment
Conforti et al. Timestamp repair for business process event logs
Ashraf et al. WeFreS: weighted frequent subgraph mining in a single large graph
CN115358395A (en) Knowledge graph updating method and device, storage medium and electronic device
CN113240139B (en) Alarm cause and effect evaluation method, fault root cause positioning method and electronic equipment
CN116467176A (en) Determination method and device of test task, storage medium and electronic device
Yilmaz et al. Generating Performance Improvement Suggestions by using Cross-Organizational Process Mining.
CN108681745B (en) Abnormal information identification method and device, storage medium and electronic device
CN116027937A (en) Rendering method and device of component to be edited, storage medium and electronic device
CN115631832A (en) Cooking plan determination method and device, storage medium and electronic device
CN114924908A (en) Data backup method and device, storage medium and electronic device
CN112434019A (en) Historical electric quantity tracing and cleaning method applied to household variable relation change and electric power center
CN117749549A (en) Equipment operation method and device, storage medium and electronic device
CN117743461A (en) Data synchronization method and device, storage medium and electronic device
CN118277233A (en) Method and device for generating test case and storage medium
CN115865650A (en) Service deployment method and device, storage medium and electronic device
CN116383196A (en) Data uniqueness identification method and device, electronic equipment and storage medium
CN115774660A (en) Method and device for predicting system stability, storage medium and electronic device
CN116521164A (en) Layout method and device of function entrance, storage medium and electronic device

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