Big data testing method and apparatus

By generating test data through reverse function call chains, the problems of test data omissions and high time costs in existing technologies are solved, enabling efficient and accurate big data testing.

CN115563016BActive Publication Date: 2026-04-17BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
Filing Date
2022-11-09
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies often produce flawed test data, leading to high testing time costs and issues such as blind spots and missed scenarios.

Method used

By constructing a reverse function call chain based on the project code of the business system, calling the instances of each node in sequence, generating test data, and using it as input parameters to run the business system code, the discrepancies between the development and the requirements processing logic can be located.

Benefits of technology

It reduces test data omissions, improves test accuracy and coverage, reduces test time costs, and avoids the breakpoint phenomenon caused by intermediate tables or layered testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115563016B_ABST
    Figure CN115563016B_ABST
Patent Text Reader

Abstract

This invention discloses a big data testing method and apparatus, relating to the field of big data technology. One specific implementation of the method includes: constructing a reverse function call chain based on the project code of a business system; sequentially calling the instances corresponding to each node in the reverse function call chain to construct test data; using the test data as input parameters to the project code of the business system and running the project code to obtain data execution results and the code coverage of the business system; and locating the processing logic deviation between the development and requirements of the business system based on the data execution results and the expected result set data. This implementation can solve the technical problems of easily flawed constructed test data and high testing time costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data technology, and in particular to a big data testing method and apparatus. Background Technology

[0002] With the development of big data and the accelerated informatization of logistics technology, enterprise supply chain data is experiencing explosive growth, exhibiting diverse types and complex relationship networks. Consequently, big data testing scenarios corresponding to actual supply chain sales forecasting, replenishment, and allocation are becoming increasingly complex. The challenges of big data testing are increasingly reflected in: the diversity of unstructured data, the accuracy and relevance of constructing test data to match business needs, and the effectiveness of big data testing.

[0003] In the process of realizing this invention, the inventors discovered at least the following problems in the prior art:

[0004] The constructed test data is often fixed and prone to errors. When the positive test coverage is in place, there are test blind spots or even missed scenarios. Once a missed scenario is found, it is necessary to reconstruct the test data of the complete logic chain, resulting in high test time costs. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a big data testing method and apparatus to solve the technical problems of easily flawed constructed test data and high testing time costs.

[0006] To achieve the above objectives, according to one aspect of the present invention, a big data testing method is provided, comprising:

[0007] Construct a reverse function call chain based on the project code of the business system;

[0008] Based on each node in the reverse function call chain, the instance corresponding to each node is called sequentially to construct the test data.

[0009] The test data is used as input parameters for the project code of the business system, and the project code of the business system is run to obtain the data running results and the code coverage of the business system.

[0010] Based on the data execution results and expected result set data, the deviation in processing logic between the development and requirements of the business system is located.

[0011] Optionally, based on the project code of the business system, a reverse function call chain is constructed, including:

[0012] Obtain the forward function call chain from the project code of the business system;

[0013] The forward function call chain is parsed and reversed to obtain the reverse function call chain;

[0014] Each instance corresponding to a node in the reverse function call chain is encapsulated separately.

[0015] Optionally, instances corresponding to each node in the reverse function call chain are encapsulated, including:

[0016] For each node in the reverse function call chain, an inverse function is constructed based on the function of the node, and an instance of the node is obtained by encapsulating the inverse function.

[0017] Optionally, based on each node in the reverse function call chain, the instances corresponding to each node are called sequentially to construct test data, including:

[0018] Configure business parameters and reverse construct parameters;

[0019] Based on the business parameters and the reverse construction parameters, and based on each node in the reverse function call chain, the instances corresponding to each node are called sequentially to gradually generate intermediate test data until the test data is constructed.

[0020] Optionally, based on each node in the reverse function call chain, the instances corresponding to each node are called sequentially to construct the test data, which further includes:

[0021] During the construction of test data, a reverse construction identifier is added to the constructed test data; the reverse construction identifier of each node is different.

[0022] Optionally, based on the data execution results and expected result set data, the deviation in processing logic between the development and requirements of the business system is located, including:

[0023] The results of the data processing and the expected result set are verified.

[0024] In the event of inconsistent data in the verification results, the discrepancy between the development and requirements of the business system can be located by constructing an identifier based on the reverse of the data.

[0025] Optionally, after identifying the processing logic deviation between the development and requirements of the business system based on the data execution results and expected result set data, the method further includes:

[0026] Based on the code coverage of the business system and the deviation between the development and requirements of the business system, modify the business parameters, reverse-engineer the parameters, and / or modify the project code of the business system.

[0027] In addition, according to another aspect of the present invention, a big data testing apparatus is provided, comprising:

[0028] The function constructor module is used to construct a reverse function call chain based on the project code of the business system;

[0029] The data construction module is used to construct test data by sequentially calling the instances corresponding to each node in the reverse function call chain.

[0030] The testing module is used to take the test data as input parameters for the project code of the business system and run the project code of the business system to obtain the data running results and the code coverage of the business system.

[0031] The positioning module is used to locate the processing logic deviation between the development and requirements of the business system based on the data operation results and the expected result set data.

[0032] Optionally, the function constructor module is further configured to:

[0033] Obtain the forward function call chain from the project code of the business system;

[0034] The forward function call chain is parsed and reversed to obtain the reverse function call chain;

[0035] Each instance corresponding to a node in the reverse function call chain is encapsulated separately.

[0036] Optionally, the function constructor module is further configured to:

[0037] For each node in the reverse function call chain, an inverse function is constructed based on the function of the node, and an instance of the node is obtained by encapsulating the inverse function.

[0038] Optionally, the data construction module is further configured to:

[0039] Configure business parameters and reverse construct parameters;

[0040] Based on the business parameters and the reverse construction parameters, and based on each node in the reverse function call chain, the instances corresponding to each node are called sequentially to gradually generate intermediate test data until the test data is constructed.

[0041] Optionally, the data construction module is further configured to:

[0042] During the construction of test data, a reverse construction identifier is added to the constructed test data; the reverse construction identifier of each node is different.

[0043] Optionally, the positioning module is further configured to:

[0044] The data execution results and expected result set data are verified. If there are inconsistent data in the verification results, the deviation of the processing logic between the development and requirements of the business system is located based on the reverse construction identifier of the data.

[0045] Optionally, the positioning module is further configured to:

[0046] Based on the data execution results and expected result set data, after locating the processing logic deviation between the development and requirements of the business system, and based on the code coverage of the business system and the processing logic deviation between the development and requirements of the business system, modify the business parameters, reverse construction parameters and / or the project code of the business system.

[0047] According to another aspect of the present invention, an electronic device is also provided, comprising:

[0048] One or more processors;

[0049] Storage device for storing one or more programs.

[0050] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.

[0051] According to another aspect of the present invention, a computer-readable medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the methods described in any of the above embodiments.

[0052] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods described in any of the above embodiments.

[0053] One embodiment of the above invention has the following advantages or beneficial effects: By employing a technique that first constructs a reverse function call chain based on the project code of the business system, then sequentially calls the corresponding instances of each node in the reverse function call chain to construct test data, and finally runs the project code of the business system based on the test data for data testing, the technical problems of easily flawed test data and high testing time costs in existing technologies are overcome. This invention constructs test data based on a reverse function call chain, and then performs big data testing according to the project's forward business logic. This reduces the flaws that may occur when manually constructing test data, avoids test data gaps and breakpoints caused by using intermediate tables or layered testing in big data testing, and simultaneously achieves a significant improvement in testing accuracy, coverage, and efficiency, thereby saving testing time costs.

[0054] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0056] Figure 1 This is a schematic diagram of the main flow of the big data testing method according to an embodiment of the present invention;

[0057] Figure 2 This is a schematic diagram of the expected result set data according to an embodiment of the present invention;

[0058] Figure 3 This is a schematic diagram of the main flow of a big data testing method according to a possible embodiment of the present invention;

[0059] Figure 4 This is a schematic diagram of adding a reverse construction identifier to the constructed test data according to an embodiment of the present invention;

[0060] Figure 5 This is a schematic diagram of the main modules of the big data testing device according to an embodiment of the present invention;

[0061] Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0062] Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0063] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0064] Figure 1 This is a schematic diagram of the main flow of a big data testing method according to an embodiment of the present invention. As one embodiment of the present invention, such as... Figure 1 As shown, the big data testing method may include:

[0065] Step 101: Construct a reverse function call chain based on the project code of the business system.

[0066] First, obtain the project code of the business system that needs to be tested with big data. Then, construct a reverse function call chain based on the project code of the business system. The reverse function call chain consists of multiple nodes. The reverse function call chain may or may not contain multiple branches.

[0067] Optionally, step 101 may include: obtaining a forward function call chain from the project code of the business system; parsing and reversing the forward function call chain to obtain a reverse function call chain; and encapsulating instances corresponding to each node in the reverse function call chain. Specifically, a code management tool can be used to pull the project code of the business system, and a code parsing tool can be used to parse the project code to obtain the forward function call chain. Taking Python as an example, tools such as profiler or pycallgraph can be used to parse the project code to obtain the forward function call chain. For example, the forward function call chain might be: order summary --> active sales filter --> replacement chain --> large order removal --> daily sales summary result. The functions of each node can be denoted as: order_sum, active_filter, replace_chain, bo_del, sales_day, i.e., order_sum-- The forward function call chain is then processed in reverse to obtain the reverse function call chain. For example, the reverse function call chain could be: daily sales summary result --> large order removal --> replacement chain --> sales activity filter --> order summary, i.e., sales_day --> bo_del --> replace_chain --> active filter --> order_sum. Finally, instances (including function components, class components, and method components) corresponding to each node in the reverse function call chain are encapsulated.

[0068] Optionally, encapsulating instances corresponding to each node in the reverse function call chain can include: for each node in the reverse function call chain, constructing an inverse function based on the node's function, and then encapsulating the node's instance based on the inverse function. In an embodiment of the present invention, for each node in the reverse function call chain, an inverse function is constructed based on the node's function, for example, constructing an inverse function for "active sales filtering", and then encapsulating the inverse function to obtain an instance of the node. Instances corresponding to each node (including function components, class components, and method components, which can realize data reverse processing) can be stored in an instance pool for later use.

[0069] For example, the "Sales Filter" in the forward function call chain is an addition function that can achieve 1+1=2, obtaining 2 through 1 and 1. Then, the reverse "Sales Filter" is an inverse addition function that achieves 2=1+1, obtaining 1 and 1 through 2. Of course, depending on the actual reverse construction configuration, more test scenario data can be constructed, such as 2=0+2, 2=0.5+1.5, etc. The two addends obtained are the constructed test data.

[0070] For example, if the "Daily Sales Summary Result" in the forward function call chain is an addition function, then the reverse "Daily Sales Summary Result" is an inverse addition function. For instance, given 2022-01-01, product SKU1, sales of 20, the test data that can be constructed are: 2022-01-01, product SKU1, order 001, sales of 5; 2022-01-01, product SKU1, order 002, sales of 15. Here, order 001 or 002 is configurable and can be configured in the function parameters; 5 and 15 are also configurable and can be configured in the function parameters.

[0071] Step 102: Based on each node in the reverse function call chain, the instance corresponding to each node is called sequentially to construct the test data.

[0072] In this step, based on the order of each node in the reverse function call chain, instances are obtained from the instance pool, and the instances corresponding to each node are called in sequence to construct the test data.

[0073] Optionally, step 102 may include: configuring business parameters and reverse construction parameters; based on the business parameters and the reverse construction parameters, and simultaneously based on each node in the reverse function call chain, sequentially calling the instances corresponding to each node to gradually generate intermediate test data until test data is constructed. The configuration of business parameters corresponds to the configuration of the actual developed business system, and is the business configuration for the business system to run and implement relevant big data processing. Different configuration items can achieve different processing of big data to achieve the big data processing results for the corresponding scenario. The configuration of reverse construction parameters is the configuration for constructing test data. This part of the configuration will not affect the normal operation of the business system, but will depend on the construction of test data according to the business configuration. Reverse construction parameters may include: the time range for constructing test data, the distribution rules for constructing test data, data partitioning processing (reverse operation of SQL join or pandas merge join), abnormal data inclusion, distributed resource configuration, and data production volume, etc.

[0074] Step 103: Use the test data as input parameters for the project code of the business system and run the project code of the business system to obtain the data running results and the code coverage of the business system.

[0075] In this step, the constructed test data is used as the input parameters of the project code of the business system, and the project code of the business system is run. The running results of the test data and the code coverage of the business system are obtained by running the project code of the business system.

[0076] Forward testing can be performed using code coverage tools. For example, Python uses tools like Coverage, and Java uses tools like JaCoCo. By performing forward testing on constructed test data, code coverage can be analyzed to identify missing validations and requirements in the development project's code. This also allows for the supplementation of missing scenarios in the constructed test data, improving and optimizing the test data. If code coverage does not reach 100%, then reverse function call chains and corresponding test data should be added.

[0077] The following description covers commonly used test points in big data testing:

[0078] The validity of the value threshold, whether it exceeds the range of the dimension table or the business value range;

[0079] The handling of null values, whether to control the field capture, or to replace null values ​​or handle other meaning-related issues;

[0080] Checking for garbled characters, and handling rules for special matches or garbled characters;

[0081] Handling dirty data, such as data that does not conform to business logic;

[0082] Data range and distribution (min, max, average, etc.);

[0083] Data boundaries;

[0084] Is the data consistent or is there any data loss?

[0085] Is the column order correct?

[0086] Data precision and formatting information;

[0087] Data source and data result read / write logic, etc.

[0088] Step 104: Based on the data execution results and expected result set data, locate the processing logic deviation between the development and requirements of the business system.

[0089] The expected result set data can be pre-configured as needed, and relational row-column data can be constructed from offline documents, online database tables (Hive, Doris, MySQL, etc.). Figure 2 As shown, the expected result set data may include time-series data such as sku_id (product code), wh_no (warehouse code), date (date), and quality (sales volume). The business logic data flow nodes or the final daily sales summary are verified using the unique primary key wh_no—sku_id—date. This verification confirms the consistency between the data execution results and the expected result set data, revealing the discrepancies between the development and requirements of the business system.

[0090] Optionally, step 104 may include: verifying the data execution results and the expected result set data; if there is inconsistent data in the verification results, locating the processing logic deviation (diff) between the development and requirements of the business system based on the reverse construction identifier of the data; if it is a development problem, submitting it to the development team for repair; if it is a test data problem, optimizing the test data.

[0091] Optionally, after step 104, the process may further include: modifying business parameters, reverse engineering parameters, and / or the project code of the business system based on the code coverage of the business system and the deviation between the development and requirements of the business system. If the code coverage of the business system is less than 100%, then supplement the reverse function call chain and add corresponding test data; based on the diff result analysis, compare the actual requirements with the test data construction data for potential problems or the development design logic for potential problems and requirement vulnerabilities, and reconstruct the test data.

[0092] For example, the constructed test data might include a large order rejection logic, filtering out orders with more than 100 items. The reverse-engineered test data successfully generated orders with 101 items, but this logic wasn't implemented in the project code. The expected result set would contain orders with fewer than 100 items, but the code execution resulted in orders with more than 100 items appearing. Therefore, in the large order rejection module, there's a difference (diff) in the logic branch processing data with more than 100 items.

[0093] Based on the various embodiments described above, it can be seen that the embodiments of the present invention construct test data by first building a reverse function call chain based on the project code of the business system, then sequentially calling the corresponding instances of each node in the reverse function call chain, and finally running the project code of the business system based on the test data. This technical approach solves the technical problems of easy errors in constructed test data and high testing time costs in the prior art. The embodiments of the present invention construct test data based on the reverse function call chain, and then perform big data testing according to the forward business logic of the project. This reduces the errors that occur when manually constructing test data, avoids test data gaps and breakpoints caused by using intermediate tables or layered testing in big data testing, and significantly improves test accuracy, coverage, and efficiency, thereby saving testing time costs.

[0094] Figure 3 This is a schematic diagram of the main flow of a big data testing method according to a possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 3As shown, the big data testing method may include:

[0095] Step 301: Configure business parameters, reverse construction parameters, and expected result set data.

[0096] The configuration of business parameters corresponds to the configuration of the actual developed business system. It is the business configuration for the business system to run and implement relevant big data processing. Different configuration items can perform different processing on big data to achieve the big data processing results for the corresponding scenarios.

[0097] For example:

[0098] conf1:

[0099] The `order_date_filter:2022-01-02` option indicates that order data later than 2022-01-02 should be read.

[0100] active_date_filter:2022-03-02 indicates that the active date filter starts filtering order data from 2022-03-02;

[0101] bo_filter:100 means filtering out order data with more than 100 items at the order level;

[0102] The above is a simple configuration of business parameters. The actual configuration data is more extensive and complex, and is related to the production system. Therefore, the embodiments of this invention will not elaborate further.

[0103] The configuration of reverse construction parameters is the configuration for constructing test data. This part of the configuration will not affect the normal operation of the business system, but it will depend on the construction of test data according to the business configuration. Reverse construction parameters may include: the time range for constructing test data, the distribution rules for constructing test data, data partitioning processing (reverse operation of SQL join or pandas merge join), abnormal data inclusion, distributed resource configuration, and data production volume, etc.

[0104] Regarding the construction of the time range for test data, the following example is provided:

[0105] conf2:

[0106] order_date_scope:1000 indicates that the order date configuration will not exceed 1000 (it will construct order data with random dates no more than 1000 days around 2022-01-02 based on the business configuration order_date_filter:2022-01-02);

[0107] active_date_scope:300 indicates that the order configuration will not exceed 300 (it will construct order data with random dates no more than 300 days around 2022-03-02 based on the business configuration active_date_filter:2022-03-02);

[0108] bo_scope:40 indicates that the order configuration will not exceed 40 (the business configuration bo_filter:100 will construct order data with no more than 100 items of 40 each).

[0109] Examples of data distribution rules are as follows:

[0110] For example, a normal distribution is configured:

[0111] conf2:

[0112] distribute_type:normal

[0113] The constructed order data shows that the sales values ​​for each order, under the same primary key dimension (same merchant, same warehouse, same product), satisfy or nearly satisfy a normal distribution (e.g., using Python Numpy to generate normally distributed data). Of course, test data with mean fluctuation, discrete distribution, moving average, and other data distribution types can also be configured, but these will not be elaborated upon in this embodiment.

[0114] Abnormal data refers to data that is outside the scope of normal business logic processing. It usually refers to empty, duplicate, abnormal data types or formats, out-of-bounds length, dirty data, etc. Abnormal data can be defined according to the actual project requirements.

[0115] Examples of anomalous data inclusion are as follows:

[0116] conf2:

[0117] blank: True indicates that empty data is constructed;

[0118] duplicate: False indicates that duplicate data will not be constructed.

[0119] For example, if empty data construction and duplicate data construction are configured, the constructed test data will look like this:

[0120]

[0121] This allows for testing of the data processing logic developed and designed to detect and handle any anomalies. For example, business requirements may stipulate that duplicate data should be deduplicated and empty data should be filtered under normal circumstances.

[0122] Distributed resource configuration can include some common Spark configuration parameters, such as how many operators to allocate to each task, how much memory to allocate to each driver, and how much memory to allocate to each operator.

[0123] The data production volume configuration determines the scale of the data to be generated. For example, if you need to generate 10 million order data entries, the configuration would be as follows:

[0124] conf2:

[0125] order_cnt:10000000

[0126] The constructed test data is shown below:

[0127]

[0128] It should be noted that the above configuration is for illustrative purposes only, and there are many more configurations involved in the actual reverse engineering.

[0129] The expected result set data needs to be pre-configured, and relational row and column data can be constructed using offline documents, online database tables (Hive, Doris, MySQL, etc.).

[0130] Step 302: Obtain the forward function call chain from the project code of the business system.

[0131] Specifically, code management tools can be used to pull the project code of the business system, and code parsing tools can be used to parse the project code to obtain the forward function call chain. Taking Python as an example, tools such as profile or pycallgraph can be used to parse the project code to obtain the forward function call chain. For example, the forward function call chain is: order summary --> active sales filter --> replacement chain --> large order removal --> daily sales summary result. The functions of each node can be denoted as: order_sum, active_filter, replace_chain, bo_del, sales_day, that is, order_sum --> active_filter --> replace_chain --> bo_del --> sales_day.

[0132] Step 303: The forward function call chain is parsed and reversed to obtain the reverse function call chain.

[0133] The forward function call chain is reversed to obtain the reverse function call chain. For example, the reverse function call chain is: daily sales summary result --> large order removal --> replacement chain --> active sales filter --> order summary, i.e., sales_day --> bo_del --> replace_chain --> active_filter --> order_sum.

[0134] Step 304: Encapsulate the instances corresponding to each node in the reverse function call chain.

[0135] Optionally, a collection of functions or classes that are highly reusable during the construction of test data can be encapsulated and stored in an instance pool. For example, consider two reverse function call chains:

[0136] sales_day-->bo_del-->replace_chain-->order_sum

[0137] sales_day-->replace_chain-->active_filter-->order_sum

[0138] Therefore, the common nodes of these two reverse function call chains include sales_day, replace_chain, and order_sum. Thus, a common instance of these three common nodes can be constructed, and these common instances can be called when constructing test data based on the reverse function call chains.

[0139] Step 305: Based on the business parameters and the reverse construction parameters, and based on each node in the reverse function call chain, sequentially call the instance corresponding to each node to gradually generate intermediate test data until the test data is constructed.

[0140] Optionally, step 305 further includes: adding a reverse construction identifier to the constructed test data during the construction of test data; wherein the reverse construction identifier for each node is different. In order to facilitate the identification of the processing logic discrepancy between the development of the business system and the requirements, different reverse construction identifiers are added to the constructed test data for different nodes during the construction of test data, so as to record and identify the scenarios corresponding to different test data.

[0141] Taking "Large Order Removal" as an example, assuming the large order threshold is configured to 100, the time-series data is converted into order-dimensional data. Based on the primary key dimension, i.e., wh_no_sku_id_date, order data with values ​​greater than 100 and equal to 100 are constructed, and these order data are marked with bo_assert=1. Figure 4 As shown.

[0142] For nodes such as replacement chain, sales filtering, and order summary, corresponding test data needs to be constructed to form test data for a single line. For the conditional branches generated by the demand side, each inverse function is constructed in parallel, and finally the test data of each line branch can be vertically integrated.

[0143] For example:

[0144] For example, test data that satisfies the replacement chain logic includes test data that follows the replacement logic and test data that does not follow the replacement logic:

[0145]

[0146] For example, test data that satisfies the sales filtering logic includes test data that follows the filtering logic and test data that does not follow the filtering logic:

[0147]

[0148] Finally, the test data from each branch are vertically integrated to form complete test data that meets all data processing requirements and can verify all conditional branches, as shown below:

[0149]

[0150] In summary, if the test data involves two nodes: replacement chain and active filtering, four branch scenarios will be constructed, including:

[0151] Test data that needs to be replaced --> Test data that needs to be filtered for active pins

[0152] Replacement required --> Test data that does not require pin filtering

[0153] No replacement needed --> Test data requiring pin filtering

[0154] Test data that does not require replacement --> does not require pin filtering

[0155] Vertical aggregation yields test data that fully covers all branch scenarios.

[0156] Step 306: Use the test data as input parameters for the project code of the business system and run the project code of the business system to obtain the data execution results and the code coverage of the business system.

[0157] Code coverage tools can be used for positive testing. For example, Python uses code coverage tools such as Coverage, and Java uses code coverage tools such as Jacoco. By performing positive testing on the constructed test data, code coverage can be analyzed to check for missing verifications and requirements in the development project code. At the same time, it can supplement the missing scenarios in the constructed test data and improve and optimize the constructed test data.

[0158] Step 307: Verify the data execution results and the expected result set data to check for any inconsistencies. If yes, proceed to step 308; otherwise, end the process.

[0159] Step 308: Based on the reverse construction of the data, locate the processing logic deviation between the development and requirements of the business system.

[0160] If there is inconsistency between the data execution result and the expected result set data, the discrepancy between the development and requirements of the business system is located based on the reverse construction identifier of the data. If it is a development problem, it is submitted to the development team for repair; if it is a problem with the test data, the test data is optimized.

[0161] Step 309: Based on the code coverage of the business system and the deviation between the development and requirements of the business system, modify the business parameters, reverse construction parameters and / or the project code of the business system.

[0162] If the code coverage of the business system is less than 100%, then supplement the reverse function call chain and add corresponding test data; based on the diff result analysis, compare the actual requirements with the test data construction problems or development design logic problems, adjust and identify requirement vulnerabilities, and reconstruct the test data.

[0163] After fixing defects in the project code or improving and optimizing the test data, regression testing is performed until the test passes, thus achieving a closed testing loop.

[0164] This invention constructs a reverse function call chain by reverse parsing the project code, thereby constructing test data in reverse. Then, it performs big data testing according to the project's forward business logic, reducing the errors that may occur when manually constructing test data and avoiding test data gaps and breakpoints caused by using intermediate tables or layered testing in big data testing. At the same time, it significantly improves test accuracy, coverage, and efficiency, and can improve the efficiency of constructing test data in a distributed framework, thereby saving testing time costs.

[0165] Furthermore, the specific implementation details of the big data testing method in one of the reference embodiments of the present invention have been described in detail in the big data testing method described above, so the details will not be repeated here.

[0166] Figure 5 This is a schematic diagram of the main modules of a big data testing device according to an embodiment of the present invention. Figure 5 As shown, the big data testing device 500 includes a function construction module 501, a data construction module 502, a testing module 503, and a positioning module 504. The function construction module 501 constructs a reverse function call chain based on the project code of the business system. The data construction module 502 sequentially calls the instances corresponding to each node in the reverse function call chain to construct test data. The testing module 503 uses the test data as input parameters to run the project code of the business system, thereby obtaining the data execution results and the code coverage of the business system. The positioning module 504 locates the processing logic deviation between the development and requirements of the business system based on the data execution results and the expected result set data.

[0167] Optionally, the function construction module 501 is further configured to:

[0168] Obtain the forward function call chain from the project code of the business system;

[0169] The forward function call chain is parsed and reversed to obtain the reverse function call chain;

[0170] Each instance corresponding to a node in the reverse function call chain is encapsulated separately.

[0171] Optionally, the function construction module 501 is further configured to:

[0172] For each node in the reverse function call chain, an inverse function is constructed based on the function of the node, and an instance of the node is obtained by encapsulating the inverse function.

[0173] Optionally, the data construction module 502 is further configured to:

[0174] Configure business parameters and reverse construct parameters;

[0175] Based on the business parameters and the reverse construction parameters, and based on each node in the reverse function call chain, the instances corresponding to each node are called sequentially to gradually generate intermediate test data until the test data is constructed.

[0176] Optionally, the data construction module 502 is further configured to:

[0177] During the construction of test data, a reverse construction identifier is added to the constructed test data; the reverse construction identifier of each node is different.

[0178] Optionally, the positioning module 504 is further configured to:

[0179] The data execution results and expected result set data are verified; if there are inconsistent data in the verification results, the deviation of the processing logic between the development and requirements of the business system is located based on the reverse construction identifier of the data.

[0180] Optionally, the positioning module 504 is further configured to:

[0181] Based on the data execution results and expected result set data, after locating the processing logic deviation between the development and requirements of the business system, and based on the code coverage of the business system and the processing logic deviation between the development and requirements of the business system, modify the business parameters, reverse construction parameters and / or the project code of the business system.

[0182] It should be noted that the specific implementation details of the big data testing device described in this invention have been described in detail in the big data testing method described above, so the details will not be repeated here.

[0183] Figure 6 An exemplary system architecture 600 is shown that can be applied to the big data testing method or big data testing apparatus of the present invention.

[0184] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0185] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0186] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0187] Server 605 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 601, 602, and 603 (this is just an example). The backend management server can analyze and process data such as received item information query requests, and then feed the processing results back to the terminal devices.

[0188] It should be noted that the big data testing method provided in this embodiment of the invention is generally executed by server 605, and correspondingly, the big data testing device is generally set in server 605.

[0189] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0190] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing a terminal device of the present invention. Figure 7 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0191] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0192] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0193] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.

[0194] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0195] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer programs according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0196] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be located in a processor; for example, a processor can be described as including a function construction module, a data construction module, a testing module, and a location module. The names of these modules do not necessarily limit the functionality of the module itself.

[0197] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device implements the following method: constructing a reverse function call chain based on the project code of the business system; sequentially calling the instances corresponding to each node in the reverse function call chain to construct test data; using the test data as input parameters to the project code of the business system and running the project code of the business system to obtain data execution results and the code coverage of the business system; and locating the processing logic deviation between the development and requirements of the business system based on the data execution results and the expected result set data.

[0198] In another aspect, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the above embodiments.

[0199] According to the technical solution of this invention, by first constructing a reverse function call chain based on the project code of the business system, then sequentially calling the instances corresponding to each node in the reverse function call chain to construct test data, and finally running the project code of the business system based on the test data to perform data testing, this invention overcomes the technical problems of flawed test data and high testing time costs in the prior art. This invention constructs test data based on a reverse function call chain and then performs big data testing according to the project's forward business logic, reducing flaws caused by manually constructed test data and avoiding test data gaps and breakpoints caused by using intermediate tables or layered testing in big data testing. Simultaneously, it significantly improves testing accuracy, coverage, and efficiency, thereby saving testing time costs.

[0200] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A big data testing method, characterized in that, include: Obtain the forward function call chain from the project code of the business system; The forward function call chain is parsed and reversed to obtain the reverse function call chain; Each instance corresponding to a node in the reverse function call chain is encapsulated separately; Based on each node in the reverse function call chain, the instance corresponding to each node is called sequentially to construct the test data. The test data is used as input parameters for the project code of the business system, and the project code of the business system is run to obtain the data running results and the code coverage of the business system. Based on the data execution results and expected result set data, the deviation in processing logic between the development and requirements of the business system can be identified; Based on each node in the reverse function call chain, the instances corresponding to each node are called sequentially to construct test data, including: Configure business parameters and reverse construct parameters; Based on the business parameters and the reverse construction parameters, and based on each node in the reverse function call chain, the instances corresponding to each node are called sequentially to gradually generate intermediate test data until the test data is constructed.

2. The method according to claim 1, characterized in that, Each instance corresponding to a node in the reverse function call chain is encapsulated, including: For each node in the reverse function call chain, an inverse function is constructed based on the function of the node, and an instance of the node is obtained by encapsulating the inverse function.

3. The method according to claim 1, characterized in that, Based on each node in the reverse function call chain, the instances corresponding to each node are called sequentially to construct the test data, which also includes: During the construction of test data, a reverse construction identifier is added to the constructed test data; the reverse construction identifier of each node is different.

4. The method according to claim 1, characterized in that, Based on the data execution results and expected result set data, the discrepancies between the development and requirements of the business system are identified, including: The results of the data processing and the expected result set are verified. In the event of inconsistent data in the verification results, the discrepancy between the development and requirements of the business system can be located by constructing an identifier based on the reverse of the data.

5. The method according to claim 1, characterized in that, After identifying the processing logic deviation between the development and requirements of the business system based on the data execution results and expected result set data, the method further includes: Based on the code coverage of the business system and the deviation between the development and requirements of the business system, modify the business parameters, reverse-engineer the parameters, and / or modify the project code of the business system.

6. A big data testing device, characterized in that, include: Function constructor module, used for Obtain the forward function call chain from the project code of the business system; The forward function call chain is parsed and reversed to obtain the reverse function call chain; instances corresponding to each node in the reverse function call chain are then encapsulated. The data construction module is used to construct test data by sequentially calling the instances corresponding to each node in the reverse function call chain. The testing module is used to take the test data as input parameters for the project code of the business system and run the project code of the business system to obtain the data running results and the code coverage of the business system. The positioning module is used to locate the processing logic deviation between the development and requirements of the business system based on the data operation results and the expected result set data; The data construction module is also used for: Configure business parameters and reverse construct parameters; Based on the business parameters and the reverse construction parameters, and based on each node in the reverse function call chain, the instances corresponding to each node are called sequentially to gradually generate intermediate test data until the test data is constructed.

7. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.

8. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method for analyzing consistency of source codes and target codes in airborne software

    CN107391368A

  • Code branch coverage condition determination method and device, computer system and medium

    CN111831573A