CN115934546A - A blockchain integration testing method and system based on Go language - Google Patents
A blockchain integration testing method and system based on Go language Download PDFInfo
- Publication number
- CN115934546A CN115934546A CN202211619412.4A CN202211619412A CN115934546A CN 115934546 A CN115934546 A CN 115934546A CN 202211619412 A CN202211619412 A CN 202211619412A CN 115934546 A CN115934546 A CN 115934546A
- Authority
- CN
- China
- Prior art keywords
- test
- tested
- block chain
- cluster
- blockchain
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域technical field
本申请属于区块链测试技术领域,具体涉及一种基于Go语言的区块链集成测试方法及系统。The application belongs to the technical field of blockchain testing, and in particular relates to a Go language-based blockchain integration testing method and system.
背景技术Background technique
现有区块链系统的集成测试在测试时,一般使用Python或Java作为执行的远程调用命令语言,但是服务端的SDK均使用GoSDK或者JavaSDK。对于JavaSDK的服务端来说,由于远程调用命令同样使用Java,可以直接通过Java进行测试。但是对于GoSDK的服务端来说,中间还需要做一层中转,将GoSDK发出的远程调用命令传递给Python语言,然后通过Python语言再次真正对区块链系统进行调用。这样的实现方式在运行效率上大打折扣,并且增加了测试系统的维护成本。The integration test of the existing blockchain system generally uses Python or Java as the remote call command language for execution, but the SDK on the server side uses GoSDK or JavaSDK. For the server side of the JavaSDK, because the remote call command also uses Java, it can be tested directly through Java. However, for the server of GoSDK, a layer of relay is needed in the middle to pass the remote call command issued by GoSDK to the Python language, and then actually call the blockchain system again through the Python language. Such an implementation method greatly reduces operating efficiency and increases the maintenance cost of the test system.
另外,区块链上的一些功能(如合约、存储、密码学),由于语言特性或缺少相应的一些依赖库等原因,通过Python进行实现会很复杂,甚至无法实现,这也增加了通过Python语言对区块链系统进行测试的实现及开发难度。In addition, some functions on the blockchain (such as contracts, storage, cryptography), due to language features or lack of corresponding dependent libraries, etc., it will be very complicated or even impossible to implement through Python, which also increases the The implementation and development difficulty of the language to test the blockchain system.
因此需要一种基于Go语言的区块链集成测试方法及系统,能够使用直接对区块链系统进行集成测试,减少调用中转的效率损耗。Therefore, there is a need for a blockchain integration testing method and system based on the Go language, which can be used to directly perform integration testing on the blockchain system and reduce the efficiency loss of call transfer.
发明内容Contents of the invention
基于现有技术中存在的上述缺点和不足,本发明的目的之一是至少解决现有技术中存在的上述问题之一或多个,换言之,本发明的目的之一是提供满足前述需求之一或多个的一种基于Go语言的区块链集成测试方法及系统。Based on the above-mentioned shortcomings and deficiencies in the prior art, one of the purposes of the present invention is to at least solve one or more of the above-mentioned problems in the prior art. In other words, one of the purposes of the present invention is to provide a One or more blockchain integration testing methods and systems based on the Go language.
为了达到上述发明目的,本发明采用以下技术方案:In order to achieve the above object of the invention, the present invention adopts the following technical solutions:
第一方面,本发明提供了一种基于Go语言的区块链集成测试方法,应用于区块链集群,具体包括步骤:In the first aspect, the present invention provides a block chain integration testing method based on Go language, which is applied to block chain clusters, and specifically includes steps:
指定GoSDK依赖,初始化配置文件;Specify GoSDK dependencies and initialize configuration files;
根据配置文件确定待测区块链集群,使用GoSDK发出部署指令,部署待测区块链集群的各个节点,生成待测区块链集群;Determine the blockchain cluster to be tested according to the configuration file, use GoSDK to issue deployment instructions, deploy each node of the blockchain cluster to be tested, and generate a blockchain cluster to be tested;
根据配置文件生成测试用例,使用GoSDK发出测试指令,以测试用例对待测区块链集群执行测试;Generate test cases according to the configuration file, use GoSDK to issue test instructions, and use the test cases to perform tests on the blockchain cluster to be tested;
收集测试日志及统计结果。Collect test logs and statistical results.
上述方法基于Go语言实现的测试方法,能够完成对区块链系统的节点、网络、共识、合约、存储、密码学进行测试的任务,并利用Go语言与区块链集群的适配性,以较高性能完成区块链集群的测试任务,且调用过程无需中转,减少了测试系统的维护成本。The above method is based on the test method implemented by the Go language, which can complete the tasks of testing the nodes, network, consensus, contract, storage, and cryptography of the blockchain system, and utilizes the adaptability of the Go language and the blockchain cluster to Complete the test tasks of the blockchain cluster with high performance, and the call process does not need to be transferred, which reduces the maintenance cost of the test system.
作为一种进一步改进的方案,方法还包括:As a further improved solution, the method also includes:
配置文件包括模糊测试规则,模糊测试规则指定了某一或多项测试的输入参数个数、种类及值范围;The configuration file includes fuzzing test rules, which specify the number, type and value range of input parameters for one or more tests;
当根据配置文件生成测试用例时,还包括使用GoSDK发出测试指令,根据模糊测试规则以测试用例对待测区块链集群执行模糊测试;When generating test cases according to the configuration file, it also includes using GoSDK to issue test instructions, and perform fuzzing tests on the blockchain cluster to be tested with test cases according to the fuzzing test rules;
模糊测试具体包括,根据模糊测试规则生成模糊测试参数,以模糊测试参数生成若干分裂测试用例;The fuzz test specifically includes generating fuzz test parameters according to the fuzz test rules, and generating several split test cases with the fuzz test parameters;
使用GoSDK发出测试指令,以若干分裂测试用例分别对待测区块链集群进行测试。Use GoSDK to issue test instructions, and test the blockchain cluster to be tested with several split test cases.
上述改进方法为本发明的方法增加了模糊测试过程,以一定的分裂模式生成指定字段总长度、区间规则等规格的测试输入参数,解决了传统区块链测试方法中仅能人工设定测试输入参数的缺陷。以模糊生成的符合规格的测试输入参数进行大批量测试,能够有效测试区块链系统的载荷及测定功能的数据参数边界,提供了区块链系统测试的自动化程度和可扩展性。The above-mentioned improved method adds a fuzzy testing process to the method of the present invention, and generates test input parameters with specifications such as the total length of the specified field and interval rules in a certain split mode, and solves the problem that the traditional block chain test method can only manually set the test input parameters. Parameter flaws. Using fuzzy-generated test input parameters that meet the specifications for mass testing can effectively test the load of the blockchain system and the data parameter boundaries of the measurement function, providing automation and scalability of the blockchain system test.
作为一种进一步改进的方案,方法还包括:As a further improved solution, the method also includes:
根据配置文件生成测试用例,同时为每个测试用例设置用例等级;Generate test cases according to the configuration file, and set the use case level for each test case at the same time;
以测试用例对待测区块链集群执行测试,根据用例等级优先以高用例等级或低用例等级的测试用例对待测区块链集群执行测试,或选取某一用例等级范围,仅以处于该用例等级范围的测试用例对待测区块链集群执行测试。Execute the test on the blockchain cluster to be tested with the test case, and perform the test on the blockchain cluster to be tested with the test case of the high or low use case level according to the use case level, or select a certain level range of the use case, only the level of the use case The scope of the test cases executes the tests on the blockchain cluster under test.
上述改进方法为测试用例分别设置了用例等级,在执行测试时可以根据用例等级的高低以一定优先度执行测试用例、或指定某个用例等级范围执行测试用例,从而减少测试产品开发及修改的等待验证时间,提高测试效率。The above improved method sets the use case level for the test case respectively. When executing the test, the test case can be executed with a certain priority according to the level of the use case, or a certain level range of the use case can be specified to execute the test case, thereby reducing the waiting time for test product development and modification Verification time, improve test efficiency.
作为一种优选的方案,初始化配置文件具体包括:As a preferred solution, the initialization configuration file specifically includes:
预生成配置结构体;Pre-generated configuration structure;
读取输入的配置指令,将配置指令的内容序列化至配置结构体。Read the input configuration command and serialize the content of the configuration command to the configuration structure.
作为一种进一步改进的方案,方法还包括:As a further improved solution, the method also includes:
在根据配置文件确定待测区块链集群之后,对现有区块链集群进行检索比对,确定待测区块链集群是否已经部署完成;After determining the blockchain cluster to be tested according to the configuration file, search and compare the existing blockchain cluster to determine whether the blockchain cluster to be tested has been deployed;
若是,则使用GoSDK发出检测指令,检测该待测区块链集群状态,若检测失败,收集测试日志及统计结果;If so, use GoSDK to issue detection commands to detect the status of the blockchain cluster to be tested. If the detection fails, collect test logs and statistical results;
若否,则使用GoSDK发出部署指令,部署待测区块链集群的各个节点,生成待测区块链集群。If not, use GoSDK to issue a deployment command, deploy each node of the blockchain cluster to be tested, and generate a blockchain cluster to be tested.
作为一种进一步改进的方案,方法还包括:As a further improved solution, the method also includes:
在根据配置文件生成测试用例时,在测试用例中插入测试探针;When generating test cases according to configuration files, insert test probes into test cases;
在以测试用例对待测区块链集群执行测试时,根据测试探针检测区块链状态是否异常;When the test case is used to test the blockchain cluster to be tested, it is detected whether the status of the blockchain is abnormal according to the test probe;
若区块链状态持续异常时间超过预设时间阈值,则判定为环境异常,终止测试。If the abnormal state of the blockchain continues for more than the preset time threshold, it is determined that the environment is abnormal and the test is terminated.
第二方面,本发明还提供一种基于Go语言的区块链集成测试系统,用于对区块链集群进行集成测试,系统包括:In the second aspect, the present invention also provides a block chain integration test system based on Go language, which is used to carry out integration test to the block chain cluster, and the system includes:
初始化模块,用于指定GoSDK依赖,并获取配置文件的输入参数,根据输入参数初始化配置文件;The initialization module is used to specify the GoSDK dependency, obtain the input parameters of the configuration file, and initialize the configuration file according to the input parameters;
节点部署模块,用于根据配置文件确定待测区块链集群,使用GoSDK发出部署指令,部署待测区块链集群的各个节点,生成待测区块链集群;The node deployment module is used to determine the blockchain cluster to be tested according to the configuration file, use GoSDK to issue deployment instructions, deploy each node of the blockchain cluster to be tested, and generate a blockchain cluster to be tested;
测试计划模块,根据配置文件生成测试用例;Test plan module, generate test cases according to configuration files;
脚本执行模块,用于使用GoSDK发出测试指令,以测试用例对待测区块链集群执行测试;The script execution module is used to issue test instructions using GoSDK to execute tests on the blockchain cluster to be tested with test cases;
日志模块,用于收集测试日志及统计结果。The log module is used to collect test logs and statistical results.
本发明的基于Go语言实现的测试系统,能够应用上述方法完成对区块链系统的节点、网络、共识、合约、存储、密码学的测试。利用Go语言与区块链集群的适配性,以较高性能完成区块链集群的测试任务,且调用过程无需中转,减少了测试系统的维护成本。The test system implemented based on the Go language of the present invention can apply the above method to complete the tests of the nodes, network, consensus, contract, storage, and cryptography of the blockchain system. Utilizing the adaptability of the Go language and the blockchain cluster, the test tasks of the blockchain cluster are completed with high performance, and the calling process does not need to be transferred, which reduces the maintenance cost of the test system.
作为一种进一步改进的方案,脚本执行模块包括规则解析模块、用例生成模块和模糊测试模块;As a further improved solution, the script execution module includes a rule parsing module, a use case generation module and a fuzzing testing module;
规则解析模块用于解析配置文件,生成模糊测试规则,模糊测试规则指定了某一或多项测试的输入参数个数、种类及值范围;The rule parsing module is used to parse configuration files and generate fuzzy test rules. The fuzzy test rules specify the number, type and value range of input parameters for one or more tests;
用例生成模块用于根据模糊测试规则生成模糊测试参数,以模糊测试参数生成若干分裂测试用例;The use case generation module is used to generate fuzzy test parameters according to the fuzzy test rules, and generate several split test cases with the fuzzy test parameters;
模糊测试模块用于使用GoSDK发出测试指令,以若干分裂测试用例分别对待测区块链集群进行测试。The fuzzing test module is used to issue test instructions using GoSDK, and test the blockchain cluster to be tested with several split test cases.
与上述方法中的模糊测试改进相似,在脚本执行模块中设置规则解析模块、用例生成模块和模糊测试模块为本测试系统增加了模糊测试的能力,以一定的分裂模式生成指定字段总长度、区间规则等规格的测试输入参数,解决了传统区块链测试系统仅能人工设定测试输入参数的缺陷。以模糊生成的符合规格的测试输入参数进行大批量测试,能够有效测试区块链系统的载荷及测定功能的数据参数边界,提供了区块链系统的自动化程度和可扩展性。Similar to the fuzz test improvement in the above method, setting the rule analysis module, use case generation module and fuzz test module in the script execution module adds the ability of fuzz test to the test system, and generates the total length and interval of the specified field in a certain split mode Standard test input parameters such as rules solve the defect that traditional blockchain test systems can only manually set test input parameters. Using fuzzy-generated test input parameters that meet the specifications for mass testing can effectively test the load of the blockchain system and the data parameter boundaries of the measurement function, providing the automation and scalability of the blockchain system.
第三方面,本发明还提供一种计算机设备,计算机设备包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,计算机程序被处理器执行时实现如上述任一项的方法。In a third aspect, the present invention also provides a computer device. The computer device includes a memory, a processor, and a computer program stored in the memory and operable on the processor. When the computer program is executed by the processor, any of the above-mentioned method.
第四方面,本发明还提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现如上述任一项的方法。In a fourth aspect, the present invention also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any one of the methods above is implemented.
本发明与现有技术相比,有益效果是:The present invention compares with prior art, beneficial effect is:
本发明的方法及系统基于Go设置,能够利用GoSDK无需调用直接对区块链系统的节点、网络、共识、合约、存储、密码学进行测试,减少了测试过程中远程调用命令中转至其他语言对效率的损耗,同时减少了系统维护所消耗的人工成本。The method and system of the present invention are based on Go settings, and can use GoSDK to directly test the nodes, network, consensus, contract, storage, and cryptography of the blockchain system without calling, reducing the need for remote call commands to be transferred to other language pairs during the test process. Efficiency loss, while reducing labor costs for system maintenance.
本发明的方法和系统还利用Go语言的特性及其与区块链系统的适配性,实现了Python语言难以实现的用例生成及模糊测试功能,能够便利地直接生成符合规格的测试输入参数,并用这些测试输入参数进行大批量测试,能够有效测试区块链系统的载荷及测定功能的数据参数边界,提供了区块链系统测试的自动化程度和可扩展性。The method and system of the present invention also utilize the characteristics of the Go language and its adaptability to the blockchain system to realize the use case generation and fuzzy testing functions that are difficult to implement in the Python language, and can conveniently and directly generate test input parameters that meet the specifications. And use these test input parameters to carry out mass testing, which can effectively test the load of the blockchain system and the data parameter boundary of the measurement function, and provide the automation and scalability of the blockchain system test.
本发明的方法和系统还能够在测试时根据用例等级划分测试优先度,可以在开发或修复过程中先运行一些冒烟用例(即比较重要的基本功能用例),以验证其基本的正确性,大大缩短等待验证的时间。与上述方法及系统的模糊测试功能结合,能够在兼具测试速度的同时进行大批量测试。The method and system of the present invention can also divide the test priority according to the use case level during the test, and can run some smoke use cases (that is, relatively important basic function use cases) in the development or repair process to verify their basic correctness. Significantly shorten the waiting time for verification. Combined with the above-mentioned method and the fuzzing test function of the system, it is possible to perform large-scale testing while maintaining testing speed.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.
图1是本申请实施例提供的一种基于Go语言的区块链集成测试方法的流程图;Fig. 1 is the flow chart of a kind of block chain integration test method based on Go language that the embodiment of the application provides;
图2是本申请实施例提供的模糊用例生成方法的流程图;Fig. 2 is the flowchart of the fuzzy use case generating method provided by the embodiment of the present application;
图3是本申请实施例提供的一种基于Go语言的区块链集成测试系统的结构框图。Fig. 3 is a structural block diagram of a blockchain integration testing system based on the Go language provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
下述介绍提供了本申请的多个实施例,不同实施例之间可以替换或者合并组合,因此本申请也可认为包含所记载的相同和/或不同实施例的所有可能组合。因而,如果一个实施例包含特征A、B、C,另一个实施例包含特征B、D,那么本申请也应视为包括含有A、B、C、D的一个或多个所有其他可能的组合的实施例,尽管该实施例可能并未在以下内容中有明确的文字记载。The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined and combined, so the present application can also be considered to include all possible combinations of the same and/or different embodiments described. Thus, if one embodiment contains features A, B, C, and another embodiment contains features B, D, then the application should also be considered to include all other possible combinations containing one or more of A, B, C, D Although this embodiment may not be clearly written in the following content.
下面的描述提供了示例,并且不对权利要求书中阐述的范围、适用性或示例进行限制。可以在不脱离本申请内容的范围的情况下,对描述的元素的功能和布置做出改变。各个示例可以适当省略、替代或添加各种过程或组件。例如所描述的方法可以以所描述的顺序不同的顺序来执行,并且可以添加、省略或组合各种步骤。此外,可以将关于一些示例描述的特征组合到其他示例中。The following description provides examples, and does not limit the scope, applicability or examples set forth in the claims. Changes may be made in the function and arrangement of elements described without departing from the scope of the disclosure. Various examples may omit, substitute, or add various procedures or components as appropriate. For example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
本申请提供了一种基于Go语言的区块链集成测试方法,用于在开发、维护或修复过程中对区块链集群进行测试,方法具体包括如下步骤:This application provides a blockchain integration testing method based on the Go language, which is used to test the blockchain cluster during the development, maintenance or repair process. The method specifically includes the following steps:
S1、首先,指定GoSDK依赖,并初始化配置文件。S1. First, specify the GoSDK dependency and initialize the configuration file.
GoSDK依赖是本方法所应用的API命令,其定义了不同区块链在署合约、调用合约用到的指令和传参格式。GoSDK dependency is the API command applied by this method, which defines the command and parameter format used by different blockchains to sign contracts and call contracts.
配置文件用于指定待测区块链集群的版本号、部署方式、测试脚本的版本号;还有在控制待测区块链集群部署及测试的过程中分别调用哪些脚本、如何调用这些脚本、并统计哪些结果。The configuration file is used to specify the version number of the blockchain cluster to be tested, the deployment method, and the version number of the test script; as well as which scripts are called and how to call these scripts in the process of controlling the deployment and testing of the blockchain cluster to be tested, and count the results.
作为另一个实施例,配置文件还可以指定测试过程的额外流程策略,如远程调用方式、重发轮询策略、https及证书配置开关,还有自定义的日志输出策略。As another embodiment, the configuration file can also specify additional process policies of the test process, such as remote call mode, retransmission polling policy, https and certificate configuration switches, and custom log output policies.
其中,远程调用方式可以支持rpc、grpc、websocket三种方式,在配置文件中配置好对应方式的端口号即可使用相应的方式进行请求调用。Among them, the remote call method can support three methods: rpc, grpc, and websocket. After configuring the port number of the corresponding method in the configuration file, you can use the corresponding method to make the request call.
重发轮询策略默认配置为支持重发轮询,并可在配置文件中配置重发次数、轮询时间间隔、轮询次数等参数。The resending polling policy is configured by default to support resending polling, and parameters such as the number of resending times, polling interval, and polling times can be configured in the configuration file.
在本申请的某些实施例中,作为一种优选的实现方式,初始化配置文件这一方法可以具体包括如下步骤:In some embodiments of the present application, as a preferred implementation, the method of initializing the configuration file may specifically include the following steps:
S11、预生成配置结构体,配置结构体是具有多个参数空间的数据段落或表,在预生成的初始状态下配置结构体的参数空间留空。S11. Pre-generate a configuration structure. The configuration structure is a data paragraph or table with multiple parameter spaces. In the initial pre-generated state, the parameter space of the configuration structure is left blank.
S12、读取输入的配置指令,这一配置指令可以是单独输入的指令段,也可以是指定格式的toml或者yaml文件。读取配置指令以后,将配置指令中的内容序列化至配置结构体的参数空间中,序列化后的配置结构体即完成初始化。S12. Read the input configuration instruction, which may be a separately input instruction segment, or a toml or yaml file in a specified format. After reading the configuration command, serialize the content of the configuration command into the parameter space of the configuration structure, and the serialized configuration structure is initialized.
基于上述部分实施例的在配置文件中指定测试过程的额外流程策略,配置结构体中还可以根据配置指令的节点信息、端口号分别初始化rpc、websocket、grpc服务。根据配置指令中的安全策略信息,判断是否需要通过https或者证书的方式发送,如果需要则在发送请求的时候会带上相关的证书。或者根据配置指令中的轮询策略,进行策略配置,包括重发次数和每次重发后的时间间隔,并在轮询时使用上述初始化后的rpc、websocket、grpc服务进行远程通信。Based on the additional process strategy of specifying the test process in the configuration file in the above-mentioned partial embodiments, the configuration structure can also initialize rpc, websocket, and grpc services respectively according to the node information and port number of the configuration instruction. According to the security policy information in the configuration command, judge whether it needs to be sent by https or certificate. If necessary, the relevant certificate will be brought when sending the request. Or configure the policy according to the polling policy in the configuration command, including the number of retransmissions and the time interval after each retransmission, and use the above-mentioned initialized rpc, websocket, and grpc services for remote communication during polling.
S2、根据配置文件确定待测区块链集群,使用GoSDK发出部署指令,部署待测区块链集群的各个节点,生成待测区块链集群。S2. Determine the blockchain cluster to be tested according to the configuration file, use GoSDK to issue a deployment command, deploy each node of the blockchain cluster to be tested, and generate a blockchain cluster to be tested.
在步骤S2中,分别读取上述配置文件中的各个参数,根据参数确定节点部署方案,对于待测区块链集群中的各个节点分别选择哪个版本,然后使用GoSDK的API发出相应的节点部署指令。将各个节点依照配置文件进行部署以后,则完成待测区块链集群的部署。In step S2, read each parameter in the above configuration file, determine the node deployment scheme according to the parameters, select which version for each node in the blockchain cluster to be tested, and then use the API of GoSDK to issue the corresponding node deployment command . After each node is deployed according to the configuration file, the deployment of the blockchain cluster to be tested is completed.
在本申请的某些实施例中,由于待测区块链集群可能已经部署过而不需重复部署,为了节省测试时间,作为一种进一步改进的方案,对方法做如下改进:In some embodiments of this application, since the blockchain cluster to be tested may have already been deployed and does not need to be deployed repeatedly, in order to save testing time, as a further improvement solution, the method is improved as follows:
在根据配置文件确定需要测试的待测区块链集群之后,对现有已经部署完成的区块链集群进行检索比对,确定待测区块链集群是否已经部署完成。这一检索比对需要对整个区块链集群的各个节点分别进行比对,若存在某一区块链集群其各个节点及结构均与目前待测区块链集群相同,则认为待测区块链集群已经部署完成。After determining the blockchain cluster to be tested according to the configuration file, search and compare the existing blockchain clusters that have been deployed to determine whether the blockchain cluster to be tested has been deployed. This search comparison needs to compare each node of the entire blockchain cluster separately. If there is a blockchain cluster whose nodes and structure are the same as the current blockchain cluster to be tested, the block to be tested is considered The chain cluster has been deployed.
上述这一检索比对可以单独对每个区块链集群的每个节点独立进行比对,或也可预先根据每个区块链集群其各个节点及结构生成一组单一的识别码,并将多个区块链集群的识别码存放于一处。若存在某一区块链集群其各个节点及结构均与目前待测区块链集群相同,则其所生成的识别码将与目前储存的识别码之一相同,由此可以认为该二区块链集群具有相同的结构,也便能够认为待测区块链集群已经部署完成。The above search and comparison can be performed independently for each node of each blockchain cluster, or a set of single identification codes can be generated in advance according to each node and structure of each blockchain cluster, and the The identification codes of multiple blockchain clusters are stored in one place. If there is a blockchain cluster whose nodes and structure are the same as the current blockchain cluster to be tested, the identification code generated by it will be the same as one of the currently stored identification codes, so the two blocks can be considered Chain clusters have the same structure, so it can be considered that the blockchain cluster to be tested has been deployed.
在检索以后,若确定待测区块链集群已经部署完成,则使用GoSDK发出检测指令,检测该待测区块链集群状态是否正常。若检测回传确认该区块链集群状态正常,则可以直接用于后续的测试过程。若检测失败,没有得到回传或回传报错,则收集日志,重新部署待测区块链集群。After retrieval, if it is determined that the blockchain cluster to be tested has been deployed, use GoSDK to issue a detection command to check whether the status of the blockchain cluster to be tested is normal. If the detection feedback confirms that the state of the blockchain cluster is normal, it can be directly used in the subsequent testing process. If the detection fails, no feedback or error is reported, the logs are collected and the blockchain cluster to be tested is redeployed.
在检索以后,若确定待测区块链集群没有部署完成,则如正常流程使用GoSDK发出部署指令,部署待测区块链集群的各个节点,生成待测区块链集群。After retrieval, if it is determined that the deployment of the blockchain cluster to be tested has not been completed, use GoSDK to issue a deployment command as in the normal process, deploy each node of the blockchain cluster to be tested, and generate a blockchain cluster to be tested.
当区块链集群部署完成后,进行步骤S3、根据配置文件生成测试用例,使用GoSDK发出测试指令,以测试用例对待测区块链集群执行测试。After the deployment of the blockchain cluster is completed, go to step S3, generate a test case according to the configuration file, use GoSDK to issue a test command, and execute the test on the blockchain cluster to be tested with the test case.
测试用例包括了测试选择怎样的脚本执行、以怎样顺序执行、每次执行时使用什么参数传入区块链系统、并应该得到哪些回传或输出结果。The test case includes the test selection of what script to execute, in what order to execute, what parameters are used to pass into the blockchain system for each execution, and what return or output results should be obtained.
当以测试用例对待测区块链集群执行测试时,待测区块链根据测试用例的脚本及传入参数执行业务,并输出相应的结果及测试日志。When the test case is used to test the blockchain cluster to be tested, the blockchain to be tested executes the business according to the script of the test case and the incoming parameters, and outputs the corresponding results and test logs.
当脚本正式执行时,首先会初始化测试套件的内容,判断当前脚本是否应该在本次计划中调用,然后依次执行脚本的前置操作、测试内容、后置操作等过程。When the script is officially executed, it will first initialize the content of the test suite, judge whether the current script should be called in this plan, and then execute the pre-operation, test content, post-operation and other processes of the script in sequence.
在本申请的某些实施例中,作为一种进一步改进的方案,方法还在根据配置文件生成测试用例时,于测试用例中插入测试探针;In some embodiments of the present application, as a further improvement, the method also inserts test probes into the test case when generating the test case according to the configuration file;
测试探针在以测试用例对待测区块链集群执行测试时,会不定时检测区块链的状态,若检测到区块链状态异常则记录异常开始的时间。在下一次测试探针检测区块链的状态后,判断区块链集群是否恢复正常,如果没有恢复正常,则判断当前持续异常时间是否已经超过预设时间阈值,如果超过则认定环境异常,标记相应的脚本为错误,继续完成测试以后统计错误脚本、考虑修改测试方案,或者直接终止测试。When the test probe executes the test of the blockchain cluster to be tested with the test case, it will detect the status of the blockchain from time to time, and record the time when the abnormality starts if it detects that the status of the blockchain is abnormal. After the next test probe detects the status of the blockchain, it will be judged whether the blockchain cluster has returned to normal. If not, it will be judged whether the current continuous abnormal time has exceeded the preset time threshold. If the script is wrong, continue to complete the test to count the wrong script, consider modifying the test plan, or terminate the test directly.
S4、在S3的测试过程中获取区块链系统的回参,根据回参及测试用例的比较结果确定测试结果,收集测试日志,并将各个测试的结果统计。S4. Obtain the back reference of the blockchain system during the test of S3, determine the test result according to the comparison result of the back reference and the test case, collect the test log, and make statistics on the results of each test.
作为一种具体的实施方案,步骤S4手机测试结果及测试日志,生成allure测试报告,首先生成指定的json文件文本,然后通过allure工具将json文件文本转换成前端页面的测试报告。As a specific implementation plan, in step S4, mobile phone test results and test logs are generated to generate an allure test report. First, a specified json file text is generated, and then the json file text is converted into a test report on the front-end page by the allure tool.
上述方法的整体流程图如图1所示,这一基于Go语言实现的测试方法,能够完成对区块链系统的节点、网络、共识、合约、存储、密码学进行测试的任务,并利用Go语言与区块链集群的适配性,以较高性能完成区块链集群的测试任务,且调用过程无需中转,减少了测试系统的维护成本。The overall flowchart of the above method is shown in Figure 1. This test method based on the Go language can complete the tasks of testing the nodes, network, consensus, contract, storage, and cryptography of the blockchain system, and uses Go The adaptability of the language and the blockchain cluster can complete the testing tasks of the blockchain cluster with high performance, and the calling process does not need to be transferred, which reduces the maintenance cost of the test system.
在本申请的某些实施例中,为了提高本申请的方法执行批量测试及测试参数边界的能力,如图2的模糊用例生成方法流程图所示,对上述方法还做如下改进:In some embodiments of the present application, in order to improve the ability of the method of the present application to perform batch testing and test parameter boundaries, as shown in the flow chart of the fuzzy use case generation method in Figure 2, the above method is also improved as follows:
在配置文件中还包括一系列模糊测试规则,模糊测试规则指定了某一或多项测试的输入参数个数、种类及值范围。另外,模糊测试规则针对每个参数还可以新增区间规则,比如一个数据需要以某种特定字段开头为标识、一个数据的第一段和第二段之间需要有特定的推导关系等。The configuration file also includes a series of fuzzy testing rules, and the fuzzy testing rules specify the number, type and value range of input parameters for one or more tests. In addition, the fuzzing test rules can also add interval rules for each parameter, such as a data needs to start with a specific field as an identifier, a specific derivation relationship between the first segment and the second segment of a data, etc.
当根据配置文件生成测试用例时,还包括使用GoSDK发出测试指令,根据模糊测试规则以测试用例对待测区块链集群执行模糊测试;When generating test cases according to the configuration file, it also includes using GoSDK to issue test instructions, and perform fuzzing tests on the blockchain cluster to be tested with test cases according to the fuzzing test rules;
模糊测试具体包括,根据模糊测试规则生成模糊测试参数,以模糊测试参数生成若干分裂测试用例。Specifically, fuzz testing includes generating fuzz test parameters according to fuzz test rules, and generating several split test cases with the fuzz test parameters.
这一步骤分为两方面进行,第一方面,根据测试用例的传入参数进行参数解析。参数解析时采用了泛型的模式,举例说明:如果需要输入两个数据进行比大小,那么这两个数据的类型需要是相同的,也即都是int或者float类型。而在参数解析时传入参数不能直接使用某个类型,而是使用一个泛型T,它可以接收任意类型的参数。This step is divided into two aspects. In the first aspect, parameter parsing is performed according to the incoming parameters of the test case. Generic mode is used for parameter parsing. For example: if two data need to be input for size comparison, the two data types must be the same, that is, both are of int or float type. In parameter parsing, the incoming parameters cannot directly use a certain type, but use a generic T, which can receive parameters of any type.
第二方面,需要读取模糊测试规则,根据模糊测试规则先检查传入参数是否符合要求,当检查通过后,进行用例分裂,使用符合要求的多组传入参数分别生成一个分裂测试用例。In the second aspect, it is necessary to read the fuzzing test rules. According to the fuzzing testing rules, first check whether the incoming parameters meet the requirements. After the inspection is passed, use case splitting is performed, and multiple sets of incoming parameters that meet the requirements are used to generate a split test case.
使用GoSDK发出测试指令,以上述生成的多个分裂测试用例额分别对待测区块链集群进行测试,从而使用模糊测试根据规则所生成的生成各式各样不同的参数执行脚本,返回结果。并当脚本运行失败时,展示相关调用栈及数据报错信息。Use GoSDK to issue test instructions, test the blockchain cluster to be tested with the multiple split test cases generated above, and then use the fuzz test to generate various parameters according to the rules to execute the script and return the result. And when the script fails to run, the relevant call stack and data error information will be displayed.
上述改进方法为本发明的方法增加了模糊测试过程,以一定的分裂模式生成指定字段总长度、区间规则等规格的测试输入参数,解决了传统区块链测试方法中仅能人工设定测试输入参数的缺陷。以模糊生成的符合规格的测试输入参数进行大批量测试,能够有效测试区块链系统的载荷及测定功能的数据参数边界,提供了区块链系统测试的自动化程度和可扩展性。The above-mentioned improved method adds a fuzzy testing process to the method of the present invention, and generates test input parameters with specifications such as the total length of the specified field and interval rules in a certain split mode, and solves the problem that the traditional block chain test method can only manually set the test input parameters. Parameter flaws. Using fuzzy-generated test input parameters that meet the specifications for mass testing can effectively test the load of the blockchain system and the data parameter boundaries of the measurement function, providing automation and scalability of the blockchain system test.
在本申请的另一些实施例中,对方法还做如下改进:In other embodiments of the present application, the method is further improved as follows:
在根据配置文件生成测试用例时,同时为每个测试用例设置用例等级。When generating test cases according to the configuration file, set the use case level for each test case at the same time.
进一步的,用例等级可以以如下两种方法设置:Further, the use case level can be set in the following two ways:
每个测试用例都有测试名,通过规划好指定的测试名进行用例等级区分,比如规定每个测试用例的用例名后缀加上对应的等级。在运行测试用例时根据用例名进行判断,不属于该等级范围的跳过即可。Each test case has a test name, and the use case level is distinguished by planning the specified test name, such as specifying the suffix of the use case name of each test case plus the corresponding level. Judgment is made based on the test case name when running the test case, and those that do not belong to the scope of this level can be skipped.
或者,在生成测试用例时通过注解的形式标注好对应等级,然后在运行用例时,于运行的测试命令里设置筛选测试用例等级的可选参数,用来判断是否运行各个等级的用例。Or, mark the corresponding level in the form of annotations when generating test cases, and then set optional parameters for filtering test case levels in the running test command when running test cases to determine whether to run use cases of each level.
以测试用例对待测区块链集群执行测试,根据用例等级优先以高用例等级或低用例等级的测试用例对待测区块链集群执行测试,或选取某一用例等级范围,仅以处于该用例等级范围的测试用例对待测区块链集群执行测试。Execute the test on the blockchain cluster to be tested with the test case, and perform the test on the blockchain cluster to be tested with the test case of the high or low use case level according to the use case level, or select a certain level range of the use case, only the level of the use case The scope of the test cases executes the tests on the blockchain cluster under test.
在日常测试活动的执行中,如果发现产品的功能问题,开发人员会做相应的修复,然后重写跑用例进行验证。但在这一过程中,开发人员的修复又可能会引起新的问题,假设运行所有的脚本需要花费6个小时,那么需要等待验证的成本就比较高。而上述用例等级的划分在编写测试用例的过程中,将某个测试用例设置一定的级别,在运行测试用例时,可以指定仅某些级别的测试用例运行或者运行全量用例。因此可以在每项开发修复后先运行一些冒烟用例(即比较重要的基本功能用例),以验证其基本的正确性,这样大大的缩短等待验证的时间。等多个开发的修复都通过后,再统一运行全量用例,然后循环迭代。During the execution of daily testing activities, if a functional problem of the product is found, the developer will make corresponding repairs, and then rewrite and run the use cases for verification. But in the process, developers' fixes may cause new problems. Assuming that it takes 6 hours to run all the scripts, the cost of waiting for verification is relatively high. In the process of writing test cases, a test case is set to a certain level. When running test cases, it can be specified that only certain levels of test cases are run or all test cases are run. Therefore, you can run some smoking use cases (that is, more important basic functional use cases) after each development fix to verify its basic correctness, which greatly shortens the waiting time for verification. After the repairs of multiple developments have passed, run the full number of use cases in a unified manner, and then iterate in a loop.
上述改进方法为测试用例分别设置了用例等级,在执行测试时可以根据用例等级的高低以一定优先度执行测试用例、或指定某个用例等级范围执行测试用例,从而减少测试产品开发及修改的等待验证时间,提高测试效率。The above improved method sets the use case level for the test case respectively. When executing the test, the test case can be executed with a certain priority according to the level of the use case, or a certain level range of the use case can be specified to execute the test case, thereby reducing the waiting time for test product development and modification Verification time, improve test efficiency.
另外,作为一个更优的改进方案,在本申请的某些实施例中,本申请的方法同时具有上述增加了模糊测试过程和为每个测试用例设置用例等级并分别执行的改进,在以随机生成的大批量分裂测试用例对区块链集群进行测试的基础上为分裂测试用例设置用例等级,并按照用例等级分别执行分裂测试用例。结合上述两种改进的方法能够进行批量测试的同时减少测试消耗时间,从而得到更好的测试效率。In addition, as a better improvement solution, in some embodiments of the present application, the method of the present application has the above-mentioned improvement of adding the fuzzing test process and setting the use case level for each test case and executing them separately. Based on the large batch of split test cases generated to test the blockchain cluster, the use case level is set for the split test case, and the split test cases are respectively executed according to the use case level. Combining the above two improved methods can perform batch testing while reducing test consumption time, thereby obtaining better testing efficiency.
第二方面,本发明还提供一种基于Go语言的区块链集成测试系统,用于执行上述方法对区块链集群进行集成测试,其系统结构框图如图3所示,包括:In the second aspect, the present invention also provides a block chain integration testing system based on Go language, which is used to perform the above method to carry out integration testing of block chain clusters, and its system structure diagram is shown in Figure 3, including:
配置模块,用于指定GoSDK依赖,并获取配置文件的输入参数,根据输入参数初始化配置文件。The configuration module is used to specify GoSDK dependencies, obtain the input parameters of the configuration file, and initialize the configuration file according to the input parameters.
节点部署模块,用于根据配置文件确定待测区块链集群,使用GoSDK发出部署指令,部署待测区块链集群的各个节点,生成待测区块链集群。节点部署模块还设有外置调用接口与检测探针,外置调用接口用于调用外置存储的区块链节点,检测探针用于在区块链节点中放置检测点。The node deployment module is used to determine the blockchain cluster to be tested according to the configuration file, use GoSDK to issue deployment instructions, deploy each node of the blockchain cluster to be tested, and generate a blockchain cluster to be tested. The node deployment module is also provided with an external call interface and a detection probe, the external call interface is used to call the blockchain node stored externally, and the detection probe is used to place a detection point in the blockchain node.
测试计划模块,用于根据配置文件生成测试用例。测试计划模块能够生成组成测试用例的各种脚本调度策略,基于上述方法中测试用例等级的改进,测试计划模块还能够为生成的测试用例设置用例等级。Test plan module for generating test cases based on configuration files. The test planning module can generate various script scheduling strategies that make up the test cases. Based on the improvement of the test case level in the above method, the test planning module can also set the use case level for the generated test cases.
脚本执行模块,能够生成测试套件、自定义断言、数据驱动生成器,并对执行的脚本进行版本控制。脚本执行模块用于使用GoSDK发出测试指令,以测试用例对待测区块链集群执行测试;Script execution module capable of generating test suites, custom assertions, data-driven generators, and versioning executed scripts. The script execution module is used to issue test instructions using GoSDK to execute tests on the blockchain cluster to be tested with test cases;
日志模块,用于收集测试日志及统计结果。在某些实施例中,日志模块包括allure监听器、日志格式转换器、结果分析、日志展示插件。The log module is used to collect test logs and statistical results. In some embodiments, the log module includes an allure listener, a log format converter, a result analysis, and a log display plug-in.
本发明的基于Go语言实现的测试系统,能够应用上述方法完成对区块链系统的节点、网络、共识、合约、存储、密码学的测试。利用Go语言与区块链集群的适配性,以较高性能完成区块链集群的测试任务,且调用过程无需中转,减少了测试系统的维护成本。The test system implemented based on the Go language of the present invention can apply the above method to complete the tests of the nodes, network, consensus, contract, storage, and cryptography of the blockchain system. Utilizing the adaptability of the Go language and the blockchain cluster, the test tasks of the blockchain cluster are completed with high performance, and the calling process does not need to be transferred, which reduces the maintenance cost of the test system.
与上述模糊测试方法的改进相对应的,在本申请的某些实施例中,脚本执行模块还包括规则解析模块、用例生成模块和模糊测试模块;Corresponding to the improvement of the above-mentioned fuzz testing method, in some embodiments of the present application, the script execution module further includes a rule analysis module, a use case generation module and a fuzz testing module;
规则解析模块用于解析配置文件,生成模糊测试规则,模糊测试规则指定了某一或多项测试的输入参数个数、种类及值范围;The rule parsing module is used to parse configuration files and generate fuzzy test rules. The fuzzy test rules specify the number, type and value range of input parameters for one or more tests;
用例生成模块用于根据模糊测试规则生成模糊测试参数,以模糊测试参数生成若干分裂测试用例;The use case generation module is used to generate fuzzy test parameters according to the fuzzy test rules, and generate several split test cases with the fuzzy test parameters;
模糊测试模块用于使用GoSDK发出测试指令,以若干分裂测试用例分别对待测区块链集群进行测试。The fuzzing test module is used to issue test instructions using GoSDK, and test the blockchain cluster to be tested with several split test cases.
与上述方法中的模糊测试改进相似,在脚本执行模块中设置规则解析模块、用例生成模块和模糊测试模块为本测试系统增加了模糊测试的能力,以一定的分裂模式生成指定字段总长度、区间规则等规格的测试输入参数,解决了传统区块链测试系统仅能人工设定测试输入参数的缺陷。以模糊生成的符合规格的测试输入参数进行大批量测试,能够有效测试区块链系统的载荷及测定功能的数据参数边界,提供了区块链系统的自动化程度和可扩展性。Similar to the fuzz test improvement in the above method, setting the rule analysis module, use case generation module and fuzz test module in the script execution module adds the ability of fuzz test to the test system, and generates the total length and interval of the specified field in a certain split mode Standard test input parameters such as rules solve the defect that traditional blockchain test systems can only manually set test input parameters. Using fuzzy-generated test input parameters that meet the specifications for mass testing can effectively test the load of the blockchain system and the data parameter boundaries of the measurement function, providing the automation and scalability of the blockchain system.
本发明上述的方法及系统基于Go设置,能够利用GoSDK无需调用直接对区块链系统的节点、网络、共识、合约、存储、密码学进行测试,减少了测试过程中远程调用命令中转至其他语言对效率的损耗,同时减少了系统维护所消耗的人工成本。The above-mentioned method and system of the present invention are based on Go settings, and can use GoSDK to directly test the nodes, network, consensus, contract, storage, and cryptography of the blockchain system without calling, reducing the need for remote call commands to be transferred to other languages during the test process The loss of efficiency, while reducing the labor cost of system maintenance.
其次,本发明的方法和系统还利用Go语言的特性及其与区块链系统的适配性,实现了Python语言难以实现的用例生成及模糊测试功能,能够便利地直接生成符合规格的测试输入参数,并用这些测试输入参数进行大批量测试,能够有效测试区块链系统的载荷及测定功能的数据参数边界,提供了区块链系统测试的自动化程度和可扩展性。Secondly, the method and system of the present invention also utilize the characteristics of the Go language and its adaptability to the blockchain system to realize the use case generation and fuzzy testing functions that are difficult to implement in the Python language, and can conveniently and directly generate test inputs that meet the specifications Parameters, and use these test input parameters to conduct mass testing, which can effectively test the load of the blockchain system and the data parameter boundaries of the determination function, and provide the automation and scalability of the blockchain system test.
另外,本发明的方法和系统还能够在测试时根据用例等级划分测试优先度,可以在开发或修复过程中先运行一些冒烟用例(即比较重要的基本功能用例),以验证其基本的正确性,大大缩短等待验证的时间。与上述方法及系统的模糊测试功能结合,能够在兼具测试速度的同时进行大批量测试。In addition, the method and system of the present invention can also divide the test priority according to the use case level during the test, and can run some smoke use cases (that is, more important basic function use cases) in the development or repair process to verify their basic correctness. performance, greatly shortening the waiting time for verification. Combined with the above-mentioned method and the fuzzing test function of the system, it is possible to perform large-scale testing while maintaining testing speed.
本领域的技术人员可以清楚地了解到本申请实施例的技术方案可借助软件和/或硬件来实现。本说明书中的“单元”是指能够独立完成或与其他部件配合完成特定功能的软件和/或硬件,其中硬件例如可以是现场可编程门阵列(Field-Programmable GateArray,FPGA)、集成电路(Integrated Circuit,IC)等。Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented by means of software and/or hardware. The "unit" in this specification refers to the software and/or hardware that can complete specific functions independently or in cooperation with other components. Circuit, IC), etc.
本申请的实施例还提供了一种电子设备,包括至少一个处理器、至少一个存储器及存储在存储器上并可在处理器上运行的计算机程序。The embodiment of the present application also provides an electronic device, including at least one processor, at least one memory, and a computer program stored in the memory and operable on the processor.
其中,处理器可以包括一个或者多个处理核心。处理器利用各种接口和线路连接整个电子设备内的各个部分,通过运行或执行存储在存储器内的指令、程序、代码集或指令集,以及调用存储在存储器内的数据,执行各种功能和处理数据。可选的,处理器可以采用DSP、FPGA、PLA中的至少一种硬件形式来实现。处理器可集成CPU、GPU和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示屏所需要显示的内容的渲染和绘制。Wherein, the processor may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions and functions by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Data processing. Optionally, the processor may be implemented in at least one hardware form among DSP, FPGA, and PLA. The processor can integrate one or a combination of CPU, GPU, and modem. Among them, the CPU mainly processes the operating system, user interface and application programs, etc.; the GPU is responsible for rendering and drawing the content that needs to be displayed on the display screen.
其中,存储器可以包括RAM,也可以包括ROM。可选的,该存储器包括非瞬时性计算机可读介质。存储器可用于存储指令、程序、代码、代码集或指令集。存储器可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现上述各个方法实施例的指令等;存储数据区可存储上面各个方法实施例中涉及到的数据等。存储器可选的还可以是至少一个位于远离前述处理器的存储装置。作为一种计算机存储介质的存储器中可以包括操作系统、网络通信模块、用户接口模块以及上述集成测试的应用程序。Wherein, the memory may include RAM or ROM. Optionally, the memory includes non-transitory computer readable media. Memory may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing the operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), user Instructions and the like for implementing the above method embodiments; the storage data area can store the data and the like involved in the above method embodiments. Optionally, the memory may also be at least one storage device located away from the aforementioned processor. The memory as a computer storage medium may include an operating system, a network communication module, a user interface module, and the application program for the above-mentioned integration test.
本申请还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述任意实施例中各个方法的步骤。其中,计算机可读存储介质可以包括但不限于任何类型的盘,包括软盘、光盘、DVD、CD-ROM、微型驱动器以及磁光盘、ROM、RAM、EPROM、EEPROM、DRAM、VRAM、闪速存储器设备、磁卡或光卡、纳米系统(包括分子存储器IC),或适合于存储指令和/或数据的任何类型的媒介或设备。The present application also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of each method in any of the foregoing embodiments are implemented. Among them, the computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disk, optical disk, DVD, CD-ROM, microdrive, and magneto-optical disk, ROM, RAM, EPROM, EEPROM, DRAM, VRAM, flash memory device , magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and/or data.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Depending on the application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by this application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些服务接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or can be Integrate into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some service interfaces, and the indirect coupling or communication connection of devices or units may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described 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 may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的实施例还提供了一种计算机程序产品,当其在计算机上运行时,使得计算机执行并实现上述方法实施例中的全部或部分流程。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the embodiments of the present application also provide a computer program product, which, when run on a computer, causes the computer to execute and implement all or part of the procedures in the above method embodiments.
这一实现可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,该计算机程序包括计算机程序代码,该计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。该计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、ROM(Read-Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、CD-ROM(Compact Disc Read-Only Memory,只读光盘)、磁带、软盘和光数据存储设备等。本申请提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。This realization can be accomplished by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be realized. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program codes to the camera device/terminal device, recording medium, computer memory, ROM (Read-Only Memory, read-only memory), RAM (Random Access Memory , random access memory), CD-ROM (Compact Disc Read-Only Memory, CD-ROM), magnetic tape, floppy disk and optical data storage devices, etc. The computer-readable storage medium mentioned in this application may be a non-volatile storage medium, in other words, may be a non-transitory storage medium.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
以上所述者,仅为本公开的示例性实施例,不能以此限定本公开的范围。即但凡依本公开教导所作的等效变化与修饰,皆仍属本公开涵盖的范围内。本领域技术人员在考虑说明书及实践这里的公开后,将容易想到本公开的其实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未记载的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的范围和精神由权利要求限定。What is described above is only an exemplary embodiment of the present disclosure, and should not limit the scope of the present disclosure. That is, all equivalent changes and modifications made according to the teachings of the present disclosure still fall within the scope of the present disclosure. Embodiments of the present disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application intends to cover any modification, use or adaptation of the present disclosure. These modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not described in the present disclosure. . The specification and examples are to be considered exemplary only, with the scope and spirit of the present disclosure defined by the claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211619412.4A CN115934546A (en) | 2022-12-16 | 2022-12-16 | A blockchain integration testing method and system based on Go language |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211619412.4A CN115934546A (en) | 2022-12-16 | 2022-12-16 | A blockchain integration testing method and system based on Go language |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115934546A true CN115934546A (en) | 2023-04-07 |
Family
ID=86648746
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211619412.4A Pending CN115934546A (en) | 2022-12-16 | 2022-12-16 | A blockchain integration testing method and system based on Go language |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115934546A (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2020233073A1 (en) * | 2019-05-23 | 2020-11-26 | 深圳壹账通智能科技有限公司 | Blockchain environment test method, device and apparatus, and storage medium |
| CN113204765A (en) * | 2021-04-27 | 2021-08-03 | 交叉信息核心技术研究院(西安)有限公司 | Method and system for testing HyperLegger Fabric chain code |
| CN114385488A (en) * | 2021-12-17 | 2022-04-22 | 杭州趣链科技有限公司 | Blockchain testing method, device, equipment and storage medium |
-
2022
- 2022-12-16 CN CN202211619412.4A patent/CN115934546A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2020233073A1 (en) * | 2019-05-23 | 2020-11-26 | 深圳壹账通智能科技有限公司 | Blockchain environment test method, device and apparatus, and storage medium |
| CN113204765A (en) * | 2021-04-27 | 2021-08-03 | 交叉信息核心技术研究院(西安)有限公司 | Method and system for testing HyperLegger Fabric chain code |
| CN114385488A (en) * | 2021-12-17 | 2022-04-22 | 杭州趣链科技有限公司 | Blockchain testing method, device, equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106940428B (en) | Chip verification method, device and system | |
| US20190065351A1 (en) | System and method for providing a test manager for use with a mainframe rehosting platform | |
| CN112306887B (en) | Program testing distribution method and its corresponding devices, equipment and media | |
| CN111240955A (en) | Automatic testing method and device for Http interface, storage medium and electronic device | |
| CN111767226A (en) | Method, system and equipment for testing cloud computing platform resources | |
| CN116089275A (en) | Database testing method, database system, electronic equipment and storage medium | |
| CN111309297B (en) | Script development system and method | |
| CN108874441B (en) | Board card configuration method, device, server and storage medium | |
| CN101634965B (en) | Method for testing Linux kernel-grade unit | |
| CN110750445A (en) | Method, system and equipment for testing high-availability function of YARN component | |
| US8997048B1 (en) | Method and apparatus for profiling a virtual machine | |
| CN114546749A (en) | Chip random test case regression method, device, equipment and readable medium | |
| CN107122307A (en) | A kind of Internet of Things execution system | |
| CN114490337A (en) | Commissioning method, commissioning platform, equipment and storage medium | |
| CN118519920A (en) | Automatic test method, device, equipment and storage medium | |
| CN115934546A (en) | A blockchain integration testing method and system based on Go language | |
| CN114647565A (en) | Android project test method, storage medium and electronic equipment | |
| CN106656684B (en) | Grid resource reliability monitoring method and device | |
| CN115794577A (en) | Recording method, device, medium, equipment and system of automatic test script | |
| CN115034164A (en) | Verification method, electronic device, and storage medium | |
| CN114416584A (en) | Information processing method and device for automated testing | |
| CN115114101B (en) | Link testing method, device, system and storage medium | |
| CN114461525B (en) | Configuration interface automatic testing method, device, electronic equipment and storage medium | |
| CN114968270B (en) | Deployment method and system for heterogeneous server clusters for hyperledger blockchain | |
| CN117933155B (en) | A multi-process joint simulation system and method, electronic device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |