Blockchain system testing method, system, computer equipment and storage medium

By selecting test cases and script templates from the preset template library and generating test scripts, the problem of low efficiency in blockchain system testing is solved, and the standardization of the testing process and cost reduction are achieved.

CN114817038BActive Publication Date: 2025-09-12CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210452631.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-27
Publication Date
2025-09-12
Estimated Expiration
2042-04-27

AI Technical Summary

Technical Problem

Blockchain system testing is inefficient, costly, and involves irregular testing processes, which results in extended testing cycles and waste of resources.

Method used

By obtaining the test item attribute information and indicator information of the blockchain system, selecting test cases and test script templates from the preset test template library, parsing the indicator information to generate test scripts, and realizing the solidification of test scripts, only the test variable data needs to be provided to generate test scripts, thus reducing repetitive writing work.

Benefits of technology

It improves the efficiency and flexibility of blockchain system testing, standardizes the testing process, reduces testing costs, and avoids repeated testing and manual compilation work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114817038B_ABST
    Figure CN114817038B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer testing technology, and discloses a blockchain system testing method, system, computer device, and storage medium, including: obtaining attribute information and indicator information of a test item of the blockchain system; selecting a test case and a test script template for the test item from a preset test template library based on the attribute information of the test item; parsing the indicator information of the test item to obtain test variable data for the test item, and generating a test script for the test item based on the test variable data and the test script template for the test item; and calling the test script for the test item to perform blockchain system testing based on the test case of the test item to obtain a blockchain system test result. This method achieves test script solidification, requiring only obtaining test variable data to maintain the test script template to generate a test script, without the need to rewrite the test script for a specific test item. This method is highly flexible and greatly improves the testing efficiency of the blockchain system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer testing technology and relates to a blockchain system testing method, system, computer equipment and storage medium. Background Art

[0002] Currently, blockchain technology has extended to multiple fields such as digital finance, Internet of Things, intelligent manufacturing, supply chain, energy and electricity, but there are still many challenges in terms of functionality, performance and security. Blockchain is decentralized, traceable and tamper-proof. Smart contracts, as the core application of blockchain, undertake the important mission of value transfer and trusted interconnection. Testing of blockchain helps to detect the correctness of the system, that is, whether the output value of the blockchain system meets the expectation under the premise of predetermined input values, and then discover the faults of various modules of the blockchain system during the development process, improve the overall development efficiency, and lead to the increasingly urgent demand for testing system in the development and research of blockchain technology.

[0003] However, companies and laboratories often prioritize development over testing, resulting in a haphazard and simplistic approach to management. This leads to a lack of data and documentation traceability, leading to constant repetition and changes in the blockchain system testing process, increasing testing costs and prolonging the testing cycle. Furthermore, to ensure the quality of blockchain systems, extensive testing is required before release, consuming significant manpower and resources while also extending the testing cycle. Therefore, improving the efficiency of blockchain system testing and reducing testing costs are pressing challenges. Summary of the Invention

[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a blockchain system testing method, system, computer device and storage medium.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A first aspect of the present invention is a blockchain system testing method, comprising:

[0007] Obtain the attribute information and indicator information of the test items of the blockchain system;

[0008] Selecting a test case and a test script template for the test item from a preset test template library based on the attribute information of the test item;

[0009] Parsing the indicator information of the test item to obtain the test variable data of the test item, and generating the test script of the test item according to the test variable data of the test item and the test script template of the test item;

[0010] According to the test case of the test item, call the test script of the test item to perform blockchain system testing and obtain the blockchain system test results.

[0011] Optionally, selecting a test case and a test script template of the test item from a preset test template library according to the attribute information of the test item includes:

[0012] According to the attribute information of the test item, a keyword association method is adopted to select the test case of the test item and the test script template of the test item from the preset test template library.

[0013] Optionally, the attribute information of the test item includes the test project to which the test item belongs, the field to which the blockchain system belongs, the application type of the blockchain system, and the name of the test item, and the test project to which the test item belongs, the field to which the blockchain system belongs, the application type of the blockchain system, and the name of the test item are used in sequence as keywords in the keyword association method.

[0014] Optionally, generating a test script for a test item according to the test variable data of the test item and a test script template of the test item includes:

[0015] The test variable data of the test item is added to the test variable data position reserved in the test script template of the test item, and an assertion for judging the test result is added to obtain the test script of the test item.

[0016] Optionally, also include:

[0017] Record the blockchain system name, blockchain system version number, test case number of the test item, test case name of the test item, blockchain system test results, test user ID, test user name, and test time during the test process to generate a test record.

[0018] A second aspect of the present invention is a blockchain system testing system, comprising:

[0019] The data acquisition module is used to obtain the attribute information and indicator information of the test items of the blockchain system;

[0020] A selection module is used to select a test case and a test script template of a test item from a preset test template library according to the attribute information of the test item;

[0021] A script generation module is used to parse the indicator information of the test item, obtain the test variable data of the test item, and generate the test script of the test item according to the test variable data of the test item and the test script template of the test item;

[0022] The test module is used to call the test script of the test item according to the test case of the test item to perform blockchain system testing and obtain the blockchain system test results.

[0023] Optionally, the selection module is specifically configured to: select a test case and a test script template of the test item from a preset test template library in accordance with the attribute information of the test item and in a keyword association manner;

[0024] The script generation module is specifically used to add the test variable data of the test item to the test variable data position reserved in the test script template of the test item, and add assertions for judging the test results to obtain the test script of the test item.

[0025] Optionally, a test record module is also included to record the blockchain system name, blockchain system version number, test case number of the test item, test case name of the test item, blockchain system test results, test user ID, test user name and test time during the test process to generate a test record.

[0026] In a third aspect of the present invention, a computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned blockchain system testing method when executing the computer program.

[0027] In a fourth aspect of the present invention, a computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned blockchain system testing method.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] The blockchain system testing method of the present invention selects a test case and a test script template for the test item from a preset test template library based on the attribute information of the test item. It then parses the test item's indicator information to obtain the test variable data for the test item. The test script template for the test item is then maintained using the test variable data to generate a test script for the test item. Finally, based on the test case for the test item, the test script for the test item is called to perform blockchain system testing and obtain blockchain system test results. This entire process standardizes the operational steps of each link in the testing process and enables test script solidification. Test scripts can be generated by simply obtaining test variable data to maintain the test script template, eliminating the need to rewrite test scripts for specific test items. This provides high flexibility and greatly improves the testing efficiency of blockchain systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a flowchart of a blockchain system testing method according to an embodiment of the present invention;

[0031] Figure 2This is a block diagram of the blockchain system testing system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention 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 numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes 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.

[0034] As discussed in the background, companies and laboratories prioritize development over testing, resulting in a haphazard and simplistic approach to management and a lack of data and documentation traceability. This leads to constant repetition and changes in the blockchain system testing process, increasing testing costs and prolonging the testing cycle. Furthermore, to ensure the quality of blockchain systems, extensive testing is required before release, consuming significant manpower and resources while also extending the testing cycle. Therefore, improving the efficiency and reducing the cost of blockchain system testing are pressing challenges.

[0035] To improve the above-mentioned problems, an embodiment of the present invention provides a blockchain system testing method. The method obtains attribute information and indicator information of the test items of the blockchain system; selects a test case and a test script template for the test item from a preset test template library based on the attribute information of the test item; parses the indicator information of the test item to obtain test variable data for the test item, and generates a test script for the test item based on the test variable data and the test script template for the test item; and calls the test script of the test item based on the test case of the test item to perform blockchain system testing and obtain blockchain system test results. This method achieves test script solidification. Test scripts can be generated by simply obtaining test variable data to maintain the test script template. There is no need to rewrite the test script for specific test items. This method is highly flexible and greatly improves the testing efficiency of the blockchain system. The above solution is elaborated in detail below.

[0036] First, the relevant terms involved in the embodiments of the present invention are introduced:

[0037] Blockchain: A model that implements and manages transaction processing by building an unforgeable, tamper-proof and traceable block chain data structure through transparent and trusted rules in a peer-to-peer network environment.

[0038] Block chain data structure: A data structure in which transactions occurring over a period of time are stored in blocks, and cryptographic algorithms are used to connect the blocks into a chain in chronological order.

[0039] Smart contract: A contract defined in digital form that can automatically execute its terms.

[0040] Encryption: The process of cryptographically exchanging data to produce ciphertext, typically consisting of a set of transformations using a set of algorithms and a set of input parameters, the input parameters usually being called keys.

[0041] Consensus algorithm: The calculation method used by nodes in a blockchain system to reach consensus.

[0042] Consensus mechanism: A method in the blockchain system that uses mathematical algorithms to achieve consensus on accounting content between different nodes. It is the basis for the blockchain system to confirm status and establish trust and collaboration between nodes.

[0043] Cryptography technology: In the traditional sense, the science and technology of studying information encryption and decryption is called cryptography. Modern cryptography technology not only provides information encryption and decryption functions, but also can effectively protect the integrity and non-repudiation of information.

[0044] Confidentiality: The property of information that prevents it from being disclosed to or used by unauthorized individuals, entities, or processes.

[0045] Integrity: The property of data that it has not been altered or destroyed in an unauthorized manner.

[0046] Functional testing: Testing the features and operational behaviors of a blockchain system to ensure they meet design requirements, based on product features, operational descriptions, and user scenarios.

[0047] Performance testing: The performance indicators of the blockchain system are tested by simulating various normal, peak and abnormal load conditions.

[0048] Security testing: Verify the security of the system under test during the development and maintenance process.

[0049] Cryptographic testing: Verify the security, correctness, and efficiency of the cryptographic hashing algorithm, encryption / decryption algorithm, and signature algorithm used by the blockchain system under test. The present invention is further described in detail below with reference to the accompanying drawings:

[0050] See also Figure 1 In one embodiment of the present invention, a blockchain system testing method is provided to solve the current problems of low blockchain system testing efficiency and high testing costs, and can effectively improve the testing efficiency of the blockchain system. Specifically, the blockchain system testing method includes the following steps:

[0051] S1: Obtain the attribute information and indicator information of the test items of the blockchain system.

[0052] S2: According to the attribute information of the test item, a test case of the test item and a test script template of the test item are selected from a preset test template library.

[0053] S3: Parse the indicator information of the test item to obtain the test variable data of the test item, and generate the test script of the test item according to the test variable data of the test item and the test script template of the test item.

[0054] S4: According to the test case of the test item, call the test script of the test item to perform blockchain system testing and obtain the blockchain system test results.

[0055] The pre-set test template library is a result of a rational analysis of common test items in blockchain systems. Based on the general characteristics of blockchain systems, test cases and test script templates for each test item are set up. These templates are then aggregated to form a test template library for selection during specific tests. The test cases include the specific test steps for each test item.

[0056] Specifically, this blockchain system testing method selects a test case and a test script template for a test item from a preset test template library based on the test item's attribute information. It then parses the test item's indicator information to obtain the test variable data for the test item. The test script template for the test item is then maintained using the test variable data to generate a test script for the test item. Finally, based on the test case for the test item, the test script for the test item is called to perform blockchain system testing and obtain blockchain system test results. Throughout this process, the operational steps for each link in the testing process are standardized, and test scripts are solidified. Test scripts can be generated by simply obtaining test variable data to maintain the test script template, eliminating the need to rewrite test scripts for specific test items. This highly flexible approach significantly improves blockchain system testing efficiency, effectively resolving current issues such as lengthy blockchain system testing, non-standard testing, and difficulty reusing test scripts.

[0057] In a possible implementation, in step S1, the attribute information of the test items of the blockchain system and the content of the test basis document can be obtained by parsing the commissioned test form of the blockchain system, and then the indicator information of the test items can be determined according to the content of the test basis document. Alternatively, the attribute information of the test items of the blockchain system and the indicator information of the test items can be directly manually input.

[0058] Among them, the commissioned test form is filled out by the test entrusting party, and the entrusting party declares information, generally including the unit name, blockchain system name, blockchain system version number, contact name and contact phone number, etc., and then selects the test project, uploads the test basis document, and enters the test basis document name. The test basis document generally includes the system outline design manual, system requirement specification manual, security protection plan, software source code and source code compilation guide, etc. Finally, a test task is generated based on the above content, and the test application number and task generation time are generated to form a commissioned test form.

[0059] In a possible implementation, in step S2, when selecting the test case of the test item and the test script template of the test item from a preset test template library based on the attribute information of the test item, the test case of the test item and the test script template of the test item are selected by keyword association.

[0060] Optionally, the test cases and test script templates preset in the test template library can be divided according to test items, fields, and application types. The attribute information of a test item includes the test item to which the test item belongs, the field to which the blockchain system belongs, the blockchain system application type, and the test item name. When selecting using a keyword association method, the test item to which the test item belongs, the blockchain system field, the blockchain system application type, and the test item name are used as keywords in the keyword association method, and the test template library is sequentially associated to ultimately select the test case and test script template for the current test item.

[0061] For example, first, according to the test project to which the test item belongs, select all test cases and test script templates whose test project is the test project to which the test item belongs from the test template library; then, from the obtained test cases and test script templates, according to the field to which the blockchain system belongs, select all test cases and test script templates whose field is the field to which the blockchain system belongs; then, from the obtained test cases and test script templates, according to the blockchain system application type, select all test cases and test script templates whose application type is the blockchain system application type; finally, from the obtained test cases and test script templates, according to the test item name, select test cases and test script templates whose names contain the test item name.

[0062] Optional testing items generally include functional testing, performance testing, security testing and cryptographic testing. Functional testing generally includes account management, permission management, data processing, node management, smart contracts, consensus mechanism and ledger application. Performance testing generally includes resource consumption, transaction requests and cross-chain calls. Security testing generally includes security function testing, penetration testing and code testing. Cryptographic testing generally includes cryptographic hash algorithm testing, encryption and decryption algorithm testing and signature algorithm testing. Each subcategory also includes several test items. For example, the security function test category includes labeling and identification, node management, access control, security auditing, data integrity, data confidentiality, non-repudiation, block chain data structure, consensus mechanism, smart contract, interface testing, data validity verification, port testing and resource control, etc. The penetration test category includes unauthorized access vulnerabilities, plain text transmission vulnerabilities, SQL (Structured Query Language) injection vulnerabilities, XSS (Cross Site Scripting, cross-site scripting) vulnerabilities, file upload vulnerabilities, background address information leakage vulnerabilities, sensitive information leakage vulnerabilities, command execution vulnerabilities, directory traversal vulnerabilities, session replay attack vulnerabilities, CSRF (Cross-site Request Forgery, cross-site request forgery) vulnerabilities, arbitrary file inclusion / arbitrary file download vulnerabilities, design defects / logical errors, XML (EXtensible Markup Language) entity injection vulnerabilities, detection of risky irrelevant services and ports, login function verification code vulnerabilities, insecure Cookies vulnerabilities, SSL (Secure Sockets Layer (Secure Sockets Layer) 3.0 vulnerabilities, SSRF (Server-Side Request Forgery) vulnerabilities, default / weak passwords, and other vulnerabilities. Code testing includes input validation, API (Application Programming Interface) misuse, security features, time and state, error handling, code quality, code encapsulation, environment, and web Trojan backdoors. Password hashing algorithm testing includes birthday attacks, meet-in-the-middle attacks, differential attacks, and collision attacks. Encryption and decryption algorithm testing includes ciphertext-only attacks, known plaintext attacks, chosen plaintext attacks, chosen ciphertext attacks, and chosen text attacks. Signature algorithm testing includes selected message attacks and key substitution attacks. Information about the test project to which a general test item belongs will include the major category, subcategory, and specific name.

[0063] The fields are generally divided into energy, finance and government affairs. The application types in the energy field include power trading applications, new energy cloud applications, material applications, safety supervision applications and regulation and operation applications. The application types in the financial field include smart financial applications, online industrial chain financial applications and power insurance applications. The application types in the government affairs field include judicial evidence applications, credit investigation applications, one-stop service applications and data management applications.

[0064] Each test project includes several test items. For example, the consensus mechanism includes a) public consensus algorithm technical details, b) pluggable consensus algorithm, c) flexibility of consensus mechanism switching, d) logic verification before consensus, e) result verification after consensus, f) the ability to prevent independent consensus nodes from performing information operations without confirmation, g) the ability to reach consensus without failure and fraud, h) the ability to anti-fraud based on a consensus mechanism with high probability of consistency, i) the ability to anti-fraud based on a consensus mechanism with absolute consistency, and j) the ability to The ability to reach consensus under theoretical values, k) the ability to not reach consensus when the number of failures is greater than the theoretical value, l) the ability to resist replay attacks, m) the ability to handle message tampering anomalies, n) the ability to prevent "double-spending attacks" in the case of transfers, etc. Taking cross-chain calls as an example, including o) the business throughput of cross-chain calls is not less than 1.2*N times the original business throughput (the number of cross-chains is N), p) the business throughput of cross-chain consensus is not less than 1.2*N times the original business throughput, etc. Each test item will have a preset corresponding test case and test script template.

[0065] In a possible implementation, in step S3, generating the test script of the test item based on the test variable data of the test item and the test script template of the test item includes: adding the test variable data of the test item to the test variable data position reserved in the test script template of the test item, and adding an assertion for judging the test result to obtain the test script of the test item.

[0066] Specifically, when setting up the test script template, a test variable data location will be reserved in advance. When conducting a test, the maintenance of the test script template is completed by adding the acquired test variable data to the test variable data location reserved in the test script template of the test item.

[0067] Optionally, add an assertion for judging the test result at the end of the maintained test script template. For example, set the assertion to check whether the response information after the test script is run contains the expected character. The expected character may be included in the response information when the test passes, but not included in the response information when the test fails. By setting the assertion to detect whether the response information contains the character, it is determined whether the test passes and the corresponding test result is fed back, thereby realizing automated testing and saving a lot of manual compilation work.

[0068] In a possible implementation, in step S4, when calling the test script of the test item to perform blockchain system testing according to the test case of the test item, the test execution start time of the test script of the test item can be set according to the test case of the test item. After the test execution start time is reached or the test script execution request of the test item is received, the test script content of the test item is parsed and the test script of the test item is automatically executed.

[0069] In one possible implementation, the blockchain system testing method further includes the following steps:

[0070] Record the blockchain system name, blockchain system version number, test case number of the test item, test case name of the test item, blockchain system test results, test user ID, test user name and test time during the test process to generate test records. The generated test records provide conditions for subsequent data tracing, effectively avoid repeated testing, and improve the credibility of test results.

[0071] The following are device embodiments of the present invention, which can be used to perform the method embodiments of the present invention. For details not disclosed in the device embodiments, please refer to the method embodiments of the present invention.

[0072] See also Figure 2 In another embodiment of the present invention, a blockchain system testing system is provided, which can be used to implement the above-mentioned blockchain system testing method. Specifically, the blockchain system testing system includes a data acquisition module, a selection module, a script generation module and a testing module.

[0073] Among them, the data acquisition module is used to obtain the attribute information of the test items and the indicator information of the test items of the blockchain system; the selection module is used to select the test cases of the test items and the test script templates of the test items from the preset test template library according to the attribute information of the test items; the script generation module is used to parse the indicator information of the test items, obtain the test variable data of the test items, and generate the test script of the test items according to the test variable data of the test items and the test script template of the test items; the testing module is used to call the test script of the test items according to the test cases of the test items to perform blockchain system testing and obtain the blockchain system test results.

[0074] In a possible implementation, the selection module is specifically configured to select a test case and a test script template of the test item from a preset test template library in accordance with attribute information of the test item and in a keyword association manner.

[0075] In a possible implementation, the attribute information of the test item includes the test project to which the test item belongs, the field to which the blockchain system belongs, the application type of the blockchain system, and the name of the test item, and the test project to which the test item belongs, the field to which the blockchain system belongs, the application type of the blockchain system, and the name of the test item are used in sequence as keywords in the keyword association method.

[0076] In a possible implementation, the script generation module is specifically configured to add the test variable data of the test item to a test variable data location reserved in the test script template of the test item, and add assertions for determining the test results to obtain the test script of the test item.

[0077] In one possible implementation, the blockchain system testing system further includes a test recording module for recording the blockchain system name, blockchain system version number, test case number of the test item, test case name of the test item, blockchain system test results, test user ID, test user name, and test time during the test process to generate a test record.

[0078] All relevant contents of each step involved in the embodiment of the aforementioned blockchain system testing method can be referred to the functional description of the functional module corresponding to the blockchain system testing system in the embodiment of the present invention, and will not be repeated here. The division of modules in the embodiment of the present invention is schematic and is only a logical functional division. There may be other division methods in actual implementation. In addition, the functional modules in various embodiments of the present invention can be integrated into a processor, or they can exist separately physically, or two or more modules can be integrated into a module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules.

[0079] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the blockchain system testing method.

[0080] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in a computer device, used to store programs and data. It is understood that the computer-readable storage medium herein may include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides storage space, which stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for being loaded and executed by a processor. These instructions may be one or more computer programs (including program code). It should be noted that the computer-readable storage medium herein may be high-speed RAM memory or non-volatile memory, such as at least one disk storage device. The processor may load and execute the one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the blockchain system testing method in the above-mentioned embodiment.

[0081] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0082] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0083] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A blockchain system testing method, characterized in that: include: Obtaining attribute information and indicator information of test items of the blockchain system; including: obtaining attribute information of test items of the blockchain system and content of a test basis document by parsing a commissioned test order of the blockchain system, and determining indicator information of the test items according to the content of the test basis document; Selecting a test case for the test item and a test script template for the test item from a preset test template library based on the attribute information of the test item; including: selecting a test case for the test item and a test script template for the test item from a preset test template library using a keyword association method based on the attribute information of the test item; the attribute information of the test item includes the test project to which the test item belongs, the field to which the blockchain system belongs, the application type of the blockchain system, and the name of the test item, and using the test project to which the test item belongs, the field to which the blockchain system belongs, the application type of the blockchain system, and the name of the test item in sequence as keywords in the keyword association method; Parsing the indicator information of the test item to obtain the test variable data of the test item, and generating the test script of the test item according to the test variable data of the test item and the test script template of the test item; According to the test case of the test item, call the test script of the test item to perform blockchain system testing and obtain the blockchain system test results.

2. The blockchain system testing method according to claim 1, characterized in that: Generating a test script for a test item according to the test variable data of the test item and the test script template of the test item includes: The test variable data of the test item is added to the test variable data position reserved in the test script template of the test item, and an assertion for judging the test result is added to obtain the test script of the test item.

3. The blockchain system testing method according to claim 1, characterized in that: Also includes: Record the blockchain system name, blockchain system version number, test case number of the test item, test case name of the test item, blockchain system test results, test user ID, test user name, and test time during the test process to generate a test record.

4. A blockchain system testing system, characterized in that: include: The data acquisition module is used to obtain the attribute information and indicator information of the test items of the blockchain system; including: obtaining the attribute information of the test items of the blockchain system and the content of the test basis document by parsing the commissioned test order of the blockchain system, and determining the indicator information of the test items according to the content of the test basis document; A selection module is configured to select a test case and a test script template for the test item from a preset test template library based on the attribute information of the test item; specifically, the selection module is configured to select a test case and a test script template for the test item from a preset test template library based on the attribute information of the test item using a keyword association method; the attribute information of the test item includes the test project to which the test item belongs, the field to which the blockchain system belongs, the application type of the blockchain system, and the name of the test item, and the test project to which the test item belongs, the field to which the blockchain system belongs, the application type of the blockchain system, and the name of the test item are used in sequence as keywords in the keyword association method; A script generation module is used to parse the indicator information of the test item, obtain the test variable data of the test item, and generate the test script of the test item according to the test variable data of the test item and the test script template of the test item; The test module is used to call the test script of the test item according to the test case of the test item to perform blockchain system testing and obtain the blockchain system test results.

5. The blockchain system testing system according to claim 4, characterized in that: The script generation module is specifically used to add the test variable data of the test item to the test variable data position reserved in the test script template of the test item, and add assertions for judging the test results to obtain the test script of the test item.

6. The blockchain system testing system according to claim 4, characterized in that: It also includes a test record module, which is used to record the blockchain system name, blockchain system version number, test case number of the test item, test case name of the test item, blockchain system test results, test user ID, test user name and test time during the test process to generate a test record.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the blockchain system testing method according to any one of claims 1 to 3 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the blockchain system testing method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Test data generation method, device, equipment and storage medium

    CN112162915A

  • Automatic testing method and system for functionality of power blockchain interface

    CN113268433A