CN113778881A - Data processing method and device and electronic equipment - Google Patents

Data processing method and device and electronic equipment Download PDF

Info

Publication number
CN113778881A
CN113778881A CN202111067931.XA CN202111067931A CN113778881A CN 113778881 A CN113778881 A CN 113778881A CN 202111067931 A CN202111067931 A CN 202111067931A CN 113778881 A CN113778881 A CN 113778881A
Authority
CN
China
Prior art keywords
test
test case
result
data processing
case
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
CN202111067931.XA
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202111067931.XA priority Critical patent/CN113778881A/en
Publication of CN113778881A publication Critical patent/CN113778881A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Abstract

The invention provides a data processing method, a data processing device and electronic equipment, relates to the technical field of data processing, and solves the problem of low software testing efficiency in the prior art. The method comprises the steps of obtaining test requirements; determining at least one test case according to the test point type corresponding to each field name; inputting each test case into a pre-stored test script, and determining the actual result of each test case; and determining the test result of the test requirement according to the actual result and the corresponding expected result of each test case.

Description

Data processing method and device and electronic equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method and apparatus, and an electronic device.
Background
Software testing is a process used to promote the correctness, integrity, security, and quality of the software under test, which is a process of auditing or comparing between actual and expected outputs. At present, a large amount of manual operation is needed to set test points in the software testing process. For example, when adding test points, a test developer is required to manually add codes at positions where the test points need to be set to set the test points, which results in low efficiency of software testing.
Disclosure of Invention
The invention provides a data processing method, a data processing device and electronic equipment, and solves the problem of low software testing efficiency in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a data processing method, including: acquiring a test requirement; the testing requirement comprises one or more field names and testing point types respectively corresponding to the field names; determining at least one test case according to the test point type corresponding to each field name; the test case at least comprises test data and an expected result corresponding to the field name; inputting each test case into a pre-stored test script, and determining the actual result of each test case; and determining the test result of the test requirement according to the actual result and the corresponding expected result of each test case.
Therefore, according to the data processing method provided by the invention, after the test requirement is obtained, at least one test case is determined according to the test point type corresponding to each field name in the test requirement, and the test case corresponding to each test point type does not need to be manually configured. And then, inputting each test case into a pre-stored test script to determine the actual result of each test case. And determining the test result of the test requirement according to the actual result and the expected result of each test case. Therefore, in the process of software testing, test developers do not need to configure the test cases corresponding to the types of the test points one by one, and therefore a large amount of configuration time can be saved. The total time required by the software test is reduced, so that the software test efficiency can be improved, and the software test cost can be reduced.
In an implementation manner, the test requirement further includes a system address, and the pre-stored test script further includes a test address; the "inputting each test case into a pre-stored test script to determine the actual result of each test case" may be specifically implemented in the following manner: and after the test address is determined to be the system address, inputting each test case into a pre-stored test script, and determining the actual result of each test case.
In an implementation manner, the "determining a test result of the test requirement according to the actual result and the corresponding expected result of each test case" may be implemented specifically by the following manners: determining that the test result of the test requirement is passed under the condition that the actual result and the corresponding expected result of each test case are the same; and under the condition that the actual result and the corresponding expected result of any test case are different, determining that the test result of the test requirement is not passed.
In an implementation manner, the "determining at least one test case according to the test point type corresponding to each field name" may be implemented specifically by: and inquiring the test case corresponding to the test point type corresponding to each field name in a pre-configured database, and determining at least one test case.
In an implementation manner, the programming language of the test script may be any one of VB programming language, Java and Python.
In a second aspect, an embodiment of the present invention provides a data processing apparatus, including: an acquisition unit and a processing unit.
An acquisition unit for acquiring a test requirement; the test requirement comprises one or more field names and test point classes respectively corresponding to the field names; the processing unit is used for determining at least one test case according to the test point type corresponding to the field name acquired by each acquisition unit; the test case at least comprises test data and an expected result corresponding to the field name; the processing unit is also used for inputting each test case into a pre-stored test script and determining the actual result of each test case; and the processing unit is also used for determining the test result of the test requirement according to the actual result and the corresponding expected result of each test case.
In an implementation manner, the test requirement further includes a system address, and the pre-stored test script further includes a test address; and the processing unit is specifically used for inputting each test case into a pre-stored test script after the test address is determined to be the system address acquired by the acquisition unit, and determining the actual result of each test case.
In an implementation manner, the processing unit is specifically configured to determine that the test result of the test requirement is a pass condition when the actual result and the corresponding expected result of each test case are the same; and the processing unit is specifically used for determining that the test result of the test requirement does not pass under the condition that the actual result and the corresponding expected result of any test case are different.
In an implementation manner, the processing unit is specifically configured to query, in a preconfigured database, a test case corresponding to the test point type corresponding to the field name acquired by each acquiring unit, and determine at least one test case.
In an implementation, the programming language of the test script may be any one of VB programming language, Java, Python.
In a third aspect, the present invention provides an electronic device comprising: communication interface, processor, memory, bus; the memory is used for storing computer execution instructions, and the processor is connected with the memory through a bus. When the electronic device is operating, the processor executes the computer-executable instructions stored by the memory to cause the electronic device to perform the data processing method as provided by the first aspect above.
In a fourth aspect, the invention provides a computer-readable storage medium comprising instructions. When the instructions are run on a computer, the instructions cause the computer to perform the data processing method as provided in the first aspect above.
In a fifth aspect, the present invention provides a computer program product for causing a computer to perform the data processing method according to the first aspect when the computer program product runs on the computer.
It should be noted that all or part of the above computer instructions may be stored on the first computer readable storage medium. The first computer readable storage medium may be packaged with a processor of the data processing apparatus, or may be packaged separately from the processor of the data processing apparatus, which is not limited in the present invention.
For the description of the second, third, fourth and fifth aspects of the present invention, reference may be made to the detailed description of the first aspect; in addition, for the beneficial effects described in the second aspect, the third aspect, the fourth aspect and the fifth aspect, reference may be made to beneficial effect analysis of the first aspect, and details are not repeated here.
In the present invention, the names of the above-mentioned data processing apparatuses do not limit the devices or functional modules themselves, and in actual implementation, the devices or functional modules may appear by other names. Insofar as the functions of the respective devices or functional blocks are similar to those of the present invention, they are within the scope of the claims of the present invention and their equivalents.
These and other aspects of the invention will be more readily apparent from the following description.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic view of a data processing method applied in a scenario according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a data processing method according to an embodiment of the present invention;
FIG. 3 is a second flowchart illustrating a data processing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention;
FIG. 5 is a second schematic diagram of a data processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer program product of a data processing method according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described below with reference to the accompanying drawings.
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.
For the convenience of clearly describing the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", and the like are used to distinguish the same items or similar items with basically the same functions and actions, and those skilled in the art can understand that the words "first", "second", and the like do not limit the quantity and execution order.
The following explains the related concepts involved in the present invention:
visual Basic (VB) is a common object-based programming language developed by Microsoft corporation, and is a structured, modular, object-oriented, Visual programming language that contains event-driven mechanisms that assist in the development environment. Is a language which can be used for the development of Microsoft's own products.
Java is an object-oriented programming language, not only absorbs various advantages of C + + language, but also abandons concepts such as multiple inheritance, pointers and the like which are difficult to understand in C + +, so that the Java language has two characteristics of strong function, simplicity and easiness in use.
Python was designed by Guido van Rossum, the institute of mathematics and computer science, the Netherlands, in the early 1990's as a substitute for the language called ABC.
A test script (Testing script) generally refers to a series of instructions for a particular test that may be executed by an automated test tool.
The Test Case (Test Case) refers to the description of a Test task performed on a specific software product, and embodies Test schemes, methods, techniques and strategies.
Fig. 1 is a schematic view of a scenario to which an embodiment of the present invention may be applied, as shown in fig. 1, the scenario may include: a user 1, an electronic device 2 and a server 3. User 1 may be a tester or the like.
As an example, the user 1 may input the test requirements into the electronic device 2. After receiving the test requirement, the electronic device 2 determines at least one test case according to the test point type corresponding to each field name in the test requirement. The electronic device 2 inputs each test case into a pre-stored test script, and determines an actual result of each test case. The electronic device 2 determines the test result of the test requirement according to the actual result and the expected result of each test case. The electronic device 2 displays the test result corresponding to the test requirement.
As another example, the user 1 may input a test requirement into the electronic device 2. After receiving the test requirement, the electronic device 2 sends the test requirement to the server 3. After receiving the test requirement, the server 3 determines at least one test case according to the test point type corresponding to each field name in the test requirement. The server 3 inputs each test case into a pre-stored test script, and determines an actual result of each test case. The server 3 determines the test result of the test requirement according to the actual result and the expected result of each test case. The server 3 sends the test result corresponding to the test requirement to the electronic device 2. The electronic device 2 displays the test result corresponding to the test requirement.
The data processing apparatus in the embodiment of the present invention may be the electronic device 2 or the server 3 shown in fig. 1, or may be a part of the apparatus in the electronic device 2 or the server 3. For example the data processing means is a system of chips in the electronic device 2. The chip system is configured to support the electronic device 2 to implement the functions referred to in the first aspect and any one of its possible implementations. For example, after the chip system receives the test requirement, at least one test case is determined according to the test point type corresponding to each field name in the test requirement. And the chip system inputs each test case into a pre-stored test script, and determines the actual result of each test case. And the chip system determines the test result of the test requirement according to the actual result and the expected result of each test case. The chip system includes a chip and may also include other discrete devices or circuit structures.
The electronic device 2 in the present application may be a portable computer (e.g., a mobile phone), a tablet computer, a notebook computer, a Personal Computer (PC), etc., for example, and the following embodiment does not limit the specific form of the electronic device 2.
The following describes a data processing method provided by an embodiment of the present invention with reference to a scenario shown in fig. 1 and taking a data processing apparatus as a server 3 as an example.
As shown in FIG. 2, the data processing method includes the following steps S11-S14:
s11, the server 3 obtains the test requirement. The test requirement comprises one or more field names and test point types respectively corresponding to the field names.
Specifically, in an actual application, one test requirement may include one or more test points, each test point corresponds to one field name, and the server 3 collects a test result of each test point after testing each test point, so that the test result corresponding to the test requirement can be determined.
In some examples, when the test requirement includes one or more field names and test point types respectively corresponding to each field name, the server 3 needs to determine at least one test case corresponding to each test point type according to the test point type corresponding to each field name, and summarize the at least one test case corresponding to each test point type to obtain all test cases to be tested.
In other examples, whether to perform special checking corresponding to the field names may be further included in the test requirement. When the special check is no, the server 3 needs to determine at least one test case corresponding to each test point type according to the test point type corresponding to each field name, and summarize the at least one test case corresponding to each test point type to obtain all test cases needing to be tested. When the special verification is a designated item (such as time), the server 3 needs to determine at least one test case corresponding to each test point type according to the test point type corresponding to each field name. Meanwhile, the server 3 needs to determine the test case corresponding to the specified project. And then, the server 3 summarizes at least one test case corresponding to each test point type and the test case corresponding to the specified project to obtain all the test cases to be tested. In addition, in order to describe the test point more clearly, the test requirement may further include an english name corresponding to the field name, whether input is necessary, and the like, which facilitates subsequent management. For convenience, the server 3 may only test the target items in the test requirement (e.g., the field names, the test point types respectively corresponding to the field names, and the special checks), so as to save the test time.
For example, the test requirement includes one or more field names, and test point types, english names, whether input is necessary, and special checks corresponding to the field names are described as examples. When a user inputs a test requirement on the electronic device 2, the test requirement table shown in table 1 needs to be filled in. After the user fills in the test requirement table, the electronic device 2 sends the test requirement table to the server 3. Thus, the server 3 can obtain the test requirement according to the test requirement table input by the user.
TABLE 1
Figure BDA0003259271850000071
Then, the server 3 identifies one or more field names in the test requirement table, and identifies the test point types corresponding to each field name, for example: when the field name is the user number, the test point type corresponding to the user number is int (16), and the special check is none. When the field name is time, the test point type corresponding to the user number is String (8), and the special check is date. Thus, the server 3 determines that the special check corresponding to the user number is none, and the server 3 only needs to determine the test case corresponding to the test point type int (16). The server 3 determines that the special verification corresponding to the time is a date, and the server 3 needs to determine the test case corresponding to the date while testing the test case corresponding to the point type String (8).
S12, the server 3 determines at least one test case according to the test point type corresponding to each field name. The test case at least comprises test data corresponding to the field name and an expected result.
S13, the server 3 inputs each test case into a pre-stored test script, and determines an actual result of each test case.
S14, the server 3 determines the test result of the test requirement according to the actual result and the corresponding expected result of each test case.
As can be seen from the above, after the server 3 obtains the test requirement, at least one test case is determined according to the test point type corresponding to each field name in the test requirement, and the test case corresponding to each test point type does not need to be manually configured. Thereafter, the server 3 determines an actual result of each test case by inputting each test case into a test script stored in advance. The server 3 determines the test result of the test requirement according to the actual result and the expected result of each test case. Therefore, when the test developer adopts the data processing method provided by the embodiment of the invention to test the software, the test developer does not need to configure the test cases corresponding to each test point type one by one, thereby saving a large amount of configuration time. The total time required by the software test is reduced, so that the software test efficiency can be improved, and the software test cost can be reduced.
In an implementation manner, referring to fig. 2, as shown in fig. 3, the above S12 can be specifically realized by the following S120.
S120, the server 3 queries the test case corresponding to the test point type corresponding to each field name in a pre-configured database, and determines at least one test case.
Specifically, in order to facilitate management of test cases corresponding to different test point types, the data processing method provided in the embodiment of the present invention collects historical test cases and corresponding test point types, and generates a corresponding relationship between a test case and a test point type according to the historical test cases and test data. Therefore, as the types of the test cases and the test points in the database are gradually increased, the experience effect of the user is also gradually increased.
It should be noted that, when the server 3 queries the test case corresponding to the test point type in the pre-configured database, if the test case corresponding to the test point type does not exist, the server 3 needs to prompt the user through the electronic device 2 that the test case corresponding to the test point type does not exist in the user database. In this way, after receiving the test case corresponding to the test point type, the electronic device 2 sends the test case corresponding to the test point type to the server 3. Therefore, the server 3 can update the corresponding relation between the test cases and the test point types in the database while running normally, and the subsequent use is facilitated.
Exemplarily, in combination with the table 1, taking the test point type as int (16) as an example, the server 3 determines that the special check corresponding to the user number is none, and the server 3 only needs to query the test case corresponding to the test point type int (16) in a pre-configured database. The test for int (16) is shown in table 2, for example. Wherein, the test case includes: the field name corresponds to the test data and the expected result. In addition, the test case further includes: test data format and test case type.
TABLE 2
Figure BDA0003259271850000091
For example, in combination with table 1, taking the test point type as String (8) as an example, the server 3 determines that the special verification corresponding to the time is a date, and the server 3 needs to query the test case corresponding to the test point type String (8) in the preconfigured database and also needs to query the test case corresponding to the date in the preconfigured database. The test for String (8) is shown in table 3, and the test for date is shown in table 4.
TABLE 3
Figure BDA0003259271850000101
TABLE 4
Figure BDA0003259271850000102
The server 3 thus obtains at least one test case for the test. Such as: the field name is user number and time, the test point type corresponding to the user number is int (16), the special check is none, the test point type corresponding to the time is String (8), and the special check is date. If the server 3 determines that the special check corresponding to the user number is none, the server 3 queries at least one test case corresponding to the test point type int (16) in a pre-configured database. Then, the server 3 determines that the special verification corresponding to the time is a date, and after the server 3 queries at least one test case corresponding to the test point type String (8) in the pre-configured database, the server also needs to query at least one test case corresponding to the date in the pre-configured database. Then, the server 3 summarizes each test case obtained by the query, thereby obtaining all test cases to be tested. For example, all tests obtained by the server 3 are shown in table 5.
TABLE 5
Figure BDA0003259271850000111
Figure BDA0003259271850000121
In an implementation manner, the test requirement further includes a system address, and the pre-stored test script further includes a test address; referring to fig. 2, as shown in fig. 3, S13 may be implemented in detail as S130 described below.
S130, after the server 3 determines that the test address is the system address, each test case is input into a pre-stored test script, and the actual result of each test case is determined.
Specifically, in order to better complete the software test, a plurality of different test scripts may be stored in the server 3 in advance for completing different test requirements. In one example, the server 3 may randomly select a test script (e.g., test script 1) from a plurality of different test scripts as the currently used test script, and input each test case into the test script 1 to determine the actual result of each test case. In other examples, after the server 3 receives the test requirements, the server 3 presents each test script currently available to the user via the electronic device 2. After receiving the determination operation of the user for any one of the test scripts (e.g., test script 1), the electronic device 2 notifies the server 3 that the determination operation is performed on the test script 1. Then, the server 3 determines the actual result of each test case according to the input of each test case into the test script 1.
Illustratively, the programming language of the test script may be any one of VB programming language, Java, Python. If the programming language of the test script is Python, the test script is as follows:
Figure BDA0003259271850000131
here, the "| test address | |", may be a preset address, or may be a system address as shown in table 1. Such as: when the "| test address | |" is a system address, the "| | test address | |" is http://xx.xx.xx.xx:xxx/info。the test address is a preset address. Thus, when executing the above S13, the server 3 does not need to execute the above S13 after determining the test address as the system address, thereby saving the time for software testing.
'l listDetail l' may be one or more field names included in the test requirement, and may be test data of the test case currently tested, and a business correct value corresponding to each field name other than the field name corresponding to the test case currently tested. Such as: the field name contained in the test requirement is user number, the test point type corresponding to the user number is int (16), the test case corresponding to int (16) includes test case 1 and test case 2, when the server 3 inputs the test case 1 into the pre-stored test script, the 'l listDetail l' can be english name customer no corresponding to the user number. "| listDetail |" may be test data in test case 1.
Alternatively, the first and second electrodes may be,
the field names contained in the test requirements are user numbers and time, the test point type corresponding to the user numbers is int (16), the service correct value corresponding to the time is 20210902, and the test cases corresponding to int (16) include test case 1 and test case 2. When the server 3 inputs the test case 1 into a pre-stored test script, 'l listDetail |' includes an english name customer no corresponding to the user number and an english name Time corresponding to the Time. The "| listDetail |" includes the test data in the test case 1, and the correct service value 20210902 corresponding to time.
Alternatively, the first and second electrodes may be,
the field names contained in the test requirements are user number, time and age, the test point type corresponding to the time is String (8), the service correct value corresponding to the user number is 1352001, the service correct value corresponding to the age is 1425434, and the test case corresponding to the String (8) comprises a test case 3 and a test case 4. When the server 3 inputs the test case 3 into a pre-stored test script, 'l listDetail' includes an english name customer no corresponding to the user number, an english name Time corresponding to the Time, and an english name age corresponding to the age. The "| listDetail |" includes the test data in the test case 3, the correct value 1352001 of the service corresponding to the user number, and the correct value 1425434 of the service corresponding to the age.
The expected result | | may be the expected result corresponding to the field name. Such as: the field name is the user name, taking the test of TestCase0001 as an example, | | | the expected result | | | may be that the interface returns a correct.
For example, in combination with the examples of table 1 and S120, the test requirement includes 2 field names, which are respectively a user number and time, the test point type corresponding to the user number is int (16), the test case corresponding to int (16) includes test case 1, the test data in the test case 1 is 1234567890123456, and the service correctness value of the time pair is 20210902, and after the server 3 determines that the test address is the system address, the test case 1 is input into the pre-stored test script, and then the following operations are performed.
Figure BDA0003259271850000151
After that, the server 3 can determine the actual result corresponding to the TestCase0001 after executing the above operations.
In an implementation manner, referring to fig. 2, as shown in fig. 3, the above S14 can be specifically realized by the following S140 and S141.
S140, the server 3 determines that the test result of the test requirement is passed under the condition that the actual result and the corresponding expected result of each test case are the same.
S141, the server 3 determines that the test result of the test requirement does not pass the test case when the actual result of any test case is different from the corresponding expected result.
Specifically, when the actual result and the expected result of each test case are the same, it is indicated that each test case is normally operated. In this way, the server 3 determines that the test result of the test requirement is a pass if the actual result and the expected result of each test case are the same. When the actual result and the expected result of any test case are different, the test case is abnormal. At this time, the server 3 determines that the test result of the test requirement is failed when the actual result and the expected result of any test case are not the same.
Specifically, in the data processing method provided by the embodiment of the present invention, the server 3 may show the actual result and the expected result of each test case to the user in a table manner, so that the user can conveniently view the actual result and the expected result of each test case.
Illustratively, the actual results and expected results for each test case are shown in table 6.
TABLE 6
Figure BDA0003259271850000161
Figure BDA0003259271850000171
Figure BDA0003259271850000181
In one example, for a test case (e.g., test case 2) whose actual result is not the same as the expected result, the server 3 needs to input the test case 2 into a test script other than the currently used test script (e.g., test script 1) (e.g., the test script other than test case 1 only contains test script 2 and test script 3). If the server 3 inputs the test case 2 into the test script 2, the actual result and the expected result of the test case 2 are the same. In this way, the server 3 determines that the test result of the test requirement is a pass if the actual result and the expected result of each test case are the same. If the server 3 inputs the test case 2 into the test script 2, the actual result and the expected result of the test case 2 are different, and if the server 3 inputs the test case 2 into the test script 3, the actual result and the expected result of the test case 2 are the same, so that the server 3 determines that the test result of the test requirement is passed under the condition that the actual result and the expected result of each test case are the same. If the server 3 inputs the test case 2 into the test script 2, the actual result and the expected result of the test case 2 are different, and after the server 3 inputs the test case 2 into the test script 3, the actual result and the expected result of the test case 2 are different, and the server 3 determines that the test result of the test requirement does not pass.
In other examples, for a test case (e.g., test case 2) with an actual result different from an expected result, the server 3 prompts the user to reselect an unused test script through the electronic device 2, where, for example, the currently used test script is test script 1, and the test scripts other than test case 1 only include test script 2 and test script 3, and then the test scripts that can be selected by the user are test script 2 and test script 3. After the user performs the determination operation on the test script 2, the electronic device 2 notifies the server 3 that the user performs the determination operation on the test script 2. After the server 3 inputs the test case 2 into the test script 2, the actual result and the expected result of the test case 2 are the same, and thus, the server 3 determines that the test result of the test requirement is a pass test under the condition that the actual result and the expected result of each test case are the same. If the actual result and the expected result of the test case 2 are different after the server 3 inputs the test case 2 into the test script 2, the server 3 prompts the user to reselect the test script through the electronic device 2, and if the currently used test scripts are the test script 1 and the test script 2, and the unused test script is the test script 3, the test script which can be selected by the user is the test script 3. After the user performs the determination operation on the test script 3, the electronic device 2 notifies the server 3 that the user performs the determination operation on the test script 3.
After the server 3 inputs the test case 2 into the test script 3, the actual result and the expected result of the test case 2 are the same, and thus, the server 3 determines that the test result of the test requirement is a pass test under the condition that the actual result and the expected result of each test case are the same. If the server 3 inputs the test case 2 into the test script 2, the actual result and the expected result of the test case 2 are different, and the server 3 determines that the test result of the test requirement is not passed.
The above example is described by taking the server 3 as an example of the data processing apparatus according to the embodiment of the present invention. In other examples, the data processing apparatus provided in the embodiment of the present invention may also be an electronic device 2, and a process of the electronic device 2 executing the data processing method provided in the embodiment of the present invention is similar to a process of the server 3 executing the data processing method provided in the embodiment of the present invention, and is not described here again.
The scheme provided by the embodiment of the invention is mainly introduced from the perspective of a method. To implement the above functions, it includes hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the present invention can be implemented in hardware or a combination of hardware and computer software, with the exemplary elements and algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiment of the present invention, the data processing apparatus may be divided into the functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 4 is a schematic structural diagram of a data processing apparatus 10 according to an embodiment of the present invention. The data processing device 10 is used for acquiring test requirements; determining at least one test case according to the test point type corresponding to each field name; inputting each test case into a pre-stored test script, and determining the actual result of each test case; and determining the test result of the test requirement according to the actual result and the expected result of each test case. The data processing apparatus 10 may include an acquisition unit 101 and a processing unit 102.
An obtaining unit 101 is configured to obtain a test requirement. For example, in conjunction with fig. 2, the obtaining unit 101 may be configured to execute S11.
The processing unit 102 is configured to determine at least one test case according to the test point type corresponding to each field name; inputting each test case into a pre-stored test script, and determining the actual result of each test case; and determining the test result of the test requirement according to the actual result and the corresponding expected result of each test case. For example, in conjunction with fig. 2, processing unit 101 may be configured to perform S12, S12, and S14. In conjunction with fig. 3, processing unit 101 may be configured to perform S120, S130, S140, and S141.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and the function thereof is not described herein again.
Of course, the data processing apparatus 10 provided in the embodiment of the present invention includes, but is not limited to, the above modules, for example, the data processing apparatus 10 may further include the storage unit 103. The storage unit 103 may be used to store the program code of the write data processing apparatus 10, and may also be used to store data generated by the write data processing apparatus 10 during operation, such as data in a write request.
Fig. 5 is a schematic structural diagram of a data processing apparatus 10 according to an embodiment of the present invention, and as shown in fig. 5, the data processing apparatus 10 may include: at least one processor 51, a memory 52, a communication interface 53 and a communication bus 54.
The following specifically describes each component of the data processing apparatus 10 with reference to fig. 5:
the processor 51 is a control center of the data processing apparatus 10, and may be a single processor or a collective term for a plurality of processing elements. For example, the processor 51 is a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention, such as: one or more DSPs, or one or more Field Programmable Gate Arrays (FPGAs).
In particular implementations, processor 51 may include one or more CPUs such as CPU0 and CPU1 shown in fig. 5 as one example. Also, as an example, the data processing apparatus 10 may include a plurality of processors, such as the processor 51 and the processor 55 shown in fig. 5. Each of these processors may be a Single-core processor (Single-CPU) or a Multi-core processor (Multi-CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
The Memory 52 may be a Read-Only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 52 may be self-contained and coupled to the processor 51 via a communication bus 54. The memory 52 may also be integrated with the processor 51.
In a particular implementation, the memory 52 is used for storing data and software programs for implementing the present invention. The processor 51 may perform various functions of the air conditioner by running or executing software programs stored in the memory 52 and calling data stored in the memory 52.
The communication interface 53 is a device such as any transceiver, and is used for communicating with other devices or communication Networks, such as a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), a terminal, and a cloud. The communication interface 53 may include an acquisition implementation receiving function.
The communication bus 54 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
As an example, in conjunction with fig. 4, the acquisition unit 101 in the data processing apparatus 10 implements the same function as the communication interface 53 in fig. 5, the processing unit 102 implements the same function as the processor 51 in fig. 5, and the storage unit 103 implements the same function as the memory 52 in fig. 5.
Another embodiment of the present invention further provides a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to perform the method shown in the above method embodiment.
In some embodiments, the disclosed methods may be implemented as computer program instructions encoded on a computer-readable storage medium in a machine-readable format or encoded on other non-transitory media or articles of manufacture.
Fig. 6 schematically illustrates a conceptual partial view of a computer program product comprising a computer program for executing a computer process on a computing device provided by an embodiment of the invention.
In one embodiment, the computer program product is provided using a signal bearing medium 410. The signal bearing medium 410 may include one or more program instructions that, when executed by one or more processors, may provide the functions or portions of the functions described above with respect to fig. 2. Thus, for example, referring to the embodiment shown in FIG. 2, one or more features of S11-S14 may be undertaken by one or more instructions associated with the signal bearing medium 410. Further, the program instructions in FIG. 6 also describe example instructions.
In some examples, signal bearing medium 410 may include a computer readable medium 411, such as, but not limited to, a hard disk drive, a Compact Disc (CD), a Digital Video Disc (DVD), a digital tape, a memory, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
In some implementations, the signal bearing medium 410 may comprise a computer recordable medium 412 such as, but not limited to, a memory, a read/write (R/W) CD, a R/W DVD, and the like.
In some implementations, the signal bearing medium 410 may include a communication medium 413, such as, but not limited to, a digital and/or analog communication medium (e.g., a fiber optic cable, a waveguide, a wired communications link, a wireless communication link, etc.).
The signal bearing medium 410 may be conveyed by a wireless form of communication medium 413, such as a wireless communication medium compliant with the IEEE802.41 standard or other transport protocol. The one or more program instructions may be, for example, computer-executable instructions or logic-implementing instructions.
In some examples, a data writing apparatus, such as that described with respect to fig. 2, may be configured to provide various operations, functions, or actions in response to one or more program instructions via the computer-readable medium 411, the computer-recordable medium 412, and/or the communication medium 413.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, 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, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. 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 readable storage medium. Based on such understanding, the technical solution of the embodiments of the present invention may be essentially or partially contributed to by the prior art, or all or part of the technical solution may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) 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: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions within the technical scope of the present invention are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (12)

1. A data processing method, comprising:
acquiring a test requirement; the test requirement comprises one or more field names and test point types corresponding to the field names respectively;
determining at least one test case according to the test point type corresponding to each field name; the test case at least comprises test data and an expected result corresponding to the field name;
inputting each test case into a pre-stored test script, and determining an actual result of each test case;
and determining the test result of the test requirement according to the actual result and the corresponding expected result of each test case.
2. The data processing method of claim 1, wherein the determining at least one test case according to the test point type corresponding to each field name comprises:
and inquiring a test case corresponding to the test point type corresponding to each field name in a pre-configured database, and determining the at least one test case.
3. The data processing method according to claim 1 or 2, wherein the test requirement further includes a system address, and the pre-stored test script further includes a test address;
inputting each test case into a pre-stored test script, and determining an actual result of each test case, including:
and after the test address is determined to be the system address, inputting each test case into a pre-stored test script, and determining the actual result of each test case.
4. The data processing method according to any one of claims 1 to 3, wherein the determining the test result of the test requirement according to the actual result and the corresponding expected result of each test case comprises:
determining that the test result of the test requirement passes under the condition that the actual result and the corresponding expected result of each test case are the same;
and determining that the test result of the test requirement does not pass under the condition that the actual result and the corresponding expected result of any one of the test cases are different.
5. A data processing method according to any one of claims 1 to 4, wherein the programming language of the test script is any one of VB programming language, Java and Python.
6. A data processing apparatus, comprising:
an acquisition unit for acquiring a test requirement; wherein, the test requirement comprises one or more field names and test point classes respectively corresponding to each field name;
the processing unit is used for determining at least one test case according to the test point type corresponding to the field name acquired by each acquisition unit; the test case at least comprises test data and an expected result corresponding to the field name;
the processing unit is further configured to input each test case into a pre-stored test script, and determine an actual result of each test case;
the processing unit is further configured to determine a test result of the test requirement according to the actual result and the corresponding expected result of each test case.
7. The data processing apparatus according to claim 6, wherein the processing unit is specifically configured to query a preconfigured database for a test case corresponding to the test point type corresponding to each field name, and determine the at least one test case.
8. The data processing apparatus according to claim 6 or 7, wherein the test requirement further includes a system address, and the pre-stored test script further includes a test address;
the processing unit is specifically configured to, after determining that the test address is the system address acquired by the acquisition unit, input each test case into a pre-stored test script, and determine an actual result of each test case.
9. The data processing apparatus according to any one of claims 6 to 8, wherein the processing unit is specifically configured to determine that the test result of the test requirement passes when the actual result and the corresponding expected result of each of the test cases are the same;
the processing unit is specifically configured to determine that the test result of the test requirement does not pass under the condition that the actual result and the corresponding expected result of any one of the test cases are different.
10. A data processing apparatus as claimed in any one of claims 6 to 9, wherein the programming language of the test script is any one of VB programming language, Java, Python.
11. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the data processing method of any one of claims 1 to 5.
12. An electronic device, comprising: communication interface, processor, memory, bus;
the memory is used for storing computer execution instructions, and the processor is connected with the memory through the bus;
the processor executes computer-executable instructions stored by the memory when the electronic device is operating to cause the electronic device to perform the data processing method of any of claims 1-5.
CN202111067931.XA 2021-09-13 2021-09-13 Data processing method and device and electronic equipment Pending CN113778881A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111067931.XA CN113778881A (en) 2021-09-13 2021-09-13 Data processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111067931.XA CN113778881A (en) 2021-09-13 2021-09-13 Data processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN113778881A true CN113778881A (en) 2021-12-10

Family

ID=78842985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111067931.XA Pending CN113778881A (en) 2021-09-13 2021-09-13 Data processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113778881A (en)

Similar Documents

Publication Publication Date Title
CN109302522B (en) Test method, test device, computer system, and computer medium
CN112765023B (en) Test case generation method and device
US7536599B2 (en) Methods and systems for validating a system environment
CN110188135B (en) File generation method and equipment
CN111290941A (en) Method and device for testing multiple interfaces, computing equipment and medium
CN110990274A (en) Data processing method, device and system for generating test case
CN115617780A (en) Data import method, device, equipment and storage medium
CN109558315B (en) Method, device and equipment for determining test range
CN112561690A (en) Method, system, equipment and storage medium for testing credit card staging service interface
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN112445490A (en) File sequence processing method and device, terminal equipment and storage medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN113778881A (en) Data processing method and device and electronic equipment
CN113986753A (en) Interface test method, device, equipment and storage medium
CN114527993A (en) Application deployment method, device, equipment and medium
CN108959508B (en) SQL data generation method and device
CN111679885A (en) Method, device, medium and electronic equipment for determining virtual machine drift
CN116661758B (en) Method, device, electronic equipment and medium for optimizing log framework configuration
CN111949510B (en) Test processing method, device, electronic equipment and readable storage medium
CN114756473A (en) Test method, test device, electronic equipment and storage medium
CN115617675A (en) Automatic testing method, device and equipment of application program and storage medium
CN117234884A (en) Configuration information modification method, device, computer equipment and storage medium
CN113377648A (en) Software system diagnosis method and device, electronic equipment and computer readable medium
CN113626445A (en) Report processing method and device
CN107800490B (en) Parameter processing method and system

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