CN110781090A - Control method and device for data processing test, computer equipment and storage medium - Google Patents

Control method and device for data processing test, computer equipment and storage medium Download PDF

Info

Publication number
CN110781090A
CN110781090A CN201911053607.5A CN201911053607A CN110781090A CN 110781090 A CN110781090 A CN 110781090A CN 201911053607 A CN201911053607 A CN 201911053607A CN 110781090 A CN110781090 A CN 110781090A
Authority
CN
China
Prior art keywords
test
test case
data
information
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911053607.5A
Other languages
Chinese (zh)
Other versions
CN110781090B (en
Inventor
于奇
龙乐乐
贾宏超
王世星
盖守文
安天元
姚亚峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Neusoft Wang Hai Technology Co Ltd
Original Assignee
Beijing Neusoft Wang Hai Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Neusoft Wang Hai Technology Co Ltd filed Critical Beijing Neusoft Wang Hai Technology Co Ltd
Priority to CN201911053607.5A priority Critical patent/CN110781090B/en
Publication of CN110781090A publication Critical patent/CN110781090A/en
Application granted granted Critical
Publication of CN110781090B publication Critical patent/CN110781090B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Abstract

The embodiment of the invention discloses a control method and a control device for data processing test, computer equipment and a storage medium, wherein the control method comprises the following steps: acquiring at least one preset test case, wherein any test case comprises test input data information and test expected data information; for each test case, acquiring target input data according to the test input data information, and acquiring target expected data according to the test expected data information; executing at least one test case according to a preset test execution rule so that each test case executes corresponding target input data to generate test result data; and comparing the test result data of at least one test case with the target expected data of the corresponding test case respectively, and generating test information according to the comparison result. In the data testing process of the embodiment of the invention, the operations of data input, data download, data comparison and the like do not need the participation of testers, so that the workload of the testers can be effectively reduced, and the testing efficiency is improved.

Description

Control method and device for data processing test, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a control method and device for data processing test, computer equipment and a storage medium.
Background
Data processing has become an important part of work and life, for example, enterprises mine valuable information through data processing so as to obtain business value. In the development process of data processing, the logic of data processing needs to be tested, so that the correctness of the logic of data processing is guaranteed.
However, in the existing testing method, a tester needs to upload input data to a big data platform before the testing work starts, download output data and compare the output data with expected data after the data processing is finished, and the uploading, downloading, comparison and other works of the data need to be manually participated in the testing process, so that a large amount of work is added to the tester, and the efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a control method and device for data processing test, computer equipment and a storage medium, which can improve the test efficiency.
In order to solve the above technical problem, the embodiment of the present invention adopts a technical solution that: a control method for data processing test is provided, which comprises the following steps:
acquiring at least one preset test case, wherein any test case comprises test input data information and test expected data information;
for each test case, acquiring target input data according to the test input data information, and acquiring target expected data according to the test expected data information;
executing the at least one test case according to a preset test execution rule so that each test case executes corresponding target input data to generate test result data;
and comparing the test result data of the at least one test case with the target expected data of the corresponding test case respectively, and generating test information according to the comparison result.
Optionally, the step of obtaining target input data according to the test input data information for each test case includes the following steps:
determining a package name and a class name of each test case, wherein the package name comprises first storage path information of the target input data of the corresponding test case, and the class name comprises a first file name of the target input data of the corresponding test case;
and aiming at each test case, acquiring the target input data of the corresponding test case according to the first storage path information and the first file name.
Optionally, the step of obtaining the target expected data according to the test expected data information includes the following steps:
determining a package name and a class name of each test case, wherein the package name comprises second storage path information of the target expected data of the corresponding test case, and the class name comprises a second file name of the target expected data of the corresponding test case;
and aiming at each test case, acquiring the target expected data of the corresponding test case according to the second storage path information and the second file name.
Optionally, after the step of executing the at least one test case according to a preset test execution rule to enable each test case to execute the corresponding target input data to generate the test result data, the method further includes the following steps:
calculating and generating a third storage path and a third file name of the test result data of the corresponding test case according to the package name and the class name of each test case;
and for each test case, determining the name information of the test result data of the corresponding test case according to the third storage path and the third file name combination of the same test case, and storing the test result data into the third storage path.
Optionally, the step of executing the at least one test case according to a preset test execution rule includes the following steps:
acquiring test configuration information input by a target user, wherein the test configuration information comprises test sequence information;
and configuring a test case execution sequence according to the test sequence information, and executing the at least one test case according to the test case execution sequence.
Optionally, the step of comparing the test result data of the at least one test case with the target expected data of the corresponding test case, and generating test information according to the comparison result includes the following steps:
acquiring a data comparison result of the at least one test case;
and when the data comparison result of the at least one test case is correct, generating test information in a preset state code format.
To solve the above technical problem, an embodiment of the present invention further provides a control device for data processing test, including:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring at least one preset test case, and any test case comprises test input data information and test expected data information;
the first processing module is used for acquiring target input data according to the test input data information and acquiring target expected data according to the test expected data information aiming at each test case;
the first execution module is used for executing the at least one test case according to a preset test execution rule so that each test case executes the corresponding target input data to generate test result data;
and the data comparison module is used for comparing the test result data of the at least one test case with the target expected data of the corresponding test case respectively and generating test information according to the comparison result.
Optionally, the method further comprises:
the first obtaining submodule is used for determining a package name and a class name of each test case, wherein the package name comprises first storage path information of the target input data of the corresponding test case, and the class name comprises a first file name of the target input data of the corresponding test case;
and the first execution submodule is used for acquiring the target input data of the corresponding test case according to the first storage path information and the first file name aiming at each test case.
Optionally, the method further comprises:
the second obtaining submodule is used for determining a package name and a class name of each test case, wherein the package name comprises second storage path information of the target expected data of the corresponding test case, and the class name comprises a second file name of the target expected data of the corresponding test case;
and the second execution submodule is used for acquiring the target expected data of the corresponding test case according to the second storage path information and the second file name aiming at each test case.
Optionally, the method further comprises:
the path generation module is used for calculating and generating a third storage path and a third file name of the test result data of the corresponding test case according to the package name and the class name of each test case;
and the storage module is used for determining the name information of the test result data of the corresponding test case according to the third storage path and the third file name combination of the same test case aiming at each test case, and storing the test result data into the third storage path.
Optionally, the method further comprises:
the third obtaining submodule is used for obtaining test configuration information input by a target user, wherein the test configuration information comprises test sequence information;
and the third execution sub-module is used for configuring a test case execution sequence according to the test sequence information and executing the at least one test case according to the test case execution sequence.
Optionally, the method further comprises:
the fourth obtaining submodule is used for obtaining a data comparison result of the at least one test case;
and the fourth execution submodule is used for generating test information in a preset state code format when the data comparison result of the at least one test case is correct.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device, including a memory and a processor, where the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to execute the steps of the control method for data processing test.
To solve the above technical problem, an embodiment of the present invention further provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to execute the steps of the control method for data processing test.
The embodiment of the invention has the beneficial effects that: by acquiring a plurality of test cases, wherein any test case comprises test input data information and test expected data information of the test case, target input data and target expected data are respectively acquired according to the test input data information and the test expected data information of any test case, and the system executes all test cases according to the test execution rule, so that each test case executes corresponding target input data to generate test result data, then the test result data of each test case is compared with the target expected data of the corresponding test case, and test information is generated according to the comparison result, so that the operations of data input, downloading, comparison and the like in the test process do not need the participation of test personnel, the workload of the test personnel can be effectively reduced, and the test efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a basic flow chart of a control method for data processing test according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating the process of acquiring target input data according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating the process of obtaining target expected data according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating an embodiment of storing test result data;
FIG. 5 is a basic flowchart illustrating the execution of test cases according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a basic flow chart of generating test information according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a basic structure of a control device for data processing test according to an embodiment of the present invention;
FIG. 8 is a block diagram of the basic structure of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.
In some of the flows described in the present specification and claims and in the above figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, with the order of the operations being indicated as 101, 102, etc. merely to distinguish between the various operations, and the order of the operations by themselves does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
Referring to fig. 1, fig. 1 is a basic flow chart illustrating a control method of a data processing test according to the present embodiment.
As shown in fig. 1, a control method of a data processing test includes the steps of:
s1100, acquiring at least one preset test case, wherein any test case comprises test input data information and test expected data information;
the test case is a set of test inputs, execution conditions, and expected results that are programmed for a particular purpose to test a certain program path or verify whether a certain requirement is met, and to make the result of data processing satisfactory to the user, it is necessary to ensure the logical correctness of data processing, i.e., to verify the user's expectation and confirm the validity thereof, so that in the development process of data processing, the logic of data processing needs to be tested, and the test case reflects the requirement to be verified. In implementation, the test cases may be input by a tester, and the test cases used for different data processing procedures are different. A tester adds a test case aiming at a preset data processing process in the system, the test case comprises test input data information and test expected data information, and the system can obtain the test case and execute the test case to test the logic of data processing. In specific implementation, the system includes a plurality of data processing processes, and test cases may be added to the plurality of data processing processes, or certainly, a plurality of test cases that do not have a test purpose may be added to the same data processing process.
In one embodiment, taking the application of the control method for data processing test of the invention to testing the data processing process of a Hadoop platform as an example, Hadoop is a distributed system infrastructure developed by Apache foundation, testers add test cases aiming at a certain data processing process in the Hadoop platform in the system, the test case must inherit the abstract parent class provided by the frame (Hadoop platform), and of course, when in implementation, the control method of the data processing test of the invention can also be applied to other frames, such as ElasticSearch (ElasticSearch is a Lucene-based search server), Spark (Spark is a fast general-purpose computing engine designed for large-scale data processing), Storm (Storm is a distributed real-time big data processing system), or Kafka (Kafka is a high-throughput distributed publish-subscribe messaging system that can process all the action flow data of consumers in a web site).
S1200, aiming at each test case, acquiring target input data according to the test input data information, and acquiring target expected data according to the test expected data information;
each test case carries test input data information and test expected data information, the system can respectively search and acquire target input data and target expected data corresponding to the test case according to the test input data information and the test expected data information, when the system is implemented, the target input data and the target expected data are used for logic correctness of a certain data processing process in a test frame, the target input data can be used for data processing of the certain data processing process in the test frame, such as simple four-way arithmetic data processing, linear regression arithmetic processing or other data arithmetic processing, and the target expected data are used for verifying data correctness output by the data processing process and correspond to the target input data.
In one embodiment, the test input data information and the test expected data information of the same test case may be integrated into the name of the test case, and taking the example that the test data is stored in the class-a disc class-B C folder and the verification data is stored in the class-a disc class-B C folder, the test case may be named as "class-a disc class-B C folder test + class-B disc class-C folder expected", and the file type of the test case corresponds to the frame, for example, the input of the data processing of the Hadoop platform is an HDFS file or a Hive table, so that the test case can be read by the Hadoop platform. The system obtains the test input data information and the test expected data information through the calculation rule matched with the naming rule, and defines the storage path and file name calculation rule of the target input data by taking the naming of the test case as an example, wherein the storage path and file name calculation rule comprises the following steps: and acquiring a storage path and a file name of corresponding target input data according to the packet name and the class name of the test case, wherein the packet name of the test case is divided according to the 'txt' and then sequentially corresponds to each level of folder directory of the target input data storage path, the class name and a specific suffix correspond to the file name of the target input data in the leaf folder, and the specific suffix comprises but is not limited to the 'txt' and the 'csv' and the like. Similarly, the storage path and file naming rule for the target expected data are as follows: and acquiring a storage path and a file name of corresponding target expected data according to the packet name and the class name of the test case, wherein the packet name of the test case is divided according to the ". multidot.m. and then sequentially corresponds to each level of folder directory of the target expected data storage path, the class name and the specific suffix correspond to the file name of the target expected data in the leaf folder, and the specific suffix comprises but is not limited to". txt "and". csv ".
In an optional embodiment, the storage path and the file name of the target input data and the target expected data may be obtained by means of keyword matching, for example, a test case name "a.b.c. test. txt + a.b.c. expected. txt", where "a.b.c" corresponds to a folder directory of each level of the storage path of the target input data, and "test. txt" corresponds to the file name of the target input data, and the system may locate the target input data according to the storage path and the file name. The 'a.b.c' corresponds to the folder directory of each level of the storage path of the target expected data, the 'expected.txt' corresponds to the file name of the target expected data, and the system can locate the target expected data according to the storage path and the file name. In implementation, in order to distinguish from the suffix of the test case, the file names of the target input data and the target expected data in the name of the test case may be modified, and in the test case, the file name of the target input data is "test.
S1300, executing the at least one test case according to a preset test execution rule so that each test case executes the corresponding target input data to generate test result data;
after the target input data and the target expected data are acquired, the system executes the at least one test case according to a preset test execution rule, when the test execution rule is implemented, the test execution rule is used for stipulating an execution sequence of the test case, the test execution rule can be configured by a tester according to requirements, for example, all the test case sequences can be configured for serial execution, the test case can be executed in parallel according to a preset condition, for example, two, three or all the test cases are executed in parallel, and when each test case is executed, only the target input data corresponding to the test case is executed, so that the test result data corresponding to the test case is generated. Taking three test cases comprising a test case 1, a test case 2 and a test case 3 as an example, when the test cases are executed in series according to a sequence, the system sequentially executes the test case 1, the test case 2 and the test case 3, when the test case 1 is executed, target input data corresponding to the test case 1 are input into a data processing process in a Hadoop platform, and test result data corresponding to the test case 1 output by the Hadoop platform are received; when the test case 2 is executed, target input data corresponding to the test case 2 is input into a data processing process in the Hadoop platform, and test result data corresponding to the test case 2 and output by the Hadoop platform are received, when the test case 3 is executed, target input data corresponding to the test case 3 is input into a data processing process in the Hadoop platform, and test result data corresponding to the test case 3 and output by the Hadoop platform are received.
When the test case 1, the test case 2 and the test case 3 are executed in parallel, the system executes the test case 1, the test case 2 and the test case 3 simultaneously, target input data corresponding to the test case 1 are input into a data processing process corresponding to the test case 1, target input data corresponding to the test case 2 are input into a data processing process corresponding to the test case 2, target input data corresponding to the test case 3 are input into a data processing process corresponding to the test case 3, and then test result data corresponding to the test case 1, the test case 2 and the test case 3 and output by the Hadoop platform are received.
S1400, comparing the test result data of the at least one test case with the target expected data of the corresponding test case respectively, and generating test information according to the comparison result.
And for each test case, after the system finishes executing one test case, comparing the test result data of the unified test case with the target expected data, and generating test information of the test case according to the comparison result, wherein the test information is used for indicating whether the test case passes or not, when the test result data is inconsistent with the target expected data, the test case does not pass, and when the test result data is consistent with the target expected data, the test case passes. When all the test cases pass, the test process of the control method for data processing test ends with 0 as the state code, otherwise, 1 as the state code.
In the embodiment, a plurality of test cases are obtained, any test case includes test input data information and test expected data information of the test case, for any test case, target input data and target expected data are respectively obtained according to the test input data information and the test expected data information, and the system executes all test cases according to the test execution rule, so that each test case executes corresponding target input data to generate test result data, the test result data of each test case is compared with the target expected data of the corresponding test case, and test information is generated according to the comparison result, so that the operations of data input, downloading, comparison and the like in the test process do not need the participation of testers, the workload of the testers can be effectively reduced, and the test efficiency is improved.
In an alternative embodiment, please refer to fig. 2, and fig. 2 is a schematic flowchart illustrating a specific process of acquiring target input data according to an embodiment of the present invention.
As shown in fig. 2, the step of obtaining the target input data according to the test input data information for each test case includes the following steps:
s1210, determining a package name and a class name of each test case, wherein the package name comprises first storage path information of the target input data of the corresponding test case, and the class name comprises a first file name of the target input data of the corresponding test case;
the name of the test case comprises a packet name and a class name, the packet name carries first storage path information of target input data of the test case, the first storage path information is used for representing a storage path of the target input data of the test case, the class name carries a first file name of the target input data of the test case, in implementation, the class name further comprises a file type of the target input data of the test case, namely a suffix of a target input data file, and the file type of the target input data comprises but is not limited to ". txt" and ". csv".
S1220, aiming at each test case, obtaining the target input data of the corresponding test case according to the first storage path information and the first file name.
After first storage path information of target input data of a test case is acquired, a storage path of the target input data can be acquired according to the first storage path information, and then the target input data is acquired according to the storage path, taking the name of the test case as 'A.B.C. test.txt', the system divides the packet names of the test case according to 'right', and sequentially corresponds to all levels of folder directories of the storage path of the target input data, namely 'A.B.C' is all levels of folder directories of the target input data, for example, 'A', 'B' and 'C' respectively represent an A database, a B folder and a C folder, wherein the B folder belongs to one folder in the A database, the C folder belongs to one subfolder in the B folder, the test 'represents the file name of the target input data, and the txt' represents the file suffix of the target input data, the storage position of the target input data can be positioned through the first storage path information and the first file name, and then the target input data is obtained.
In an embodiment, the storage path and the file name of the target input data are different for different test cases, for example, the file name of the target input data of test case 1 may be designed to be "test 1. txt", and the file name of the target input data of test case 2 may be designed to be "test 2. txt", and of course, the file name of the target input data may also be designed to be in other styles, so that the target input data of different test cases can be distinguished.
Similarly, referring to fig. 3, fig. 3 is a basic flowchart illustrating a step of obtaining target expected data according to an embodiment of the present invention, where the step of obtaining target expected data may refer to the step of obtaining target input data, where the step of obtaining target expected data according to the test expected data information includes the following steps:
s1230, determining a package name and a class name of each test case, wherein the package name comprises second storage path information of the target expected data of the corresponding test case, and the class name comprises a second file name of the target expected data of the corresponding test case;
the packet name of the test case may further carry second storage path information of the target expected data corresponding to the test case, where the second storage path information characterizes a storage path of the target expected data, the class name of the test case further carries a second file name of the target expected data, and in implementation, the class name further includes a file type of the target expected data, that is, a suffix of the target expected data file, and the file suffix of the target expected data includes, but is not limited to, ". txt" and ". csv"
S1240, aiming at each test case, obtaining the target expected data of the corresponding test case according to the second storage path information and the second file name.
After second storage path information of target expected data of a test case is acquired, a storage path of the target expected data can be acquired according to the second storage path information, and then the target expected data is acquired according to the storage path, wherein the test case is named as ' A.B.C. test.txt + a.b.c. expected.txt ', for example, after the package names of the test cases are divided according to ' a ', the system sequentially corresponds to all levels of folder directories of the storage path of the target expected data, namely ' a.b.c ' is all levels of folder directories of the target expected data, for example, ' a ', ' b ' and ' c ' respectively represent a disc, b folder and c folder, wherein b folder belongs to one folder in a disc, c folder belongs to one subfolder in b folder, expected ' represents the file name of the target expected data, and ' txt ' represents the file suffix of the target expected data, the target expected data can be obtained through the second storage path information and the second file name.
For the test result data output after the execution of one test case is finished, the system can also store the test result data, and then compare the test result data with the target expected data file to judge whether the test case passes or not. Referring to fig. 4, fig. 4 is a basic flow chart illustrating a process of storing test result data according to an embodiment of the invention.
As shown in fig. 4, after step S1300, the following steps are further included:
s1310, calculating and generating a third storage path and a third file name of the test result data of the corresponding test case according to the package name and the class name of each test case;
after the test case is operated, the test result data can be stored, in order to enable the test case to correspond to the test result data, a storage path and a file name of the test result data can be calculated and generated according to a package name and a class name of the test case, when the test case is implemented, the package name of the test case comprises storage path information of target input data and target expected data, the storage path can also be used as a storage path of the test result data, and therefore the target input data, the target expected data and the test result data of the same test case are stored in the same folder and are convenient to manage, wherein a third storage path of the test result data corresponds to the storage path of the target expected data, and the file type of the test result data corresponds to the file type of the target expected data.
S1320, aiming at each test case, determining the name information of the test result data of the corresponding test case according to the third storage path and the third file name combination of the same test case, and storing the test result data into the third storage path.
After a third storage path and a third file name of the test result data are obtained, the test result data can be named and stored according to the third storage path and the third file name, the name of the test case is ' e.f.g. expected.csv ', wherein ' e.f.g ' is a folder directory of each level stored by the target expected data of the test case, ' expected ' is a file name of the target expected data, ' csv ' is a suffix of the target expected data, according to the packet name and the class name of the test case, the third storage path of the test result data can be calculated to be ' e.f.g ', the third file name is ' result ', the type can be the same as the file type of the target expected data, the name of the test result data is ' e.f.g. result, ' csv ', and the test result data can be stored in the folder directory of each level corresponding to ' e.f.g ', so that the test result data and the target expected data of the same test case can be compared conveniently, the testing efficiency is improved.
In an alternative embodiment, please refer to fig. 5, where fig. 5 is a schematic diagram of a basic flow of executing a test case according to an embodiment of the present invention.
As shown in fig. 5, step S1300 includes the following steps:
s1301, obtaining test configuration information input by a target user, wherein the test configuration information comprises test sequence information;
the test execution rule may be configured by a user, and then at least one test case may be executed according to the configured test execution rule. The system firstly obtains test configuration information input by a target user, the test configuration information comprises test sequence information, when the system is implemented, taking a Hadoop platform as an example, a tester adds 2 test cases in the system, the system respectively obtains target input data and target expected data according to the packet names and class names of the two test cases, the tester inputs the test configuration information according to needs to configure the execution of the test cases, and the system can obtain the test sequence information in the test configuration information.
S1302, configuring a test case execution sequence according to the test sequence information, and executing the at least one test case according to the test case execution sequence.
The system configures an execution sequence of the test cases according to the test sequence information, or the two test cases are taken as an example and comprise a first test case and a second test case, wherein the first test case is used for testing a first section of data processing logic in the frame, the second test case is used for testing a second section of data processing logic in the frame, the first section of data processing process is prior to the second section of data processing process in the frame, and a user can configure the first test case and the second test case to be executed in series according to requirements, namely, the first test case is executed first and then the second test case is executed; the test cases can also be executed in parallel, namely the first test case and the second test case are executed simultaneously, so that different test requirements are met.
In an alternative embodiment, please refer to fig. 6, where fig. 6 is a basic flow diagram illustrating the generation of test information according to an embodiment of the present invention.
As shown in fig. 6, step S1400 includes the following steps:
s1410, acquiring a data comparison result of the at least one test case;
after each test case is executed, the system calculates the storage type and the storage path of corresponding test result data according to the class name and the configuration file of the test case, stores the test result data, compares the test result data with a target expected data file of the same test case, considers that the test case passes under the condition that the contents of the two files are completely consistent, and otherwise, considers that the test case does not pass, thereby obtaining the data comparison result of each test case.
And S1420, when the data comparison result of the at least one test case is correct, generating test information in a preset state code format.
After the data comparison results of all the test cases are obtained, the system verifies whether the data comparison results of all the test cases are correct, namely, all the test cases are verified to pass, and test information is correspondingly generated, wherein the test information is in a preset state code format.
In order to solve the above technical problem, an embodiment of the present invention further provides a control device for data processing test.
Referring to fig. 7, fig. 7 is a schematic diagram of a basic structure of a control device for data processing test according to the present embodiment.
As shown in fig. 7, a control apparatus for data processing test includes: the test system comprises a first obtaining module 2100, a first processing module 2200, a first executing module 2300 and a data comparing module 2400, wherein the first obtaining module 2100 is configured to obtain at least one preset test case, and any test case includes test input data information and test expected data information; the first processing module 2200 is configured to, for each test case, obtain target input data according to the test input data information, and obtain target expected data according to the test expected data information; the first execution module 2300 is configured to execute the at least one test case according to a preset test execution rule, so that each test case executes the corresponding target input data to generate test result data; the data comparison module 2400 is configured to compare the test result data of the at least one test case with the target expected data of the corresponding test case, and generate test information according to a comparison result.
In the embodiment, a plurality of test cases are obtained, any test case includes test input data information and test expected data information of the test case, for any test case, target input data and target expected data are respectively obtained according to the test input data information and the test expected data information, and the system executes all test cases according to the test execution rule, so that each test case executes corresponding target input data to generate test result data, the test result data of each test case is compared with the target expected data of the corresponding test case, and test information is generated according to the comparison result, so that the operations of data input, downloading, comparison and the like in the test process do not need the participation of testers, the workload of the testers can be effectively reduced, and the test efficiency is improved.
In some embodiments, the control device for data processing test further comprises: the test system comprises a first acquisition submodule and a first execution submodule, wherein the first acquisition submodule is used for determining a package name and a class name of each test case, the package name comprises first storage path information of target input data of the corresponding test case, and the class name comprises a first file name of the target input data of the corresponding test case; the first execution submodule is used for acquiring the target input data of the corresponding test case according to the first storage path information and the first file name aiming at each test case.
In some embodiments, the control device for data processing test further comprises: the second obtaining submodule is used for determining a package name and a class name of each test case, wherein the package name comprises second storage path information of the target expected data of the corresponding test case, and the class name comprises a second file name of the target expected data of the corresponding test case; and the second execution submodule is used for acquiring the target expected data of the corresponding test case according to the second storage path information and the second file name aiming at each test case.
In some embodiments, the control device for data processing test further comprises: the system comprises a path generation module and a storage module, wherein the path generation module is used for calculating and generating a third storage path and a third file name of the test result data of the corresponding test case according to the package name and the class name of each test case; the storage module is used for determining the name information of the test result data of the corresponding test case according to the third storage path and the third file name combination of the same test case aiming at each test case, and storing the test result data into the third storage path.
In some embodiments, the test system comprises a third obtaining sub-module and a third executing sub-module, wherein the third obtaining sub-module is configured to obtain test configuration information input by a target user, and the test configuration information includes test sequence information; and the third execution sub-module is used for configuring a test case execution sequence according to the test sequence information and executing the at least one test case according to the test case execution sequence.
In some embodiments, the control device for data processing test further comprises: the fourth obtaining submodule is used for obtaining a data comparison result of the at least one test case; the fourth execution submodule is used for generating test information in a preset state code format when the data comparison result of the at least one test case is correct.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device. Referring to fig. 8, fig. 8 is a block diagram of a basic structure of a computer device according to the present embodiment.
As shown in fig. 8, the internal structure of the computer device is schematically illustrated. As shown in fig. 8, the computer apparatus includes a processor, a nonvolatile storage medium, a memory, and a network interface connected through a system bus. The non-volatile storage medium of the computer device stores an operating system, a database and computer readable instructions, the database can store control information sequences, and the computer readable instructions can enable the processor to realize a control method of data processing test when being executed by the processor. The processor of the computer device is used for providing calculation and control capability and supporting the operation of the whole computer device. The memory of the computer device may have stored therein computer readable instructions that, when executed by the processor, may cause the processor to perform a method of controlling a data processing test. The network interface of the computer device is used for connecting and communicating with the terminal. It will be appreciated by those skilled in the art that the configurations shown in the figures are block diagrams of only some of the configurations relevant to the present application, and do not constitute a limitation on the computing devices to which the present application may be applied, and that a particular computing device may include more or less components than those shown in the figures, or may combine certain components, or have a different arrangement of components.
In this embodiment, the processor is configured to execute the first obtaining module 2100, the first processing module 2200, the first executing module 2300 and the data comparing module 2400 in fig. 7, and the memory stores program codes and various data required for executing the modules. The network interface is used for data transmission to and from a user terminal or a server. The memory in the present embodiment stores program codes and data necessary for executing all the submodules in the control device for data processing test, and the server can call the program codes and data of the server to execute the functions of all the submodules.
The computer obtains a plurality of test cases which comprise test input data information and test expected data information, then obtains target input data according to the test input data information, and the system executes the test cases according to the test execution rule so as to obtain test result data of the test cases, and then compares the test result data with the target expected data obtained according to the test expected data information so as to generate test information.
The present invention also provides a storage medium storing computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the method of controlling a data processing test described in any of the embodiments above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method of controlling a data processing test, comprising the steps of:
acquiring at least one preset test case, wherein any test case comprises test input data information and test expected data information;
for each test case, acquiring target input data according to the test input data information, and acquiring target expected data according to the test expected data information;
executing the at least one test case according to a preset test execution rule so that each test case executes corresponding target input data to generate test result data;
and comparing the test result data of the at least one test case with the target expected data of the corresponding test case respectively, and generating test information according to the comparison result.
2. The method according to claim 1, wherein the step of obtaining target input data from the test input data information for each test case comprises the steps of:
determining a package name and a class name of each test case, wherein the package name comprises first storage path information of the target input data of the corresponding test case, and the class name comprises a first file name of the target input data of the corresponding test case;
and aiming at each test case, acquiring the target input data of the corresponding test case according to the first storage path information and the first file name.
3. The method for controlling data processing test according to claim 1, wherein the step of obtaining target expected data based on the test expected data information includes the steps of:
determining a package name and a class name of each test case, wherein the package name comprises second storage path information of the target expected data of the corresponding test case, and the class name comprises a second file name of the target expected data of the corresponding test case;
and aiming at each test case, acquiring the target expected data of the corresponding test case according to the second storage path information and the second file name.
4. The method according to claim 2 or 3, wherein after the step of executing the at least one test case according to a preset test execution rule to enable each test case to execute the corresponding target input data to generate the test result data, the method further comprises the following steps:
calculating and generating a third storage path and a third file name of the test result data of the corresponding test case according to the package name and the class name of each test case;
and for each test case, determining the name information of the test result data of the corresponding test case according to the third storage path and the third file name combination of the same test case, and storing the test result data into the third storage path.
5. The method according to claim 1, wherein the step of executing the at least one test case according to a preset test execution rule comprises the steps of:
acquiring test configuration information input by a target user, wherein the test configuration information comprises test sequence information;
and configuring a test case execution sequence according to the test sequence information, and executing the at least one test case according to the test case execution sequence.
6. The method according to claim 1, wherein the step of comparing the test result data of the at least one test case with the target expected data of the corresponding test case and generating the test information according to the comparison result comprises the steps of:
acquiring a data comparison result of the at least one test case;
and when the data comparison result of the at least one test case is correct, generating test information in a preset state code format.
7. A control apparatus for data processing testing, comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring at least one preset test case, and any test case comprises test input data information and test expected data information;
the first processing module is used for acquiring target input data according to the test input data information and acquiring target expected data according to the test expected data information aiming at each test case;
the first execution module is used for executing the at least one test case according to a preset test execution rule so that each test case executes the corresponding target input data to generate test result data;
and the data comparison module is used for comparing the test result data of the at least one test case with the target expected data of the corresponding test case respectively and generating test information according to the comparison result.
8. The control device for data processing test according to claim 7, further comprising:
the first obtaining submodule is used for determining a package name and a class name of each test case, wherein the package name comprises first storage path information of the target input data of the corresponding test case, and the class name comprises a first file name of the target input data of the corresponding test case;
and the first execution submodule is used for acquiring the target input data of the corresponding test case according to the first storage path information and the first file name aiming at each test case.
9. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to carry out the steps of the method of controlling a data processing test according to any one of claims 1 to 6.
10. A storage medium having stored thereon computer readable instructions which, when executed by one or more processors, cause the one or more processors to carry out the steps of a method of controlling a data processing test according to any one of claims 1 to 6.
CN201911053607.5A 2019-10-31 2019-10-31 Control method and device for data processing test, computer equipment and storage medium Active CN110781090B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911053607.5A CN110781090B (en) 2019-10-31 2019-10-31 Control method and device for data processing test, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911053607.5A CN110781090B (en) 2019-10-31 2019-10-31 Control method and device for data processing test, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110781090A true CN110781090A (en) 2020-02-11
CN110781090B CN110781090B (en) 2023-09-12

Family

ID=69388060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911053607.5A Active CN110781090B (en) 2019-10-31 2019-10-31 Control method and device for data processing test, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110781090B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538666A (en) * 2020-04-27 2020-08-14 深圳忆联信息系统有限公司 Method and device for collecting test results in batches, computer equipment and storage medium
CN111625471A (en) * 2020-06-12 2020-09-04 北京灵汐科技有限公司 Execution processing and exception positioning method, device, equipment and medium of test case
CN112199297A (en) * 2020-10-30 2021-01-08 久瓴(江苏)数字智能科技有限公司 Data testing method and device, nonvolatile storage medium and processor

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050204343A1 (en) * 2004-03-12 2005-09-15 United Parcel Service Of America, Inc. Automated test system for testing an application running in a windows-based environment and related methods
JP2013186696A (en) * 2012-03-08 2013-09-19 Nec Corp Test method for distributed processing system and distributed processing system
CN103631720A (en) * 2013-12-20 2014-03-12 百度在线网络技术(北京)有限公司 Method and device for generating test case
CN106326116A (en) * 2016-08-17 2017-01-11 北京奇虎科技有限公司 Method and device for testing product
CN107665171A (en) * 2017-10-11 2018-02-06 中国民生银行股份有限公司 Automatic regression test method and device
CN108108297A (en) * 2016-11-25 2018-06-01 腾讯科技(深圳)有限公司 The method and apparatus of automatic test
US20180173606A1 (en) * 2016-12-15 2018-06-21 Syntel, Inc. Hybrid testing automation engine
CN109800154A (en) * 2018-12-15 2019-05-24 深圳壹账通智能科技有限公司 Loading method, device, computer equipment and the storage medium of test data
CN109885488A (en) * 2019-01-30 2019-06-14 上海卫星工程研究所 The satellite orbit software for calculation automated testing method and system of use-case table- driven
CN109947646A (en) * 2019-03-13 2019-06-28 平安信托有限责任公司 Interface test method, device, computer equipment and storage medium
CN110162468A (en) * 2019-04-26 2019-08-23 腾讯科技(深圳)有限公司 A kind of test method, device and computer readable storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050204343A1 (en) * 2004-03-12 2005-09-15 United Parcel Service Of America, Inc. Automated test system for testing an application running in a windows-based environment and related methods
JP2013186696A (en) * 2012-03-08 2013-09-19 Nec Corp Test method for distributed processing system and distributed processing system
CN103631720A (en) * 2013-12-20 2014-03-12 百度在线网络技术(北京)有限公司 Method and device for generating test case
CN106326116A (en) * 2016-08-17 2017-01-11 北京奇虎科技有限公司 Method and device for testing product
CN108108297A (en) * 2016-11-25 2018-06-01 腾讯科技(深圳)有限公司 The method and apparatus of automatic test
US20180173606A1 (en) * 2016-12-15 2018-06-21 Syntel, Inc. Hybrid testing automation engine
CN107665171A (en) * 2017-10-11 2018-02-06 中国民生银行股份有限公司 Automatic regression test method and device
CN109800154A (en) * 2018-12-15 2019-05-24 深圳壹账通智能科技有限公司 Loading method, device, computer equipment and the storage medium of test data
CN109885488A (en) * 2019-01-30 2019-06-14 上海卫星工程研究所 The satellite orbit software for calculation automated testing method and system of use-case table- driven
CN109947646A (en) * 2019-03-13 2019-06-28 平安信托有限责任公司 Interface test method, device, computer equipment and storage medium
CN110162468A (en) * 2019-04-26 2019-08-23 腾讯科技(深圳)有限公司 A kind of test method, device and computer readable storage medium

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
F. RICCA等: "Analysis and testing of Web applications", PROCEEDINGS OF THE 23RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, pages 25 - 34 *
孙沫涵: "Android系统的持续集成自动化测试框架的研究与实践", 中国优秀硕士学位论文全文数据库 信息科技辑, no. 3, pages 138 - 1165 *
张清等: "针对EJB测试特殊性扩充JUnit框架", 成都信息工程学院学报, vol. 20, no. 4, pages 429 - 433 *
毛澄映等: "分支测试中测试路径用例的简化生成方法", 《计算机研究与发展》 *
毛澄映等: "分支测试中测试路径用例的简化生成方法", 《计算机研究与发展》, vol. 43, no. 2, 31 December 2006 (2006-12-31), pages 321 - 328 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538666A (en) * 2020-04-27 2020-08-14 深圳忆联信息系统有限公司 Method and device for collecting test results in batches, computer equipment and storage medium
CN111538666B (en) * 2020-04-27 2024-04-02 深圳忆联信息系统有限公司 Method, device, computer equipment and storage medium for collecting test results in batches
CN111625471A (en) * 2020-06-12 2020-09-04 北京灵汐科技有限公司 Execution processing and exception positioning method, device, equipment and medium of test case
CN111625471B (en) * 2020-06-12 2023-05-09 北京灵汐科技有限公司 Method, device, equipment and medium for executing and processing test cases and locating abnormality
CN112199297A (en) * 2020-10-30 2021-01-08 久瓴(江苏)数字智能科技有限公司 Data testing method and device, nonvolatile storage medium and processor

Also Published As

Publication number Publication date
CN110781090B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
US10353913B2 (en) Automating extract, transform, and load job testing
US11163731B1 (en) Autobuild log anomaly detection methods and systems
CN110781090A (en) Control method and device for data processing test, computer equipment and storage medium
CN109947646A (en) Interface test method, device, computer equipment and storage medium
US8756460B2 (en) Test selection based on an N-wise combinations coverage
US20170060546A1 (en) System and method for providing software build violation detection and self-healing
CN108399151B (en) Data comparison system and method
CN111309734B (en) Method and system for automatically generating table data
CN111382073A (en) Automatic test case determination method, device, equipment and storage medium
US20190086908A1 (en) Devices, methods, and systems for a distributed rule based automated fault detection
US9582270B2 (en) Effective feature location in large legacy systems
CN109814877A (en) Project dispositions method and its device based on environmental management
CN114116496A (en) Automatic testing method, device, equipment and medium
CN112631919A (en) Comparison test method and device, computer equipment and storage medium
US10261922B2 (en) Field device commissioning system and field device commissioning method
CN111813377A (en) Method and device for automatically generating application program
CN114996127A (en) Intelligent test method and system for solid state disk firmware module
CN107357721B (en) Method and device for testing system
CN109684205B (en) System testing method, device, electronic equipment and storage medium
CN111400245B (en) Art resource migration method and device
US11347533B2 (en) Enhanced virtual machine image management system
CN103761247B (en) A kind of processing method and processing device of error file
CN111274128A (en) Test method, test device, computer equipment and computer readable storage medium
CN112416648A (en) Data verification method and device
CN114143235A (en) NFV automatic test method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 801-2, floor 8, building 3, No. 22, Ronghua Middle Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Applicant after: Wanghai Kangxin (Beijing) Technology Co.,Ltd.

Address before: Room 07, Room 2, Building B, 12 Hongda North Road, Beijing Daxing District, Beijing

Applicant before: BEIJING NEUSOFT VIEWHIGH TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant