CN107229650B - Test method and device - Google Patents

Test method and device Download PDF

Info

Publication number
CN107229650B
CN107229650B CN201610178362.9A CN201610178362A CN107229650B CN 107229650 B CN107229650 B CN 107229650B CN 201610178362 A CN201610178362 A CN 201610178362A CN 107229650 B CN107229650 B CN 107229650B
Authority
CN
China
Prior art keywords
tested
data
environment
operating environment
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610178362.9A
Other languages
Chinese (zh)
Other versions
CN107229650A (en
Inventor
王虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201610178362.9A priority Critical patent/CN107229650B/en
Publication of CN107229650A publication Critical patent/CN107229650A/en
Application granted granted Critical
Publication of CN107229650B publication Critical patent/CN107229650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases

Abstract

The embodiment of the invention provides a test method and a test device. When the data to be tested needs to be tested by using the test case in the current operating environment, acquiring the environment configuration information of the current operating environment; the environment configuration information is different for different operating environments. And updating the attribute information of the data to be tested into the environment configuration information of the current operating environment in the data to be tested. Initializing the data to be tested with updated attribute information into a shared database. And testing the data to be tested initialized into the shared database by using the test case in the current operating environment. The embodiment of the invention can simultaneously and respectively test two identical data by using the test cases in different operating environments.

Description

Test method and device
Technical Field
The invention relates to the technical field of computers, in particular to a testing method and a testing device.
Background
Currently, it is often necessary to test data using test cases, for example, to test a written computer program, and when data needs to be tested using test cases, the data needs to be initialized into a database first, and then the data initialized into the database needs to be tested using test cases.
However, sometimes the data needs to be tested by using test cases in different running environments, for example, the data needs to be tested by using test cases not only in the site running environment but also in the dev running environment; the different operating environments share the database.
When the data is tested by using the test case in each operating environment, the data needs to be initialized into the database first, and then the data initialized into the database can be tested. However, two identical data cannot be initialized simultaneously in this database.
Therefore, when the data needs to be tested in a certain operating environment by using the test case, after the data is initialized into the shared database in the one operating environment, if the data needs to be tested in another operating environment by using the test case, because two identical data cannot be simultaneously initialized in the shared database, the data cannot be initialized into the shared database in the other operating environment, and further the data cannot be tested in the other operating environment by using the test case, resulting in test failure. That is, after the data initialized into the database in the certain operating environment is deleted, the data can be initialized into the shared database in another operating environment, so that the data can be tested by using the test case in another operating environment. The test case cannot be used to test two identical data in different operating environments at the same time.
Therefore, how to implement the test of two identical data by using test cases in different operating environments at the same time is an urgent technical problem to be solved.
Disclosure of Invention
In order to overcome the problems in the related art, the invention provides a testing method and a testing device.
According to a first aspect of embodiments of the present invention, there is provided a test method, the method comprising:
when data to be tested needs to be tested in a current operating environment by using a test case, acquiring environment configuration information of the current operating environment; different environment configuration information of different operation environments is different;
in the data to be tested, updating the attribute information of the data to be tested into the environment configuration information of the current operating environment;
initializing the data to be tested with the updated attribute information into a shared database;
and testing the data to be tested initialized into the shared database by using the test case in the current operating environment.
Wherein, in the data to be tested, updating the attribute information of the data to be tested to the environment configuration information of the current operating environment includes:
acquiring a preset data field in the data to be tested;
judging whether the preset data field stores content or not;
when the content is not stored in the preset data field, storing the environment configuration information of the current operating environment in the preset data field;
and when the content is stored in the preset data field, replacing the content stored in the preset data field with the environment configuration information of the current operating environment.
Wherein, in the data to be tested, updating the attribute information of the data to be tested to the environment configuration information of the current operating environment includes:
creating a new data field in the data to be tested;
storing environment configuration information for the current operating environment in the new data field.
Further, the method further comprises:
when the test of the data to be tested initialized into the shared database is completed by using the test case in the current operating environment and a test result is obtained, updating the attribute information of the test result into the environment configuration information of the current operating environment;
storing the test results with updated attribute information in the shared database.
Further, the method further comprises:
verifying the test results stored in the shared database and updated with the attribute information;
and after the verification is finished, deleting the data to be tested which is initialized into the shared database and has the attribute information of the environmental configuration information of the current operating environment, and deleting the test result which is stored in the shared database and has the attribute information of the environmental configuration information of the current operating environment.
According to a second aspect of embodiments of the present invention, there is provided a test apparatus, the apparatus comprising:
the system comprises an acquisition module, a test case acquisition module and a test execution module, wherein the acquisition module is used for acquiring environment configuration information of a current operation environment when data to be tested needs to be tested by using the test case in the current operation environment; different environment configuration information of different operation environments is different;
the first updating module is used for updating the attribute information of the data to be tested into the environment configuration information of the current operating environment in the data to be tested;
the initialization module is used for initializing the data to be tested with the updated attribute information into a shared database;
and the testing module is used for testing the data to be tested initialized into the shared database by using the test case in the current operating environment.
Wherein the first update module comprises:
the acquisition unit is used for acquiring a preset data field in the data to be tested;
the judging unit is used for judging whether the preset data field stores content or not;
the first storage unit is used for storing the environment configuration information of the current operating environment in the preset data field when the content is not stored in the preset data field;
and the replacing unit is used for replacing the content stored in the preset data field with the environment configuration information of the current operating environment when the content is stored in the preset data field.
Wherein the first update module comprises:
the creating unit is used for creating a new data field in the data to be tested;
and the second storage unit is used for storing the environment configuration information of the current operating environment in the new data field.
Further, the apparatus further comprises:
the second updating module is used for updating the attribute information of the test result into the environment configuration information of the current operation environment when the test case is used for testing the data to be tested initialized into the shared database in the current operation environment and obtaining the test result;
and the storage module is used for storing the test result with the updated attribute information in the shared database.
Further, the apparatus further comprises:
the verification module is used for verifying the test result which is stored in the shared database and updated with the attribute information;
and the deleting module is used for deleting the data to be tested which is initialized into the shared database and has the attribute information of the environmental configuration information of the current operating environment, and deleting the test result which is stored in the shared database and has the attribute information of the environmental configuration information of the current operating environment.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
in the embodiment of the invention, when the data to be tested needs to be tested by using the test case in the current operating environment, the environment configuration information of the current operating environment is obtained; the environment configuration information is different for different operating environments. And updating the attribute information of the data to be tested into the environment configuration information of the current operating environment in the data to be tested. Initializing the data to be tested with updated attribute information into a shared database. And testing the data to be tested initialized into the shared database by using the test case in the current operating environment.
When a plurality of different operation environments exist locally, the shared database is shared by the plurality of different operation environments, and in the process of testing the data to be tested by using the test case in each operation environment, the data to be tested needs to be initialized into the shared database, and then the data to be tested initialized into the shared database can be tested. However, two identical data cannot be initialized at the same time in a shared database.
Therefore, in the prior art, when a certain data to be tested needs to be tested in a certain operating environment by using a test case, the time from the initialization of the data to be tested in the shared database in the one operating environment to the deletion of the data to be tested initialized in the shared database is provided, if the data to be tested needs to be tested in another operating environment by using the test case, because two identical data cannot be initialized in the shared database at the same time, the data to be tested cannot be initialized in the shared database in another operating environment, and the data to be tested cannot be tested in another operating environment by using the test case, so that the test fails. That is, after the data initialized into the database in the certain operating environment is deleted, the data can be initialized into the shared database in another operating environment, so that the data can be tested by using the test case in another operating environment.
That is, in the prior art, two identical data cannot be tested by using test cases in different operating environments at the same time.
In the embodiment of the invention, when a certain data to be tested needs to be tested in a certain operation environment by using the test case, the environment configuration information of the certain operation environment is obtained; different environment configuration information of different operation environments is different; in the certain data to be tested, the attribute information of the certain data to be tested is updated to the environment configuration information of the certain running environment, and then the certain data to be tested with the updated attribute information is initialized into the shared database. During the period from the initialization of the certain data to be tested with the updated attribute information into the shared database in the certain operating environment to the deletion of the certain data to be tested with the updated attribute information initialized into the shared database, if the other data to be tested needs to be tested by using the test case in the other operating environment, the environment configuration information of the other operating environment is obtained; and updating the attribute information of the other data to be tested into the environment configuration information of the other operating environment in the other data to be tested.
Whether the certain data to be tested of which the attribute information is not updated is completely the same as the other data to be tested of which the attribute information is not updated, because the environment configuration information of the certain operating environment is different from the environment configuration information of the other operating environment, the attribute information of the certain data to be tested of which the attribute information is updated is different from the attribute information of the other data to be tested of which the attribute information is updated, and therefore, the certain data to be tested of which the attribute information is updated is not completely the same as the other data to be tested of which the attribute information is updated.
Therefore, during the period from the initialization of the certain data to be tested, in which the attribute information is updated, into the shared database in the certain operating environment to the deletion of the certain data to be tested, in which the attribute information is updated, in the shared database in the initialization, the other data to be tested, in which the attribute information is updated, can also be successfully initialized into the shared database in the other operating environment, and then the other data to be tested, in which the attribute information is updated, in the shared database in the initialization can be successfully tested by using the test case in the other operating environment.
Therefore, compared with the prior art, the embodiment of the invention can simultaneously test two identical data by using the test cases in different operating environments.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow chart illustrating a testing method according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating a testing method according to an exemplary embodiment;
FIG. 3 is a flow chart illustrating a testing method according to an exemplary embodiment;
FIG. 4 is a block diagram illustrating a test apparatus according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
FIG. 1 is a flow chart illustrating a method of testing, as shown in FIG. 1, including the following steps, according to an exemplary embodiment.
In step S101, when the data to be tested needs to be tested in the current operating environment by using the test case, obtaining environment configuration information of the current operating environment; the environment configuration information is different for different operating environments.
In the embodiment of the present invention, a technician sets a piece of configuration information for each operating environment locally in advance, and the environment configuration information set for different operating environments is different, that is, the environment configuration information of any two operating environments is different.
The environment configuration information of the operating environment may be a name or a number of the operating environment, or may be other contents, which is not limited in the present invention, and it is only necessary to satisfy that the environment configuration information of different operating environments is different.
For example, the environment configuration information of the sit running environment is sitTnt, and the environment configuration information of the dev running environment is devTnt.
In step S102, in the data to be tested, the attribute information of the data to be tested is updated to the environment configuration information of the current operating environment.
In the embodiment of the present invention, this step may be implemented in the following two ways.
One method comprises the following steps:
11. and acquiring a preset data field in the data to be tested.
The preset data field is one of a plurality of different existing data fields in the data to be tested, for example, an owner field for storing an owner of the data to be tested, a time field for storing a generation time for generating the data to be tested, or an address field for storing a generation address for generating the data to be tested, and the like.
12. And judging whether the preset data field stores the content or not.
In the embodiment of the present invention, the preset data field in the data to be tested may or may not store the content.
For example, assuming that the preset data field is an owner field, when the data to be tested is initially generated, if the owner of the data to be tested is not obtained, the owner of the data to be tested is not stored in the owner field of the data to be tested, so that no content is stored in the owner field of the data to be tested. When the data to be tested is initially generated, if the owner of the data to be tested is obtained, the owner of the data to be tested is stored in the owner field of the data to be tested, so that the content is stored in the owner field of the data to be tested.
13. And when the content is not stored in the preset data field, storing the environment configuration information of the current operating environment in the preset data field so as to update the attribute information of the data to be tested into the environment configuration information of the current operating environment in the data to be tested.
In the embodiment of the invention, when the content is not stored in the preset data field, the environment configuration information of the current operation environment can be stored in the preset data field, so that the attribute information of the data to be tested is updated to the environment configuration information of the current operation environment, and further the attribute information of the data to be tested is updated to the environment configuration information of the current operation environment in the data to be tested
14. When the content is stored in the preset data field, the content stored in the preset data field is replaced by the environment configuration information of the current operation environment, so that the attribute information of the data to be tested is updated to the environment configuration information of the current operation environment in the data to be tested.
In the embodiment of the invention, when the content is stored in the preset data field, the content stored in the preset storage field can be deleted, and then the environment configuration information of the current operating environment is stored in the preset data field, so that the content stored in the preset data field can be replaced by the environment configuration information of the current operating environment, and further the attribute information of the data to be tested is updated to the environment configuration information of the current operating environment in the data to be tested.
The other mode comprises the following steps:
21. a new data field is created in the data to be tested.
22. And storing the environment configuration information of the current operating environment in the new data field so as to update the attribute information of the data to be tested into the environment configuration information of the current operating environment in the data to be tested.
In the embodiment of the present invention, the created new data field does not store any content, so that the environment configuration information of the current operating environment can be stored in the created new data field at this time, and thus, in the data to be tested, the attribute information of the data to be tested is updated to the environment configuration information of the current operating environment.
In step S103, the data to be tested, whose attribute information is updated, is initialized into the shared database.
In step S104, the data to be tested initialized into the shared database is tested by using the test case in the current running environment.
In the embodiment of the invention, when the data to be tested needs to be tested by using the test case in the current operating environment, the environment configuration information of the current operating environment is obtained; the environment configuration information is different for different operating environments. And updating the attribute information of the data to be tested into the environment configuration information of the current operating environment in the data to be tested. Initializing the data to be tested with updated attribute information into a shared database. And testing the data to be tested initialized into the shared database by using the test case in the current operating environment.
When a plurality of different operation environments exist locally, the shared database is shared by the plurality of different operation environments, and in the process of testing the data to be tested by using the test case in each operation environment, the data to be tested needs to be initialized into the shared database, and then the data to be tested initialized into the shared database can be tested. However, two identical data cannot be initialized at the same time in a shared database.
Therefore, in the prior art, when a certain data to be tested needs to be tested in a certain operating environment by using a test case, the time from the initialization of the data to be tested in the shared database in the one operating environment to the deletion of the data to be tested initialized in the shared database is provided, if the data to be tested needs to be tested in another operating environment by using the test case, because two identical data cannot be initialized in the shared database at the same time, the data to be tested cannot be initialized in the shared database in another operating environment, and the data to be tested cannot be tested in another operating environment by using the test case, so that the test fails. That is, after the data initialized into the database in the certain operating environment is deleted, the data can be initialized into the shared database in another operating environment, so that the data can be tested by using the test case in another operating environment.
That is, in the prior art, two identical data cannot be tested by using test cases in different operating environments at the same time.
In the embodiment of the invention, when a certain data to be tested needs to be tested in a certain operation environment by using the test case, the environment configuration information of the certain operation environment is obtained; different environment configuration information of different operation environments is different; in the certain data to be tested, the attribute information of the certain data to be tested is updated to the environment configuration information of the certain running environment, and then the certain data to be tested with the updated attribute information is initialized into the shared database. During the period from the initialization of the certain data to be tested with the updated attribute information into the shared database in the certain operating environment to the deletion of the certain data to be tested with the updated attribute information initialized into the shared database, if the other data to be tested needs to be tested by using the test case in the other operating environment, the environment configuration information of the other operating environment is obtained; and updating the attribute information of the other data to be tested into the environment configuration information of the other operating environment in the other data to be tested.
Whether the certain data to be tested of which the attribute information is not updated is completely the same as the other data to be tested of which the attribute information is not updated, because the environment configuration information of the certain operating environment is different from the environment configuration information of the other operating environment, the attribute information of the certain data to be tested of which the attribute information is updated is different from the attribute information of the other data to be tested of which the attribute information is updated, and therefore, the certain data to be tested of which the attribute information is updated is not completely the same as the other data to be tested of which the attribute information is updated.
Therefore, during the period from the initialization of the certain data to be tested, in which the attribute information is updated, into the shared database in the certain operating environment to the deletion of the certain data to be tested, in which the attribute information is updated, in the shared database in the initialization, the other data to be tested, in which the attribute information is updated, can also be successfully initialized into the shared database in the other operating environment, and then the other data to be tested, in which the attribute information is updated, in the shared database in the initialization can be successfully tested by using the test case in the other operating environment.
Therefore, compared with the prior art, the embodiment of the invention can simultaneously test two identical data by using the test cases in different operating environments.
In the foregoing embodiment, after the test of the to-be-tested data initialized into the shared database by using the test case in the current operating environment is completed, a test result for testing the to-be-tested data initialized into the shared database is obtained, so that the test result can be verified.
Further, in another embodiment of the present invention, referring to fig. 2, the method further comprises:
in step S201, when the data to be tested initialized in the shared database is tested by using the test case in the current operating environment and a test result is obtained, in the test result, the attribute information of the test result is updated to the environment configuration information of the current operating environment.
Wherein, the environment configuration information of different operation environments is different.
In this step, the specific step of updating the attribute information of the test result to the environment configuration information of the current operating environment may refer to the specific process of "updating the attribute information of the data to be tested to the environment configuration information of the current operating environment in the data to be tested" in step S102, which is not described in detail herein.
In step S202, the test result with the updated attribute information is stored in the shared database.
After storing the test result with updated attribute information in the shared database, further, in another embodiment of the present invention, referring to fig. 3, the method further includes:
in step S301, the test result stored in the shared database, the attribute information of which is updated, is verified.
In step S302, after the verification is completed, the data to be tested, which is initialized into the shared database and whose attribute information is the environment configuration information of the current operating environment, is deleted, and the test result, which is stored in the shared database and whose attribute information is the environment configuration information of the current operating environment, is deleted.
In the embodiments shown in fig. 2 and fig. 3, after the test result is obtained, the test result needs to be stored in the shared database, then the test result stored in the shared database is verified, and after the verification is completed, the to-be-tested data initialized into the shared database and having the attribute information as the environment configuration information of the current operating environment is deleted, and the test result stored in the shared database and having the attribute information as the environment configuration information of the current operating environment is deleted.
When a certain data to be tested initialized in the shared database needs to be deleted in a certain operating environment, the data to be tested can be deleted according to a specific condition, for example, the data can be deleted according to attribute information of the data. If the attribute information of the data to be tested, which needs to be deleted, is AAA, when the data is deleted in the shared database according to the attribute information AAA in the operating environment, the attribute information of the data to be tested, which needs to be deleted, is AAA, so that the data to be tested is deleted from the shared database.
However, if other data to be tested has been initialized into the shared database in other operating environments at this time, the other data to be tested is not exactly the same as the data to be tested that needs to be deleted, but the attribute information of the other data and the attribute information of the data to be tested that needs to be deleted are both the attribute information AAA, when the data is deleted in the shared database according to the attribute information AAA in the operating environment, not only the data to be tested is deleted from the shared database, but also the other data to be tested that is initialized into the shared database in other operating environments is deleted in the shared database at the same time.
If the other data to be tested initialized into the shared database is not tested by using the test case in other operating environments, and the other data to be tested initialized into the shared database is deleted in the certain operating environment, the other data to be tested initialized into the shared database cannot be tested by using the test case in other operating environments, so that the other data to be tested fails to be tested.
In the embodiment of the present invention, in each of the aforementioned embodiments, before the data to be tested needs to be initialized into the shared database in one operating environment, the attribute information of the data to be tested needs to be updated to the environment configuration information of the current operating environment in the data to be tested, and then the data to be tested with the updated attribute information is initialized into the shared database. That is, in all the data to be tested initialized into the shared database, the attribute information of any two data to be tested is different.
Therefore, when a certain data to be tested initialized into the shared database needs to be deleted in a certain operating environment, only the data to be tested of which the attribute information initialized into the shared database is the environment configuration information of the certain operating environment is deleted, and other data to be tested initialized into the shared database in other operating environments cannot be deleted by mistake, so that the situation that the test fails when the other data to be tested initialized into the shared database needs to be tested by using a test case in other operating environments can be avoided.
Secondly, in the embodiment of the present invention, each time before a certain test result needs to be stored in the shared database in one operating environment, the attribute information of the certain test result needs to be updated to the environment configuration information of the current operating environment in the certain test result, and then the certain test result with the updated attribute information is stored in the shared database. That is, the attribute information of any two test results is different among all the test results stored in the shared database.
Therefore, after the test on the certain test result in the certain operating environment is completed, the certain test result stored in the shared database needs to be deleted in the certain operating environment, and other test results stored in other operating environments are also stored in the shared database in time. The method and the device avoid the situation that when the environment configuration information of a certain operating environment is used as the attribute information to delete the test result in the shared database because the certain test result is not completely the same as the other test results but the attribute information is the same, the certain test result is deleted and the other test results are deleted, so that the other test results cannot be verified in other operating environments later to cause verification failure.
FIG. 4 is a block diagram illustrating a test apparatus according to an exemplary embodiment. Referring to fig. 4, the apparatus includes:
the acquisition module 11 is configured to acquire environment configuration information of a current operation environment when data to be tested needs to be tested in the current operation environment by using a test case; different environment configuration information of different operation environments is different;
the first updating module 12 is configured to update attribute information of the data to be tested to the environment configuration information of the current operating environment in the data to be tested;
the initialization module 13 is configured to initialize the data to be tested, of which the attribute information is updated, into a shared database;
and the testing module 14 is configured to test the to-be-tested data initialized into the shared database by using the test case in the current operating environment.
Wherein the first updating module 12 comprises:
the acquisition unit is used for acquiring a preset data field in the data to be tested;
the judging unit is used for judging whether the preset data field stores content or not;
the first storage unit is used for storing the environment configuration information of the current operating environment in the preset data field when the content is not stored in the preset data field;
and the replacing unit is used for replacing the content stored in the preset data field with the environment configuration information of the current operating environment when the content is stored in the preset data field.
Wherein the first updating module 12 comprises:
the creating unit is used for creating a new data field in the data to be tested;
and the second storage unit is used for storing the environment configuration information of the current operating environment in the new data field.
Further, the apparatus further comprises:
the second updating module is used for updating the attribute information of the test result into the environment configuration information of the current operation environment when the test case is used for testing the data to be tested initialized into the shared database in the current operation environment and obtaining the test result;
and the storage module is used for storing the test result with the updated attribute information in the shared database.
Further, the apparatus further comprises:
the verification module is used for verifying the test result which is stored in the shared database and updated with the attribute information;
and the deleting module is used for deleting the data to be tested which is initialized into the shared database and has the attribute information of the environmental configuration information of the current operating environment, and deleting the test result which is stored in the shared database and has the attribute information of the environmental configuration information of the current operating environment.
In the embodiment of the invention, when the data to be tested needs to be tested by using the test case in the current operating environment, the environment configuration information of the current operating environment is obtained; the environment configuration information is different for different operating environments. And updating the attribute information of the data to be tested into the environment configuration information of the current operating environment in the data to be tested. Initializing the data to be tested with updated attribute information into a shared database. And testing the data to be tested initialized into the shared database by using the test case in the current operating environment.
When a plurality of different operation environments exist locally, the shared database is shared by the plurality of different operation environments, and in the process of testing the data to be tested by using the test case in each operation environment, the data to be tested needs to be initialized into the shared database, and then the data to be tested initialized into the shared database can be tested. However, two identical data cannot be initialized at the same time in a shared database.
Therefore, in the prior art, when a certain data to be tested needs to be tested in a certain operating environment by using a test case, the time from the initialization of the data to be tested in the shared database in the one operating environment to the deletion of the data to be tested initialized in the shared database is provided, if the data to be tested needs to be tested in another operating environment by using the test case, because two identical data cannot be initialized in the shared database at the same time, the data to be tested cannot be initialized in the shared database in another operating environment, and the data to be tested cannot be tested in another operating environment by using the test case, so that the test fails. That is, after the data initialized into the database in the certain operating environment is deleted, the data can be initialized into the shared database in another operating environment, so that the data can be tested by using the test case in another operating environment.
That is, in the prior art, two identical data cannot be tested by using test cases in different operating environments at the same time.
In the embodiment of the invention, when a certain data to be tested needs to be tested in a certain operation environment by using the test case, the environment configuration information of the certain operation environment is obtained; different environment configuration information of different operation environments is different; in the certain data to be tested, the attribute information of the certain data to be tested is updated to the environment configuration information of the certain running environment, and then the certain data to be tested with the updated attribute information is initialized into the shared database. During the period from the initialization of the certain data to be tested with the updated attribute information into the shared database in the certain operating environment to the deletion of the certain data to be tested with the updated attribute information initialized into the shared database, if the other data to be tested needs to be tested by using the test case in the other operating environment, the environment configuration information of the other operating environment is obtained; and updating the attribute information of the other data to be tested into the environment configuration information of the other operating environment in the other data to be tested.
Whether the certain data to be tested of which the attribute information is not updated is completely the same as the other data to be tested of which the attribute information is not updated, because the environment configuration information of the certain operating environment is different from the environment configuration information of the other operating environment, the attribute information of the certain data to be tested of which the attribute information is updated is different from the attribute information of the other data to be tested of which the attribute information is updated, and therefore, the certain data to be tested of which the attribute information is updated is not completely the same as the other data to be tested of which the attribute information is updated.
Therefore, during the period from the initialization of the certain data to be tested, in which the attribute information is updated, into the shared database in the certain operating environment to the deletion of the certain data to be tested, in which the attribute information is updated, in the shared database in the initialization, the other data to be tested, in which the attribute information is updated, can also be successfully initialized into the shared database in the other operating environment, and then the other data to be tested, in which the attribute information is updated, in the shared database in the initialization can be successfully tested by using the test case in the other operating environment.
Therefore, compared with the prior art, the embodiment of the invention can simultaneously test two identical data by using the test cases in different operating environments.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (6)

1. A method of testing, the method comprising:
when data to be tested needs to be tested in a current operating environment by using a test case, acquiring environment configuration information of the current operating environment; different environment configuration information of different operation environments is different;
in the data to be tested, updating the attribute information of the data to be tested into the environment configuration information of the current operating environment;
in the data to be tested, updating the attribute information of the data to be tested to the environment configuration information of the current operating environment, including:
acquiring a preset data field in the data to be tested;
judging whether the preset data field stores content or not;
when the content is not stored in the preset data field, storing the environment configuration information of the current operating environment in the preset data field;
when the content is stored in the preset data field, replacing the content stored in the preset data field with the environment configuration information of the current operating environment;
creating a new data field in the data to be tested;
storing the environment configuration information of the current operating environment in the new data field;
initializing the data to be tested with the updated attribute information into a shared database;
and testing the data to be tested initialized into the shared database by using the test case in the current operating environment.
2. The method of claim 1, further comprising:
when the test of the data to be tested initialized into the shared database is completed by using the test case in the current operating environment and a test result is obtained, updating the attribute information of the test result into the environment configuration information of the current operating environment;
storing the test results with updated attribute information in the shared database.
3. The method of claim 2, further comprising:
verifying the test results stored in the shared database and updated with the attribute information;
and after the verification is finished, deleting the data to be tested which is initialized into the shared database and has the attribute information of the environmental configuration information of the current operating environment, and deleting the test result which is stored in the shared database and has the attribute information of the environmental configuration information of the current operating environment.
4. A test apparatus, the apparatus comprising:
the system comprises an acquisition module, a test case acquisition module and a test execution module, wherein the acquisition module is used for acquiring environment configuration information of a current operation environment when data to be tested needs to be tested by using the test case in the current operation environment; different environment configuration information of different operation environments is different;
the first updating module is used for updating the attribute information of the data to be tested into the environment configuration information of the current operating environment in the data to be tested;
the initialization module is used for initializing the data to be tested with the updated attribute information into a shared database;
the test module is used for testing the data to be tested initialized into the shared database by using the test case in the current operating environment;
the first update module includes:
the acquisition unit is used for acquiring a preset data field in the data to be tested;
the judging unit is used for judging whether the preset data field stores content or not;
the first storage unit is used for storing the environment configuration information of the current operating environment in the preset data field when the content is not stored in the preset data field;
a replacing unit, configured to replace, when content is stored in the preset data field, the content stored in the preset data field with the environment configuration information of the current operating environment;
the creating unit is used for creating a new data field in the data to be tested;
and the second storage unit is used for storing the environment configuration information of the current operating environment in the new data field.
5. The apparatus of claim 4, further comprising:
the second updating module is used for updating the attribute information of the test result into the environment configuration information of the current operation environment when the test case is used for testing the data to be tested initialized into the shared database in the current operation environment and obtaining the test result;
and the storage module is used for storing the test result with the updated attribute information in the shared database.
6. The apparatus of claim 5, further comprising:
the verification module is used for verifying the test result which is stored in the shared database and updated with the attribute information;
and the deleting module is used for deleting the data to be tested which is initialized into the shared database and has the attribute information of the environmental configuration information of the current operating environment, and deleting the test result which is stored in the shared database and has the attribute information of the environmental configuration information of the current operating environment.
CN201610178362.9A 2016-03-25 2016-03-25 Test method and device Active CN107229650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610178362.9A CN107229650B (en) 2016-03-25 2016-03-25 Test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610178362.9A CN107229650B (en) 2016-03-25 2016-03-25 Test method and device

Publications (2)

Publication Number Publication Date
CN107229650A CN107229650A (en) 2017-10-03
CN107229650B true CN107229650B (en) 2020-12-15

Family

ID=59933042

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610178362.9A Active CN107229650B (en) 2016-03-25 2016-03-25 Test method and device

Country Status (1)

Country Link
CN (1) CN107229650B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255735B (en) * 2018-01-31 2020-02-11 平安科技(深圳)有限公司 Associated environment testing method, electronic device and computer readable storage medium
CN110990267B (en) * 2019-11-25 2023-09-05 泰康保险集团股份有限公司 Data processing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102123058A (en) * 2011-01-19 2011-07-13 北京神州绿盟信息安全科技股份有限公司 Test equipment and method for testing network protocol decoder
CN104899149A (en) * 2015-06-29 2015-09-09 上海瀚银信息技术有限公司 Automatic testing management method
CN105095089A (en) * 2015-09-14 2015-11-25 北京金山安全软件有限公司 Method and device for testing performance of application software
CN105227406A (en) * 2015-10-16 2016-01-06 上海矽昌通信技术有限公司 A kind of method of testing of router combination property

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9311223B2 (en) * 2013-05-21 2016-04-12 International Business Machines Corporation Prioritizing test cases using multiple variables

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102123058A (en) * 2011-01-19 2011-07-13 北京神州绿盟信息安全科技股份有限公司 Test equipment and method for testing network protocol decoder
CN104899149A (en) * 2015-06-29 2015-09-09 上海瀚银信息技术有限公司 Automatic testing management method
CN105095089A (en) * 2015-09-14 2015-11-25 北京金山安全软件有限公司 Method and device for testing performance of application software
CN105227406A (en) * 2015-10-16 2016-01-06 上海矽昌通信技术有限公司 A kind of method of testing of router combination property

Also Published As

Publication number Publication date
CN107229650A (en) 2017-10-03

Similar Documents

Publication Publication Date Title
KR102341154B1 (en) High-speed application for installation on mobile devices for permitting remote configuration of such mobile devices
CN109542529B (en) Function name-based point burying method and device, computer equipment and storage medium
US20160239409A1 (en) Testing a web service using inherited test attributes
CN108196878A (en) Generation method, device, electronic equipment and the storage medium of application program installation kit
CN111090452A (en) Service environment switching method and computer-readable storage medium
CN102592084A (en) Bug-fixing client logic testing method and bug-fixing client logic testing system
CN110347590A (en) The interface testing control method and device of operation system
CN104468655A (en) Method and system for testing reverse proxy software
US10185559B2 (en) Documentation notification
CN110083379A (en) A kind of server component upgrade method and relevant apparatus
CN107229650B (en) Test method and device
CN110727575B (en) Information processing method, system, device and storage medium
CN106990974B (en) APP updating method and device and electronic equipment
CN105808559A (en) Data conflict processing method and apparatus
CN107590064A (en) A kind of application upgrade method of testing, device and system
CN111159025B (en) Application program interface testing method and device, computer equipment and storage medium
CN103685471B (en) Method and system for updating software client sides in monopoly mode
KR101334806B1 (en) Method of proudcing input sets of test case in test case generating system
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN116257438A (en) Updating method of interface test case and related equipment
CN113805965B (en) Method, device, equipment and readable medium for installing external plug-in
CN112860585A (en) Test script assertion generation method and device
CN107450910B (en) Method and system for providing design resources and method, system and device for software development
CN111625330A (en) Cross-thread task processing method and device, server and storage medium
CN114595159B (en) Test data generation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200922

Address after: Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200922

Address after: Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: Grand Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant