CN112199297A - Data testing method and device, nonvolatile storage medium and processor - Google Patents

Data testing method and device, nonvolatile storage medium and processor Download PDF

Info

Publication number
CN112199297A
CN112199297A CN202011193981.8A CN202011193981A CN112199297A CN 112199297 A CN112199297 A CN 112199297A CN 202011193981 A CN202011193981 A CN 202011193981A CN 112199297 A CN112199297 A CN 112199297A
Authority
CN
China
Prior art keywords
result
target algorithm
test
data
testing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011193981.8A
Other languages
Chinese (zh)
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.)
Jiuling Jiangsu Digital Intelligent Technology Co Ltd
Original Assignee
Jiuling Jiangsu Digital Intelligent 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 Jiuling Jiangsu Digital Intelligent Technology Co Ltd filed Critical Jiuling Jiangsu Digital Intelligent Technology Co Ltd
Priority to CN202011193981.8A priority Critical patent/CN112199297A/en
Publication of CN112199297A publication Critical patent/CN112199297A/en
Pending legal-status Critical Current

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/3684Test management for test design, e.g. generating new test cases
    • 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

Abstract

The invention discloses a data testing method, a data testing device, a nonvolatile storage medium and a processor. Wherein, the method comprises the following steps: obtaining a test case, wherein the test case is used for testing target algorithm data, and the target algorithm data is used for constructing a target algorithm; calling target algorithm data through a first calling interface, and testing the target algorithm data through a test case to obtain a first return result; comparing the first return result with a second return result, wherein the second return result is a standard result obtained by testing the target algorithm data; determining that the target algorithm data is successfully tested under the condition that the first returned result is the same as the second returned result; and determining that the target algorithm data test fails under the condition that the first returned result is not the same as the second returned result. The invention solves the technical problem of low efficiency of testing the algorithm.

Description

Data testing method and device, nonvolatile storage medium and processor
Technical Field
The invention relates to the field of data testing, in particular to a data testing method and device, a nonvolatile storage medium and a processor.
Background
At present, when the algorithm test is carried out, due to the particularity of the algorithm test, unlike the traditional interface test, the verification can be carried out according to the return state code and the logic processing result, and the verification has a certain expected return.
Algorithmic testing is typically performed manually. However, it is difficult to manually test the algorithm, and it is impossible to run more tests in a short time, so that the efficiency of testing the algorithm is low.
Aiming at the problem of low efficiency of testing the algorithm, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides a data testing method, a data testing device, a nonvolatile storage medium and a processor, and at least solves the technical problem of low efficiency of testing an algorithm.
According to an aspect of an embodiment of the present invention, there is provided a data testing method. The method comprises the following steps: obtaining a test case, wherein the test case is used for testing target algorithm data, and the target algorithm data is used for constructing a target algorithm; calling target algorithm data through a first calling interface, and testing the target algorithm data through a test case to obtain a first return result; comparing the first return result with a second return result, wherein the second return result is a standard result obtained by testing the target algorithm data; determining that the target algorithm data is successfully tested under the condition that the first returned result is the same as the second returned result; determining that the target algorithm data fails the test if the first returned result is different from the second returned result
Optionally, before comparing the first returned result and the second returned result, the method further comprises: and calling a second return result through a second calling interface.
Optionally, obtaining the test case includes: and loading the test cases in the target table through C # coding.
Optionally, before the target algorithm data is called through the first calling interface, the method further includes: and taking a row of data in the target table as a parameter to call the first calling interface.
Optionally, obtaining the test case includes: and generating a test case through a random number, wherein the execution times of the test are transmitted when the test case is called for testing.
Optionally, before the target algorithm data is called through the first calling interface, the method further includes: test data is randomly generated by a random number to call the first call interface.
Optionally, the first returned result comprises: the closest distance of the point to the circle and the coordinates of the projected point of the point on the circle.
Optionally, after determining that the test on the target algorithm data is successful or determining that the test on the target algorithm data is failed, the method further includes: and writing the result of successful test on the target algorithm data or the result of failed test on the target algorithm data into the target table.
According to another aspect of the embodiment of the invention, a data testing device is also provided. The apparatus may include: the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a test case, the test case is used for testing target algorithm data, and the target algorithm data is used for constructing a target algorithm; the test unit is used for calling the target algorithm data through the first calling interface and testing the target algorithm data through the test case to obtain a first return result; the comparison unit is used for comparing the first return result with a second return result, wherein the second return result is a standard result obtained by testing the target algorithm data; the first determining unit is used for determining that the target algorithm data is successfully tested under the condition that the first returned result is the same as the second returned result; and the second determining unit is used for determining that the target algorithm data fails to test under the condition that the first returned result is different from the second returned result.
According to another aspect of the embodiments of the present invention, there is also provided a nonvolatile storage medium, wherein the storage medium stores therein a computer program, and the computer program is configured to execute the data testing method of the embodiments of the present invention when running.
According to another aspect of the embodiments of the present invention, there is also provided a processor. The processor is configured to run a program, wherein the program is configured to perform the data testing method of an embodiment of the invention when running.
According to another aspect of the embodiment of the invention, an electronic device is also provided. The electronic device may comprise a memory having a computer program stored therein and a processor arranged to run the computer program to perform the data testing method of an embodiment of the invention.
In the embodiment of the invention, a test case is obtained, wherein the test case is used for testing target algorithm data, and the target algorithm data is used for constructing a target algorithm; calling target algorithm data through a first calling interface, and testing the target algorithm data through a test case to obtain a first return result; comparing the first return result with a second return result, wherein the second return result is a standard result obtained by testing the target algorithm data; determining that the target algorithm data is successfully tested under the condition that the first returned result is the same as the second returned result; and determining that the target algorithm data test fails under the condition that the first returned result is not the same as the second returned result. That is to say, the target algorithm data used for constructing the target algorithm is called through the first calling interface, the target algorithm data is tested through the obtained test case, the obtained first return result is compared with the second return result, whether the target algorithm data is successfully tested is determined, and therefore a dynamic test scheme is achieved, repeated execution can be conducted in a short time, scenes which cannot be involved in manual test are completed, the technical effect of improving the efficiency of testing the algorithm is achieved, and the technical problem of low efficiency of testing the algorithm is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a method of data testing according to an embodiment of the invention;
FIG. 2 is a schematic diagram of an automated test framework for calculating point-to-circle nearest distances and intersection coordinates for an algorithm library, according to an embodiment of the present invention;
FIG. 3 is a flow chart of a method of reading data from Excel for algorithmic testing in accordance with an embodiment of the present invention;
FIG. 4 is a flow diagram of a method for algorithm testing using generated random numbers in accordance with an embodiment of the present invention;
FIG. 5 is a diagram of a data testing apparatus 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, 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of a data testing method, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
FIG. 1 is a flow chart of a data testing method according to an embodiment of the invention. As shown in fig. 1, the method comprises the steps of:
step S102, a test case is obtained, wherein the test case is used for testing the target algorithm data, and the target algorithm data is used for constructing a target algorithm.
In the technical solution provided in the above step S102 of the present invention, the test case may be a pre-designed test case, for example, a test case in a target table, or a test case generated by a random number method, and is used for testing target algorithm data, and the target algorithm data may be used for constructing a target algorithm, so that the target algorithm may be tested by the test case.
Alternatively, the target algorithm of this embodiment may be a library of algorithms that may be called and include a plurality of algorithms (e.g., JLGCom) that calculate the closest distance of a point to a circle and the coordinates of the projected point of the point on the circle, which may also be referred to as intersection coordinates.
And step S104, calling the target algorithm data through the first calling interface, and testing the target algorithm data through the test case to obtain a first return result.
In the technical solution provided in the above step S104 of the present invention, after the test case is obtained, the target algorithm data may be called through the first call interface, and the target algorithm data is tested through the test case to obtain the first return result.
In this embodiment, the first calling interface may be a C # calling interface of the target algorithm, and in the case that the target algorithm is a callable algorithm library, the first calling interface may also be an algorithm interface, which may be provided in advance by a C + + algorithm engineer. In the embodiment, the target algorithm data is called through the first calling interface, and the target algorithm data is tested through the obtained test case to obtain a first return result, which is also the result after the interface calling.
And S106, comparing the first return result with a second return result, wherein the second return result is a standard result obtained by testing the target algorithm data.
In the technical solution provided in step S106 of the present invention, after the target algorithm data is tested by the test case to obtain the first returned result, the first returned result and the second returned result may be compared, for example, the first returned result and the second returned result are subjected to an equal comparison operation, a difference between the first returned result and the second returned result may be obtained, if the difference is 0, it may be determined that the first returned result and the second returned result are equal, and if the difference is not 0, it may be determined that the first returned result and the second returned result are not equal.
In this embodiment, the second returned result is a standard result for comparison with the first returned result, so that a reference result is available for the algorithm test to determine whether the test on the target algorithm data is successful, which may be the returned result of the third party library.
And S108, determining that the target algorithm data is successfully tested under the condition that the first returned result is the same as the second returned result.
In the technical solution provided by step S108 of the present invention, after comparing the first returned result with the second returned result, if the first returned result is the same as the second returned result, it may be determined that the target algorithm data is successfully tested.
In this embodiment, since the second returned result is a standard result obtained by testing the target algorithm data, if the first returned result is the same as the second returned result, that is, the first returned result is a standard result obtained by testing the target algorithm data, it may be determined that the target algorithm data is successfully tested, that is, the target algorithm data is passed, and a single test case is passed.
And step S110, determining that the target algorithm data fails to test under the condition that the first returned result is different from the second returned result.
In the technical solution provided by step S110 of the present invention, after comparing the first returned result and the second returned result, if the first returned result is different from the second returned result, it may be determined that the test on the target algorithm data fails.
In this embodiment, if the first returned result is different from the second returned result, that is, the first returned result is not a standard result obtained by testing the target algorithm data, it may be determined that the target algorithm data fails to be tested, that is, the target algorithm fails to be tested, and a single test case fails.
Obtaining a test case through the steps S102 to S110, wherein the test case is used for testing target algorithm data, and the target algorithm data is used for constructing a target algorithm; calling target algorithm data through a first calling interface, and testing the target algorithm data through a test case to obtain a first return result; comparing the first return result with a second return result, wherein the second return result is a standard result obtained by testing the target algorithm data; determining that the target algorithm data is successfully tested under the condition that the first returned result is the same as the second returned result; and determining that the target algorithm data test fails under the condition that the first returned result is not the same as the second returned result. That is to say, in the embodiment, the target algorithm data used for constructing the target algorithm is called through the first calling interface, the target algorithm data is tested through the obtained test case, the obtained first return result is compared with the obtained second return result, and whether the target algorithm data is successfully tested is determined, so that a dynamic test scheme is realized, repeated execution can be performed in a short time, a scene which cannot be involved in manual test is completed, the technical effect of improving the efficiency of testing the algorithm is achieved, and the technical problem of low efficiency of testing the algorithm is solved.
The above-described method of this embodiment is further described below.
As an optional implementation manner, before comparing the first returned result and the second returned result in step S106, the method further includes: and calling a second return result through a second calling interface.
In this embodiment, the second invocation interface may be a C # invocation interface of the Revit third party library, that is, a Revit third party library interface, which is provided by a C + + algorithm engineer in advance and is used as a standard for algorithm comparison. In this embodiment, a second return result may be called through the second calling interface, where the second return result is also a return result of the Revit third-party library interface, and the first return result and the second return result are compared to determine whether the target algorithm data is successfully tested.
As an optional implementation manner, in step S102, obtaining a test case includes: and loading the test cases in the target table through C # coding.
In this embodiment, when obtaining the test case is implemented, the test case may be designed by itself, or the test case designed in the target table may be loaded using C # coding, where the target table may be EXCEL.
As an optional implementation manner, before the step S104, invoking the target algorithm data through the first invocation interface, the method further includes: and taking a row of data in the target table as a parameter to call the first calling interface.
In this embodiment, the encoding may be to realize cyclic reading of data in the target table, and a row of data in the target table may be used as a parameter for calling the first calling interface. Optionally, in this embodiment, while the first interface is called through the parameter, the second calling interface may also be called through the parameter.
As an optional implementation manner, in step S102, obtaining a test case includes: and generating a test case through a random number, wherein the execution times of the test are transmitted when the test case is called for testing.
In this embodiment, when obtaining the test case is implemented, the test case may be generated by using a written random number method, and when the test case generated by using the random number is called for testing, the number of execution times of the test may be transmitted to ensure that the test is executed within a limited number of times.
As an alternative implementation, before the step S104, the method may include: test data is randomly generated by a random number to call the first call interface.
In this embodiment, before the target algorithm data is called through the first calling interface, the test data is randomly generated through a random number, and the random generation of the test data through which the first interface is called may be implemented by using a random test method. Optionally, in this embodiment, when the first interface is called by the test data, the second interface may also be called by the test data.
As an optional implementation, the first returned result includes: the closest distance of the point to the circle and the coordinates of the projected point of the point on the circle.
In this embodiment, the target algorithm data is tested by using the test case, and the obtained first return result may be the closest distance from the test point to the circle and the coordinates of the projection point of the point on the circle, where the closest distance from the test point to the circle is also the returned distance, and the coordinates of the projection point of the point on the circle is also the coordinate point position.
Optionally, the second returned result comprises a standard result of the closest distance of the point to the circle and a standard result of the coordinates of the projected point of the point on the circle.
As an optional implementation manner, after determining that the test on the target algorithm data is successful in step S108, or determining that the test on the target algorithm data is failed in step S110, the method further includes: and writing the result of successful test on the target algorithm data or the result of failed test on the target algorithm data into the target table.
In this embodiment, after determining that the target algorithm data is successfully tested, that is, determining that the target algorithm data is successfully tested, or determining that the target algorithm data is failed to test, that is, determining that the target algorithm data is failed to test, a result of successful testing of the target algorithm data or a result of failed testing of the target algorithm data may be written into a target table, for example, into EXCEL, so that the purpose of recording a test return result is achieved.
The embodiment provides an automatic testing scheme for the algorithm, the algorithm test has a reference result, the algorithm test can be repeatedly used for multiple times in a short time, the testing efficiency is improved, and scenes which cannot be involved in the manual test are completed, so that the condition that the algorithm check cannot be completed through the manual test is avoided, manpower resources are better utilized, the efficiency of testing the algorithm is improved, and the technical problem of low efficiency of testing the algorithm is solved.
Example 2
The technical solutions of the embodiments of the present invention will be further illustrated with reference to preferred embodiments.
In this embodiment, the algorithm library may be a callable algorithm library including many algorithms, which are not tested by the related art. The embodiment provides a test scheme aiming at the algorithm, a frame for the automatic test of the algorithm is built by using a C #, the frame can be repeatedly used for many times, the test efficiency is improved, the scenes which cannot be involved in the manual test are completed, and the problem that the algorithm check cannot be completed through the manual test is solved.
The algorithm test is different from the traditional interface test due to the particularity of the algorithm test, and can be verified according to the returned state code and the logic processing result, so that a certain expected return is provided. However, manual testing is difficult and does not allow more tests to be run in a short amount of time.
The embodiment can use C # language to build an automatic test framework for the algorithm library.
FIG. 2 is a schematic diagram of an automated testing framework for calculating point-to-circle nearest distances and intersection coordinates for a library of algorithms according to an embodiment of the present invention. As shown in fig. 2, the framework includes test from excel () with self-defined test case, test random () with random number, and terminator ProcessKill (). After testfromaxcel () is used and TestRandom () is used, an automatic test algorithm library assistant (autotestjlgcomp helper) can be used for further automatic test, so that automatic test of the algorithm is realized.
The method of testing using the customized test case scenario in this embodiment is described below.
FIG. 3 is a flow chart of a method for reading data from Excel for algorithmic testing in accordance with an embodiment of the present invention. As shown in fig. 3, the method may include the steps of:
in step S301, the testfromsexcel () method is started.
The embodiment can design the test cases, and can load the test cases designed in the EXCEL by using the C # code.
Step S302, calling an algorithm interface.
In this embodiment, the algorithm interface may be a C # invocation interface of an algorithm library, may be provided by a C + + algorithm engineer, and may implement cyclic reading of EXCEL data by encoding, and invoke the algorithm interface with a row of data in the EXCEL as a parameter.
Step S303, calling a Revit third party library interface.
In this embodiment, the Revit third party library interface may be a C # invocation interface of the Revit third party library, which is used as a standard for algorithm comparison, may be provided by a C + + algorithm engineer, and may implement cyclic reading of EXCEL data by encoding, and invoke the Revit third party library interface by using a line of data in the EXCEL as a parameter.
And step S304, judging whether the result after the algorithm interface is called is equal to the result returned by the Revit third-party library interface.
If the result after the algorithm interface is called is equal to the result returned by the Revit third-party library interface, executing step S305; otherwise, step S306 is executed.
Step S305, determining that the test result is that a single test case passes through.
In this embodiment, the result after the algorithm interface call may be the closest distance from the point to the circle and the coordinates of the projected point from the point to the circle. And if the nearest distance from the point to the circle and the coordinate of the projection point from the point to the circle are equal to the returned result of the Revit third-party library interface, the single test case passes.
Step S306, determining that the test result is that a single test case fails.
And if the nearest distance from the point to the circle and the coordinate of the projection point from the point to the circle are not equal to the result returned by the Revit third-party library interface, the single test case fails.
Step S307, writing the test result into EXCEL.
After determining that the test result is a single test case pass, or after determining that the test result is a single test case fail, the test result may be written to EXCEL.
The following describes a scenario of this embodiment in which a test of random numbers is performed.
FIG. 4 is a flow diagram of a method for algorithm testing using generated random numbers in accordance with an embodiment of the present invention. As shown in fig. 4, the method may include the steps of:
step S401 starts executing the TestTestRandom () method.
The embodiment can use a written random number method to generate the test case.
In step S402, random numbers are generated in batch.
In this embodiment, the number of executions of the random test may be passed in.
Step S403, call an algorithm interface.
In this embodiment, the algorithm interface may be a C # invocation interface of the algorithm library, may be provided by a C + + algorithm engineer, and may use a random test method to randomly generate test data through which the algorithm interface is invoked.
Step S404, calling a Revit third-party library interface.
In this embodiment, the Revit third party library interface may be a C # invocation interface of the Revit third party library, which is used as a standard for algorithm comparison, may be provided by a C + + algorithm engineer, may use a random test method to randomly generate test data, and invokes the Revit third party library interface through the test data.
And step S405, judging whether the result after the algorithm interface is called is equal to the result returned by the Revit third-party library interface.
If the result after the algorithm interface is called is equal to the result returned by the Revit third-party library interface, executing the step S406; otherwise, step S407 is executed.
Step S406, determining that the test result is that a single test case passes through.
In this embodiment, the result after the algorithm interface call may be the closest distance from the point to the circle and the coordinates of the projected point from the point to the circle. And if the nearest distance from the point to the circle and the coordinate of the projection point from the point to the circle are equal to the returned result of the Revit third-party library interface, the single test case passes.
Step S407, determining that the test result is that a single test case fails.
And if the nearest distance from the point to the circle and the coordinate of the projection point from the point to the circle are not equal to the result returned by the Revit third-party library interface, the single test case fails.
Step S408, writing the test result into EXCEL.
After determining that the test result is a single test case pass, or after determining that the test result is a single test case fail, the test result may be written to EXCEL.
The embodiment provides an automatic testing scheme for the algorithm, the algorithm test has a reference result, the algorithm test can be repeatedly used for multiple times in a short time, the testing efficiency is improved, scenes which cannot be involved in manual test are completed, the condition that the algorithm check cannot be completed through the manual test is avoided, manpower resources are better utilized, the efficiency of testing the algorithm is improved, and the technical problem of low efficiency of testing the algorithm is solved.
Example 3
The embodiment of the invention also provides a data testing device. It should be noted that the data testing apparatus of this embodiment can be used to execute the data testing method of the embodiment of the present invention.
FIG. 5 is a diagram of a data testing apparatus according to an embodiment of the present invention. As shown in fig. 5, the data testing apparatus 50 may include: an acquisition unit 51, a test unit 52, a comparison unit 53, a first determination unit 54 and a second determination unit 55.
The obtaining unit 51 is configured to obtain a test case, where the test case is used to test target algorithm data, and the target algorithm data is used to construct a target algorithm.
The testing unit 52 is configured to call the target algorithm data through the first call interface, and test the target algorithm data through the test case to obtain a first return result.
And the comparing unit 53 is configured to compare the first returned result with a second returned result, where the second returned result is a standard result obtained by testing the target algorithm data.
And a first determining unit 54, configured to determine that the test on the target algorithm data is successful if the first returned result is the same as the second returned result.
And a second determining unit 55, configured to determine that the target algorithm data test fails if the first returned result is not the same as the second returned result.
Optionally, the apparatus further comprises: and the calling unit is used for calling the second return result through the second calling interface before comparing the first return result with the second return result.
Alternatively, the acquisition unit 51 includes: and the first acquisition module is used for loading the test cases in the target table through the C # code.
Optionally, the apparatus is further configured to use a row of data in the target table as a parameter to call the first calling interface before calling the target algorithm data through the first calling interface.
Alternatively, the acquisition unit 51 includes: the method comprises the following steps: and the generating module is used for generating a test case through the random number, wherein the execution times of the test are transmitted when the test case is called for testing.
Optionally, the apparatus is further configured to randomly generate test data by a random number before calling the target algorithm data by the first calling interface to call the first calling interface.
Optionally, the first returned result of this embodiment includes: the closest distance of the point to the circle and the coordinates of the projected point of the point on the circle.
Optionally, the apparatus further comprises: and the writing unit is used for writing the successful test result of the target algorithm data or the failed test result of the target algorithm data into the target table after the successful test of the target algorithm data or the failed test of the target algorithm data is determined.
In the data testing device of this embodiment, the target algorithm data for constructing the target algorithm is called through the first calling interface, the target algorithm data is tested through the obtained test case, and the obtained first return result is compared with the second return result to determine whether the target algorithm data is successfully tested, so that a dynamic testing scheme is realized, repeated execution can be performed in a short time, a scene which cannot be involved in manual testing is completed, a technical effect of improving the efficiency of testing the algorithm is achieved, and the technical problem of low efficiency of testing the algorithm is solved.
Example 4
According to the embodiment of the invention, a nonvolatile storage medium is also provided. The storage medium has stored therein a computer program, wherein the computer program is arranged to execute the data testing method of an embodiment of the invention when running.
Example 5
According to the embodiment of the invention, the invention also provides the processor. The processor is configured to run a program, wherein the program is configured to perform the data testing method of an embodiment of the invention when running.
Example 6
According to the embodiment of the invention, the electronic device is also provided. The apparatus may include a memory and a processor. The memory has stored therein a computer program and the processor is arranged to run the computer program to perform the data testing method of an embodiment of the invention.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred 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 (12)

1. A method for testing data, comprising:
obtaining a test case, wherein the test case is used for testing target algorithm data, and the target algorithm data is used for constructing a target algorithm;
calling the target algorithm data through a first calling interface, and testing the target algorithm data through the test case to obtain a first return result;
comparing the first return result with a second return result, wherein the second return result is a standard result obtained by testing the target algorithm data;
determining that the target algorithm data is successfully tested under the condition that the first returned result is the same as the second returned result;
and determining that the target algorithm data fails to test under the condition that the first returned result is different from the second returned result.
2. The method of claim 1, wherein prior to comparing the first and second returned results, the method further comprises:
and calling the second return result through a second calling interface.
3. The method of claim 1, wherein obtaining the test case comprises:
and loading the test case in the target table through C # coding.
4. The method of claim 3, wherein prior to invoking the target algorithm data through the first invocation interface, the method further comprises:
and taking a row of data in the target table as a parameter to call the first calling interface.
5. The method of claim 1, wherein obtaining the test case comprises:
and generating the test case through a random number, wherein the execution times of the test are transmitted when the test case is called for testing.
6. The method of claim 5, wherein prior to invoking the target algorithm data through the first invocation interface, the method further comprises:
and randomly generating test data through the random number to call the first calling interface.
7. The method of any of claims 1-6, wherein the first returned result comprises: the closest distance of a point to a circle and the coordinates of the projected point of said point on said circle.
8. The method of any one of claims 1 to 6, wherein after determining that the target algorithm data test was successful or determining that the target algorithm data test failed, the method further comprises:
and writing the result of successful test on the target algorithm data or the result of failed test on the target algorithm data into a target table.
9. A data testing apparatus, comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a test case, the test case is used for testing target algorithm data, and the target algorithm data is used for constructing a target algorithm;
the test unit is used for calling the target algorithm data through a first calling interface and testing the target algorithm data through the test case to obtain a first return result;
the comparison unit is used for comparing the first return result with a second return result, wherein the second return result is a standard result obtained by testing the target algorithm data;
a first determining unit, configured to determine that the target algorithm data is successfully tested when the first returned result is the same as the second returned result;
and the second determining unit is used for determining that the target algorithm data fails to test under the condition that the first returned result is different from the second returned result.
10. A non-volatile storage medium, characterized in that a computer program is stored in the storage medium, wherein the computer program is arranged to perform the method of any of claims 1 to 8 when executed.
11. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to perform the method of any of claims 1 to 8 when running.
12. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 8.
CN202011193981.8A 2020-10-30 2020-10-30 Data testing method and device, nonvolatile storage medium and processor Pending CN112199297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011193981.8A CN112199297A (en) 2020-10-30 2020-10-30 Data testing method and device, nonvolatile storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011193981.8A CN112199297A (en) 2020-10-30 2020-10-30 Data testing method and device, nonvolatile storage medium and processor

Publications (1)

Publication Number Publication Date
CN112199297A true CN112199297A (en) 2021-01-08

Family

ID=74012208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011193981.8A Pending CN112199297A (en) 2020-10-30 2020-10-30 Data testing method and device, nonvolatile storage medium and processor

Country Status (1)

Country Link
CN (1) CN112199297A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101714166A (en) * 2009-10-30 2010-05-26 清华大学 Method and system for testing performance of large-scale multi-keyword precise matching algorithm
US20140081590A1 (en) * 2012-09-17 2014-03-20 Hon Hai Precision Industry Co., Ltd. Electronic device and method for managing test items of an object
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
CN105792241A (en) * 2014-12-26 2016-07-20 展讯通信(上海)有限公司 Automatic test system and method and mobile terminal
CN106201891A (en) * 2016-07-19 2016-12-07 意昂神州(北京)科技有限公司 A kind of model automatization method of testing and device
CN106502895A (en) * 2016-10-21 2017-03-15 郑州云海信息技术有限公司 A kind of automatic test information generation device and method
CN107515819A (en) * 2016-06-16 2017-12-26 平安科技(深圳)有限公司 Medicare system method of testing and device
CN107885665A (en) * 2017-12-28 2018-04-06 努比亚技术有限公司 With case script method of testing, mobile terminal and computer-readable recording medium
CN110781090A (en) * 2019-10-31 2020-02-11 北京东软望海科技有限公司 Control method and device for data processing test, computer equipment and storage medium
CN111382074A (en) * 2020-03-09 2020-07-07 摩拜(北京)信息技术有限公司 Interface test method and device and electronic equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101714166A (en) * 2009-10-30 2010-05-26 清华大学 Method and system for testing performance of large-scale multi-keyword precise matching algorithm
US20140081590A1 (en) * 2012-09-17 2014-03-20 Hon Hai Precision Industry Co., Ltd. Electronic device and method for managing test items of an object
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
CN105792241A (en) * 2014-12-26 2016-07-20 展讯通信(上海)有限公司 Automatic test system and method and mobile terminal
CN107515819A (en) * 2016-06-16 2017-12-26 平安科技(深圳)有限公司 Medicare system method of testing and device
CN106201891A (en) * 2016-07-19 2016-12-07 意昂神州(北京)科技有限公司 A kind of model automatization method of testing and device
CN106502895A (en) * 2016-10-21 2017-03-15 郑州云海信息技术有限公司 A kind of automatic test information generation device and method
CN107885665A (en) * 2017-12-28 2018-04-06 努比亚技术有限公司 With case script method of testing, mobile terminal and computer-readable recording medium
CN110781090A (en) * 2019-10-31 2020-02-11 北京东软望海科技有限公司 Control method and device for data processing test, computer equipment and storage medium
CN111382074A (en) * 2020-03-09 2020-07-07 摩拜(北京)信息技术有限公司 Interface test method and device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郑炜等: "《Web应用软件的测试技术研究》", 西安:西北工业大学出版社, pages: 243 *

Similar Documents

Publication Publication Date Title
CN107885656B (en) Automatic product algorithm testing method and application server
CN111522734B (en) Software function testing method and device, electronic equipment and storage medium
CN105389256A (en) Unit testing method and system
CN108734304B (en) Training method and device of data model and computer equipment
CN107908553B (en) Association testing method, application server and computer readable storage medium
CN110059068B (en) Data verification method and data verification system in distributed storage system
CN112560114B (en) Method and device for calling intelligent contract
CN111597110A (en) Page testing method and device, electronic equipment and storage medium
CN114117977B (en) Method suitable for automatically verifying processor system scene
CN111475402A (en) Program function testing method and related device
CN113032202B (en) Chip verification method, system, device, computer equipment and storage medium
CN113778878A (en) Interface testing method and device, electronic equipment and storage medium
CN112052157B (en) Method, device and system for constructing test message
CN112561690A (en) Method, system, equipment and storage medium for testing credit card staging service interface
CN112199297A (en) Data testing method and device, nonvolatile storage medium and processor
CN115276844B (en) Communication module testing method and device, storage medium and electronic equipment
CN115203050A (en) Method and device for determining dependency relationship of services
CN113704123A (en) Interface test method, device, equipment and storage medium
CN112083952A (en) Spring architecture-based exception handling method and system
CN107678967B (en) Unit test coverage rate generation method and device, readable storage medium and equipment
CN113360402A (en) Test method, electronic device, chip and storage medium
CN108628750B (en) Test code processing method and device
CN117827632A (en) Test method, test device and storage medium
CN110928788B (en) Service verification method and device
CN109800155B (en) Method and device for testing QTE interlocking application software based on Probe

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: Room 701, East Building, innovation and Research Center, 8 Yanzheng West Avenue, Wujin District, Changzhou City, Jiangsu Province, 213100

Applicant after: Jiuling (Jiangsu) Digital Intelligent Technology Co., Ltd

Address before: Room d1-9999, 58 Fumin Branch Road, Hengsha Township, Chongming District, Shanghai, 201914 (Shanghai Hengtai Economic Development Zone)

Applicant before: Jiuling (Jiangsu) Digital Intelligent Technology Co., Ltd