Data detection method and device, electronic equipment and storage medium

By adopting data detection methods on the blockchain smart contract trading platform and using text similarity analysis technology to generate a test suite, the problems of inefficiency and high time cost of traditional detection methods in unstable testing are solved, achieving more efficient testing and reducing costs.

CN119512948APending Publication Date: 2025-02-25E-SURFING DIGITAL LIFE TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411558774.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Traditional blockchain smart contract trading platforms have problems of inefficiency and high time cost in unstable testing, especially on new blockchain platforms, where traditional detection methods cannot effectively solve these problems.

Method used

A data detection method is proposed. By obtaining the source program file, data extraction process is performed to obtain the target test function set, and then the target test function is divided to obtain word vectors, the text similarity between word vectors is calculated, the test suite is generated and executed to obtain the run result log, and the unstable test data is finally detected.

Benefits of technology

This method saves time cost by reducing the number of executions of test functions, and by generating function-related test suites, it reduces the number of repeated runs of tests, thereby improving the testing efficiency of the detection system and reducing the execution time cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512948A_ABST
    Figure CN119512948A_ABST
Patent Text Reader

Abstract

The invention discloses a data detection method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a source program file; performing first data extraction processing on the source program file to obtain a target test function set; performing data segmentation processing on a plurality of target test functions in the target test function set to obtain word vectors corresponding to the target test functions; calculating the text similarity between the word vectors corresponding to each target test function to obtain a similarity calculation result; generating a plurality of test suites based on the similarity calculation result, and executing each test suite to obtain a running result log; and detecting unstable test data in the source program file according to the running result log. The method can reduce the repeated operation frequency of the test, improve the test efficiency of the detection system and reduce the execution time cost, and can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data detection method, device, electronic device and storage medium. Background Art

[0002] At present, smart contracts have been widely used in many fields. However, the transaction speed of traditional Ethereum has greatly restricted the development of blockchain technology. In order to break through the limitations of transaction speed, emerging blockchain smart contract trading platforms have emerged. However, emerging blockchain smart contract trading platforms face the challenge of unstable testing problems. Unstable testing problems greatly reduce the efficiency of software development and deployment.

[0003] In related technologies, in order to deal with the problem of unstable testing, some technical solutions only focus on their working mechanism and smart contract vulnerability detection, ignoring the problem of unstable testing; some technical solutions only focus on Java projects or Python projects in traditional fields, relying on their own language characteristics, and are not suitable for new blockchain platforms written in new programming languages; and some technical solutions are implemented by repeatedly running test functions, which is also a commonly used detection method in the industry, but has the defects of being time-consuming and having low execution efficiency.

[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention

[0005] The embodiments of the present application aim to solve at least one of the technical problems in the related art to a certain extent. To this end, the main purpose of the embodiments of the present application is to propose a data detection method, device, electronic device and storage medium, which can reduce the number of repeated runs of the test, improve the test efficiency of the detection system and reduce the execution time cost.

[0006] To achieve the above object, an embodiment of the present application provides a data detection method, which includes the following steps:

[0007] Get the source program file;

[0008] Performing a first data extraction process on the source program file to obtain a target test function set;

[0009] Performing data segmentation processing on several target test functions in the target test function set to obtain word vectors corresponding to each of the target test functions;

[0010] Calculate the text similarity between the word vectors corresponding to each of the target test functions to obtain a similarity calculation result;

[0011] Generate a plurality of test suites based on the similarity calculation results, and execute each of the test suites to obtain an operation result log;

[0012] Unstable test data in the source program file is detected according to the operation result log.

[0013] In some embodiments, performing a first data extraction process on the source program file to obtain a target test function set includes:

[0014] Extracting a number of candidate test functions from the test module of the source program file;

[0015] Filtering each of the candidate test functions to obtain a number of target test functions;

[0016] The target test function set is constructed based on each of the target test functions.

[0017] In some embodiments, performing data segmentation processing on several target test functions in the target test function set to obtain word vectors corresponding to each of the target test functions includes:

[0018] Performing a second data extraction process on a number of the target test functions in the target test function set to obtain a test function name corresponding to each of the target test functions;

[0019] The test function names corresponding to each of the target test functions are subjected to data segmentation processing through regular expressions to obtain the word vectors corresponding to each of the target test functions.

[0020] In some embodiments, calculating the text similarity between the word vectors corresponding to each of the target test functions to obtain a similarity calculation result includes:

[0021] Calculate the word vectors corresponding to each of the target test functions to obtain the average word vectors corresponding to each of the target test functions;

[0022] The cosine similarity between the average word vectors corresponding to each of the target test functions is calculated through the target calculation model to obtain the similarity calculation result.

[0023] In some embodiments, generating a plurality of test suites based on the similarity calculation result, and executing each of the test suites to obtain an operation result log includes:

[0024] Grouping the target test functions according to the similarity calculation result to obtain a plurality of test function grouping lists, and using the test function grouping lists as the test suite;

[0025] A test function pair is generated based on each of the test suites, and each of the test suites is executed in the form of the test function pair to obtain the operation result log.

[0026] In some embodiments, the generating of the test function pairs based on the respective test suites, and executing the respective test suites in the form of the test function pairs to obtain the running result logs includes:

[0027] Generate a function index sequence based on the suite length corresponding to each of the test suites;

[0028] Generate a full permutation run sequence based on the function index sequence;

[0029] The test function pairs are generated based on the full permutation running sequence, and each of the test suites is executed in the form of the test function pairs to obtain the running result log.

[0030] In some embodiments, detecting unstable test data in the source program file according to the operation result log includes:

[0031] Classify the operation result log to obtain success log result and failure log result;

[0032] The success log result and the failure log result are compared to detect the unstable test data in the source program file.

[0033] To achieve the above object, another aspect of an embodiment of the present application provides a data detection device, the device comprising:

[0034] The device comprises the following modules:

[0035] A data acquisition module, used for acquiring source program files;

[0036] A data extraction processing module, used for performing a first data extraction process on the source program file to obtain a target test function set;

[0037] A data segmentation processing module, used to perform data segmentation processing on a plurality of target test functions in the target test function set to obtain a word vector corresponding to each of the target test functions;

[0038] A similarity calculation module is used to calculate the text similarity between the word vectors corresponding to each of the target test functions to obtain a similarity calculation result;

[0039] A test suite generation module, used to generate a plurality of test suites based on the similarity calculation results, and execute each of the test suites to obtain an operation result log;

[0040] A data detection module is used to detect unstable test data in the source program file according to the operation result log.

[0041] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.

[0042] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0043] The embodiments of the present application at least include the following beneficial effects: the present application provides a data detection method, device, electronic device and storage medium, the scheme obtains a source program file; performs a first data extraction process on the source program file to obtain a target test function set; performs data segmentation process on several target test functions in the target test function set to obtain word vectors corresponding to each target test function; calculates the text similarity between the word vectors corresponding to each target test function to obtain a similarity calculation result; generates several test suites based on the similarity calculation result, and executes each test suite to obtain a running result log; detects unstable test data in the source program file according to the running result log. The embodiment of the present application reduces the number of executions of the required test function by using the text similarity analysis technology with the help of the similarity between word vectors as a measure of the dependency between different test functions, greatly saving the required time cost, and at the same time, generates a test suite related to the functional characteristics of the test function based on the similarity calculation result, and executes the test in the form of a test suite, which can reduce the number of repeated runs of the test, thereby improving the test efficiency of the detection system and reducing the execution time cost. The efficient detection method that does not rely on language characteristics constructed in the embodiments of the present application can solve the problem that the detection method of traditional unstable testing is insufficient in the new blockchain platform, thereby helping to improve the efficiency of software development and deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flowchart of a data detection method provided by an embodiment of the present application;

[0045] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.

[0046] Figure 3 yes Figure 1 Flow chart of step S103 in FIG.

[0047] Figure 4 yes Figure 1Flow chart of step S104 in FIG.

[0048] Figure 5 yes Figure 1 Flow chart of step S105 in FIG.

[0049] Figure 6 yes Figure 5 Flow chart of step S502 in FIG.

[0050] Figure 7 yes Figure 1 Flow chart of step S106 in FIG.

[0051] Figure 8 It is a schematic diagram of the overall architecture of a data detection method provided in an embodiment of the present application;

[0052] Fig. 9 This is a schematic diagram of a test grouping process provided by an embodiment of the present application;

[0053] Fig.10 is a structural schematic diagram of a data detection device provided in an embodiment of the present application;

[0054] Fig.11 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0056] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0057] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0059] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:

[0060] OD test (Order-dependent test), OD test is an unstable test that depends on the test running order, that is, the running result of the test function depends on the execution order of the test function. It runs successfully under one execution order, but fails under another execution order.

[0061] At present, smart contracts have been widely used in finance, medical care, copyright protection, supply chain management and other fields. However, the transaction speed of traditional Ethereum is only 10 to 15 transactions per second, which greatly limits the development of blockchain technology. In order to break through the limitations of transaction speed, emerging blockchain smart contract trading platforms have emerged. Among them, Solana is currently recognized as one of the fastest blockchain smart contract trading platforms, with an actual transaction speed of more than 3,700 transactions per second. Solana is written in Rust language, which ensures high concurrency and high availability, while ensuring the security of transactions. Solana itself has more than 500,000 lines of code and is a large software system. Unstable testing is a problem that all large software systems will face. Unstable testing refers to the test with two execution results of successful operation and failed operation for the same test function when both the test function and the tested function have not changed. Unstable testing has brought great trouble to software testing and maintenance work, greatly reducing the efficiency of software development and deployment, and OD testing is a representative type of problem in unstable testing.

[0062] Among the related technologies, some studies focus on Solana, a novel blockchain platform, and study the working principle of this platform and the vulnerability detection of smart contracts deployed on Solana. The purpose of these studies is to help researchers better understand the characteristics and working mechanisms of new blockchain technologies. Some studies have studied how to detect OD tests in non-blockchain fields and traditional projects written in languages ​​such as Java and Python. These studies can be divided into two types of implementation methods: relying on repeated runs and relying on specific conditions or language features. However, most of these studies are limited by specific restrictions or language scenarios and are difficult to expand to projects implemented in new languages, especially programming languages ​​such as Rust, which have many new features. Although the related technologies have achieved some good results, there are still some limitations. For example: (1) The research on new blockchain platforms only focuses on their working mechanisms and smart contract vulnerability detection, ignoring the problem of unstable testing. (2) The research on OD testing only focuses on Java or Python projects in traditional fields, relying on their own language characteristics, and is not suitable for new blockchain platforms written in new programming languages ​​(such as Rust), such as Solana. (3) The detection method that does not rely on language characteristics is to repeatedly run the test function. It is also a commonly used detection method in the industry, but it has the disadvantages of being time-consuming, low in accuracy, and low in execution efficiency.

[0063] In view of this, a data detection method, device, electronic device and storage medium are provided in the embodiment of the present application. The scheme obtains the source program file; performs a first data extraction process on the source program file to obtain a target test function set; performs data segmentation process on several target test functions in the target test function set to obtain the word vectors corresponding to each target test function; calculates the text similarity between the word vectors corresponding to each target test function to obtain the similarity calculation result; generates several test suites based on the similarity calculation result, and executes each test suite to obtain the operation result log; detects the unstable test data in the source program file according to the operation result log. The embodiment of the present application adopts the text similarity analysis technology to use the similarity between word vectors as a measure of the dependency between different test functions, thereby reducing the number of executions of the required test functions and greatly saving the required time cost. At the same time, a test suite related to the functional characteristics of the test function is generated based on the similarity calculation result, and the test is executed in the form of a test suite, which can reduce the number of repeated runs of the test, thereby improving the test efficiency of the detection system and reducing the execution time cost. The efficient detection method that does not rely on language characteristics constructed in the embodiments of the present application can solve the problem that the detection method of traditional unstable testing is insufficient in the new blockchain platform, thereby helping to improve the efficiency of software development and deployment.

[0064] The data detection method provided in the embodiment of the present application relates to the field of data processing technology. The data detection method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network) and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements the data detection method, etc., but is not limited to the above forms.

[0065] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs (Personal Computers, personal computers), minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0066] See also Figure 1 , Figure 1 is an optional step flow chart of a data detection method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0067] Step S101, obtaining a source program file;

[0068] In an embodiment of the present application, the source program file is an rs file, which contains instructions and logic written in a specific programming language (such as Rust) and is the basis of software development.

[0069] In the specific implementation, in order to solve the shortcomings of the detection method of the traditional OD test in the new blockchain platform and construct an efficient detection method that does not rely on language characteristics, the embodiment of the present application proposes a detection method of OD test based on text similarity features, that is, a technical solution for detecting unstable tests based on the feature information of the text similarity between the test function names, thereby improving the test efficiency and reducing the execution time cost. The embodiment of the present application adopts text similarity analysis technology, using the cosine similarity between word vectors as a measure of the dependency between different test functions, and then generates a test suite related to the functional characteristics of the test function, and finally executes the running sequence of the test suite in the form of a test function pair to reduce the number of repeated runs of the test, thereby improving the overall performance of the detection system. The embodiment of the present application will adopt a modular function point design, combined with a chain combination method, to form a plug-and-play solution to cope with the complexity of business needs, thereby reducing R&D costs and simplifying application complexity, and can achieve more efficient and faster OD test detection services in the new blockchain platform.

[0070] Specifically, by performing a series of processing and detection on the source program file (rs file), unstable tests (such as OD tests) that may exist in the source program file (rs file) are identified.

[0071] Step S101 shown in the embodiment of the present application can avoid inaccurate detection problems caused by missing or damaged files by obtaining source program files, provide a data basis for subsequent analysis and processing, and improve the accuracy and timeliness of the test.

[0072] Step S102, performing a first data extraction process on the source program file to obtain a target test function set;

[0073] The first data extraction process is a process of extracting data from the source program file to obtain the target test function. Figure 2 , Figure 2 yes Figure 1 Flow chart of step S102 in FIG. 1 ; in some embodiments, step S102 may include but is not limited to steps S201 to S203:

[0074] Step S201, extracting a number of candidate test functions from the test module of the source program file;

[0075] Optionally, there is a test module in the source program file (rs file), and there is a test function in the test module. In a specific implementation, the process of extracting several candidate test functions from the test module of the source program file is: first, the source program file is identified, and the test module in the source program file is confirmed; then, all test functions in the test module are extracted as candidate test functions. Among them, the candidate test function is a test function that has not been processed or filtered.

[0076] Step S202, filtering each of the candidate test functions to obtain a number of the target test functions;

[0077] In the specific implementation, the filtering process is: each candidate test function is run in isolation n times. Assuming that the n running results of candidate test function A are all failures, candidate test function A is discarded. Such candidate test functions with multiple failure results are considered to contain bugs rather than being unstable; assuming that the n running results of candidate test function B are not all failures and include successful running results, candidate test function B can be saved and classified as one of the target test functions in the target test function set.

[0078] Step S203: construct the target test function set based on each of the target test functions.

[0079] The target test function set is a collection of multiple target test functions.

[0080] In step S102 shown in the embodiment of the present application, by performing data extraction processing on the source program file to obtain a target test function set, key functions that need to be tested can be screened out, unnecessary running tests can be reduced, and test efficiency can be improved.

[0081] Step S103, performing data segmentation processing on several target test functions in the target test function set to obtain word vectors corresponding to each of the target test functions;

[0082] For data segmentation, it is a process of using regular expressions to segment the test function name of each test function into different word vectors. Figure 3 , Figure 3 yes Figure 1 Flow chart of step S103 in FIG. 1 ; in some embodiments, step S103 may include but is not limited to steps S301 to S302:

[0083] Step S301, performing a second data extraction process on a number of the target test functions in the target test function set to obtain a test function name corresponding to each of the target test functions;

[0084] The second data extraction process is a process of extracting the test function name in the target test function, wherein each line of the test function is a test function name in the form of test_parse_token.

[0085] Step S302, performing data segmentation processing on the test function names corresponding to each of the target test functions through regular expressions to obtain the word vectors corresponding to each of the target test functions.

[0086] For the specific implementation principle of regular expressions, reference may be made to the specific implementation in the relevant technology, which is a relatively mature technical means in the relevant technology and will not be elaborated in detail in the embodiments of the present application.

[0087] In the specific implementation, you can use "_" as a separator to separate the test function name (such as test_parse_token) to obtain different word vectors ([test, parse, token]).

[0088] Step S103 shown in the embodiment of the present application can quantitatively analyze the similarity between test functions by converting the test function name in the test function into a word vector, which facilitates subsequent text similarity analysis and improves the accuracy and efficiency of the analysis.

[0089] Step S104, calculating the text similarity between the word vectors corresponding to each of the target test functions to obtain a similarity calculation result;

[0090] The text similarity in the embodiment of the present application is cosine similarity. In the embodiment of the present application, the word2vec model is used as the text processing model, wherein the word2vec model is trained using the gensim library. Specifically, the cosine similarity between the test functions is calculated using the trained word2vec model.

[0091] See also Figure 4 , Figure 4 yes Figure 1 Flow chart of step S104 in FIG. 1 ; in some embodiments, step S104 may include but is not limited to steps S401 to S402:

[0092] Step S401, calculating the word vectors corresponding to the target test functions to obtain average word vectors corresponding to the target test functions;

[0093] For the average word vector, it is the average vector of multiple word vectors corresponding to the test function name in each target test function. Among them, the average word vector corresponding to the target test function is the average word vector corresponding to the test function name in the target test function. In the embodiment of the present application, the average word vector is used as the overall vector corresponding to the test function name in the target test function, that is, the overall vector of the target test function.

[0094] In the specific implementation, the average word vector of multiple different word vectors corresponding to the test function name in each target test function is calculated, and the average word vector is used as the overall vector corresponding to each test function name, that is, the average word vector is used as the overall vector corresponding to each test function.

[0095] Step S402, calculating the cosine similarity between the average word vectors corresponding to each of the target test functions through the target calculation model to obtain the similarity calculation result.

[0096] For cosine similarity, the trained word2vec model is used to calculate the text similarity between the overall vectors corresponding to the test function names in the test function. Cosine similarity is an indicator used to measure the dependency relationship between test functions. Based on this indicator, test functions can be grouped and different test suites can be generated.

[0097] Step S104 shown in the embodiment of the present application can accurately identify test functions with similar functions by calculating the text similarity between the word vectors corresponding to each target test function, thereby providing a basis for generating a test suite.

[0098] Step S105, generating a plurality of test suites based on the similarity calculation result, and executing each of the test suites to obtain an operation result log;

[0099] See also Figure 5 , Figure 5 yes Figure 1 Flow chart of step S105 in FIG. 1 ; in some embodiments, step S105 may include but is not limited to steps S501 to S502:

[0100] Step S501, grouping the target test functions according to the similarity calculation result to obtain a plurality of test function grouping lists, and using the test function grouping lists as the test suite;

[0101] For the grouping operation, the calculation results of the text similarity in step S104 are traversed, and the test functions greater than the given threshold δ0 are divided into the same group and saved in a list; for multiple related test functions, if there is a conflict, the union of the test functions is taken as the test suite. It can be understood that if there is no conflict among multiple related test functions, the grouped list is the test suite; if there is a conflict among multiple related test functions, the grouping is first performed and then the union of the test functions is taken, and the list obtained after the union is the test suite, where different groups are saved in different lists, and the final groups are presented in the form of different lists, and one list is a test suite.

[0102] For example, assuming that among the three test functions test1, test2, and test3, the degree of association between test1 and test2 δ1>δ0, the degree of association between test2 and test3 δ2>δ0, but the degree of association between test1 and test3 δ3<δ0, then take the union of the three test functions test1, test2, and test3, and group test1, test2, and test3 into one group.

[0103] Step S502: Generate a test function pair based on each of the test suites, and execute each of the test suites in the form of the test function pair to obtain the running result log.

[0104] See also Figure 6 , Figure 6 yes Figure 5 In some embodiments, step S502 may include, but is not limited to, steps S601 to S603:

[0105] Step S601, generating a function index sequence based on the suite length corresponding to each of the test suites;

[0106] Step S602, generating a full permutation running sequence based on the function index sequence;

[0107] Step S603: Generate the test function pair based on the full permutation running sequence, and execute each of the test suites in the form of the test function pair to obtain the running result log.

[0108] In the specific implementation, taking test suite A as an example, test1, test2 and test3 are used to represent the test functions test_get_token_account_mint(), test_ui_token_amount_real_string() and test_ui_token_amount_real_string_zero() in A respectively. The specific execution process of step S502 is as follows: First, according to the test suite length n of the test suite, a corresponding function index sequence T = [t0, t1, ..., t n-1 ], assuming that the test suite length is 3, so the function index sequence T = [t0, t1, t2] = [0, 1, 2]; then, according to the function index sequence T, the full permutation run sequence R is generated T =[[t0,t1,…,t n-1 ],[t0,t2,…,t n-1 ],…,[t1,t0,…,t n-1 ],…,[t n-1 ,…,t1,t0], the full permutation operation sequence is specifically R T =[[0,1,2],[0,2,1],[1,0,2],[1,2,0],[2,0,1],[2,1,0]]; Then, the run sequence is traversed in a loop to achieve permutations and combinations to generate test function pairs: (test1,test2), (test1,test3), (test2,test1), (test2,test3), (test3,test1), (test3,test2); Finally, the test suite is executed in the order of the test function pairs to obtain the run result log.

[0109] Step S105 shown in the embodiment of the present application generates several test suites based on the similarity calculation results, and executes each test suite to obtain an operation result log, which can reduce the number of repeated test runs, improve test efficiency, achieve reasonable allocation and utilization of test resources, reduce test costs, and at the same time, the test process can be better monitored through the operation result log.

[0110] Step S106, detecting unstable test data in the source program file according to the operation result log.

[0111] See also Figure 7 , Figure 7 yes Figure 1 Flow chart of step S106 in FIG. 1 ; in some embodiments, step S106 may include but is not limited to steps S701 to S702:

[0112] Step S701, classify the operation result log to obtain success log result and failure log result;

[0113] Step S702: Compare the success log result with the failure log result to detect the unstable test data in the source program file.

[0114] Unstable test data refers to tests with two execution results: successful execution and failed execution for the same test function when neither the test function nor the tested function has changed. Unstable tests have brought great troubles to software testing and maintenance work, and greatly reduced the efficiency of software development and deployment. OD tests are a representative type of problems in unstable tests.

[0115] In a specific implementation, the successful log results and the failed log results in the operation result log are compared to identify the OD test. For example, assuming that the order of successful operation is (test2, test1), (test2, test3), (test3, test1), (test3, test2), and the order of failed operation is (test1, test2), (test1, test3), then test1 is identified as an OD test, that is, only when test1 fails when it is run before the other two tests (test2, test3), the test result is affected by the specific order.

[0116] Step S106 shown in the embodiment of the present application can accurately identify unstable test data in the source program through analysis of the operation result log, provide a basis for subsequent repair and optimization, improve the stability and reliability of the test, and help improve the efficiency of software development and deployment.

[0117] Steps S101 to S106 shown in the embodiment of the present application are obtained by obtaining the source program file; performing a first data extraction process on the source program file to obtain a target test function set; performing data segmentation processing on several target test functions in the target test function set to obtain the word vectors corresponding to each target test function; calculating the text similarity between the word vectors corresponding to each target test function to obtain the similarity calculation result; generating several test suites based on the similarity calculation result, and executing each test suite to obtain the operation result log; detecting the unstable test data in the source program file according to the operation result log. The embodiment of the present application adopts the text similarity analysis technology to use the similarity between word vectors as a measure of the dependency between different test functions, thereby reducing the number of executions of the required test function, greatly saving the required time cost, and at the same time, generating a test suite related to the functional characteristics of the test function based on the similarity calculation result, and executing the test in the form of a test suite, which can reduce the number of repeated runs of the test, thereby improving the test efficiency of the detection system and reducing the execution time cost. The efficient detection method that does not rely on language characteristics constructed by the embodiment of the present application can solve the problem that the detection method of traditional unstable tests is insufficient in the new blockchain platform, thereby helping to improve the efficiency of software development and deployment.

[0118] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.

[0119] In the embodiment of the present application, in order to solve the shortcomings of the detection method of the traditional OD test in the new blockchain platform, an efficient detection method that does not rely on language characteristics is constructed. The embodiment of the present application proposes a detection method of OD test based on text similarity features, that is, a technical solution for detecting unstable tests based on the feature information of the text similarity between the test function names, thereby improving the test efficiency and reducing the execution time cost. The embodiment of the present application adopts text similarity analysis technology, using the cosine similarity between word vectors as a measure of the dependency between different test functions, and then generates a test suite related to the functional characteristics of the test function, and finally executes the running sequence of the test suite in the form of a test function pair to reduce the number of repeated runs of the test, thereby improving the overall performance of the detection system. The embodiment of the present application will adopt a modular function point design, combined with a chain combination method, to form a plug-and-play solution to cope with the complexity of business needs, thereby reducing R&D costs and simplifying application complexity, and can achieve more efficient and faster OD test detection services in the new blockchain platform.

[0120] Specifically, see Figure 8 , Figure 8Schematic diagram of the overall architecture of a data detection method provided in an embodiment of the present application; Figure 8 As shown, the overall detection architecture in the embodiment of the present application includes three parts: a preprocessing module, a core processing module and an execution module. Figure 8 As shown, the overall process of a data detection method provided by an embodiment of the present application is: first, input the source program file (rs file) into the preprocessing module; then, extract the test function in the source program file through the preprocessing module, and extract the word vector corresponding to the test function name in the test function; then, calculate the text similarity between the word vectors corresponding to different test functions through the core processing module, group the tests based on the text similarity, and generate different test suites based on the test grouping; further, generate a running sequence through the execution module and execute the corresponding test suite to obtain the running result; finally, identify the OD test from the running result and output it in the detection log. Please refer to Fig. 9 , Fig. 9 is a schematic diagram of a test grouping process provided by an embodiment of the present application; Fig. 9 As shown in the figure, firstly, the rs file in the input preprocessing module is identified, the test functions in the rs file are extracted, and the test functions that still fail after multiple runs are filtered out; then the function name of each test function is extracted, and the function name of each test function is divided into different word vectors through regular matching; after the word vectors corresponding to different test functions are extracted, the word2vec model is trained using the gensim library, and the word2vec model is used as a text processing model. The text similarity between different word vectors corresponding to the function name of each test function is calculated through the word2vec model, and this calculation result is used as an indicator to measure the dependency relationship between test functions. According to this indicator, tests are grouped, and different test suites are generated based on the test grouping, and finally the test grouping result is returned, wherein different groups are saved in different lists, and the final groups are presented in the form of different lists, and one list is a test suite.

[0121] The overall implementation process of a data detection method provided in an embodiment of the present application is as follows:

[0122] (1) In the preprocessing module. First, the rs file in the input preprocessing module is identified to confirm the test module in the rs file; then the test functions in the test module are extracted, and the test functions that still fail after multiple runs are filtered out. Among them, the test functions that still fail after multiple runs are considered to contain bugs (vulnerabilities) rather than instability; then the function name of each test function is extracted; finally, the function name of each test function is segmented into different word vectors through regular expressions.

[0123] (2) In the core processing module, the word2vec model is used to calculate the text similarity between different word vectors corresponding to the function name of each test function. This calculation result is used as an indicator to measure the dependency relationship between test functions. Tests are grouped according to this indicator, and different test suites are generated based on the test groups.

[0124] (3) In the execution module, a corresponding running sequence is generated for each test suite, and each test suite is executed in the form of a test function pair, and finally a test running log is generated. By comparing the execution logs, possible OD tests in the test function can be identified.

[0125] Exemplarily, in order to explain the principle of the technical solution of the present invention in detail, take the input of a Solana parse_token.rs file as an example, where the parse_token.rs file contains the following 6 test functions:

[0126] ①test_parse_token();

[0127] ②test_get_token_account_mint();

[0128] ③test_ui_token_amount_real_string();

[0129] ④test_ui_token_amount_real_string_zero();

[0130] ⑤test_parse_token_account_with_extensions();

[0131] ⑥test_parse_token_mint_with_extensions().

[0132] Based on the parse_token.rs file of Solana, the specific implementation process of a data detection method provided in an embodiment of the present application is as follows:

[0133] Step 1, preprocessing process.

[0134] First, identify the parse_token.rs file in the input preprocessing module and confirm the test module in the parse_token.rs file. Then extract the test functions in the test module and run a single test function in isolation for 3 times. If the running results are all failures, discard it. Such test functions that fail multiple times are considered to contain bugs rather than being unstable. Then extract the function name of each test function. Finally, use regular expressions to split the function name of each test function into different word vectors, that is, different word lists.

[0135] Step 2, core processing flow. Use the word2vec model to calculate text similarity features, extract test functions related to functional characteristics and group them into different test suites. The specific steps are as follows:

[0136] Step 2.1, use the word2vec model as the text processing model, where the word2vec model is trained using the gensim library. First, calculate the average word vector of multiple different word vectors corresponding to each test function name, and use the average word vector as the overall vector corresponding to each test function name, that is, use the average word vector as the overall vector corresponding to each test function; then, use the trained word2vec model to calculate the cosine similarity between the overall vectors corresponding to the test function, and use the cosine similarity as a metric to reflect the degree of association δ between the two test functions.

[0137] Step 2.2, traverse the calculation results of the text similarity in step 2.1, divide the test functions greater than the given threshold δ0 into the same group, and save them in a list; for multiple related test functions, if there is a conflict, take the union of the test functions as the test suite. It can be understood that if there is no conflict between multiple related test functions, the grouped list is the test suite; if there is a conflict between multiple related test functions, group them first and then take the union of the test functions, and the list obtained after taking the union is the test suite, where different groups are saved in different lists, and the final groups are presented in the form of different lists, and one list is a test suite.

[0138] For example, assuming that among the three test functions test1, test2, and test3, the degree of association between test1 and test2 δ1>δ0, the degree of association between test2 and test3 δ2>δ0, but the degree of association between test1 and test3 δ3<δ0, then take the union of the three test functions test1, test2, and test3, and group test1, test2, and test3 into one group.

[0139] The different grouping results obtained in the end are different test suites. In the embodiment of the present application, it is assumed that δ0=0.75, and two test suites A and B are finally obtained. Among them, test suite A includes the following three test functions:

[0140] ①test_get_token_account_mint();

[0141] ②test_ui_token_amount_real_string();

[0142] ③test_ui_token_amount_real_string_zero().

[0143] Test suite B includes the following two test functions:

[0144] ①test_parse_token_account_with_extensions();

[0145] ②test_parse_minit_with_extensions().

[0146] Step 3, execution process. By running the test suite, get the running result log, and judge whether there is OD test in the test suite according to the running result log. Taking test suite A as an example, test1, test2 and test3 are used to represent the test functions test_get_token_account_mint(), test_ui_token_amount_real_string() and test_ui_token_amount_real_string_zero() in test suite A respectively. The specific execution process is as follows:

[0147] Step 3.1, generate the corresponding function index sequence T = [t0, t1, ..., t n-1 In the embodiment of the present application, it is assumed that the test suite length is 3, so the function index sequence T = [t0, t1, t2] = [0, 1, 2];

[0148] Step 3.2: Generate the full permutation running sequence R based on the function index sequence T obtained in step 3.1 T =[[t0,t1,…,t n-1 ],[t0,t2,…,t n-1 ],…,[t1,t0,…,t n-1 ],…,[t n-1 ,…,t1,t0]. In the embodiment of the present application, RT =[[0,1,2],[0,2,1],[1,0,2],[1,2,0],[2,0,1],[2,1,0]];

[0149] Step 3.3, by looping through the run sequence to achieve permutations and combinations to generate test function pairs, and finally executing the test suite in the order of the test function pairs to obtain the run result log. In the embodiment of the present application, a total of 6 test function pairs are generated: (test1, test2), (test1, test3), (test2, test1), (test2, test3), (test3, test1), (test3, test2).

[0150] Step 3.4, compare the success log result and the failure log result in the operation result log to identify the OD test. For example, the order of successful operation is (test2, test1), (test2, test3), (test3, test1), (test3, test2), and the order of failed operation is (test1, test2), (test1, test3), then test1 is identified as an OD test, that is, only when test1 fails when it is run before the other two tests (test2, test3), the test result is affected by the specific order.

[0151] It should be pointed out that this embodiment only provides a brief schematic description of the general process of the data detection method. The detailed description of each step can refer to the relevant content in the aforementioned embodiment and will not be repeated here. It can be understood that the present invention is not limited to this.

[0152] The embodiment of the present application obtains the source program file; performs a first data extraction process on the source program file to obtain a target test function set; performs data segmentation processing on several target test functions in the target test function set to obtain the word vectors corresponding to each target test function; calculates the text similarity between the word vectors corresponding to each target test function to obtain the similarity calculation result; generates several test suites based on the similarity calculation result, and executes each test suite to obtain the operation result log; detects the unstable test data in the source program file according to the operation result log. The embodiment of the present application adopts the text similarity analysis technology to use the similarity between word vectors as a measure of the dependency between different test functions, thereby reducing the number of executions of the required test function, greatly saving the required time cost, and at the same time, generating a test suite related to the functional characteristics of the test function based on the similarity calculation result, and executing the test in the form of a test suite, which can reduce the number of repeated runs of the test, thereby improving the test efficiency of the detection system and reducing the execution time cost. The efficient detection method that does not rely on language characteristics constructed by the embodiment of the present application can solve the problem that the detection method of traditional unstable tests is insufficient in the new blockchain platform, thereby helping to improve the efficiency of software development and deployment.

[0153] Compared with the related art, the embodiments of the present application have the following advantages:

[0154] (1) Using text similarity features as a measure of the dependency between different test functions. Compared with the detection method that relies on repeated operation in the related art, the embodiment of the present application takes into account the dependency between test functions, reduces the number of executions of the required test functions, and greatly saves the required time cost.

[0155] (2) The execution module uses the method of executing the test function pair to optimize, which reduces the number of repeated runs of the test. Compared with the related art solution, the embodiment of the present application does not need to execute all the test run sequences in the run sequence, but only needs to run some test functions, and the execution efficiency is higher. In addition, the embodiment of the present application does not optimize for a specific anti-pattern, and has strong applicability.

[0156] See also Fig.10 The embodiment of the present application further provides a data detection device 1000, which can implement the above data detection method. The device includes the following modules:

[0157] Data acquisition module 1001, used to acquire source program files;

[0158] The data extraction processing module 1002 is used to perform a first data extraction process on the source program file to obtain a target test function set;

[0159] A data segmentation processing module 1003 is used to perform data segmentation processing on a plurality of target test functions in the target test function set to obtain a word vector corresponding to each of the target test functions;

[0160] A similarity calculation module 1004 is used to calculate the text similarity between the word vectors corresponding to each of the target test functions to obtain a similarity calculation result;

[0161] A test suite generation module 1005 is used to generate a plurality of test suites based on the similarity calculation result, and execute each of the test suites to obtain an operation result log;

[0162] The data detection module 1006 is used to detect unstable test data in the source program file according to the operation result log.

[0163] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0164] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above data detection method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0165] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0166] See also Fig.11 , Fig.11 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0167] The processor 1101 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0168] The memory 1102 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 can store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes the data detection method of the embodiment of the present application;

[0169] Input / output interface 1103, used to implement information input and output;

[0170] The communication interface 1104 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0171] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);

[0172] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .

[0173] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned data detection method is implemented.

[0174] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0175] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0176] The data detection method, data detection device, electronic device and storage medium provided by the embodiment of the present application, which obtains the source program file; performs a first data extraction process on the source program file to obtain a target test function set; performs data segmentation processing on several target test functions in the target test function set to obtain the word vectors corresponding to each target test function; calculates the text similarity between the word vectors corresponding to each target test function to obtain the similarity calculation result; generates several test suites based on the similarity calculation result, and executes each test suite to obtain the operation result log; detects the unstable test data in the source program file according to the operation result log. The embodiment of the present application adopts the text similarity analysis technology to use the similarity between word vectors as a measure of the dependency between different test functions, thereby reducing the number of executions of the required test function, greatly saving the required time cost, and at the same time, generates a test suite related to the functional characteristics of the test function based on the similarity calculation result, and executes the test in the form of a test suite, which can reduce the number of repeated runs of the test, thereby improving the test efficiency of the detection system and reducing the execution time cost. The efficient detection method that does not rely on language characteristics constructed by the embodiment of the present application can solve the problem that the detection method of traditional unstable tests is insufficient in the new blockchain platform, thereby helping to improve the efficiency of software development and deployment.

[0177] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0178] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0179] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0180] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0181] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0182] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0183] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0184] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0185] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0186] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0187] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A data detection method, characterized in that: The method comprises the following steps: Get the source program file; Performing a first data extraction process on the source program file to obtain a target test function set; Performing data segmentation processing on several target test functions in the target test function set to obtain word vectors corresponding to each of the target test functions; Calculate the text similarity between the word vectors corresponding to each of the target test functions to obtain a similarity calculation result; Generate a plurality of test suites based on the similarity calculation results, and execute each of the test suites to obtain an operation result log; Unstable test data in the source program file is detected according to the operation result log.

2. The method according to claim 1, characterized in that The first data extraction process is performed on the source program file to obtain a target test function set, including: Extracting a number of candidate test functions from the test module of the source program file; Filtering each of the candidate test functions to obtain a number of target test functions; The target test function set is constructed based on each of the target test functions.

3. The method according to claim 1, characterized in that The performing data segmentation processing on several target test functions in the target test function set to obtain word vectors corresponding to each of the target test functions includes: Performing a second data extraction process on a number of the target test functions in the target test function set to obtain a test function name corresponding to each of the target test functions; The test function names corresponding to each of the target test functions are subjected to data segmentation processing through regular expressions to obtain the word vectors corresponding to each of the target test functions.

4. The method according to claim 1, characterized in that The calculating the text similarity between the word vectors corresponding to each of the target test functions to obtain a similarity calculation result includes: Calculate the word vectors corresponding to each of the target test functions to obtain the average word vectors corresponding to each of the target test functions; The cosine similarity between the average word vectors corresponding to each of the target test functions is calculated through the target calculation model to obtain the similarity calculation result.

5. The method according to claim 1, characterized in that The generating of several test suites based on the similarity calculation result and executing each of the test suites to obtain an operation result log includes: Grouping the target test functions according to the similarity calculation result to obtain a plurality of test function grouping lists, and using the test function grouping lists as the test suite; A test function pair is generated based on each of the test suites, and each of the test suites is executed in the form of the test function pair to obtain the operation result log.

6. The method according to claim 5, characterized in that The generating of the test function pairs based on the respective test suites, and executing the respective test suites in the form of the test function pairs to obtain the running result logs, includes: Generate a function index sequence based on the suite length corresponding to each of the test suites; Generate a full permutation run sequence based on the function index sequence; The test function pairs are generated based on the full permutation running sequence, and each of the test suites is executed in the form of the test function pairs to obtain the running result log.

7. The method according to claim 1, characterized in that The detecting unstable test data in the source program file according to the operation result log includes: Classify the operation result log to obtain success log result and failure log result; The success log result and the failure log result are compared to detect the unstable test data in the source program file.

8. A data detection device, characterized in that: The device comprises the following modules: A data acquisition module, used for acquiring source program files; A data extraction processing module, used for performing a first data extraction process on the source program file to obtain a target test function set; A data segmentation processing module, used to perform data segmentation processing on a plurality of target test functions in the target test function set to obtain a word vector corresponding to each of the target test functions; A similarity calculation module is used to calculate the text similarity between the word vectors corresponding to each of the target test functions to obtain a similarity calculation result; A test suite generation module, used to generate a plurality of test suites based on the similarity calculation results, and execute each of the test suites to obtain an operation result log; A data detection module is used to detect unstable test data in the source program file according to the operation result log.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Detection method for instability test depending on operation sequence in Solana

    CN117609033A

  • A method for detecting unstable tests in solana that depend on the order of execution

    CN117609033B