Method and apparatus for developing functional test method of system
By generating test configuration files to define the calling relationships and data formats of functional blocks, the problem of low efficiency in functional block testing in complex development projects is solved, realizing efficient functional testing and development, and is suitable for application architectures with multiple programming languages.
Patent Information
- Application Number
- CN202310101268.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-20
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-01-20
AI Technical Summary
Existing functional block testing methods affect developers' development efficiency and have high time costs, especially in complex development projects with layered decoupling and numerous functional blocks. Frequent deployment of functional environments and high learning costs of dependent functional blocks, as well as integration testing being limited by work schedules.
By obtaining the user's functional test request, a test configuration file is generated, defining the information of the functional blocks and their calling relationships, and processing the raw data packets according to the configuration file, the test results of the function to be tested are obtained, thus realizing the organic connection of different functional blocks.
It improves developers' coding efficiency, reduces the need for in-depth learning of existing code, adapts to application architectures with multiple programming languages, and enables efficient functional testing.
Smart Images

Figure CN116185848B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a function test method and device of development system. BACKGROUND
[0002] For some complex development projects with hierarchical decoupling and numerous function blocks, it usually needs to go through development phase, compilation phase and test running phase. In the development phase, different developers usually develop each function block independently, and the development languages of each function block are also different. In the compilation phase, each function block is integrated into a complete system. In the test running phase, the integrated system is tested and run in a function environment and a production environment. Among them, in the development phase, if a developer wants to develop or test his own function, but the function needs to depend on other function blocks, the following solutions can be taken: 1) test in a function environment. 2) run the dependent function block in a development environment. 3) find the corresponding function block developer for joint debugging.
[0003] The above three solutions hinder the coding efficiency of the developer: 1) The compilation and deployment of the function environment and the running of the whole system need to spend unnecessary time, which is not suitable for frequent and large modifications in the development phase; and frequent deployment will affect the testing of others. 2) The learning cost of the dependent function block is increased, and sometimes the dependent function block also depends on other function blocks or the coding languages are not the same, which further increases the learning cost. 3) Joint debugging is limited by the work schedule arrangement of both parties, which increases the unnecessary waiting time and cannot support long-term continuous testing.
[0004] As can be seen, the existing function block test method affects the development efficiency of the developer and has high time cost. SUMMARY
[0005] In order to solve the problems in the prior art, in a first aspect, the present application provides a function test method of development system, comprising:
[0006] obtaining a function test request of a user, the function test request comprising a to-be-tested function, an original data packet, a function test step and an execution order of each function test step;
[0007] generating a corresponding test configuration file according to the function test step and the execution order of each function test step, the test configuration file comprising information of a plurality of function blocks and a calling relationship thereof;
[0008] processing the original data packet according to the test configuration file to obtain a test result of the to-be-tested function.
[0009] In an embodiment, the obtaining of the function test request of the user comprises:
[0010] Obtaining a test file uploaded by a user on a test page and parsing to obtain a function to be tested, an original data packet, a function test step and an execution order of each function test step.
[0011] In an embodiment, the obtaining of the function test request of the user comprises:
[0012] Obtaining a parameter file uploaded by a user on a test page and parsing to obtain a function to be tested and an original data packet;
[0013] Receiving a graphical configuration instruction of a user on a test page, and determining a function test step and an execution order of each function test step according to the graphical configuration instruction.
[0014] In an embodiment, the generating of a corresponding test configuration file according to the function test step and the execution order of each function test step comprises:
[0015] Determining a plurality of function blocks required according to the function test step; the function block is a pre-developed module for executing a specific function;
[0016] Determining a calling order between the plurality of function blocks according to the execution order of each function test step;
[0017] Generating the test configuration file according to a function name, a parameter packet file and an interface packet file corresponding to each function block and the calling order.
[0018] In an embodiment, the processing of the original data packet according to the test configuration file to obtain a test result of the function to be tested comprises:
[0019] Building a function test module according to the plurality of function blocks and the calling order in the test configuration file; the function test module comprises a start function block, an intermediate function block and an end function block;
[0020] Inputting the original data packet into the function test module to obtain the test result of the function to be tested.
[0021] In an embodiment, each function block is configured with a start function and an end function.
[0022] The calling step of each function block comprises:
[0023] Parsing a calling request packet received by a target function block to obtain an input parameter; when the target function block is a start function block, the calling request packet is generated by a user, and when the target function block is not a start function block, the calling request packet is generated by a previous function block.
[0024] transmitting the input parameter to a start function of the target function block to trigger the target function block;
[0025] transmitting an output result of the target function block formed for the input parameter to an end function of the target function block to be packaged and output.
[0026] In an embodiment, the calling request package is a preset unified format.
[0027] In a second aspect, the present application provides a function test device of a development system, comprising:
[0028] a function test request obtaining module, configured to obtain a function test request of a user, the function test request comprising a function to be tested, an original data package, function test steps and execution orders of the function test steps;
[0029] a test configuration file generating module, configured to generate a corresponding test configuration file according to the function test steps and the execution orders of the function test steps, the test configuration file comprising information of a plurality of function blocks and calling relationships thereof;
[0030] a test result generating module, configured to process the original data package according to the test configuration file to obtain a test result of the function to be tested.
[0031] In an embodiment, the function test request obtaining module is specifically configured to:
[0032] obtain a test file uploaded by a user on a test page and parse to obtain the function to be tested, the original data package, the function test steps and the execution orders of the function test steps.
[0033] In an embodiment, the function test request obtaining module is specifically configured to:
[0034] obtain a parameter file uploaded by a user on a test page and parse to obtain the function to be tested and the original data package;
[0035] receive a graphical configuration instruction of a user on a test page and determine the function test steps and the execution orders of the function test steps according to the graphical configuration instruction.
[0036] In an embodiment, the test configuration file generating module comprises:
[0037] a function block determining unit, configured to determine a plurality of function blocks required according to the function test steps; the function block is a module developed in advance for executing a specific function;
[0038] a calling order determining unit, configured to determine a calling order between the plurality of function blocks according to the execution orders of the function test steps;
[0039] The test configuration file generation unit is configured to generate the test configuration file according to the function names, the parameter package files and the interface package files of the function blocks and the calling sequence.
[0040] In an embodiment, the test result generation module is specifically configured to:
[0041] According to the function blocks and the calling sequence in the test configuration file, a function test module is built, and the function test module includes a start function block, an intermediate function block and an end function block.
[0042] The original data package is input into the function test module to obtain the test result of the function to be tested.
[0043] In an embodiment, each function block is configured with a start function and an end function.
[0044] The test result generation module specifically includes:
[0045] A request package analysis unit is configured to analyze a calling request package received by a target function block to obtain input parameters; when the target function block is a start function block, the calling request package is generated by a user, and when the target function block is not a start function block, the calling request package is generated by a previous function block.
[0046] A function block calling unit is configured to transmit the input parameters to a start function of the target function block to trigger the target function block.
[0047] An output unit is configured to transmit an output result formed by the target function block for the input parameters to an end function of the target function block for packaging and output.
[0048] In an embodiment, the calling request package is in a preset uniform format.
[0049] In a third aspect, the present application provides a computer device, including a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the function test method of any development system provided by the present application when executing the computer program.
[0050] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the function test method of any development system provided by the present application.
[0051] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, and the computer program, when executed by a processor, implements the function test method of any of the development systems provided by the present application.
[0052] The function test method and device of the development system provided by the present application realize the organic connection of different function blocks by analyzing the calling relationship and data format of the configured function blocks, and the developer only needs to complete the configuration and define the data access conversion function, so that the stock code without deep learning can be regarded as a black box for realizing specific functions and outputting required results, which makes the development more focused on specific function writing and improves the efficiency. The technical solution has universality and excellent adaptability to application architectures of multiple programming languages. BRIEF DESCRIPTION OF DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings. In the drawings:
[0054] Figure 1 A schematic diagram of the function test method of the development system provided by the present application.
[0055] Figure 2 Another schematic diagram of the function test method of the development system provided by the present application.
[0056] Figure 3 Another schematic diagram of the function test method of the development system provided by the present application.
[0057] Figure 4 Another schematic diagram of the function test method of the development system provided by the present application.
[0058] Figure 5 A schematic diagram of the test configuration file provided by the present application.
[0059] Figure 6 A schematic diagram of the function test device of the development system provided by the present application.
[0060] Figure 7 Another schematic diagram of the function test device of the development system provided by the present application.
[0061] Figure 8 Another schematic diagram of the function test device of the development system provided by the present application.
[0062] Figure 9A schematic diagram of a computer device is provided for the present application. DETAILED DESCRIPTION
[0063] To make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application are further described in detail below with reference to the drawings. Herein, the schematic embodiments of the present application and the descriptions thereof are used to explain the present application, but not as a limitation of the present application.
[0064] It should be noted that the function test method and device of the development system of the present application can be used in the field of computer technology, and can also be used in any field other than the field of computer technology. The application of the function test method and device of the development system of the present application is not limited.
[0065] In a first aspect, the present application provides a function test method of a development system, as shown in the following. Figure 1 The method comprises the following steps:
[0066] Step S101: Obtain a function test request of a user.
[0067] In this step, the function test request is a request initiated by the user to implement a specific function test. The function test request includes the name of the function to be tested, the original data packet, the function test steps and the execution order of each function test step. The original data packet is, for example, the initial input data of the function to be tested. The function test steps are processing steps defined by the user to implement the function to be tested. The function test steps and the execution order are determined in advance by the user in a format that can be parsed and recognized by the execution subject.
[0068] In the development process of a complex framework, different functional modules may be developed by different developers, and even different functional modules need to use different programming languages. For a function to be tested, it is usually difficult to implement only by one functional module, but needs to rely on the cooperation of multiple functional modules to implement. The division of the function test steps of the present application is based on the functions implemented by each functional module. The functions executed continuously by the same functional module are divided into one function test step.
[0069] Step S102: Generate a corresponding test configuration file according to the function test steps and the execution order of each function test step.
[0070] The test configuration file defines information of a plurality of function blocks and a calling relationship thereof. The function blocks are determined according to function test steps in the function test request, and one function test step corresponds to one function block. The calling relationship of the function blocks is determined by an execution order of the function test steps, and a function block corresponding to a later function test step is called by a function block corresponding to a previous function test step. One function block can call only one function block or simultaneously call a plurality of function blocks. Similarly, one function block can be called by only one function block or simultaneously called by a plurality of function blocks.
[0071] In step S103, the original data packet is processed according to the test configuration file to obtain a test result of the function to be tested.
[0072] The test configuration file defines the function blocks and the calling relationship thereof. The original data packet is input into a first function block for processing, and the remaining function blocks are sequentially called according to the calling relationship of the function blocks, and a test result is output by a last function block.
[0073] It can be seen that the application provides a method for implementing specific function test by linking different function blocks. A developer does not need to deeply learn stock codes, but only needs to complete configuration and define data access and format conversion functions, and uses the function blocks as black boxes to implement function test.
[0074] In an embodiment, in step S101, the function test request of the user is obtained by:
[0075] A test file uploaded by the user on a test page is obtained, and a function to be tested, an original data packet, function test steps, and an execution order of the function test steps are parsed.
[0076] This embodiment limits the user to send a function test request to an execution subject by uploading a test file. The execution subject can obtain each data in the function test request by parsing the test file.
[0077] For example, the user writes information such as a function name to be tested, an original data packet, function test steps, and an execution order of the function test steps into a test file according to a preset format. For example, the user fills in a uniformly defined file template according to a corresponding rule to generate a test file. The rule defines fields to be filled in the template, a field filling format, and the like. The types of the template include, but are not limited to,.xml,.js,.json,.xlsx,.doc, and the like, which can be set by a developer, and the application does not limit this.
[0078] The user uploads the generated test file on a test page, which is equivalent to that the user sends a function test request to an execution subject.
[0079] In one embodiment, the process of obtaining the user's functional test request includes:
[0080] Obtain the parameter file uploaded by the user on the test page, and parse it to obtain the function to be tested and the original data packet;
[0081] Receive graphical configuration instructions from the user on the test page, and determine the functional test steps and the execution order of each functional test step based on the graphical configuration instructions.
[0082] This embodiment defines an alternative method for users to send functional test requests to the execution entity. Unlike the previous embodiment, in this embodiment only the function to be tested and the original data package need to be uploaded in the form of a parameter file. The functional test steps and the execution order of each functional test step are configured on the test page through drag-and-drop, connection, and other operations.
[0083] For example, the test page is a visual interface with a module selection area and a module editing area. The module selection area provides visual representations of each functional module. Users can add the desired visual representation to the module editing area by dragging and dropping, and connect visual representations of functional modules with calling relationships using connecting lines. The connecting lines have one-way arrows indicating the execution order of the functional test steps, i.e., the calling relationship between the functional modules. Each visual representation has an editable button; users can click this button to configure the name, interface parameters, and interface functions of the corresponding functional module.
[0084] When users upload files and edit visual graphics and connecting lines on the test page, it's equivalent to sending a functional test request to the execution entity.
[0085] In one embodiment, such as Figure 2 As shown, step S102 involves generating a corresponding test configuration file based on the functional test steps and their execution order, including:
[0086] Step S1021: Determine the required multiple functional blocks according to the functional testing steps; the functional blocks are pre-developed modules for performing specific functions.
[0087] Specifically, as mentioned earlier, the functional test steps in this application are user-defined processing steps required to implement the function under test. The functional test steps and their execution order are pre-determined by the user in a format that the executing entity can parse and recognize. Each functional test step corresponds to a functional block. The user defines each functional test step in the functional test request according to the prescribed format and content. For example, a unique number for each functional block can be used to represent the functional test step executed by that block. Thus, after the executing entity parses the field content of the functional test steps, it can uniquely identify a functional block based on the unique number.
[0088] In step S1022, the calling sequence between the plurality of function blocks is determined according to the execution sequence of the function test steps.
[0089] Specifically, the user sets the execution sequence of the function test steps in the function test request. Since the function test steps correspond to the function blocks, the execution sequence of the function test steps is related to the calling sequence of the function blocks. For example, the function test step A corresponds to the function block a, the function test step B corresponds to the function block b, the function test step C corresponds to the function block c, the function test step D corresponds to the function block d, and the function test step E corresponds to the function block e. The execution sequence of the function test steps is function test step A, function test step B, function test step C, function test step D, and function test step E in sequence. The calling sequence of the function blocks is function block a, function block b, function block c, function block d, and function block e in sequence. In the above example, the function blocks are in series.
[0090] In another example, the function test step A corresponds to the function block a, the function test step B corresponds to the function block b, the function test step C corresponds to the function block c, the function test step D corresponds to the function block d, and the function test step E corresponds to the function block e. The execution sequence of the function test steps is function test step A first, function test step B second, function test step C and function test step D simultaneously third, and function test step E last. The calling sequence of the function blocks is function block a first, function block b second, function block c and function block d simultaneously third, and function block e last. In this example, the function block c and the function block d are in parallel.
[0091] In step S1023, the test configuration file is generated according to the function names corresponding to the function blocks, the parameter package file, the interface package file, and the calling sequence.
[0092] Each functional block and its calling order are determined through steps S1021 and S1022 above. The parameter package file and interface package file of the functional block are developed and generated together with the functional block; that is, when the developer develops the functional block, they also develop its corresponding parameter package file and interface package file. The parameter package file defines information such as the acquisition path of the functional block's input parameters and the storage path of the output parameters. When the functional block receives input parameters, it needs to convert the input parameters into the data format of the input parameters in the parameter package file. When the functional block obtains the processing result, it needs to convert the processing result into the data format of the output parameters in the parameter package file before outputting it. The interface package file is, for example, a Python format file, which defines calling function interfaces for various coding languages. The functional block can implement the corresponding function by calling the corresponding method through the function interface. The parameter package file and interface package file corresponding to the functional block can be configured when developing the functional block, or the user can configure them after determining the required functional blocks and their calling order. The test configuration file contains the functional block name, the corresponding parameter package file and interface package file of the functional block, and the calling order of each functional block.
[0093] In one embodiment, such as Figure 3 As shown, step S103 involves processing the original data packet according to the test configuration file to obtain the test result of the function under test, including:
[0094] Step S1031: Build a functional test module based on the multiple functional blocks and their calling order in the test configuration file.
[0095] Specifically, the test configuration file is an automatically generated file based on the functional test request. It defines the names of multiple functional blocks required for testing the function under test, the parameter package files and interface package files corresponding to each functional block, and the calling order of each functional block. The functional test module is constructed by building each functional block in the calling order and configuring it according to the parameter package files and interface package files corresponding to each functional block.
[0096] Step S1032: Input the original data packet into the functional test module to obtain the test result of the function to be tested.
[0097] The function test module defined in the step S1031 is composed of multiple function blocks. According to the calling sequence of the function blocks, the function test module can be divided into a start function block, intermediate function blocks and an end function block. The start function block corresponds to the first executed function test step and is the first called function block in the function test module. The end function block corresponds to the last executed function test step and is the last called function block in the function test module. The remaining function blocks are intermediate function blocks. It can be understood that, in the function test process, if only two function blocks are called, there is no intermediate function block. If there is only one function block, the function block is both the start function block and the end function block. The input data of the intermediate function blocks and the end function block is the processing result of the previous function block.
[0098] In the step S1032, the original data packet is input into the function test module, which is actually input into the start function block. The test result of the function under test is actually output by the end function block in the function test module.
[0099] The process of processing the original data packet by the function test module is the process of processing the original data packet by the function blocks in the function test module according to the test configuration file.
[0100] For example, it is assumed that the function test module includes a start function block for implementing function A, an intermediate function block for implementing function B, and an end function block for implementing function C. The process of processing the original data packet by the function test module is as follows: the start function block executes function A on the original data packet to obtain output result A corresponding to function A, and sends the output result A to the next function block, i.e., the intermediate function block in this example; the intermediate function block executes function B on the output result A to obtain output result B corresponding to function B; finally, the end function block executes function C on the output result B to obtain output result C. The output result C is the test result of the function under test obtained by processing the original data packet by the function test module.
[0101] The “output result” of the function block referred to in the present application refers to the result obtained by processing the corresponding input data by each function block. The processing result output by each function block is different depending on the specific function implemented by the function block. That is, the functions A, B and C include but are not limited to data screening function, function operation function (including but not limited to addition, multiplication, weighted summation, optimal solution, etc.), and the corresponding “output result” is the result after screening the input data, the operation result obtained by substituting the input data into the function, respectively.
[0102] In an embodiment, each function block is configured with a start function and an end function, and the start function and the end function are defined in the interface file package of the function block.
[0103] As shown in Figure 4 the calling step of each function block includes:
[0104] In step S201, the input parameters are obtained by parsing the calling request package received by the target function block.
[0105] The target function block of the embodiment represents the function block currently called, which can be a starting function block, an intermediate function block, or an ending function block. The calling request package refers to the request package for calling the target function block, and the calling request package is in a preset uniform format, so as to facilitate the target function block to parse the calling request package, and the calling request package contains the input parameters of the target function block.
[0106] When the target function block is a starting function block, the calling request package is generated by a user; when the target function block is an intermediate function block or an ending function block, the calling request package is generated by a previous function block. Considering that there are two function test steps executed simultaneously, the two function test steps are executed by two function blocks simultaneously, and the two function blocks generate calling request packages and send the calling request packages to the function blocks corresponding to the next function test step. That is, the function block can simultaneously receive the calling request packages from two function blocks.
[0107] In step S202, the input parameters are transmitted to the start function of the target function block, and the target function block is triggered.
[0108] After the target function block parses the calling request package to obtain the input parameters, since the calling request package is in a uniform format, the start function is first called to convert the format of the input parameters into a format that can be parsed by the coding language of the target function block, i.e., the format of the input parameters defined in the parameter file package of the target function block. Then, the target function block performs corresponding functions on the input parameters after the format conversion, so as to complete the function test step corresponding to the target function block and obtain the output result of the target function block.
[0109] In step S203, the output result formed by the target function block on the input parameters is transmitted to the end function of the target function block for packaging and output.
[0110] The data format of the processing result of the target function block is the output parameter format defined in the parameter file package of the target function block. To facilitate data processing by the next function block, the target function block needs to call the `end` function to convert the processing result into a preset unified format. If the target function block is the initial or intermediate function block, it will package the format-converted processing result and other calling information into a calling request package and output it to the next function block. If the target function block is the final function block, it will directly output the format-converted processing result as the test result of the function under test.
[0111] The functional testing method of the development system of this application will be further illustrated below with a specific example.
[0112] Suppose there is a functional test requirement for "numerical calculation". The user has an original data package and the user defines the functional test steps and their execution order as follows: (1) First, filter some data through a Python script; (2) Pass the filtered data to a Java data conversion framework for further processing and aggregation of the original data; (3) Use the first calculation module and the second calculation module to perform calculations on the processed and aggregated original data simultaneously and independently; (4) Compare the calculation results using the first calculation module and the calculation results using the second calculation module through a Python script and output the comparison results.
[0113] In this example, the user defined five functional test steps, involving five functional blocks; therefore, the test configuration file is as follows: Figure 5 As shown. Figure 5 The boxes in the diagram represent functional blocks; each box contains three lines of text, representing the name / function of the functional block, the definition of the parameter file, and the definition of the interface file. Taking the top box as an example, the first line of text "#python script to filter data" indicates the name / function of the functional block; the second line of text "Data_path:path1" indicates the path for obtaining the input parameters and the storage path for the output parameters of the functional block; and the third line of text "Processor:processor1.py" indicates the interface parameters and interface functions of the functional block. The other boxes are similar.
[0114] The unidirectional arrow between each block represents the calling relationship between the function blocks. The starting function block is "#python script filtering data", after the function block is called, the second function block "#java data conversion framework" is called to convert the data filtered by the starting function block. Then the function block "first calculation module" and the function block "second calculation module" are called at the same time, respectively calculating the data output by "#java data conversion framework". Finally, the function block "#python script for data comparison" is called to compare the calculation results of the function block "first calculation module" and the function block "second calculation module", and output the comparison result as the test result of the function test requirement "numerical calculation".
[0115] After the configuration is completed, the corresponding processor.py file needs to be provided to implement the start method and the end method. The start function of the function block "#python script filtering data" transmits the input parameter (original data packet) to the python script to filter the data, and packs and sends the processed data (processing result) of the python script to the storage path of the output parameter of "#python script filtering data" through the end function;
[0116] The start function of the function block "#java data conversion framework" obtains the processing result of the function block "#python script filtering data" from the storage path of the output parameter of "#python script filtering data" and puts it into the acquisition path of the input parameter of the function block "#java data conversion framework", and then starts the java process to process the data. The interface of the python calling java function is defined by the developer in advance, and the end function of the function block "#java data conversion framework" packs and sends the processing result of the function block to the storage path of the output parameter of "#java data conversion framework";
[0117] The start function of the function block "first calculation module" obtains the processing result of the function block "#java data conversion framework" from the storage path of the output parameter of "#java data conversion framework" and puts it into the acquisition path of the input parameter of the function block "first calculation module", and then starts the calculation process for data processing. The end function of the function block "first calculation module" packs and sends the processing result of the function block to the storage path of the output parameter of "first calculation module". Meanwhile, the start function of the function block "second calculation module" obtains the processing result of the function block "#java data conversion framework" from the storage path of the output parameter of "#java data conversion framework" and puts it into the acquisition path of the input parameter of the function block "second calculation module", and then starts the calculation process for data processing. The end function of the function block "second calculation module" packs and sends the processing result of the function block to the storage path of the output parameter of "second calculation module".
[0118] Finally, the start function of the function block "#phthon script for data comparison" obtains the processing result of the function block "first calculation module" and the function block "second calculation module" from the storage path of the output parameter of the function block "first calculation module" and the function block "second calculation module" respectively and puts it into the acquisition path of the input parameter of the function block "#phthon script for data comparison", and then starts the phthon process for data processing. The end function of the function block "#phthon script for data comparison" packs and outputs the processing result of the function block as the test result.
[0119] For the coders of different function blocks, they do not need to care about the running situation of other function blocks under this framework, and can directly transmit the original data packet to obtain the final comparison result, which greatly improves the work efficiency.
[0120] The function test method of the development system of the present application realizes the organic connection of different function blocks by analyzing the calling relationship and data format of the configured function blocks. The developers only need to configure and define the data access conversion function, and then the stock code without deep learning can be regarded as a black box for implementing specific functions and outputting the required results, so that the development can be more focused on specific function writing, and the efficiency is improved. The technical scheme has universality and excellent adaptability to application architectures of multiple programming languages.
[0121] Based on the same inventive concept, the embodiment of the present application further provides a functional test device of a development system, which can be used to implement the method described in the above embodiment, as described in the following embodiment. Since the principle of solving problems of the functional test device of the development system is similar to that of the functional test method of the development system, the implementation of the functional test device of the development system can refer to the implementation of the functional test method of the development system, and the repeated parts will not be described herein. The term "unit" or "module" used below can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiment is preferably implemented in software, the implementation of hardware or a combination of software and hardware is also possible and is conceived.
[0122] In a second aspect, the present application provides a functional test device of a development system, as shown in the following figure, which comprises: Figure 6
[0123] A functional test request obtaining module 301 is configured to obtain a functional test request of a user, wherein the functional test request comprises a function to be tested, an original data packet, functional test steps, and execution orders of the functional test steps.
[0124] A test configuration file generating module 302 is configured to generate a corresponding test configuration file according to the functional test steps and the execution orders of the functional test steps, wherein the test configuration file comprises information of a plurality of functional blocks and a calling relationship thereof.
[0125] A test result generating module 303 is configured to process the original data packet according to the test configuration file to obtain a test result of the function to be tested.
[0126] In an embodiment, the functional test request obtaining module 301 is specifically configured to:
[0127] obtain a test file uploaded by a user on a test page and parse the test file to obtain the function to be tested, the original data packet, the functional test steps, and the execution orders of the functional test steps.
[0128] In an embodiment, the functional test request obtaining module 301 is specifically configured to:
[0129] obtain a parameter file uploaded by a user on a test page and parse the parameter file to obtain the function to be tested and the original data packet.
[0130] receive a graphical configuration instruction on a test page by a user and determine the functional test steps and the execution orders of the functional test steps according to the graphical configuration instruction.
[0131] In an embodiment, as shown in the following figure, the test configuration file generating module 302 comprises: Figure 7
[0132] Function block determination unit 3021 is used to determine multiple required function blocks according to the functional test steps; the function blocks are pre-developed modules for performing specific functions.
[0133] The call order determination unit 3022 is used to determine the call order among the multiple functional blocks according to the execution order of each functional test step;
[0134] The test configuration file generation unit 3023 is used to generate the test configuration file according to the function name, parameter package file and interface package file corresponding to each function block and the calling order.
[0135] In one embodiment, the test result generation module 303 is specifically used for:
[0136] A functional test module is constructed based on multiple functional blocks and their calling order in the test configuration file; the functional test module includes a start functional block, an intermediate functional block, and an end functional block.
[0137] The original data packet is input into the functional test module to obtain the test results of the function under test.
[0138] In one embodiment, each functional block is configured with a start function and an end function;
[0139] like Figure 8 As shown, the test result generation module 303 specifically includes:
[0140] The request packet parsing unit 3031 is used to parse the call request packet received by the target function block to obtain input parameters; when the target function block is the starting function block, the call request packet is generated by the user; when the target function block is not the starting function block, the call request packet is generated by the previous function block.
[0141] The function block calling unit 3032 is used to transmit the input parameters to the start function of the target function block to trigger the target function block;
[0142] The output unit 3033 is used to transmit the output result formed by the target function block in response to the input parameters to the end function of the target function block for packaging and output.
[0143] In one embodiment, the call request packet is a preset, uniform format.
[0144] The function test device of the development system of the application realizes the organic connection of different function blocks by analyzing the calling relationship and data format of the configured required function blocks, and the developer only needs to complete the configuration and define the data access conversion function, so that the stock code without deep learning can be regarded as a black box for realizing specific functions and outputting required results, so that the development can be more focused on specific function writing, and the efficiency is improved. The technical scheme has universality, and has excellent adaptability to application architectures of multiple programming languages.
[0145] In an embodiment, the application also provides a computer device, referring to Figure 9 , the electronic device 100 specifically comprises:
[0146] A central processor (processor) 110, a memory 120, a communication module (Communications) 130, an input unit 140, an output unit 150 and a power supply 160.
[0147] Among them, the memory (memory) 120, the communication module (Communications) 130, the input unit 140, the output unit 150 and the power supply 160 are connected with the central processor (processor) 110 respectively. The memory 120 stores a computer program, and the central processor 110 can call the computer program. When the central processor 110 executes the computer program, all steps in the function test method of the development system in the above embodiment are realized.
[0148] In an embodiment, the embodiment of the application also provides a computer readable storage medium for storing a computer program, which can be executed by a processor. The computer program is executed by the processor to realize any function test method of the development system provided by the application.
[0149] In an embodiment, the embodiment of the application also provides a computer program product, which comprises a computer program. The computer program is executed by a processor to realize any function test method of the development system provided by the above embodiment.
[0150] Those skilled in the art should understand that the embodiments of the application can be provided as a method, a system or a computer program product. Therefore, the application can be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0151] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0152] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0153] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0154] The above-described specific embodiments, the purpose, technical solutions and advantages of the present application are further described in detail, it should be understood that the above-described only for the specific embodiments of the present application has, and is not used to limit the scope of protection of the present application, any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application, should be included within the scope of protection of the present application.
Claims
1. A functional test method of a development system, characterized by, The application comprises the following steps: Obtaining a function test request of a user, wherein the function test request comprises a function to be tested, an original data packet, function test steps and execution sequences of the function test steps; Determining a plurality of function blocks required according to the function test steps, wherein the function blocks are pre-developed modules for executing specific functions; Determining a calling sequence between the plurality of function blocks according to the execution sequences of the function test steps; Generating a test configuration file according to the function names, parameter packet files and interface packet files of the function blocks and the calling sequence, wherein the test configuration file comprises information of the plurality of function blocks and their calling relationship; Building a function test module according to the plurality of function blocks and their calling sequence in the test configuration file, wherein the function test module comprises a starting function block, intermediate function blocks and an ending function block; Inputting the original data packet into the function test module to obtain a test result of the function to be tested; Each function block is configured with a start function and an end function, and the start function and the end function are defined in the interface file packet of the function block; The calling steps of each function block comprise: Analyzing a calling request packet received by a target function block to obtain input parameters, wherein the calling request packet is generated by a user when the target function block is a starting function block, and the calling request packet is generated by a previous function block when the target function block is not a starting function block; wherein the calling request packet is a request packet for calling a target function module, the calling request packet is in a preset uniform format, and the calling request packet comprises input parameters of the target function block; Transmitting the input parameters to the start function of the target function block to trigger the target function block, wherein the start function is used to convert the format of the input parameters into the format of the input parameters defined in the parameter file packet of the target function block; Transmitting an output result formed by the target function block for the input parameters to the end function of the target function block for packaging and outputting, wherein the end function is used to convert the output result into a preset uniform format.
2. The method of claim 1, wherein the function test of the development system is performed by a function test program. The function test request of the user comprises: Obtaining a test file uploaded by a user on a test page and analyzing to obtain the function to be tested, the original data packet, the function test steps and the execution sequences of the function test steps.
3. The method of claim 1, wherein the function test of the development system is performed by a function test program. The function test request of the user comprises: Obtaining a parameter file uploaded by a user on a test page and analyzing to obtain the function to be tested and the original data packet; Receiving a graphical configuration instruction of a user on a test page and determining the function test steps and the execution sequences of the function test steps according to the graphical configuration instruction.
4. A functional test apparatus for a development system, characterized by comprising: The application comprises the following steps: A function test request obtaining module is configured to obtain a function test request of a user, wherein the function test request comprises a function to be tested, an original data packet, function test steps and execution sequences of the function test steps; A test configuration file generating module is configured to generate a corresponding test configuration file according to the function test steps and the execution sequences of the function test steps, wherein the test configuration file comprises information of a plurality of function blocks and their calling relationship; a test result generation module configured to process the original data packet according to the test configuration file to obtain a test result of the function to be tested; The test configuration file generation module comprises: a function block determination unit configured to determine a plurality of function blocks required according to the function test steps; the function blocks are pre-developed modules for performing specific functions; a calling sequence determination unit configured to determine a calling sequence between the plurality of function blocks according to an execution sequence of the function test steps; a test configuration file generation unit configured to generate a test configuration file according to the function names corresponding to the function blocks, the parameter packet files, the interface packet files, and the calling sequence; the test configuration file comprises information of the plurality of function blocks and a calling relationship therebetween; The test result generation module is specifically configured to: build a function test module according to the plurality of function blocks and the calling sequence in the test configuration file; the function test module comprises a start function block, an intermediate function block, and an end function block; and input the original data packet into the function test module to obtain the test result of the function to be tested; Each function block is configured with a start function and an end function, and the start function and the end function are defined in the interface file packet of the function block; The test result generation module comprises: a request packet analysis unit configured to analyze a calling request packet received by a target function block to obtain input parameters; when the target function block is a start function block, the calling request packet is generated by a user; when the target function block is not a start function block, the calling request packet is generated by a previous function block; wherein the calling request packet is a request packet for calling a target function module, the calling request packet is in a preset uniform format, and the calling request packet comprises input parameters of the target function block; a function block calling unit configured to transmit the input parameters to a start function of the target function block to trigger the target function block; wherein the start function is configured to convert a format of the input parameters into a format of input parameters defined in a parameter file packet of the target function block; an output unit configured to transmit an output result formed by the target function block for the input parameters to an end function of the target function block for packaging and outputting; wherein the end function is configured to convert the output result into a preset uniform format.
5. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the function test method of the development system according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the function test method of the development system according to any one of claims 1 to 3.
Citation Information
Patent Citations
Software testing method, computer-readable storage medium and terminal device
CN109062802A
Product function testing method and device
CN109800119A