CN110781090B - 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
CN110781090B
CN110781090B CN201911053607.5A CN201911053607A CN110781090B CN 110781090 B CN110781090 B CN 110781090B CN 201911053607 A CN201911053607 A CN 201911053607A CN 110781090 B CN110781090 B CN 110781090B
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.)
Active
Application number
CN201911053607.5A
Other languages
Chinese (zh)
Other versions
CN110781090A (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.)
Wanghai Kangxin Beijing Technology Co ltd
Original Assignee
Wanghai Kangxin Beijing 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 Wanghai Kangxin Beijing Technology Co ltd filed Critical Wanghai Kangxin Beijing 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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a control method, a device, computer equipment and a storage medium for data processing test, which comprise the following steps: acquiring at least one preset test case, wherein any test case comprises test input data information and test expected data information; 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; executing 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 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. The operations such as data input, downloading and comparison in the data testing process 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, a device, computer equipment and a storage medium for data processing test.
Background
Data processing has become an important component in work and life, for example, businesses mine valuable information through data processing, thereby gaining business value. In the development process of data processing, the logic of the data processing needs to be tested, so that the logic of the data processing is ensured to be correct.
However, in the existing test method, a tester needs to upload input data to a large data platform before starting test work, and after finishing data processing, output data is downloaded and compared with expected data, and in the test process, the work such as uploading, downloading and comparing of the data needs to be manually participated, so that great workload is added to the tester, and the efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a control method, a device, computer equipment and a storage medium for data processing test, which can improve the test efficiency.
In order to solve the technical problems, the embodiment of the invention adopts the following technical scheme: there is provided a control method of 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;
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;
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 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 acquiring 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 the preset test execution rule to enable each test case to execute the corresponding target input data to generate test result data, the method further includes the following steps:
calculating a third storage path and a third file name of the test result data of each test case according to the package name and the class name of the corresponding test case;
and aiming at each test case, determining 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 the execution sequence of the test cases according to the test sequence information, and executing the at least one test case according to the execution sequence of the test cases.
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 status code format.
In order to solve the above technical problem, an embodiment of the present invention further provides a control device for data processing testing, including:
the first acquisition module is used for acquiring at least one preset test case, wherein 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 respectively 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.
Optionally, the method further comprises:
the first acquisition sub-module 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;
the first execution sub-module 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 acquisition sub-module 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 sub-module 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;
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 for each test case, and storing the test result data into the third storage path.
Optionally, the method further comprises:
the third acquisition sub-module is used for acquiring 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 the execution sequence of the test cases according to the test sequence information and executing the at least one test case according to the execution sequence of the test cases.
Optionally, the method further comprises:
a fourth obtaining sub-module, configured to obtain a data comparison result of the at least one test case;
and the fourth execution sub-module is used for generating test information in a preset status code format when the data comparison result of the at least one test case is correct.
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 when the computer readable instructions are executed by the processor, the processor executes the steps of the control method for data processing testing described above.
To solve the above technical problem, an embodiment of the present invention further provides a storage medium storing computer readable instructions, where the computer readable instructions when executed by one or more processors cause the one or more processors to execute the steps of the control method for data processing testing described above.
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, for any 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, and the system executes all the test cases according to test execution rules, 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, test information is generated according to the comparison result, and the operations such as data input, downloading and comparison in the test process do not need the participation of test personnel, thereby effectively reducing the workload of the test personnel and improving the test efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a basic flow of a control method for data processing testing according to an embodiment of the present invention;
FIG. 2 is a flow chart of acquiring target input data according to an embodiment of the present invention;
FIG. 3 is a flow chart of acquiring target expected data according to an embodiment of the present invention;
FIG. 4 is a flow chart of storing test result data according to an embodiment of the present invention;
FIG. 5 is a basic flow diagram of a test case execution according to an embodiment of the present invention;
FIG. 6 is a basic flow diagram 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 testing according to an embodiment of the present invention;
FIG. 8 is a basic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to enable those skilled in the art to better understand the present invention, the following description will make clear and complete descriptions of the technical solutions according to the embodiments of the present invention with reference to the accompanying drawings.
In some of the flows described in the specification and claims of the present invention and in the foregoing figures, a plurality of operations occurring in a particular order are included, but it should be understood that the operations may be performed out of order or performed in parallel, with the order of operations such as 101, 102, etc., being merely used to distinguish between the various operations, the order of the operations themselves not representing any order of execution. In addition, 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" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
Example 1
Referring to fig. 1 specifically, fig. 1 is a basic flow chart of a control method of a data processing test in the present embodiment.
As shown in fig. 1, a control method for a data processing test includes the following steps:
s1100, acquiring at least one preset test case, wherein any test case comprises test input data information and test expected data information;
test cases are a set of test inputs, execution conditions and expected results compiled for a particular objective to test a program path or verify whether a particular requirement is met, and to satisfy a user with the data processing results, the logic correctness of the data processing needs to be ensured, i.e. the user's expectations are verified and their validity is confirmed, so during the development of the data processing, the logic of the data processing needs to be tested, and the test cases reflect the requirement to be verified. When in implementation, the test cases can be input by testers, and the test cases used for different data processing processes are different. The test staff adds a test case aiming at a preset data processing process in the system, wherein the test case comprises test input data information and test expected data information, and the system can acquire 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 can be added for the plurality of data processing processes respectively, and of course, a plurality of test cases without testing purposes can also be added for the same data processing process.
In one embodiment, taking the control method of the data processing test of the present invention as an example for testing the data processing process of the Hadoop platform, hadoop is a distributed system infrastructure developed by the Apache foundation, a tester adds a test case for a certain data processing process in the Hadoop platform into the system, the test case must inherit an abstract parent class provided by the framework (Hadoop platform), and of course, when implementing, the control method of the data processing test of the present invention can also be applied to other frameworks, for example, elastic search (elastic search is a search server based on Lucene), spark (Spark is a fast general-purpose computing engine designed for large-scale data processing), storm (Storm is a distributed real-time large data processing system), or Kafka (Kafka is a high throughput distributed publishing subscription message system, which can process all action stream data of consumers in a website).
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 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 respectively, when the system is implemented, the target input data and the target expected data are used for the logic correctness of a certain data processing process in the test frame, the target input data can be used for the data processing process in the test frame to perform data processing, such as simple four-rule operation data processing, linear regression operation processing or other data operation processing, and the target expected data are used for verifying the data correctness output by the data processing process corresponding 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 in the name of the test case, where the test data is stored in the a-disc B-type C folder and the verification data is stored in the a-disc B-type C folder as an example, the test case may be named as "a-disc B-type C folder test+a-disc B-type C folder expected", and the file type of the test case corresponds to the frame, for example, the input of the data processing in the Hadoop platform is an HDFS file or a Hive table, so that the test case may 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, takes the storage path and the file name of the target input data and the target expected data as examples by naming the test case, and defines the storage path and the file name calculation rule of the target input data as follows: and acquiring a storage path and a file name of the corresponding target input data according to the package name and the class name of the test case, wherein the package name of the test case is divided according to 'the class name' and sequentially corresponds to each layer of folder catalogue of the storage path of the target input data, the class name and the 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 'txt' and 'csv'. Similarly, the storage path and file naming rules 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 package name and the class name of the test case, wherein the package name of the test case is divided according to ' the folder catalogues of all levels of the storage path of the target expected data, 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 alternative 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, taking the test case name "a.b.c. test. Txt+a.b.c. expected. Txt" as an example, where "a.b.c" corresponds to each level folder directory 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. "a.b.c" corresponds to each level folder directory of the storage path of the target expected data, and "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 the 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 test case names may be modified, and taking the test case as an example, the file name of the target input data is "test txt", and the file name of the target input data may be modified into "test txt", or other forms of file names, which may be distinguished from the suffix of the test case.
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 obtained, the system executes the at least one test case according to a preset test execution rule, and when the system executes the at least one test case, the test execution rule is used for specifying the execution sequence of the test case, and the test execution rule can be configured by a tester according to requirements, for example, all the test cases can be configured to be executed in series in sequence, or all the test cases can be executed in parallel according to preset conditions, 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 test result data corresponding to the test case is generated. Taking three test cases including a test case 1, a test case 2 and a test case 3 as examples, when the test cases are executed in sequence and in series, the system executes the test case 1, the test case 2 and the test case 3 in sequence, and when the test case 1 is executed, target input data of the corresponding test case 1 is input into a data processing process in a Hadoop platform, and test result data of the corresponding test case 1 output by the Hadoop platform is received; and when the test case 2 is executed, inputting target input data of the corresponding test case 2 into a data processing process in the Hadoop platform, receiving test result data of the corresponding test case 2 output by the Hadoop platform, and when the test case 3 is executed, inputting target input data of the corresponding test case 3 into the data processing process in the Hadoop platform, and receiving test result data of the corresponding test case 3 output by the Hadoop platform.
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, the target input data of the corresponding test case 1 is input into the data processing process of the corresponding test case 1, the target input data of the corresponding test case 2 is input into the data processing process of the corresponding test case 2, the target input data of the corresponding test case 3 is input into the data processing process of the corresponding test case 3, and then the test result data of the corresponding test case 1, the test case 2 and the test case 3 respectively 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 after each test case is executed by the system, 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, and 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 test cases pass, the test process of the control method for the data processing test ends with 0 as a state code, otherwise, ends with 1 as the state code.
According to the embodiment, the plurality of test cases are obtained, the test input data information and the test expected data information of the test cases are included in any test case, the target input data and the target expected data are respectively obtained according to the test input data information and the test expected data information of any test case, the system executes all the test cases according to the test execution rule, so that each test case executes the 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, test information is generated according to the comparison result, and the operations such as data input, downloading and comparison in the test process do not need the participation of test staff, so that the workload of the test staff can be effectively reduced, and the test efficiency is improved.
In an alternative embodiment, referring to fig. 2, fig. 2 is a schematic flow chart of a method for acquiring target input data according to an embodiment of the invention.
As shown in fig. 2, the step of obtaining 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 names of the test cases comprise package names and class names, the package names carry first storage path information of target input data of the test cases, the first storage path information is used for representing storage paths of the target input data of the test cases, the class names carry first file names of the target input data of the test cases, and when the test cases are implemented, the class names also comprise file types of the target input data of the test cases, namely suffixes of target input data files, and the file types of the target input data comprise, but are not limited to, ". Txt" and ". Csv".
S1220, 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.
After the first storage path information of the target input data of the test case is obtained, the storage path of the target input data can be obtained according to the first storage path information, further the target input data is obtained according to the storage path, the test case name is "A.B.C. test. Txt" is taken as an example, after the system separates the package names of the test case according to the number of the test case, the storage path directories of the target input data are sequentially corresponding to the storage path of the target input data, namely "A.B.C" are the storage path 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 subfolder in the B folder, the test represents the file name of the target input data, the test txt represents the file suffix of the target input data, and the storage position of the target input data can be positioned through the first storage path information and the first file name, and further the target input data can be obtained.
In one 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 as "test 1.Txt", the file name of the target input data of test case 2 may be designed as "test 2.Txt", and of course, the file name of the target input data may be designed in other patterns, so that the target input data of different test cases may be distinguished.
Similarly, referring to fig. 3, fig. 3 is a schematic flow chart illustrating a basic process of acquiring target expected data according to an embodiment of the present invention, the step of acquiring target expected data may refer to the step of acquiring target input data, where the step of acquiring 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 package name of the test case may further carry second storage path information corresponding to the target expected data of the test case, where the second storage path information characterizes the 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, for 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.
After the second storage path information of the target expected data of the test case is obtained, the storage path of the target expected data can be obtained according to the second storage path information, further the target expected data is obtained according to the storage path, the test case name is "A.B.C. test. Txt+a.b.c. expected. Txt" is taken as an example, after the system separates the package names of the test case according to "...
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 schematic diagram illustrating a basic flow of storing test result data according to an embodiment of the present 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 correspond the test case to the test result data, a storage path and a file name for generating the test result data can be calculated according to the package name and the class name of the test case, and 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, and the storage path can also be used as a storage path of the test result data, so that the target input data, the target expected data and the test result data of the same test case are stored under the same folder, and management is convenient, 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 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 the third storage path and the 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 named as "e.f.g. expected.csv", wherein "e.f.g. is the folder directory of each level of the target expected data storage of the test case," expected "is the file name of the target expected data,". Csv "is the suffix of the target expected data, according to the packet name and the class name of the test case, the third storage path for generating the test result data can be calculated and is named as" e.f.g. ", the type of the third file name is 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 is stored in each level folder directory corresponding to" e.f.g. "so as to conveniently compare the test result data of the same test case with the target expected data, and improve the test efficiency.
In an alternative embodiment, referring to fig. 5, fig. 5 is a schematic diagram of a basic flow of executing test cases according to an embodiment of the present invention.
As shown in fig. 5, step S1300 includes the following steps:
S1301, acquiring test configuration information input by a target user, wherein the test configuration information comprises test sequence information;
the test execution rules may be configured by the user and then at least one test case may be executed according to the configured test execution rules. The system firstly acquires test configuration information input by a target user, the test configuration information comprises test sequence information, when in implementation, a Hadoop platform is taken as an example, 2 test cases are added into the system by a tester, the system respectively acquires target input data and target expected data according to packet names and class names of the two test cases, the tester inputs the test configuration information to configure the execution of the test cases according to requirements, and the system can acquire 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 the execution sequence of the test cases according to the test sequence information, or takes the two test cases as the cases, wherein the two test cases comprise a first test case and a second test case, the first test case is used for testing first section data processing logic in a framework, the second test case is used for testing second section data processing logic in the framework, the first section data processing process is to precede the second section data processing process, and a user can configure the first test case and the second test case to be sequentially executed according to requirements, namely, the first test case is executed before the second test case is executed; the test cases can also be executed in parallel, i.e. the first test case and the second test case are executed simultaneously, so as to meet different test requirements.
In an alternative embodiment, referring to fig. 6, fig. 6 is a schematic diagram of a basic flow of generating 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 the 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 the 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.
S1420, when the data comparison result of the at least one test case is correct, generating test information in a preset status code format.
After the data comparison result of all the test cases is obtained, the system checks whether the data comparison result of all the test cases is correct, namely, the system checks that all the test cases pass, and correspondingly generates test information which is in a preset state code format, in one embodiment, when all the test cases pass, the system ends with 0 as a state code, and otherwise, ends with 1 as a state code.
In order to solve the technical problems, the embodiment of the invention also provides a control device for data processing test.
Referring to fig. 7 specifically, fig. 7 is a schematic diagram of a basic structure of a control device for data processing testing in this embodiment.
As shown in fig. 7, a control device for data processing test includes: the device comprises a first acquisition module 2100, a first processing module 2200, a first execution module 2300 and a data comparison module 2400, wherein the first acquisition module 2100 is configured to acquire at least one preset test case, wherein any test case comprises test input data information and test expected data information; the first processing module 2200 is configured to obtain, for each test case, target input data according to the test input data information, and 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 the comparison result.
According to the embodiment, the plurality of test cases are obtained, the test input data information and the test expected data information of the test cases are included in any test case, the target input data and the target expected data are respectively obtained according to the test input data information and the test expected data information of any test case, the system executes all the test cases according to the test execution rule, so that each test case executes the 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, test information is generated according to the comparison result, and the operations such as data input, downloading and comparison in the test process do not need the participation of test staff, so that the workload of the test staff can be effectively reduced, and the test efficiency is improved.
In some embodiments, the control device for data processing testing further comprises: the system comprises a first acquisition sub-module and a first execution sub-module, wherein the first acquisition sub-module is used for determining a package name and a class name of each test case, 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 first execution submodule is used for acquiring the target input data of each test case according to the first storage path information and the first file name.
In some embodiments, the control device for data processing testing further comprises: the second acquisition sub-module 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; 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 testing 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 packet name and the class name of each test case; the storage module is used for determining 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 for each test case, and storing the test result data into the third storage path.
In some embodiments, the third obtaining sub-module and the third executing sub-module are used for obtaining test configuration information input by a target user, wherein the test configuration information comprises test sequence information; the third execution submodule is used for configuring the execution sequence of the test cases according to the test sequence information and executing the at least one test case according to the execution sequence of the test cases.
In some embodiments, the control device for data processing testing further comprises: the fourth acquisition sub-module is used for acquiring the data comparison result of the at least one test case; and the fourth execution submodule is used for generating test information in a preset status code format when the data comparison result of the at least one test case is correct.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
In order to solve the technical problems, the embodiment of the invention also provides computer equipment. Referring specifically to fig. 8, fig. 8 is a basic structural block diagram of a computer device according to the present embodiment.
As shown in fig. 8, the internal structure of the computer device is schematically shown. As shown in fig. 8, the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected by a system bus. The nonvolatile storage medium of the computer device stores an operating system, a database and computer readable instructions, the database can store a control information sequence, and the computer readable instructions can enable the processor to realize a control method of data processing test when the computer readable instructions are executed by the processor. The processor of the computer device is used to provide computing and control capabilities, supporting the operation of the entire computer device. The memory of the computer device may have stored therein computer readable instructions that, when executed by the processor, cause the processor to perform a control method of data processing testing. The network interface of the computer device is for communicating with a terminal connection. It will be appreciated by persons skilled in the art that the structures shown in the drawings are block diagrams of only some of the structures associated with the inventive arrangements and are not limiting of the computer device to which the inventive arrangements may be implemented, and that a particular computer device may include more or less elements than those shown, or may be combined with some elements or have a different arrangement of elements.
The processor in this embodiment is configured to execute the first acquisition module 2100, the first processing module 2200, the first execution module 2300, and the data comparison module 2400 in fig. 7, and the memory stores program codes and various types of data required for executing the above modules. The network interface is used for data transmission between the user terminal or the server. The memory in the present embodiment stores program codes and data required for executing all the sub-modules 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 sub-modules.
The computer obtains a plurality of test cases, wherein the test cases comprise test input data information and test expected data information, then obtains target input data according to the test input data information, the system executes the plurality of test cases according to a test execution rule, so as to obtain test result data of each test case, and then compares the test result data with the target expected data obtained according to the test expected data information to generate test information.
The present invention also provides a storage medium storing computer readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the control method of data processing testing of any of the embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above-described embodiment methods may be accomplished by way of a computer program stored in a computer-readable storage medium, which when executed, may comprise the steps of embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (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, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present invention, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (7)

1. A control method for data processing test, applied to any one of a plurality of frames, 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; the file type of the at least one test case corresponds to the arbitrary frame;
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;
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;
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;
The step of obtaining target input data according to the test input data information for each test case comprises 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;
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;
the step of acquiring target expected data according to the test expected data information comprises 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.
2. The method according to claim 1, 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 test result data, further comprising the steps of:
Calculating a third storage path and a third file name of the test result data of each test case according to the package name and the class name of the corresponding test case;
and aiming at each test case, determining 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.
3. The method for controlling a data processing test 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 the execution sequence of the test cases according to the test sequence information, and executing the at least one test case according to the execution sequence of the test cases.
4. The method for controlling data processing testing 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, respectively, and generating 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 status code format.
5. A control device for data processing testing, applied to any one of a plurality of frames, comprising:
the first acquisition module is used for acquiring at least one preset test case, wherein any test case comprises test input data information and test expected data information; the file type of the at least one test case corresponds to the arbitrary frame;
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;
the data comparison module is used for respectively 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;
The control device for the data processing test further comprises:
the first acquisition sub-module 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;
the first execution sub-module 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;
the control device for the data processing test further comprises:
the second acquisition sub-module 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 sub-module 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.
6. 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 perform the steps of the control method of the data processing test of any of claims 1 to 4.
7. 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 control method of data processing testing of any one of claims 1 to 4.
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 CN110781090A (en) 2020-02-11
CN110781090B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538666B (en) * 2020-04-27 2024-04-02 深圳忆联信息系统有限公司 Method, device, computer equipment and storage medium for collecting test results in batches
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

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7398469B2 (en) * 2004-03-12 2008-07-08 United Parcel Of America, Inc. Automated test system for testing an application running in a windows-based environment and related methods
US10565095B2 (en) * 2016-12-15 2020-02-18 Syntel, Inc. Hybrid testing automation engine

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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 (1)

* Cited by examiner, † Cited by third party
Title
Android系统的持续集成自动化测试框架的研究与实践;孙沫涵;中国优秀硕士学位论文全文数据库 信息科技辑(第3期);第I138-1165页 *

Also Published As

Publication number Publication date
CN110781090A (en) 2020-02-11

Similar Documents

Publication Publication Date Title
CN110781090B (en) Control method and device for data processing test, computer equipment and storage medium
US10353913B2 (en) Automating extract, transform, and load job testing
CN106708719B (en) Service function testing method and device
CN109947646A (en) Interface test method, device, computer equipment and storage medium
US20160196021A1 (en) Automated Modularization of Graphical User Interface Test Cases
CN113227971A (en) Real-time application error identification and mitigation
CN109344060A (en) A kind of analysis method and device of automatic test
CN104636130B (en) For generating the method and system of event tree
CN110096263A (en) Web front end code automatic generation method and device
US20180246881A1 (en) Method and system for processing semantic fragments
CN114116496A (en) Automatic testing method, device, equipment and medium
US9582270B2 (en) Effective feature location in large legacy systems
WO2015039793A1 (en) Derivation of generalized test cases
CN108460068A (en) Method, apparatus, storage medium and the terminal that report imports and exports
CN105630667A (en) Test method and terminal equipment
Jiang et al. Ranking the importance of alerts for problem determination in large computer systems
CN111767217A (en) JS unit test case generation method and device
CN114185770A (en) Method and device for generating test data, computer equipment and storage medium
Surian et al. Predicting project outcome leveraging socio-technical network patterns
Wu et al. Trust-based service composition and optimization
Li et al. Logspy: System log anomaly detection for distributed systems
CN112905370A (en) Topological graph generation method, anomaly detection method, device, equipment and storage medium
US10289788B1 (en) System and method for suggesting components associated with an electronic design
US10229140B2 (en) Extensible indexing system evaluation and recommendation
US11074508B2 (en) Constraint tracking and inference generation

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

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.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant