WO2022135276A1 - Method and apparatus for processing test cases, and storage medium - Google Patents

Method and apparatus for processing test cases, and storage medium Download PDF

Info

Publication number
WO2022135276A1
WO2022135276A1 PCT/CN2021/138935 CN2021138935W WO2022135276A1 WO 2022135276 A1 WO2022135276 A1 WO 2022135276A1 CN 2021138935 W CN2021138935 W CN 2021138935W WO 2022135276 A1 WO2022135276 A1 WO 2022135276A1
Authority
WO
WIPO (PCT)
Prior art keywords
test case
difference data
data
saved
message
Prior art date
Application number
PCT/CN2021/138935
Other languages
French (fr)
Chinese (zh)
Inventor
骆春光
王惠惠
曾庆熙
曾波
Original Assignee
深圳前海微众银行股份有限公司
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 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2022135276A1 publication Critical patent/WO2022135276A1/en

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

Definitions

  • the present application relates to computer technology, and in particular, to a test case processing method, device and storage medium.
  • test case will overwrite the previously saved test case, so that the user cannot view the modifications made to the test case in the previously saved version, and the later saved test case directly overwrites the previously saved test case, which will affect the accuracy of the final saved test case.
  • the present invention provides a test case processing method, device and storage medium, which can not only enable the user to view the modifications made to the test case in the previously saved version, but also improve the final saved test. Use case accuracy.
  • an embodiment of the present application provides a method for processing a test case, which is applied to a server, and the method includes:
  • test case to be saved and the latest test case that has been saved in the database are obtained, and the test case to be saved and the latest test case are to modify the basic test case respectively. obtained after
  • the difference type includes at least one of an addition type, a deletion type, and a modification type
  • a target test case is generated according to the target difference data, the target difference type and the latest test case.
  • obtaining the test case to be saved and the latest test case saved in the database includes:
  • the third message includes the test case to be saved and the version identifier of the test case to be saved;
  • the latest test case is acquired from the database.
  • the determining at least one difference data between the test case to be saved and the latest test case, and the difference type corresponding to the difference data include:
  • a difference type corresponding to the difference data is determined.
  • the target test case is generated according to the target difference data, the target difference type and the latest test case, including:
  • the latest test case is determined to be the target test case
  • the target difference data corresponding to the target difference type is the data in the test case to be saved, then in the latest test case, the target difference data corresponding to the target difference type is performed operations to generate the target test case; or,
  • the first data in the target difference data is the data in the latest test case
  • the second data is the data in the to-be-saved test case
  • keep the first data in the latest test case A piece of data and a difference type corresponding to the first data remain unchanged, and in the latest test case, an operation corresponding to the difference type of the second data is performed on the second data to generate the target test case.
  • the method further includes:
  • a lock message is sent to a second terminal device other than the first terminal device, where the lock message includes the basic test case
  • the lock message is used to instruct the second terminal device to set the basic test case corresponding to the second terminal device to a locked state.
  • the method further includes:
  • an unlock message is sent to the second terminal device, where the unlock message includes the version identifier of the basic test case in the locked state, the unlock message is used to instruct the generation of the first value and the The second terminal device unlocks the basic test case in the locked state when judging that the first value is the same as the pre-stored second value; the preset condition includes the basic test case in the locked state.
  • the locking duration exceeds a preset duration, and/or a fifth message sent by the first terminal device is received, where the fifth message is used to indicate that the basic test case in the locked state is saved.
  • an embodiment of the present application provides a method for processing a test case, which is applied to a terminal device, and the method includes:
  • the first message includes at least one difference data and the difference type corresponding to each difference data
  • the difference data is the difference data between the test case to be saved and the latest test case
  • the The test case to be saved and the latest test case are obtained by modifying the basic test case
  • Target difference data and the target difference type corresponding to the target difference data is the data in the at least one difference data
  • the second message includes the target difference data and the target difference type, and the second message is used to instruct the server according to the target difference data, the The target difference type and the latest test case are generated, and the target test case is generated.
  • the determining the target difference data and the target difference type corresponding to the target difference data includes:
  • a first operation instruction triggered by a user is received, where the first operation instruction includes the target difference data and the target difference type.
  • the method further includes:
  • a third message is sent to the server, where the third message includes the test case to be saved and the version identifier of the test case to be saved, and the third message is used to indicate the test case to be saved.
  • the server acquires the version identifier of the latest test case, and when the version identifier of the test case to be saved is different from the version identifier of the latest test case, acquires the latest test case from the database.
  • the method further includes:
  • the third operation instruction includes the version identifier of the basic test case to be locked
  • a fourth message is sent to the server, where the fourth message includes the version identifier of the basic test case to be locked, and the fourth message is used to instruct the server to send a message to the terminal except the terminal
  • a second terminal device other than the device sends a lock message, where the lock message includes the version identifier of the basic test case to be locked, and the lock message is used to indicate that the second terminal device will
  • the basic test case to be locked corresponding to the device is set to a locked state.
  • the method further includes:
  • a fifth message is sent to the server, where the fifth message is used to instruct the server to send an unlocking message to the second terminal device, where the unlocking message includes the basic information in a locked state
  • the version identifier of the test case the unlock message is used to instruct the generation of the first value, and instruct the second terminal device to lock the device in the locked state when judging that the first value is the same as the pre-stored second value.
  • Basic test cases are unlocked.
  • an embodiment of the present application provides a processing device for a test case, including:
  • the processing module is used to obtain the test case to be saved and the latest test case saved in the database when it is detected that the basic test case is in an unlocked state, and the test case to be saved and the latest test case are for the basic test case respectively. After the use case is modified;
  • the processing module is further configured to determine at least one difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data, where the difference type includes addition type, deletion type and modification at least one of the types;
  • a sending module configured to send a first message to a first terminal device, where the first message includes the difference data and the difference type;
  • a receiving module configured to receive a second message sent by the first terminal device, where the second message includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is the at least data in a difference data;
  • the processing module is further configured to generate a target test case according to the target difference data, the target difference type and the latest test case.
  • processing module is specifically used for:
  • the third message includes the test case to be saved and the version identifier of the test case to be saved;
  • the latest test case is acquired from the database.
  • processing module is specifically used for:
  • a difference type corresponding to the difference data is determined.
  • processing module is specifically used for:
  • the latest test case is determined to be the target test case
  • the target difference data corresponding to the target difference type is the data in the test case to be saved, then in the latest test case, the target difference data corresponding to the target difference type is performed operations to generate the target test case; or,
  • the first data in the target difference data is the data in the latest test case
  • the second data is the data in the to-be-saved test case
  • keep the first data in the latest test case A piece of data and a difference type corresponding to the first data remain unchanged, and in the latest test case, an operation corresponding to the difference type of the second data is performed on the second data to generate the target test case.
  • the sending module is further configured to send a lock message to a second terminal device other than the first terminal device when it is detected that the basic test case corresponding to the first terminal device is in a locked state, and the lock
  • the message includes the version identifier of the basic test case, and the lock message is used to instruct the second terminal device to set the basic test case corresponding to the second terminal device to a locked state.
  • the sending module is further configured to send an unlock message to the second terminal device when a preset condition is met, where the unlock message includes a version identifier of the basic test case in a locked state, and the unlock message The message is used to instruct the generation of the first value, and instruct the second terminal device to unlock the basic test case in the locked state when it determines that the first value is the same as the pre-stored second value;
  • the preset The condition includes that the lock duration of the basic test case in the locked state exceeds a preset duration, and/or a fifth message sent by the first terminal device is received, and the fifth message is used to indicate that the locked The state of the underlying test case is saved.
  • an embodiment of the present application provides a processing device for a test case, including:
  • the receiving module is configured to receive a first message sent by the server, where the first message includes at least one difference data and a difference type corresponding to each difference data, and the difference data is the difference between the test case to be saved and the latest test case. Difference data, the test case to be saved and the latest test case are obtained by modifying the basic test case;
  • a processing module for determining target difference data and a target difference type corresponding to the target difference data, the target difference data being the data in the at least one difference data;
  • a sending module configured to send the second message to the server, where the second message includes the target difference data and the target difference type, and the second message is used to instruct the server according to the target difference
  • the difference data, the target difference type and the latest test case are used to generate a target test case.
  • the device further includes: a display module;
  • the display module for displaying the difference data and the difference type
  • the receiving module is further configured to receive a first operation instruction triggered by a user, where the first operation instruction includes the target difference data and the target difference type.
  • the receiving module is further configured to receive a second operation instruction triggered by the user, where the second operation instruction is used to save the test case to be saved;
  • the sending module is further configured to send a third message to the server according to the second operation instruction, where the third message includes the test case to be saved and the version identifier of the test case to be saved,
  • the third message is used to instruct the server to obtain the version identifier of the latest test case, and when the version identifier of the to-be-saved test case is different from the version identifier of the latest test case, obtain the version identifier of the latest test case from the database. Describe the latest test case.
  • the receiving module is further configured to receive a third operation instruction triggered by the user, where the third operation instruction includes the version identifier of the basic test case to be locked;
  • the sending module is further configured to send a fourth message to the server according to the third operation instruction, where the fourth message includes the version identifier of the basic test case to be locked, and the fourth message is used to indicate
  • the server sends a lock message to a second terminal device other than the terminal device, where the lock message includes the version identifier of the basic test case to be locked, and the lock message is used to indicate the second terminal
  • the device will set the basic test case to be locked corresponding to the second terminal device to a locked state.
  • the receiving module is further configured to receive a fourth operation instruction triggered by the user, where the fourth operation instruction is used to instruct to save the basic test case in a locked state;
  • the sending module is further configured to send a fifth message to the server according to the fourth operation instruction, where the fifth message is used to instruct the server to send an unlocking message to the second terminal device, and the unlocking
  • the message includes the version identifier of the basic test case in the locked state, and the unlock message is used to instruct the generation of the first value, and instruct the second terminal device to determine that the first value is inconsistent with the pre-stored second value.
  • the basic test case in the locked state is unlocked.
  • an embodiment of the present application provides a server, including: a transceiver; a processor; a memory; and a computer program;
  • the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of the first aspect.
  • an embodiment of the present application provides a terminal device, including: a transceiver; a display; a processor; a memory; and a computer program;
  • the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of the second aspect.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program causes the server to execute the method described in the first aspect or cause the terminal device to execute the method described in the first aspect. The method described in the second aspect.
  • an embodiment of the present application provides a computer program product, including a computer program, which implements the method according to the first aspect or the second aspect when the computer program is executed by a processor.
  • test case processing method, device and storage medium provided by the embodiments of the present application, when it is detected that the basic test case is in an unlocked state, the test case to be saved and the latest test case saved in the database are obtained, and the test case to be saved is determined. at least one difference data between the test case and the latest test case, as well as the difference type corresponding to the difference data, and then send a first message to the first terminal device, the first message includes the difference data and the difference type, by receiving the first terminal device
  • the second message sent includes the target difference data and the target difference type corresponding to the target difference data, and the target test case is generated according to the target difference data, the target difference type and the latest test case.
  • the server When the server saves the test case to be saved, it determines at least one difference data between the test case to be saved and the latest test case, and generates the target test case according to the target difference data determined by the terminal device and the corresponding target difference type, thereby avoiding The phenomenon in the prior art that the test case saved before is directly used to cover the test case saved before is realized, and the difference data is selectively saved, so that the accuracy of the target test case can be improved.
  • FIG. 1 is a system architecture diagram of a method for processing a test case provided by an embodiment of the present application
  • FIG. 2 is a signaling diagram of a method for processing a test case provided by an embodiment of the present application
  • Fig. 3 is the trigger schematic diagram of the second operation instruction
  • Fig. 4 is the display schematic diagram of difference data
  • FIG. 5 is another signaling diagram of a method for processing a test case provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of triggering a third operation instruction
  • FIG. 7 is another signaling diagram of a method for processing a test case provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a processing device for a test case provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a processing device for a test case provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a server embodiment provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of an embodiment of a terminal device according to an embodiment of the application.
  • Automated testing refers to automatically simulating the real operation of the execution interface according to the usage scenario of the system to test whether the function is correct.
  • Test case refers to the description of the test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test target, test environment, input data, test steps, expected results and test scripts.
  • Redis is a high-performance key-value data storage database based on memory.
  • the method for processing test cases provided by the embodiments of the present application can be applied to scenarios in which test cases are used to automate testing of programs or applications, or when multiple users edit or modify the same test case, how to use test cases such as in the context of effective management.
  • multiple testers can be allowed to modify or edit the test case, that is, multiple people can edit the same test case at the same time.
  • the test cases are usually saved according to the chronological sequence of editing, so that the test case saved later will overwrite the test case saved before. For example, if user A and user B edit the same test case through different terminal devices, if user A finishes editing first, the edited test case can be saved. After user B finishes editing, when the server receives the save instruction sent by user B through the terminal device, the server will use the test case edited by user B to directly overwrite the test case edited by user A. In this way, the user will not be able to view the edit by user A. The completed test case. In addition, since the test case edited by user B will directly cover the test case edited by user A, if the accuracy of the test case edited by user B is not high, it will directly affect the accuracy of the final saved test case.
  • the embodiment of the present application proposes a method for processing test cases.
  • this method when multiple people edit or modify the same test case at the same time, and save the modification after the modification is completed, if the There are saved test cases, that is, when there is a data conflict, the content modified by multiple people can be saved.
  • the content modified by multiple people can be saved in the same version of the test case for users to view. It can avoid the situation where the later saved test case directly overwrites the previously saved test case.
  • multiple testers modify the same test case, most of the modified contents may be the same. In order to save storage space, the contents modified by multiple people can be compared.
  • the target difference data can be determined from the difference data. Specifically, it can be displayed through the interface, and the tester can determine the part that needs to be retained according to the difference data. In this way, on the one hand, the test case saved later will not directly cover the test case saved before, and the user can also view the test case saved before. On the other hand, the user can select the part that needs to be kept according to the difference data, thereby improving the accuracy of the final saved test case.
  • FIG. 1 is a system architecture diagram of a method for processing a test case provided by an embodiment of the present application.
  • the system includes: a first terminal device 101 , second terminal devices 102 , 103 and 104 , and a server 105 .
  • user A can edit or modify the test case through the first terminal device 101
  • users B, C and D can edit or modify the test case through the second terminal device 102, 103 and 104 respectively
  • the user can edit or modify the test case through the terminal device
  • the modified test case may be stored in the database of the server 105, where the database may be a Redis database, a SQL database, or other types of databases, as long as the test case can be stored.
  • the server 105 may be one server, or may be a distributed server cluster composed of multiple servers.
  • test case 1.1 can be used to test the system through the terminal device 101, and can modify test case 1.1 during the test process.
  • user B, user C, and user D The test case 1.1 can be used to test the system through the terminal devices 102, 103 and 104 respectively, and the test case 1.1 can be modified during the test. That is, multiple users can modify the same test case at the same time, and the users can send the modified test case to the server 105 through their corresponding terminal devices to save the modified test case of each user.
  • the server 105 will compare the differences between the test cases and send the difference data when it is determined that at least two users have saved the test cases. Display it to the terminal device, so that the user can determine the test case he wants to save according to the difference data, so as to generate the target test case for saving.
  • the target test case is used to test the system.
  • the number of users, the first terminal device 101 , the second terminal devices 102 , 103 and 104 and the server 105 is only exemplary, and more or less numbers belong to The scope of protection of this application.
  • the user can use various devices to access the network, such as personal computer, server, tablet, mobile phone, PDA (Personal Digital Assistant, PDA), notebook or any other computing device with networking capabilities .
  • the server 105 can be implemented using a server or server group with more powerful processing power and higher security.
  • the above-mentioned network may include various types of wired and wireless networks, such as but not limited to: Internet, local area network, wireless fidelity (Wireless Fidelity, WIFI), wireless local area network (Wireless Local Area Networks, WLAN), cellular communication network (General Packet Wireless service technology (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), 2G/3G/4G/5G cellular network), satellite communication network, etc.
  • FIG. 2 is a signaling diagram of a method for processing a test case provided by an embodiment of the present application. As shown in FIG. 2 , the method for processing a test case provided by the embodiment of the present application includes the following steps:
  • Step 201 If it is detected that the basic test case is in an unlocked state, the server obtains the test case to be saved and the latest test case saved in the database.
  • test case to be saved and the latest test case are obtained by modifying the basic test case respectively.
  • the server can monitor whether the basic test case is in a locked state through webSocket.
  • the test case to be saved and the latest test case are obtained after different users modify the same basic test case.
  • the modification completion time of the latest test case is earlier than the modification completion time of the test case to be saved. Therefore, the latest test case is the test case that has been modified and saved in the database, and the test case to be saved is the test case that needs to be saved currently.
  • the server when the server detects that the basic test case is in an unlocked state and a data conflict occurs, that is, when a user has modified and saved the test case, the server will obtain the test case to be saved and the saved test case in the database.
  • the latest test cases for . Therefore, in a possible implementation manner, after receiving the second operation instruction triggered by the user for saving the test case to be saved, the first terminal device will send a third message to the server, where the third message includes The test case to be saved and the version ID of the test case to be saved.
  • the server obtains the version ID of the latest test case according to the third message. If the version ID of the test case to be saved is different from the version ID of the latest test case, it is obtained from the database Latest test case.
  • Fig. 3 is a schematic diagram of triggering the second operation instruction.
  • the terminal device receives the second operation instruction triggered by the user, it will carry the test case to be saved and the version identifier of the test case to be saved in a third message and send it to the server, and the server will obtain the stored data in the database according to the third message. Version ID of the latest test case.
  • the test case to be saved and the latest test case are obtained by modifying the basic test case of the same version.
  • the server saves the modified test case, if it determines that the version identifier of the test case to be saved is the same as the If the version ID of the latest test case stored in the database is the same, it means that no user has saved it before. At this time, there is no data conflict, then the server will modify the version ID of the test case to be saved according to the version ID of the latest test case, and Store test cases to be saved.
  • the server determines that the version identifier of the test case to be saved is different from the version identifier of the latest test case stored in the database, it means that a user has saved the modified test case before. At this time, there is a data conflict, the server will The latest test case will be fetched from the database.
  • a save message will be sent to the server through the terminal device.
  • the save message includes the user A modified test case and version ID 1.1
  • the server will obtain the version ID of the latest test case stored in the database. If the version ID of the latest test case is also 1.1, it means that no other user has modified the test case before. and save it, the server will automatically increment the version number as the version identifier of the current test case, for example, modify it to 1.2.
  • the test case modified by user A is the latest test case saved in the database, and the latest test case’s
  • the version ID is 1.2.
  • a save message will be sent to the server through the corresponding terminal device.
  • the save message includes the test case modified by user B and the version ID 1.1.
  • the server will obtain the version ID of the latest test case stored in the database.
  • the version ID of the latest test case obtained at this time is 1.2.
  • This version ID is different from the version ID of the test case to be saved, which means that other users have saved the test case before, and the server will obtain the version ID of 1.2.
  • the latest test case, and the test case that needs to be saved after user B's modification is determined as the test case to be saved.
  • the server when the server updates the version identifier of the test case, it usually first determines whether it is the first version. If it is the first version, it will set the current version identifier for the test case, which is usually the default.
  • the version identifier of the test case is 1.1, and the set version identifier is saved in the Version table of the database, and the version identifier is returned to the terminal device.
  • all the information of the test case will be converted into Xml form as content storage, in which the version ID field will be set to the returned version ID Id and saved to the database Case Content table.
  • the server determines whether it is a small modification or not the first version. If it is a small modification, the last digit will be incremented automatically, for example: from 1.1 to 1.2, if it is a major modification, the first digit will be incremented automatically, and the last digit will be reset to 1, for example: 2.1 will be added from 1.3.
  • the determination of the above version number may be determined by the server according to the content modified by the user, or the user may send a modification message carrying the version number to the server through the terminal device, and the server may determine the modification message according to the version number in the modification message. definite.
  • the server when the server determines that the version identifier of the test case to be saved is different from the version identifier of the latest test case, the server obtains the latest test case from the database to determine the difference between the test case to be saved and the latest test case. Difference data, thus avoiding the phenomenon of directly using the test case to be saved to cover the latest test case.
  • Step 202 The server determines at least one difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data, where the difference type includes at least one of addition type, deletion type and modification type.
  • the server compares the obtained test case to be saved with the At least one variance data between the latest test cases and the variance type corresponding to each variance data.
  • the difference data can also be understood as different data between the test case to be saved and the latest test case.
  • the test case to be saved and the latest test case may be compared to determine the longest common subsequence of the test case to be saved and the latest test case, and the test case to be saved and the latest test case are compared with the latest test case respectively.
  • the longest common subsequence is compared, and the different data between the test case to be saved and the longest common subsequence, as well as the different data between the latest test case and the longest common subsequence, are determined as at least one difference data, and then A difference type corresponding to the difference data is determined according to the at least one difference data and the longest common subsequence.
  • At least one difference data between the test case to be saved and the latest test case, and the difference type corresponding to each difference data can be determined by the Myers difference algorithm.
  • the Myers difference algorithm is a text difference comparison algorithm. By comparing the differences between the new and old data sets, the minimum change from the old data to the new data is generated. Mainly to solve the longest common subsequence (Longest Common Subsequence, LCS) problem.
  • LCS Longest Common Subsequence
  • the server first splits the test case to be saved and the latest test case into strings according to the content of each line, thereby obtaining two data sets, namely the original data set original and the revised data set revised. Then use the Myers difference algorithm implemented in the Google DiffUtils framework tool class to process the above data sets, that is, the input source data set original and the revised data set revised. After the algorithm operation, the LCS of each line of strings in the two data sets can be obtained, thus You can get the Delta list of difference information for each line.
  • Each line of difference information Delta list includes a different string set original diff compared with each line of source data set original diff and a different string set revised diff compared with each line revised data set revised diff and the starting position of each line, and then The operation type is obtained according to the compared difference string information, that is, the difference type.
  • the Google DiffUtils framework tool class is a Myers difference algorithm implementation tool class provided by Google.
  • the Deltas object includes the character content and character position of each line of the source data and the comparison data, and the operation type obtained from the comparison, such as adding, modifying, and deleting.
  • test case to be saved is “abcdefg” and the latest test case is “defghjk”
  • the longest common value between the test case to be saved and the latest test case is determined.
  • the subsequence LCS is "defg”
  • the LCS is compared with the test case "abcdefg” to be saved, the difference data is "abc”, and the difference type is the deletion type
  • the LCS is compared with the latest test case "defghjk”
  • the difference data is "hjk”
  • the difference type is the increase type.
  • a list of the insertList addition type, the deleteList deletion type and the changeList modification type can be newly created in the server in advance, which are respectively used to save the classification information.
  • each difference data and the corresponding difference type can be traversed in a loop, and each difference data is stored in a corresponding list for subsequent viewing by the user, thereby facilitating user operations and improving user experience.
  • the server determines, through the Myers difference algorithm, at least one difference data between the test case to be saved and the latest test case, and the difference between the test case and the latest test case.
  • the difference type corresponding to the difference data can not only improve the efficiency of determining the difference data and the difference type, but also improve the accuracy.
  • Step 203 The server sends a first message to the first terminal device, where the first message includes difference data and a difference type.
  • the server may send the determined difference data and corresponding difference types in the first message to the first terminal device.
  • the server needs to process the difference data according to the difference types.
  • different types of difference data can be displayed in different colors.
  • the difference data of the deletion type can be displayed in red
  • the difference data of the added type can be displayed in green
  • the difference data of the modified type can be displayed in blue, etc. It should be understood that the same data between the test case to be saved and the latest test case can be displayed normally.
  • the server can process the difference data in the following ways:
  • the server can process the difference data in the following ways:
  • the server splices all processed character lists in sequence through the position field to generate new content, and sends it to the first terminal device.
  • the first terminal device parses and processes the difference data in the first message, and displays the difference data in different ways according to different types of differences.
  • Fig. 4 is a schematic diagram of the display of difference data, assuming that the test case to be saved is "abcdefg", the latest test case is “defghjk”, and it is determined that the difference data between the test case to be saved and LCS is "abc”, and the difference
  • the type is the deletion type
  • the difference data of the latest test case compared with the LCS is "hjk”
  • the difference type is the addition type.
  • the first terminal device will splicing and display the difference data.
  • the difference data of the deletion type can be displayed with a diagonal line as the background
  • the difference data of the added type can be displayed with the horizontal line as the background.
  • the difference data of the modification type can be displayed in other backgrounds, as long as it can be distinguished from the data of the deletion type and the addition type.
  • different difference data and difference types can also be distinguished in other ways.
  • different colors can be used to display according to the difference type.
  • the difference data of the deletion type can be displayed in red
  • the difference data of the added type can be displayed.
  • the difference data of the modification type can be displayed in blue, etc. It should be understood that the same data between the test case to be saved and the latest test case can be displayed normally.
  • Step 204 The first terminal device determines target difference data and a target difference type corresponding to the target difference data, where the target difference data is data in at least one difference data.
  • the first terminal device can display the difference data and the corresponding difference type to the user, and the user can select the data that he wants to keep according to his own needs. Therefore, the first terminal device will be triggered through the display interface.
  • An operation instruction the first operation instruction includes target difference data selected by the user from at least one difference data, and a target difference type corresponding to the target difference data.
  • the difference data "hjk” can be determined as the target difference data, and the difference type of the target difference data is increase type.
  • the user triggers the first operation instruction by clicking "hjk".
  • the user can also trigger the first operation instruction by long pressing or other operation methods.
  • the first terminal device may also determine the target difference data and the target difference type corresponding to the target difference data from the difference data through a preset rule. For example, all the difference data whose difference type is an increase type are determined as the target difference type, and so on.
  • Step 205 The first terminal device sends a second message to the server, where the second message includes target difference data and a target difference type corresponding to the target difference data.
  • the first terminal device After determining the target difference data and the corresponding target difference type, the first terminal device will send a second message to the server.
  • the first terminal device after receiving the first operation instruction triggered by the user, the first terminal device carries the target difference data selected by the user and the target difference type corresponding to the target difference data in a second message and sends it to the server.
  • the target difference data may include part of the difference data, or may include all the difference data.
  • the first terminal device may also carry the target difference data determined according to the preset rule and the target difference type corresponding to the target difference data in the second message and send it to the server.
  • Step 206 The server generates a target test case according to the target difference data, the target difference type and the latest test case.
  • the server In this step, the server generates a target test case according to the received target difference data, the target difference type corresponding to the target difference data, and the latest test case saved in the database, and saves the target test case. Since the tester can select the target difference data from at least one difference data to save according to their own needs, instead of using the test case saved later to cover the test case saved earlier, the accuracy of the target test case can be improved.
  • the server when the server generates the target test case, if the target difference data corresponding to the target difference type is determined as the data in the latest test case, the latest test case is determined as the target test case.
  • the target difference data is the data obtained by modifying the basic test case in the latest test case, at this time, it means that the difference data that the user wants to save is all the data in the latest test case. Therefore, the latest test case can be Use cases are identified as target test cases.
  • the target difference data corresponding to the target difference type is the data in the test case to be saved, in the latest test case, an operation corresponding to the target difference type is performed on the target difference data to generate the target test case.
  • the target difference data is the data obtained by modifying the basic test case in the test case to be saved, at this time, it indicates that the difference data that the user wants to save is all the data in the test case to be saved.
  • the operation corresponding to the target difference type is performed on the target difference data. For example, if the target difference type is an add type, you can add the target difference data in the latest test case. If the target difference type is a delete type, you can delete the target difference data in the latest test case. If the target difference type is Modification type, the target difference data can be modified in the latest test case.
  • the first data in the target difference data is the data in the latest test case
  • the second data is the data in the test case to be saved
  • the difference type corresponding to the data remains unchanged, and in the latest test case, an operation corresponding to the difference type of the second data is performed on the second data to generate the target test case.
  • the server will keep this part of the difference data unchanged, that is, in the latest test case continue to retain this part of the first data.
  • Another part of the second data is the data in the test case to be saved, then the server will perform corresponding operations on the second data in the latest test case according to the difference type corresponding to the second data, such as adding, deleting or modifying, thereby generating target test case.
  • the server can generate the target test case according to the target difference data determined by the first terminal device, the target difference type corresponding to the target difference data, and the latest test case, thereby improving the accuracy of the target test case.
  • the generated target test case includes the data modified by the user himself, and also includes Data modified by other users, thus avoiding the phenomenon that the later saved test case directly overwrites the previously saved test case.
  • the test case to be saved and the latest test case saved in the database are obtained by obtaining the test case to be saved and the latest test case to be saved.
  • at least one difference data of the use case, and the difference type corresponding to the difference data and then send a first message to the first terminal device, the first message includes the difference data and the difference type by receiving the second message sent by the first terminal device, The second message includes the target difference data and the target difference type corresponding to the target difference data, and generates the target test case according to the target difference data, the target difference type and the latest test case.
  • the server determines at least one difference data between the test case to be saved and the latest test case when saving the test case to be saved, and determines the target difference data from the at least one difference data by the first terminal device and the corresponding target difference type , to generate target test cases, thereby avoiding the phenomenon in the prior art that the previously saved test cases are directly used after being used to cover the previously saved test cases, and the difference data can be selectively saved, thereby improving the accuracy of the target test cases.
  • FIG. 5 is another signaling diagram of a method for processing a test case provided by an embodiment of the present application.
  • the processing method of the test case provided by the embodiment of the present application includes the following steps:
  • Step 501 The first terminal device receives a third operation instruction triggered by the user, where the third operation instruction includes the version identifier of the basic test case to be locked.
  • FIG. 6 is a schematic diagram of triggering the third operation instruction.
  • the user is editing the test case "aabbccdd", and he can choose to lock the test case according to his own needs, for example, he can click "Lock” control to trigger a third operation instruction, where the third operation instruction includes the version identifier of the basic test case to be locked, such as the version identifier curVersionId of the test case "aabbccdd".
  • the user chooses to lock the basic test case, it means that currently only the user can edit the basic test case, while other users can only read but not write, and the test case editing page of the terminal device corresponding to other users is displayed. , it will show that the basic test case has been locked or locked by the user, etc.
  • Step 502 The first terminal device sends a fourth message to the server according to the third operation instruction, where the fourth message includes the version identifier of the basic test case to be locked.
  • the first terminal device After receiving the third operation instruction triggered by the user, the first terminal device will carry the version identifier of the basic test case to be locked in a fourth message and send it to the server.
  • Step 503 According to the fourth message, the server, when detecting that the basic test case corresponding to the first terminal device is in a locked state, sends a locking message to the second terminal device other than the first terminal device, where the locking message includes the pending test case.
  • the version identifier of the locked basic test case, and the locking message is used to instruct the second terminal device to set the to-be-locked basic test case corresponding to the second terminal device to a locked state.
  • the server determines that the basic test case is in the locked state according to the fourth message received, it means that the user does not want other users to edit the basic test case at this time.
  • the version identifier is carried in the lock message and sent to the second terminal device. In this way, the second terminal device will set the basic test case to be locked into a locked state. The tester will not be able to edit the locked basic test case through the second terminal device, but can only view the locked basic test case.
  • the user can lock the basic test case to be locked according to his own needs, so that other users cannot edit the basic test case to be locked, thereby avoiding the phenomenon of data conflict in the test case.
  • the server will send an unlock message to the second terminal device, the unlock message includes the version identifier of the basic test case in the locked state, the unlock message is used to instruct the generation of the first value, and indicates
  • the second terminal device unlocks the basic test case in the locked state when judging that the first value is the same as the pre-stored second value; the preset condition includes that the locking duration of the basic test case in the locked state exceeds the preset duration, and /or, a fifth message sent by the first terminal device is received, where the fifth message is used to indicate that the basic test case in the locked state is saved.
  • the server may send an unlocking message to the second terminal device when monitoring through webSocket that the locking duration of the basic test case in the locked state exceeds the preset duration, so that the second terminal device will send an unlocking message to the second terminal device according to the unlocking message.
  • the server may send an unlocking message to the second terminal device when monitoring through webSocket that the locking duration of the basic test case in the locked state exceeds the preset duration, so that the second terminal device will send an unlocking message to the second terminal device according to the unlocking message.
  • a fourth operation instruction may be triggered to save the edited basic test case.
  • the first terminal device After receiving the fourth operation instruction triggered by the user, the first terminal device will send a fifth message to the server, and the server will send an unlock message to the second terminal device according to the received fifth message, so that the second terminal device will send an unlock message to the second terminal device according to the received fifth message.
  • the unlock message unlocks the test case in the locked state, so that other users can continue to edit the test case, which improves the user experience.
  • the above-mentioned preset condition may also be that the server monitors through webSocket that the lock duration of the test case in the locked state exceeds the preset duration, and when receiving the fifth message sent by the first terminal device, the server sends an unlock message to the second terminal device .
  • the preset condition may further include that the server monitors through the webSocket that the first terminal device exits the interface for editing the test case in the locked state.
  • distributed locks refer to when there is only one copy (or limited) of data in a distributed system, and the lock technology needs to be used to control a certain The number of processes that modify data at any time.
  • the server can implement distributed locks based on redis.
  • it can be implemented based on the following redis commands: SET key value[EX seconds][PX milliseconds][NX
  • the version ID of the test case to be locked is spliced with "_LOCK" as the key, and the value of the lock is a randomly generated unique identifier (Universally Unique Identifier, UUID).
  • UUID Universally Unique Identifier
  • the second terminal device When the second terminal device releases the lock, it will randomly generate the first value value. When it is judged that the first value is the same as the second value stored in advance, it can determine that the lock is its own, so as to execute the operation of releasing the lock. .
  • the method of deleting the key when releasing the lock, the method of deleting the key is not directly used, because the method of directly deleting the key will cause all the second terminal devices to be unlocked, which will cause some test cases that do not need to be unlocked to be unlocked, resulting in Bad user experience.
  • Fig. 6 is a schematic diagram of locking and unlocking the test case to be locked.
  • the system includes a distributed server cluster, that is, includes multiple servers A, B and C
  • the distributed The redis component in the server cluster can cache the version information of the test case and the content of the test case.
  • the server cluster will determine a server from the server cluster to establish a webSocket connection with the first terminal device according to the version identification and user identification (ID) of the test case to be locked. For example, it can be determined that server B establishes a webSocket connection with the first terminal device.
  • ID version identification and user identification
  • Server B can store the connected webSocket according to onOpen, obtain the content of the test case in redis according to the version information of the test case, and send it to the first terminal device.
  • the established webSocket connection can also be removed according to onClose, and the unlock information of the version information of the test case is stored, and stored in redis, and an unlock message is sent to the second terminal device at the same time.
  • Server B can also monitor the information sent by the first terminal device according to onMessage, and lock or unlock the test case in redis, for example, monitor whether the first terminal device currently quits editing the test case, or whether the test case is triggered Save the message, or monitor whether the editing time of the test case by the user through the first terminal device times out, and so on.
  • webSocket new webSocket(SocketUrl+“/webSocket/”+contentId+“/”+username).
  • the first terminal device can also monitor the state of the server through webSocket.onclose, so as to process the disconnection and reconnection operation after the server is interrupted.
  • the server when detecting that the basic test case corresponding to the first terminal device is in a locked state, the server may control to lock the basic test case on the second terminal device, thereby preventing multiple users from simultaneously When the basic test case is edited, the phenomenon of data conflict is caused. Further, when it is determined that the preset condition is met, the server will send an unlock message to the second terminal device to unlock the basic test case in the locked state, so as to ensure that other users can also continue to edit the basic test case. Improve user experience.
  • the version of the test case modified by each user can also be saved, so that the user can query the data of all historical versions of the test case modified by the user according to the version identifier.
  • the server will copy the test case data of the historical version and generate a new test case, thereby creating the test case content and saving it as a new test case. version ID.
  • the target test case be generated according to the difference data, but also all the test cases modified by the user can be saved, so that the user can conveniently view the test cases of any historical version, thereby improving the user experience .
  • FIG. 7 is another signaling diagram of a method for processing a test case provided by an embodiment of the present application. As shown in FIG. 7 , the method includes:
  • Step 701 The first terminal device receives a fifth operation instruction triggered by the user, where the fifth operation instruction is used to indicate whether the test case needs to be locked.
  • the user can edit the test case through the first terminal device. If the user needs to edit the test case to be locked by one person according to his own needs, he can send a fifth operation instruction to the first terminal device.
  • the fifth operation instruction The instruction is used to indicate that the test case needs to be locked, and the fifth operation instruction includes the version identifier of the test case to be locked, wherein the triggering method and implementation principle of the fifth operation instruction are the same as the third operation instruction in the foregoing embodiment. similar, and will not be repeated here.
  • the fifth operation instruction is used to indicate that the test case does not need to be locked, it means that the test case allows multiple people to edit at the same time.
  • step 702 is performed; otherwise, step 705 is performed.
  • Step 702 The first terminal device sends a fourth message to the server, where the fourth message includes the version identifier of the test case to be locked.
  • Step 703 The server sends a lock message to the second terminal device other than the first terminal device according to the fourth message, where the lock message includes the version identifier of the test case to be locked, and the lock message is used to indicate that the second terminal device will Locked test cases are set to locked state.
  • Step 704 The server monitors whether the preset conditions are met, and when the preset conditions are met, sends an unlock message to the second terminal device, where the unlock message includes the version identifier of the test case in the locked state, and the unlock message is used to indicate the first
  • the second terminal device unlocks the test case in the locked state.
  • the preset conditions include at least one of the following: the lock duration of the test case in the locked state exceeds the preset duration, the fifth message sent by the first terminal device is received, and the test case in the locked state is monitored after the first terminal device exits editing interface.
  • the user will wait for the user to continue editing the test case through the first terminal device, and when the preset condition is met, the locked test case will be unlocked.
  • the first terminal device when the user saves the edited test case through the first terminal device, the first terminal device will send the edited test case to the server, and the server will create a new version of the test case and save the test case.
  • Step 705 The first terminal device sends a third message to the server, where the third message includes the test case to be saved and the version identifier of the test case to be saved.
  • Step 706 The server obtains the version identifier of the latest test case according to the third message.
  • Step 707 If the server determines that the version identifier of the test case to be saved is different from the version identifier of the latest test case, the server obtains the latest test case from the database.
  • the version identifier of the test case to be saved is different from the version identifier of the latest test case, it means that a user has edited and saved the test case before, that is, there is a data conflict, at this time, it needs to be obtained from the database.
  • Latest test case if the version identifier of the test case to be saved is different from the version identifier of the latest test case, it means that a user has edited and saved the test case before, that is, there is a data conflict, at this time, it needs to be obtained from the database.
  • Latest test case if the version identifier of the test case to be saved is different from the version identifier of the latest test case, it means that a user has edited and saved the test case before, that is, there is a data conflict, at this time, it needs to be obtained from the database.
  • Latest test case if the version identifier of the test case to be saved is different from the version identifier of the latest test case, it means that a user has edited and saved the test case before,
  • Step 708 The server determines at least one difference data between the test case to be saved and the latest test case, and the difference type corresponding to the difference data.
  • the difference type includes at least one of an addition type, a deletion type, and a modification type.
  • Step 709 The server sends a first message to the first terminal device, where the first message includes difference data and the difference type.
  • Step 710 The first terminal device displays the difference data and the difference type.
  • Step 711 The first terminal device receives a first operation instruction triggered by the user, the first operation instruction includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is data in at least one difference data.
  • Step 712 The first terminal device sends a second message to the server according to the first operation instruction, where the second message includes the target difference data and the target difference type.
  • Step 713 The server generates a target test case according to the target difference data, the target difference type and the latest test case.
  • the server After the server generates the target test case, it will create a new version identifier for the target test case and save it.
  • the server when the server saves the test case to be saved, it determines at least one difference data between the test case to be saved and the latest test case, and selects the difference data from the at least one difference data according to the user.
  • the selected target difference data and the corresponding target difference type are used to generate target test cases, thereby avoiding the phenomenon that the test cases saved before being directly adopted in the prior art overwrite the previously saved test cases, and users can choose according to their own needs.
  • the difference data is saved so that the accuracy of the target test case can be improved.
  • the server can lock the test case according to the demand information sent by the user, which can avoid data conflicts caused when multiple people edit the same test case at the same time.
  • FIG. 8 is a schematic diagram of a processing device for a test case provided by an embodiment of the present application. As shown in FIG. 8 , the processing device 80 for the test case includes:
  • the processing module 801 is configured to acquire the test case to be saved and the latest test case saved in the database, the test case to be saved and the latest test case are obtained by modifying the basic test case respectively;
  • the processing module 801 is further configured to determine at least one difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data, and the difference type includes an addition type, a deletion type, and a difference type. at least one of the modification types;
  • a sending module 802 configured to send a first message to a first terminal device, where the first message includes the difference data and the difference type, and the first message is used to instruct the first terminal device to display the difference discrepancy data and the type of discrepancy;
  • a receiving module 803 configured to receive a second message sent by the first terminal device, where the second message includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is the data in at least one difference data;
  • the processing module 801 is further configured to generate a target test case according to the target difference data, the target difference type and the latest test case.
  • processing module 801 is specifically used for:
  • the third message includes the test case to be saved and the version identifier of the test case to be saved;
  • the latest test case is acquired from the database.
  • processing module 801 is specifically used for:
  • At least one difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data are determined by the Myers difference algorithm.
  • processing module 801 is specifically used for:
  • the latest test case is determined to be the target test case
  • the target difference data corresponding to the target difference type is the data in the test case to be saved, then in the latest test case, the target difference data corresponding to the target difference type is performed operations to generate the target test case; or,
  • the first data in the target difference data is the data in the latest test case
  • the second data is the data in the to-be-saved test case
  • keep the first data in the latest test case A piece of data and a difference type corresponding to the first data remain unchanged, and in the latest test case, an operation corresponding to the difference type of the second data is performed on the second data to generate the target test case.
  • the receiving module 803 is further configured to receive a fourth message sent by the first terminal device, where the fourth message includes a version identifier of the test case to be locked;
  • the sending module 802 is further configured to send a lock message to a second terminal device other than the first terminal device according to the fourth message, where the lock message includes the version identifier of the test case to be locked , the lock message is used to instruct the second terminal device to set the to-be-locked test case to a locked state.
  • the sending module 802 is further configured to send an unlock message to the second terminal device when a preset condition is met, where the unlock message includes the version identifier of the test case in the locked state, and the unlock message
  • the message is used to instruct the second terminal device to unlock the test case in the locked state;
  • the preset condition includes that the locking duration of the test case in the locked state exceeds the preset duration, and/or receiving all
  • the fifth message sent by the first terminal device is used to indicate that the test case in the locked state is saved.
  • test case processing device 80 provided in the embodiment of the present application can execute the technical solution of the test case processing method in any of the above embodiments, and its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the test case processing method , please refer to the implementation principle and beneficial effect of the processing method of the test case, which will not be repeated here.
  • FIG. 9 is a schematic diagram of a processing device for a test case provided by an embodiment of the present application. As shown in FIG. 9 , the processing device 90 for the test case includes:
  • the receiving module 901 is configured to receive a first message sent by the server, where the first message includes at least one difference data and a difference type corresponding to each difference data, and the difference data is the difference between the test case to be saved and the latest test case The difference data of the test case to be saved and the latest test case are obtained by modifying the basic test case;
  • a display module 902 configured to display the difference data and the difference type
  • the receiving module 901 is further configured to receive a first operation instruction triggered by a user, where the first operation instruction includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is the data in at least one difference data;
  • the sending module 903 is configured to send the second message to the server according to the first operation instruction, where the second message includes the target difference data and the target difference type, and the second message uses for instructing the server to generate a target test case according to the target difference data, the target difference type and the latest test case.
  • the receiving module 901 is further configured to receive a second operation instruction triggered by a user, where the second operation instruction is used to save the to-be-saved test case;
  • the sending module 903 is further configured to send a third message to the server according to the second operation instruction, where the third message includes the test case to be saved and the version identifier of the test case to be saved,
  • the third message is used to instruct the server to obtain the version identifier of the latest test case, and obtain from the database when the version identifier of the test case to be saved is different from the version identifier of the latest test case The latest test case described.
  • the receiving module 901 is further configured to receive a third operation instruction triggered by the user, where the third operation instruction includes the version identifier of the test case to be locked;
  • the sending module 903 is further configured to send a fourth message to the server according to the third operation instruction, where the fourth message includes the version identifier of the test case to be locked, and the fourth message is used to indicate the
  • the server sends a lock message to a second terminal device other than the terminal device, where the lock message includes the version identifier of the test case to be locked, and the lock message is used to instruct the second terminal device to The test case to be locked is set to the locked state.
  • the receiving module 901 is further configured to receive a fourth operation instruction triggered by the user, where the fourth operation instruction is used to instruct to save the test case in the locked state;
  • the sending module 903 is further configured to send a fifth message to the server according to the fourth operation instruction, where the fifth message is used to instruct the server to send an unlock message to the second terminal device, the
  • the unlock message includes the version identifier of the test case in the locked state, and the unlock message is used to instruct the second terminal device to unlock the test case in the locked state.
  • the device 90 for processing test cases provided by the embodiments of the present application can execute the technical solutions of the methods for processing test cases in any of the above embodiments, and its implementation principle and beneficial effects are similar to those of the method for processing test cases. , please refer to the implementation principle and beneficial effect of the processing method of the test case, which will not be repeated here.
  • each module of the above device is only a division of logical functions, and may be fully or partially integrated into a physical entity in actual implementation, or may be physically separated.
  • these modules can all be implemented in the form of software calling through processing elements; they can also all be implemented in hardware; some modules can also be implemented in the form of calling software through processing elements, and some modules can be implemented in hardware.
  • the determination module may be a separately established processing element, or it may be integrated into a certain chip of the above-mentioned device, and in addition, it may be stored in the memory of the above-mentioned device in the form of program code, and a certain processing element of the above-mentioned device may be used for the determination module.
  • each step of the above-mentioned method or each of the above-mentioned modules can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
  • the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital) signal processor, DSP), or, one or more field programmable gate arrays (field programmable gate array, FPGA), etc.
  • ASIC application specific integrated circuits
  • DSP digital signal processor
  • FPGA field programmable gate array
  • the processing element may be a general-purpose processor, such as a central processing unit (central processing unit, CPU) or other processors that can invoke program codes.
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • SOC system-on-a-chip
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)), and the like.
  • FIG. 10 is a schematic structural diagram of an embodiment of a server according to an embodiment of the present application.
  • the server may include: a processor 1001 , a memory 1002 , a communication interface 1003 and a system bus 1004 , the memory 1002 and the communication interface 1003 are connected to the processor 1001 through the system bus 1004 and To complete the mutual communication, the memory 1002 is used to store computer execution instructions, the communication interface 1003 is used to communicate with other devices, and the processor 1001 implements the tests shown in the above embodiments when executing the computer program The technical solution of the processing method of the use case.
  • the above-mentioned processor 1001 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field-based processor, etc. Program a gate array FPGA or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components.
  • the memory 1002 may include random access memory (RAM), may include read-only memory (RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM random access memory
  • RAM read-only memory
  • non-volatile memory such as at least one disk memory.
  • the communication interface 1003 is used to realize the communication between the database access device and other devices (eg client, read-write library and read-only library).
  • the system bus 1004 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the system bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • FIG. 11 is a schematic structural diagram of an embodiment of a terminal device according to an embodiment of the application.
  • the terminal device may include: a processor 1101 , a memory 1102 , a communication interface 1103 and a system bus 1104 , the memory 1102 and the communication interface 1103 are connected to the processor 1101 through the system bus 1104 and complete the mutual communication, the memory 1102 is used to store computer execution instructions, the communication interface 1103 is used to communicate with other devices, and the processor 1101 implements the above-mentioned embodiments when executing the computer program.
  • the technical scheme of the processing method of the test case may include: a processor 1101 , a memory 1102 , a communication interface 1103 and a system bus 1104 , the memory 1102 and the communication interface 1103 are connected to the processor 1101 through the system bus 1104 and complete the mutual communication, the memory 1102 is used to store computer execution instructions, the communication interface 1103 is used to communicate with other devices, and the processor 1101 implements the above-mentioned embodiments
  • the above-mentioned processor 1101 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field Program a gate array FPGA or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components.
  • a general-purpose processor including a central processing unit CPU, a network processor (NP), etc.
  • DSP digital signal processor
  • ASIC application-specific integrated circuit
  • FPGA field Program a gate array FPGA or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components.
  • the memory 1102 may include random access memory (RAM), may also include read-only memory (RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM random access memory
  • RAM read-only memory
  • non-volatile memory such as at least one disk memory.
  • the communication interface 1103 is used to realize the communication between the database access device and other devices (eg client, read-write library and read-only library).
  • the system bus 1104 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the system bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • an embodiment of the present application further provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the computer can be executed as shown in the foregoing embodiments.
  • an embodiment of the present application further provides a chip for running an instruction, where the chip is used to execute the technical solution of the processing method of the test case shown in the foregoing embodiment.
  • An embodiment of the present application further provides a program product, where the program product includes a computer program, the computer program is stored in a computer-readable storage medium, and at least one processor can read the computer from the computer-readable storage medium A program, when the at least one processor executes the computer program, the technical solutions of the test case processing methods shown in the foregoing embodiments can be implemented.

Landscapes

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

Abstract

Provided in the present application are a method and apparatus for processing test cases, and a storage medium. The method comprises: obtaining a test case to be saved and the latest test case saved in a database; determining at least one piece of difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data; sending a first message to a first terminal device, the first message comprising the difference data and the difference type, and the first message being used for instructing the first terminal device to display the difference data and the difference type; receiving a second message sent by the first terminal device, the second message comprising target difference data and a target difference type corresponding to the target difference data, the target difference data being data in the at least one piece of difference data; and generating a target test case according to the target difference data, the target difference type, and the latest test case. The present application can improve the accuracy of target test cases.

Description

测试用例的处理方法、装置和存储介质Test case processing method, device and storage medium
本申请基于申请号为202011530719.8,申请日为2020年12月22日,申请名称为“测试用例的处理方法、装置和存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on the Chinese patent application with the application number of 202011530719.8, the application date is December 22, 2020, and the application name is "Test Case Processing Method, Device and Storage Medium", and claims the priority of the Chinese patent application, the The entire contents of the Chinese patent application are incorporated herein by reference.
技术领域technical field
本申请涉及计算机技术,尤其涉及一种测试用例的处理方法、装置和存储介质。The present application relates to computer technology, and in particular, to a test case processing method, device and storage medium.
背景技术Background technique
随着计算机技术的发展,越来越多的技术(大数据、分布式、人工智能等)应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,但由于金融行业的安全性、实时性要求,也对服务请求技术提出了更高的要求。目前,在金融科技领域,为了保证程序或者应用的准确性,通常需要采用测试用例对程序或者应用进行自动化测试。With the development of computer technology, more and more technologies (big data, distributed, artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually transforming into financial technology (Fintech). Real-time requirements also put forward higher requirements for service request technology. At present, in the field of financial technology, in order to ensure the accuracy of the program or application, it is usually necessary to use test cases to automatically test the program or application.
现有技术中,由于程序或者应用的功能在不断变化,为了保证测试的准确性,就需要对测试用例进行编辑或者修改,当多个用户对同一个测试用例进行编辑时,后保存的测试用例会覆盖之前保存的测试用例,导致用户无法查看之前保存版本中对测试用例所作的修改,而且后保存的测试用例直接将前面保存的测试用例覆盖,会影响最终保存的测试用例的准确性。In the prior art, since the functions of programs or applications are constantly changing, in order to ensure the accuracy of the test, it is necessary to edit or modify the test case. The test case will overwrite the previously saved test case, so that the user cannot view the modifications made to the test case in the previously saved version, and the later saved test case directly overwrites the previously saved test case, which will affect the accuracy of the final saved test case.
发明内容SUMMARY OF THE INVENTION
为解决现有技术中存在的问题,本发明提供一种测试用例的处理方法、装置和存储介质,不仅可以使用户能够查看之前保存版本中对测试用例所作的修改,而且可以提高最终保存的测试用例的准确性。In order to solve the problems existing in the prior art, the present invention provides a test case processing method, device and storage medium, which can not only enable the user to view the modifications made to the test case in the previously saved version, but also improve the final saved test. Use case accuracy.
第一方面,本申请实施例提供一种测试用例的处理方法,应用于服务器,所述方法包括:In a first aspect, an embodiment of the present application provides a method for processing a test case, which is applied to a server, and the method includes:
若检测到基础测试用例处于未加锁状态,则获取待保存测试用例和数据库中已保存的最新测试用例,所述待保存测试用例和所述最新测试用例为分别对所述基础测试用例进行修改后得到的;If it is detected that the basic test case is in an unlocked state, the test case to be saved and the latest test case that has been saved in the database are obtained, and the test case to be saved and the latest test case are to modify the basic test case respectively. obtained after
确定所述待保存测试用例与所述最新测试用例的至少一个差异数据,以及与所述差异数据对应的差异类型,所述差异类型包括增加类型、删除类型和修改类型中的至少一种;determining at least one difference data between the to-be-saved test case and the latest test case, and a difference type corresponding to the difference data, where the difference type includes at least one of an addition type, a deletion type, and a modification type;
向第一终端设备发送第一消息,所述第一消息中包括所述差异数据和所述差异类型;sending a first message to a first terminal device, where the first message includes the difference data and the difference type;
接收所述第一终端设备发送的第二消息,所述第二消息中包括目标差异数据和与所述目标差异数据对应的目标差异类型,所述目标差异数据为所述至少一个差异数据中的数据;Receive a second message sent by the first terminal device, where the second message includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is one of the at least one difference data. data;
根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。A target test case is generated according to the target difference data, the target difference type and the latest test case.
可选的,所述获取待保存测试用例和数据库中已保存的最新测试用例,包括:Optionally, obtaining the test case to be saved and the latest test case saved in the database includes:
接收所述第一终端设备发送的第三消息,所述第三消息中包括所述待保存测试用例以及所述待保存测试用例的版本标识;receiving a third message sent by the first terminal device, where the third message includes the test case to be saved and the version identifier of the test case to be saved;
根据所述第三消息,获取所述最新测试用例的版本标识;obtaining the version identifier of the latest test case according to the third message;
若所述待保存测试用例的版本标识与所述最新测试用例的版本标识不同,则从所述数据库中获取所述最新测试用例。If the version identifier of the test case to be saved is different from the version identifier of the latest test case, the latest test case is acquired from the database.
可选的,所述确定所述待保存测试用例与所述最新测试用例的至少一个差异数据,以及与所述差异数据对应的差异类型,包括:Optionally, the determining at least one difference data between the test case to be saved and the latest test case, and the difference type corresponding to the difference data, include:
将所述待保存测试用例与所述最新测试用例进行比对,确定所述待保存测试用例与所述最新测试用例的最长公共子序列;Compare the test case to be saved with the latest test case, and determine the longest common subsequence of the test case to be saved and the latest test case;
分别将所述待保存测试用例和所述最新测试用例与所述最长公共子序列进行比对,将所述待保存测试用例与所述最长公共子序列之间不同的数据,以及所述最新测试用例与所述最长公共子序列之间不同的数据,确定为所述至少一个差异数据;Comparing the test case to be saved and the latest test case with the longest common subsequence respectively, comparing the different data between the test case to be saved and the longest common subsequence, and the The difference data between the latest test case and the longest common subsequence is determined as the at least one difference data;
根据所述至少一个差异数据与所述最长公共子序列,确定与所述差异数据对应的差异类型。According to the at least one difference data and the longest common subsequence, a difference type corresponding to the difference data is determined.
可选的,所述根据所述目标差异数据、所述目标差异类型和所述最新测 试用例,生成目标测试用例,包括:Optionally, the target test case is generated according to the target difference data, the target difference type and the latest test case, including:
若确定出与所述目标差异类型对应的所述目标差异数据为所述最新测试用例中的数据,则将所述最新测试用例确定为所述目标测试用例;或者,If it is determined that the target difference data corresponding to the target difference type is data in the latest test case, then the latest test case is determined to be the target test case; or,
若确定出与所述目标差异类型对应的所述目标差异数据为所述待保存测试用例中的数据,则在所述最新测试用例中,对所述目标差异数据进行与所述目标差异类型对应的操作,以生成所述目标测试用例;或者,If it is determined that the target difference data corresponding to the target difference type is the data in the test case to be saved, then in the latest test case, the target difference data corresponding to the target difference type is performed operations to generate the target test case; or,
若确定出所述目标差异数据中的第一数据为所述最新测试用例中的数据,且第二数据为所述待保存测试用例中的数据,则在所述最新测试用例中保持所述第一数据以及与所述第一数据对应的差异类型不变,且在所述最新测试用例中,对所述第二数据进行与所述第二数据的差异类型对应的操作,以生成所述目标测试用例。If it is determined that the first data in the target difference data is the data in the latest test case, and the second data is the data in the to-be-saved test case, keep the first data in the latest test case A piece of data and a difference type corresponding to the first data remain unchanged, and in the latest test case, an operation corresponding to the difference type of the second data is performed on the second data to generate the target test case.
可选的,所述方法还包括:Optionally, the method further includes:
若检测到所述第一终端设备对应的基础测试用例处于加锁状态,则向除所述第一终端设备之外的第二终端设备发送锁定消息,所述锁定消息中包括所述基础测试用例的版本标识,所述锁定消息用于指示所述第二终端设备将所述第二终端设备对应的所述基础测试用例设置为锁定状态。If it is detected that the basic test case corresponding to the first terminal device is in a locked state, a lock message is sent to a second terminal device other than the first terminal device, where the lock message includes the basic test case The lock message is used to instruct the second terminal device to set the basic test case corresponding to the second terminal device to a locked state.
可选的,所述方法还包括:Optionally, the method further includes:
在满足预设条件时,向所述第二终端设备发送解锁消息,所述解锁消息中包括处于锁定状态的基础测试用例的版本标识,所述解锁消息用于指示生成第一数值,并指示所述第二终端设备在判断出所述第一数值与预先存储的第二数值相同时将所述处于锁定状态的基础测试用例解锁;所述预设条件包括所述处于锁定状态的基础测试用例的锁定时长超过预设时长,和/或,接收到所述第一终端设备发送的第五消息,所述第五消息用于表示对所述处于锁定状态的基础测试用例进行保存。When the preset condition is met, an unlock message is sent to the second terminal device, where the unlock message includes the version identifier of the basic test case in the locked state, the unlock message is used to instruct the generation of the first value and the The second terminal device unlocks the basic test case in the locked state when judging that the first value is the same as the pre-stored second value; the preset condition includes the basic test case in the locked state. The locking duration exceeds a preset duration, and/or a fifth message sent by the first terminal device is received, where the fifth message is used to indicate that the basic test case in the locked state is saved.
第二方面,本申请实施例提供一种测试用例的处理方法,应用于终端设备,所述方法包括:In a second aspect, an embodiment of the present application provides a method for processing a test case, which is applied to a terminal device, and the method includes:
接收服务器发送的第一消息,所述第一消息中包括至少一个差异数据和每个差异数据对应的差异类型,所述差异数据为待保存测试用例与最新测试用例之间的差异数据,所述待保存测试用例和所述最新测试用例为对基础测试用例进行修改后得到的;Receive the first message sent by the server, the first message includes at least one difference data and the difference type corresponding to each difference data, the difference data is the difference data between the test case to be saved and the latest test case, the The test case to be saved and the latest test case are obtained by modifying the basic test case;
确定目标差异数据和与所述目标差异数据对应的目标差异类型,所述目 标差异数据为所述至少一个差异数据中的数据;Determine target difference data and the target difference type corresponding to the target difference data, and the target difference data is the data in the at least one difference data;
向所述服务器发送所述第二消息,所述第二消息中包括所述目标差异数据和所述目标差异类型,所述第二消息用于指示所述服务器根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。Send the second message to the server, the second message includes the target difference data and the target difference type, and the second message is used to instruct the server according to the target difference data, the The target difference type and the latest test case are generated, and the target test case is generated.
可选的,所述确定目标差异数据和与所述目标差异数据对应的目标差异类型,包括:Optionally, the determining the target difference data and the target difference type corresponding to the target difference data includes:
显示所述差异数据和所述差异类型;displaying the difference data and the difference type;
接收用户触发的第一操作指令,所述第一操作指令中包括所述目标差异数据和所述目标差异类型。A first operation instruction triggered by a user is received, where the first operation instruction includes the target difference data and the target difference type.
可选的,所述方法还包括:Optionally, the method further includes:
接收用户触发的第二操作指令,所述第二操作指令用于对所述待保存测试用例进行保存;receiving a second operation instruction triggered by the user, where the second operation instruction is used to save the to-be-saved test case;
根据所述第二操作指令,向所述服务器发送第三消息,所述第三消息中包括所述待保存测试用例以及所述待保存测试用例的版本标识,所述第三消息用于指示所述服务器获取所述最新测试用例的版本标识,并在所述待保存测试用例的版本标识与所述最新测试用例的版本标识不同时,从所述数据库中获取所述最新测试用例。According to the second operation instruction, a third message is sent to the server, where the third message includes the test case to be saved and the version identifier of the test case to be saved, and the third message is used to indicate the test case to be saved. The server acquires the version identifier of the latest test case, and when the version identifier of the test case to be saved is different from the version identifier of the latest test case, acquires the latest test case from the database.
可选的,所述方法还包括:Optionally, the method further includes:
接收所述用户触发的第三操作指令,所述第三操作指令中包括待锁定的基础测试用例的版本标识;receiving a third operation instruction triggered by the user, where the third operation instruction includes the version identifier of the basic test case to be locked;
根据所述第三操作指令,向所述服务器发送第四消息,所述第四消息中包括待锁定的基础测试用例的版本标识,所述第四消息用于指示所述服务器向除所述终端设备之外的第二终端设备发送锁定消息,所述锁定消息中包括所述待锁定的基础测试用例的版本标识,所述锁定消息用于指示所述第二终端设备将将所述第二终端设备对应的所述待锁定的基础测试用例设置为锁定状态。According to the third operation instruction, a fourth message is sent to the server, where the fourth message includes the version identifier of the basic test case to be locked, and the fourth message is used to instruct the server to send a message to the terminal except the terminal A second terminal device other than the device sends a lock message, where the lock message includes the version identifier of the basic test case to be locked, and the lock message is used to indicate that the second terminal device will The basic test case to be locked corresponding to the device is set to a locked state.
可选的,所述方法还包括:Optionally, the method further includes:
接收所述用户触发的第四操作指令,所述第四操作指令用于指示对处于锁定状态的基础测试用例进行保存;receiving a fourth operation instruction triggered by the user, where the fourth operation instruction is used to instruct to save the basic test case in the locked state;
根据所述第四操作指令,向所述服务器发送第五消息,所述第五消息用于指示所述服务器向所述第二终端设备发送解锁消息,所述解锁消息中包括 处于锁定状态的基础测试用例的版本标识,所述解锁消息用于指示生成第一数值,并指示所述第二终端设备在判断出所述第一数值与预先存储的第二数值相同时将所述处于锁定状态的基础测试用例解锁。According to the fourth operation instruction, a fifth message is sent to the server, where the fifth message is used to instruct the server to send an unlocking message to the second terminal device, where the unlocking message includes the basic information in a locked state The version identifier of the test case, the unlock message is used to instruct the generation of the first value, and instruct the second terminal device to lock the device in the locked state when judging that the first value is the same as the pre-stored second value. Basic test cases are unlocked.
第三方面,本申请实施例提供一种测试用例的处理装置,包括:In a third aspect, an embodiment of the present application provides a processing device for a test case, including:
处理模块,用于在检测到基础测试用例处于未加锁状态时,获取待保存测试用例和数据库中已保存的最新测试用例,所述待保存测试用例和所述最新测试用例为分别对基础测试用例进行修改后得到的;The processing module is used to obtain the test case to be saved and the latest test case saved in the database when it is detected that the basic test case is in an unlocked state, and the test case to be saved and the latest test case are for the basic test case respectively. After the use case is modified;
所述处理模块,还用于确定所述待保存测试用例与所述最新测试用例的至少一个差异数据,以及与所述差异数据对应的差异类型,所述差异类型包括增加类型、删除类型和修改类型中的至少一种;The processing module is further configured to determine at least one difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data, where the difference type includes addition type, deletion type and modification at least one of the types;
发送模块,用于向第一终端设备发送第一消息,所述第一消息中包括所述差异数据和所述差异类型;a sending module, configured to send a first message to a first terminal device, where the first message includes the difference data and the difference type;
接收模块,用于接收所述第一终端设备发送的第二消息,所述第二消息中包括目标差异数据和与所述目标差异数据对应的目标差异类型,所述目标差异数据为所述至少一个差异数据中的数据;A receiving module, configured to receive a second message sent by the first terminal device, where the second message includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is the at least data in a difference data;
所述处理模块,还用于根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。The processing module is further configured to generate a target test case according to the target difference data, the target difference type and the latest test case.
可选的,所述处理模块,具体用于:Optionally, the processing module is specifically used for:
接收所述第一终端设备发送的第三消息,所述第三消息中包括所述待保存测试用例以及所述待保存测试用例的版本标识;receiving a third message sent by the first terminal device, where the third message includes the test case to be saved and the version identifier of the test case to be saved;
根据所述第三消息,获取所述最新测试用例的版本标识;obtaining the version identifier of the latest test case according to the third message;
若所述待保存测试用例的版本标识与所述最新测试用例的版本标识不同,则从所述数据库中获取所述最新测试用例。If the version identifier of the test case to be saved is different from the version identifier of the latest test case, the latest test case is acquired from the database.
可选的,所述处理模块,具体用于:Optionally, the processing module is specifically used for:
将所述待保存测试用例与所述最新测试用例进行比对,确定所述待保存测试用例与所述最新测试用例的最长公共子序列;Compare the test case to be saved with the latest test case, and determine the longest common subsequence of the test case to be saved and the latest test case;
分别将所述待保存测试用例和所述最新测试用例与所述最长公共子序列进行比对,将所述待保存测试用例与所述最长公共子序列之间不同的数据,以及所述最新测试用例与所述最长公共子序列之间不同的数据,确定为所述至少一个差异数据;Comparing the test case to be saved and the latest test case with the longest common subsequence respectively, comparing the different data between the test case to be saved and the longest common subsequence, and the The difference data between the latest test case and the longest common subsequence is determined as the at least one difference data;
根据所述至少一个差异数据与所述最长公共子序列,确定与所述差异数 据对应的差异类型。According to the at least one difference data and the longest common subsequence, a difference type corresponding to the difference data is determined.
可选的,所述处理模块,具体用于:Optionally, the processing module is specifically used for:
若确定出与所述目标差异类型对应的所述目标差异数据为所述最新测试用例中的数据,则将所述最新测试用例确定为所述目标测试用例;或者,If it is determined that the target difference data corresponding to the target difference type is data in the latest test case, then the latest test case is determined to be the target test case; or,
若确定出与所述目标差异类型对应的所述目标差异数据为所述待保存测试用例中的数据,则在所述最新测试用例中,对所述目标差异数据进行与所述目标差异类型对应的操作,以生成所述目标测试用例;或者,If it is determined that the target difference data corresponding to the target difference type is the data in the test case to be saved, then in the latest test case, the target difference data corresponding to the target difference type is performed operations to generate the target test case; or,
若确定出所述目标差异数据中的第一数据为所述最新测试用例中的数据,且第二数据为所述待保存测试用例中的数据,则在所述最新测试用例中保持所述第一数据以及与所述第一数据对应的差异类型不变,且在所述最新测试用例中,对所述第二数据进行与所述第二数据的差异类型对应的操作,以生成所述目标测试用例。If it is determined that the first data in the target difference data is the data in the latest test case, and the second data is the data in the to-be-saved test case, keep the first data in the latest test case A piece of data and a difference type corresponding to the first data remain unchanged, and in the latest test case, an operation corresponding to the difference type of the second data is performed on the second data to generate the target test case.
可选的,optional,
所述发送模块,还用于在检测到所述第一终端设备对应的基础测试用例处于加锁状态时,向除所述第一终端设备之外的第二终端设备发送锁定消息,所述锁定消息中包括所述基础测试用例的版本标识,所述锁定消息用于指示所述第二终端设备将所述第二终端设备对应的所述基础测试用例设置为锁定状态。The sending module is further configured to send a lock message to a second terminal device other than the first terminal device when it is detected that the basic test case corresponding to the first terminal device is in a locked state, and the lock The message includes the version identifier of the basic test case, and the lock message is used to instruct the second terminal device to set the basic test case corresponding to the second terminal device to a locked state.
可选的,所述发送模块,还用于在满足预设条件时,向所述第二终端设备发送解锁消息,所述解锁消息中包括处于锁定状态的基础测试用例的版本标识,所述解锁消息用于指示生成第一数值,并指示所述第二终端设备在判断出所述第一数值与预先存储的第二数值相同时将所述处于锁定状态的基础测试用例解锁;所述预设条件包括所述处于锁定状态的基础测试用例的锁定时长超过预设时长,和/或,接收到所述第一终端设备发送的第五消息,所述第五消息用于表示对所述处于锁定状态的基础测试用例进行保存。Optionally, the sending module is further configured to send an unlock message to the second terminal device when a preset condition is met, where the unlock message includes a version identifier of the basic test case in a locked state, and the unlock message The message is used to instruct the generation of the first value, and instruct the second terminal device to unlock the basic test case in the locked state when it determines that the first value is the same as the pre-stored second value; the preset The condition includes that the lock duration of the basic test case in the locked state exceeds a preset duration, and/or a fifth message sent by the first terminal device is received, and the fifth message is used to indicate that the locked The state of the underlying test case is saved.
第四方面,本申请实施例提供一种测试用例的处理装置,包括:In a fourth aspect, an embodiment of the present application provides a processing device for a test case, including:
接收模块,用于接收服务器发送的第一消息,所述第一消息中包括至少一个差异数据和每个差异数据对应的差异类型,所述差异数据为待保存测试用例与最新测试用例之间的差异数据,所述待保存测试用例和所述最新测试用例为对基础测试用例进行修改后得到的;The receiving module is configured to receive a first message sent by the server, where the first message includes at least one difference data and a difference type corresponding to each difference data, and the difference data is the difference between the test case to be saved and the latest test case. Difference data, the test case to be saved and the latest test case are obtained by modifying the basic test case;
处理模块,用于确定目标差异数据和与所述目标差异数据对应的目标差 异类型,所述目标差异数据为所述至少一个差异数据中的数据;a processing module for determining target difference data and a target difference type corresponding to the target difference data, the target difference data being the data in the at least one difference data;
发送模块,用于向所述服务器发送所述第二消息,所述第二消息中包括所述目标差异数据和所述目标差异类型,所述第二消息用于指示所述服务器根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。a sending module, configured to send the second message to the server, where the second message includes the target difference data and the target difference type, and the second message is used to instruct the server according to the target difference The difference data, the target difference type and the latest test case are used to generate a target test case.
可选的,所述装置还包括:显示模块;Optionally, the device further includes: a display module;
所述显示模块,用于显示所述差异数据和所述差异类型;the display module, for displaying the difference data and the difference type;
所述接收模块,还用于接收用户触发的第一操作指令,所述第一操作指令中包括所述目标差异数据和所述目标差异类型。The receiving module is further configured to receive a first operation instruction triggered by a user, where the first operation instruction includes the target difference data and the target difference type.
可选的,所述接收模块,还用于接收用户触发的第二操作指令,所述第二操作指令用于对所述待保存测试用例进行保存;Optionally, the receiving module is further configured to receive a second operation instruction triggered by the user, where the second operation instruction is used to save the test case to be saved;
所述发送模块,还用于根据所述第二操作指令,向所述服务器发送第三消息,所述第三消息中包括所述待保存测试用例以及所述待保存测试用例的版本标识,所述第三消息用于指示所述服务器获取所述最新测试用例的版本标识,并在所述待保存测试用例的版本标识与所述最新测试用例的版本标识不同时,从所述数据库中获取所述最新测试用例。The sending module is further configured to send a third message to the server according to the second operation instruction, where the third message includes the test case to be saved and the version identifier of the test case to be saved, The third message is used to instruct the server to obtain the version identifier of the latest test case, and when the version identifier of the to-be-saved test case is different from the version identifier of the latest test case, obtain the version identifier of the latest test case from the database. Describe the latest test case.
可选的,所述接收模块,还用于接收所述用户触发的第三操作指令,所述第三操作指令中包括待锁定的基础测试用例的版本标识;Optionally, the receiving module is further configured to receive a third operation instruction triggered by the user, where the third operation instruction includes the version identifier of the basic test case to be locked;
所述发送模块,还用于根据所述第三操作指令,向所述服务器发送第四消息,所述第四消息中包括待锁定的基础测试用例的版本标识,所述第四消息用于指示所述服务器向除所述终端设备之外的第二终端设备发送锁定消息,所述锁定消息中包括所述待锁定的基础测试用例的版本标识,所述锁定消息用于指示所述第二终端设备将将所述第二终端设备对应的所述待锁定的基础测试用例设置为锁定状态。The sending module is further configured to send a fourth message to the server according to the third operation instruction, where the fourth message includes the version identifier of the basic test case to be locked, and the fourth message is used to indicate The server sends a lock message to a second terminal device other than the terminal device, where the lock message includes the version identifier of the basic test case to be locked, and the lock message is used to indicate the second terminal The device will set the basic test case to be locked corresponding to the second terminal device to a locked state.
可选的,所述接收模块,还用于接收所述用户触发的第四操作指令,所述第四操作指令用于指示对处于锁定状态的基础测试用例进行保存;Optionally, the receiving module is further configured to receive a fourth operation instruction triggered by the user, where the fourth operation instruction is used to instruct to save the basic test case in a locked state;
所述发送模块,还用于根据所述第四操作指令,向所述服务器发送第五消息,所述第五消息用于指示所述服务器向所述第二终端设备发送解锁消息,所述解锁消息中包括处于锁定状态的基础测试用例的版本标识,所述解锁消息用于指示生成第一数值,并指示所述第二终端设备在判断出所述第一数值与预先存储的第二数值相同时将所述处于锁定状态的基础测试用例解锁。The sending module is further configured to send a fifth message to the server according to the fourth operation instruction, where the fifth message is used to instruct the server to send an unlocking message to the second terminal device, and the unlocking The message includes the version identifier of the basic test case in the locked state, and the unlock message is used to instruct the generation of the first value, and instruct the second terminal device to determine that the first value is inconsistent with the pre-stored second value. At the same time, the basic test case in the locked state is unlocked.
第五方面,本申请实施例提供一种服务器,包括:收发器;处理器;存储器;以及计算机程序;In a fifth aspect, an embodiment of the present application provides a server, including: a transceiver; a processor; a memory; and a computer program;
其中,所述计算机程序被存储在所述存储器中,并且被配置为由所述处理器执行,所述计算机程序包括用于执行如第一方面所述的方法的指令。Wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of the first aspect.
第六方面,本申请实施例提供一种终端设备,包括:收发器;显示器;处理器;存储器;以及计算机程序;In a sixth aspect, an embodiment of the present application provides a terminal device, including: a transceiver; a display; a processor; a memory; and a computer program;
其中,所述计算机程序被存储在所述存储器中,并且被配置为由所述处理器执行,所述计算机程序包括用于执行如第二方面所述的方法的指令。Wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of the second aspect.
第七方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序使得服务器执行如第一方面所述的方法或使得终端设备执行如第二方面所述的方法。In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program causes the server to execute the method described in the first aspect or cause the terminal device to execute the method described in the first aspect. The method described in the second aspect.
第八方面,本申请实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如第一方面或第二方面所述的方法。In an eighth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the method according to the first aspect or the second aspect when the computer program is executed by a processor.
本申请实施例提供的测试用例的处理方法、装置和存储介质,在检测到基础测试用例处于未加锁状态时,通过获取待保存测试用例和数据库中已保存的最新测试用例,并确定待保存测试用例与最新测试用例的至少一个差异数据,以及与差异数据对应的差异类型,然后向第一终端设备发送第一消息,该第一消息中包括差异数据和差异类型,通过接收第一终端设备发送的第二消息,该第二消息中包括目标差异数据和与目标差异数据对应的目标差异类型,并根据目标差异数据、目标差异类型和最新测试用例,生成目标测试用例。由于服务器在保存待保存测试用例时,通过确定待保存测试用例与最新测试用例的至少一个差异数据,并根据终端设备确定出的目标差异数据以及对应的目标差异类型,生成目标测试用例,从而避免了现有技术中直接采用后保存的测试用例覆盖之前保存的测试用例的现象,而且实现了选择性的对差异数据进行保存,从而可以提高目标测试用例的准确性。In the test case processing method, device and storage medium provided by the embodiments of the present application, when it is detected that the basic test case is in an unlocked state, the test case to be saved and the latest test case saved in the database are obtained, and the test case to be saved is determined. at least one difference data between the test case and the latest test case, as well as the difference type corresponding to the difference data, and then send a first message to the first terminal device, the first message includes the difference data and the difference type, by receiving the first terminal device The second message sent includes the target difference data and the target difference type corresponding to the target difference data, and the target test case is generated according to the target difference data, the target difference type and the latest test case. When the server saves the test case to be saved, it determines at least one difference data between the test case to be saved and the latest test case, and generates the target test case according to the target difference data determined by the terminal device and the corresponding target difference type, thereby avoiding The phenomenon in the prior art that the test case saved before is directly used to cover the test case saved before is realized, and the difference data is selectively saved, so that the accuracy of the target test case can be improved.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1为本申请实施例提供的测试用例的处理方法的系统架构图;1 is a system architecture diagram of a method for processing a test case provided by an embodiment of the present application;
图2为本申请实施例提供的一种测试用例的处理方法的信令图;2 is a signaling diagram of a method for processing a test case provided by an embodiment of the present application;
图3为第二操作指令的触发示意图;Fig. 3 is the trigger schematic diagram of the second operation instruction;
图4为差异数据的显示示意图;Fig. 4 is the display schematic diagram of difference data;
图5为本申请实施例提供的一种测试用例的处理方法的另一信令图;FIG. 5 is another signaling diagram of a method for processing a test case provided by an embodiment of the present application;
图6为触发第三操作指令的示意图;6 is a schematic diagram of triggering a third operation instruction;
图7为本申请实施例提供的一种测试用例的处理方法的另一信令图;FIG. 7 is another signaling diagram of a method for processing a test case provided by an embodiment of the present application;
图8为本申请实施例提供的测试用例的处理装置的一示意图;FIG. 8 is a schematic diagram of a processing device for a test case provided by an embodiment of the present application;
图9为本申请实施例提供的测试用例的处理装置的一示意图;FIG. 9 is a schematic diagram of a processing device for a test case provided by an embodiment of the present application;
图10为本申请实施例提供的一种服务器实施例的结构示意图;FIG. 10 is a schematic structural diagram of a server embodiment provided by an embodiment of the present application;
图11为本申请实施例提供的一种终端设备实施例的结构示意图。FIG. 11 is a schematic structural diagram of an embodiment of a terminal device according to an embodiment of the application.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”及“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third" and "fourth", etc. (if any) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that the data so used may be interchanged under appropriate circumstances such that the embodiments of the invention described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
为了帮助本领域技术人员更好地理解本申请的技术方案,下面将对本申请技术方案涉及的相关内容进行介绍。In order to help those skilled in the art better understand the technical solutions of the present application, the relevant content involved in the technical solutions of the present application will be introduced below.
(1)自动化测试,是指根据系统的使用场景,自动去模拟执行界面真实的操作,测试功能是否正确。(1) Automated testing refers to automatically simulating the real operation of the execution interface according to the usage scenario of the system to test whether the function is correct.
(2)测试用例(Test Case)指对一项特定的软件产品进行测试任务的描述,体现测试方案、方法、技术和策略。其内容包括测试目标、测试环境、 输入数据、测试步骤、预期结果和测试脚本等。(2) Test case (Test Case) refers to the description of the test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test target, test environment, input data, test steps, expected results and test scripts.
(3)Redis,是基于内存实现的高性能的key-value数据存储的数据库。(3) Redis is a high-performance key-value data storage database based on memory.
本申请实施例提供的测试用例的处理方法可以应用于采用测试用例对程序或者应用进行自动化测试的场景中,或者应用于多个用户对同一个测试用例进行编辑或者修改时,如何对测试用例如进行有效管理的场景中。The method for processing test cases provided by the embodiments of the present application can be applied to scenarios in which test cases are used to automate testing of programs or applications, or when multiple users edit or modify the same test case, how to use test cases such as in the context of effective management.
在上述场景中,可以允许多个测试人员对测试用例进行修改或者编辑,也即多人可以同时编辑同一个测试用例。在现有技术中,当多个用户对同一个测试用例进行编辑时,通常是按照编辑完成的时间顺序,对测试用例进行保存,这样,后保存的测试用例会覆盖之前保存的测试用例。例如,若用户A和用户B分别通过不同的终端设备对同一个测试用例进行编辑,若用户A先编辑完成,则可以将编辑完成的测试用例进行保存。在用户B完成编辑后,服务器在接收到用户B通过终端设备发送的保存指令时,会采用用户B编辑完成的测试用例直接覆盖用户A编辑完成的测试用例,这样,用户将无法查看用户A编辑完成的测试用例。另外,由于用户B编辑完成的测试用例会直接覆盖用户A编辑完成的测试用例,若用户B编辑的测试用例准确性不高,则会直接影响最终保存的测试用例的准确性。In the above scenario, multiple testers can be allowed to modify or edit the test case, that is, multiple people can edit the same test case at the same time. In the prior art, when multiple users edit the same test case, the test cases are usually saved according to the chronological sequence of editing, so that the test case saved later will overwrite the test case saved before. For example, if user A and user B edit the same test case through different terminal devices, if user A finishes editing first, the edited test case can be saved. After user B finishes editing, when the server receives the save instruction sent by user B through the terminal device, the server will use the test case edited by user B to directly overwrite the test case edited by user A. In this way, the user will not be able to view the edit by user A. The completed test case. In addition, since the test case edited by user B will directly cover the test case edited by user A, if the accuracy of the test case edited by user B is not high, it will directly affect the accuracy of the final saved test case.
本申请实施例中考虑到上述问题,提出一种测试用例的处理方法,在该方法中,在多人同时对同一个测试用例进行编辑或者修改,并在修改完成后进行保存时,若之前已经有保存的测试用例,也即出现了数据冲突时,可以将多人修改的内容均进行保存,例如可以将多人修改的内容保存在同一个版本的测试用例中,以便用户进行查看,这样既可避免后保存的测试用例直接覆盖在先保存的测试用例的情况。另外,多个测试人员对同一个测试用例进行修改时,可能会存在大部分修改内容相同的现象,为了节省存储空间,可以将多人修改的内容进行比较,若存在差异数据,也即修改不同的内容时,可以从差异数据中确定出目标差异数据,具体的,可以通过界面进行显示,测试人员根据该差异数据,可以确定需要保留的部分。这样,一方面,不会根据保存时间的先后顺序,将后保存的测试用例直接覆盖之前保存的测试用例,而且用户还可以查看之前保存的测试用例。另一方面,用户可以根据差异数据,选择需要保留的部分,由此可以提高最终保存的测试用例的准确性。In consideration of the above problems, the embodiment of the present application proposes a method for processing test cases. In this method, when multiple people edit or modify the same test case at the same time, and save the modification after the modification is completed, if the There are saved test cases, that is, when there is a data conflict, the content modified by multiple people can be saved. For example, the content modified by multiple people can be saved in the same version of the test case for users to view. It can avoid the situation where the later saved test case directly overwrites the previously saved test case. In addition, when multiple testers modify the same test case, most of the modified contents may be the same. In order to save storage space, the contents modified by multiple people can be compared. If there is different data, that is, the modification is different When the content is changed, the target difference data can be determined from the difference data. Specifically, it can be displayed through the interface, and the tester can determine the part that needs to be retained according to the difference data. In this way, on the one hand, the test case saved later will not directly cover the test case saved before, and the user can also view the test case saved before. On the other hand, the user can select the part that needs to be kept according to the difference data, thereby improving the accuracy of the final saved test case.
在描述本申请的测试用例的处理方法的方案之前,先根据图1来了解下本申请的系统架构。Before describing the solution of the test case processing method of the present application, first understand the system architecture of the present application according to FIG. 1 .
图1为本申请实施例提供的测试用例的处理方法的系统架构图。如图1所示,该系统包括:第一终端设备101、第二终端设备102、103和104、以及服务器105。其中,用户A可以通过第一终端设备101对测试用例进行编辑或者修改,用户B、C和D可以分别通过第二终端设备102、103和104对测试用例进行编辑或者修改,用户通过终端设备编辑或者修改后的测试用例,可以保存在服务器105的数据库中,其中,该数据库可以为Redis数据库,也可以为SQL数据库,当然,还可以为其他类型的数据库,只要能存储测试用例即可。另外,服务器105可以为一台服务器,可以为多台服务器组成的分布式服务器集群。FIG. 1 is a system architecture diagram of a method for processing a test case provided by an embodiment of the present application. As shown in FIG. 1 , the system includes: a first terminal device 101 , second terminal devices 102 , 103 and 104 , and a server 105 . Among them, user A can edit or modify the test case through the first terminal device 101, users B, C and D can edit or modify the test case through the second terminal device 102, 103 and 104 respectively, and the user can edit or modify the test case through the terminal device Alternatively, the modified test case may be stored in the database of the server 105, where the database may be a Redis database, a SQL database, or other types of databases, as long as the test case can be stored. In addition, the server 105 may be one server, or may be a distributed server cluster composed of multiple servers.
以对系统进行测试的场景为例,用户A可以通过终端设备101采用测试用例1.1对系统进行测试,并在测试过程中可以对测试用例1.1进行修改,同样的,用户B、用户C和用户D可以分别通过终端设备102、103和104采用测试用例1.1对系统进行测试,并在测试过程中可以对测试用例1.1进行修改。也即,多个用户可以同时对同一个测试用例进行修改,且用户可以通过各自对应的终端设备,将修改之后的测试用例发送到服务器105,以对每个用户修改后的测试用例进行保存。另外,为了使用户能够查看到其他用户对测试用例所作的修改,服务器105在确定出已经有至少两个用户对测试用例进行保存时,会比较这些测试用例之间的差异,并将差异数据发送给终端设备,以进行显示,这样,用户将可以根据该差异数据,确定自己想要保存的测试用例,从而生成目标测试用例以进行保存。该目标测试用例用于对系统进行测试。Taking the scenario of testing the system as an example, user A can use test case 1.1 to test the system through the terminal device 101, and can modify test case 1.1 during the test process. Similarly, user B, user C, and user D The test case 1.1 can be used to test the system through the terminal devices 102, 103 and 104 respectively, and the test case 1.1 can be modified during the test. That is, multiple users can modify the same test case at the same time, and the users can send the modified test case to the server 105 through their corresponding terminal devices to save the modified test case of each user. In addition, in order to enable users to view the modifications made by other users to the test cases, the server 105 will compare the differences between the test cases and send the difference data when it is determined that at least two users have saved the test cases. Display it to the terminal device, so that the user can determine the test case he wants to save according to the difference data, so as to generate the target test case for saving. The target test case is used to test the system.
应该理解,在图1所示的系统架构中,用户、第一终端设备101、第二终端设备102、103和104以及服务器105的数目仅仅是示例性的,更多或更少的数量都属于本申请的保护范畴。并且,在上述示例运行场景中,所述用户可以使用各种设备访问网络,例如个人计算机、服务器、平板、手机、掌上电脑(Personal Digital Assistant,PDA)、笔记本或其它任何具有联网功能的计算设备。而服务器105则可以利用具有更强大处理能力和更高安全性的一个服务器或服务器组来实现。上述网络可以包括各种类型的有线和无线网络,例如但不局限于:互联网、局域网、无线保真(Wireless Fidelity,WIFI)、无线局域网(Wireless Local Area Networks,WLAN)、蜂窝通信网络(通用分组无线服务技术(General Packet Radio Service,GPRS)、码分多址(Code  Division Multiple Access,CDMA)、2G/3G/4G/5G蜂窝网络)、卫星通信网络等等。It should be understood that in the system architecture shown in FIG. 1 , the number of users, the first terminal device 101 , the second terminal devices 102 , 103 and 104 and the server 105 is only exemplary, and more or less numbers belong to The scope of protection of this application. In addition, in the above example operation scenario, the user can use various devices to access the network, such as personal computer, server, tablet, mobile phone, PDA (Personal Digital Assistant, PDA), notebook or any other computing device with networking capabilities . The server 105 can be implemented using a server or server group with more powerful processing power and higher security. The above-mentioned network may include various types of wired and wireless networks, such as but not limited to: Internet, local area network, wireless fidelity (Wireless Fidelity, WIFI), wireless local area network (Wireless Local Area Networks, WLAN), cellular communication network (General Packet Wireless service technology (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), 2G/3G/4G/5G cellular network), satellite communication network, etc.
在了解了本申请的系统架构后,结合图2对本申请的测试用例的处理方法的方案进行详细说明。After understanding the system architecture of the present application, the solution of the processing method of the test case of the present application will be described in detail with reference to FIG. 2 .
图2为本申请实施例提供的一种测试用例的处理方法的信令图,如图2所示,本申请实施例提供的测试用例的处理方法包括如下步骤:FIG. 2 is a signaling diagram of a method for processing a test case provided by an embodiment of the present application. As shown in FIG. 2 , the method for processing a test case provided by the embodiment of the present application includes the following steps:
步骤201:若检测到基础测试用例处于未加锁状态,则服务器获取待保存测试用例和数据库中已保存的最新测试用例。Step 201: If it is detected that the basic test case is in an unlocked state, the server obtains the test case to be saved and the latest test case saved in the database.
其中,待保存测试用例和最新测试用例为分别对基础测试用例进行修改后得到的。Among them, the test case to be saved and the latest test case are obtained by modifying the basic test case respectively.
在本步骤中,服务器可以通过webSocket监控出基础测试用例是否处于加锁状态。In this step, the server can monitor whether the basic test case is in a locked state through webSocket.
待保存测试用例和最新测试用例为不同的用户对同一个基础测试用例进行修改后得到的。其中,最新测试用例的修改完成时间早于待保存测试用例的修改完成时间,因此,最新测试用例为修改完已经在数据库中进行保存的测试用例,待保存测试用例为当前需要保存的测试用例。The test case to be saved and the latest test case are obtained after different users modify the same basic test case. The modification completion time of the latest test case is earlier than the modification completion time of the test case to be saved. Therefore, the latest test case is the test case that has been modified and saved in the database, and the test case to be saved is the test case that needs to be saved currently.
应理解,在服务器检测到基础测试用例处于未加锁状态,且在出现数据冲突,也即已经有用户对测试用例进行了修改并保存时,服务器才会获取待保存测试用例和数据库中已保存的最新测试用例。因此,在一种可能的实现方式中,第一终端设备在接收到用户触发的用于对待保存测试用例进行保存的第二操作指令后,会向服务器发送第三消息,该第三消息中包括待保存测试用例以及待保存测试用例的版本标识,服务器根据该第三消息,获取最新测试用例的版本标识,若待保存测试用例的版本标识与最新测试用例的版本标识不同,则从数据库中获取最新测试用例。It should be understood that when the server detects that the basic test case is in an unlocked state and a data conflict occurs, that is, when a user has modified and saved the test case, the server will obtain the test case to be saved and the saved test case in the database. The latest test cases for . Therefore, in a possible implementation manner, after receiving the second operation instruction triggered by the user for saving the test case to be saved, the first terminal device will send a third message to the server, where the third message includes The test case to be saved and the version ID of the test case to be saved. The server obtains the version ID of the latest test case according to the third message. If the version ID of the test case to be saved is different from the version ID of the latest test case, it is obtained from the database Latest test case.
具体的,图3为第二操作指令的触发示意图,如图3所示,用户通过终端设备对基础测试用例进行修改之后,可以通过触发操作界面上的“保存”控件,以对修改后的测试用例进行保存,该修改后的测试用例即为待保存测试用例。终端设备接收到用户触发的第二操作指令,会将待保存测试用例以及待保存测试用例的版本标识携带在第三消息中发送给服务器,服务器会根据该第三消息,获取数据库中已经保存的最新测试用例的版本标识。Specifically, Fig. 3 is a schematic diagram of triggering the second operation instruction. As shown in Fig. 3, after the user modifies the basic test case through the terminal device, he can trigger the "Save" control on the operation interface to save the modified test case. The test case is saved, and the modified test case is the test case to be saved. When the terminal device receives the second operation instruction triggered by the user, it will carry the test case to be saved and the version identifier of the test case to be saved in a third message and send it to the server, and the server will obtain the stored data in the database according to the third message. Version ID of the latest test case.
其中,待保存测试用例和最新测试用例均是对同一个版本的基础测试用例进行修改后得到的,服务器在对修改后的测试用例进行保存时,若确定出待保存的测试用例的版本标识与数据库中已存储的最新测试用例的版本标识相同,则说明之前没有用户进行保存,此时,不存在数据冲突,则服务器将根据最新测试用例的版本标识修改待保存的测试用例的版本标识,并存储待保存的测试用例。Among them, the test case to be saved and the latest test case are obtained by modifying the basic test case of the same version. When the server saves the modified test case, if it determines that the version identifier of the test case to be saved is the same as the If the version ID of the latest test case stored in the database is the same, it means that no user has saved it before. At this time, there is no data conflict, then the server will modify the version ID of the test case to be saved according to the version ID of the latest test case, and Store test cases to be saved.
若服务器确定出待保存的测试用例的版本标识与数据库中已存储的最新测试用例的版本标识不同,则说明之前已经有用户保存了修改后的测试用例,此时,存在数据冲突,则服务器将会从数据库中获取最新测试用例。If the server determines that the version identifier of the test case to be saved is different from the version identifier of the latest test case stored in the database, it means that a user has saved the modified test case before. At this time, there is a data conflict, the server will The latest test case will be fetched from the database.
举例来说,用户A和用户B分别通过不同的终端设备对版本标识为1.1的基础测试用例进行修改,当用户A修改完成之后,会通过终端设备向服务器发送保存消息,该保存消息中包括用户A修改完成的测试用例以及版本标识1.1,服务器将获取在数据库中存储的最新测试用例的版本标识,若该最新测试用例的版本标识也为1.1,则说明之前没有其他用户对该测试用例进行修改并保存,则服务器将自动自增版本号作为当前测试用例的版本标识,例如修改为1.2,此时,用户A修改后的测试用例即为数据库中保存的最新测试用例,且该最新测试用例的版本标识为1.2。For example, user A and user B modify the basic test case with version 1.1 through different terminal devices. After user A's modification is completed, a save message will be sent to the server through the terminal device. The save message includes the user A modified test case and version ID 1.1, the server will obtain the version ID of the latest test case stored in the database. If the version ID of the latest test case is also 1.1, it means that no other user has modified the test case before. and save it, the server will automatically increment the version number as the version identifier of the current test case, for example, modify it to 1.2. At this time, the test case modified by user A is the latest test case saved in the database, and the latest test case’s The version ID is 1.2.
当用户B修改完成之后,会通过对应的终端设备向服务器发送保存消息,该保存消息中包括用户B修改完成的测试用例以及版本标识1.1,服务器将获取在数据库中存储的最新测试用例的版本标识,此时获取的最新测试用例的版本标识为1.2,该版本标识与待保存测试用例的版本标识不同,则说明之前有其他用户对该测试用例进行了保存,则服务器将获取版本标识为1.2的最新测试用例,并将用户B修改完成需要进行保存的测试用例确定为待保存测试用例。After the modification of user B is completed, a save message will be sent to the server through the corresponding terminal device. The save message includes the test case modified by user B and the version ID 1.1. The server will obtain the version ID of the latest test case stored in the database. , the version ID of the latest test case obtained at this time is 1.2. This version ID is different from the version ID of the test case to be saved, which means that other users have saved the test case before, and the server will obtain the version ID of 1.2. The latest test case, and the test case that needs to be saved after user B's modification is determined as the test case to be saved.
需要进行说明的是,服务器在对测试用例的版本标识进行更新时,通常会先判断是否是第一个版本,如果是第一个版本,则会为该测试用例设置当前版本标识,通常默认该测试用例的版本标识为1.1,并将设置的版本标识保存到数据库Version表中,而且会向终端设备返回该版本标识。另外,在创建测试用例的内容后,测试用例的所有信息会转换成Xml的形式作为内容存储,其中版本标识(version ID)字段会设置为返回的版本标识Id,保存到数据库Case Content表中。It should be noted that when the server updates the version identifier of the test case, it usually first determines whether it is the first version. If it is the first version, it will set the current version identifier for the test case, which is usually the default. The version identifier of the test case is 1.1, and the set version identifier is saved in the Version table of the database, and the version identifier is returned to the terminal device. In addition, after the content of the test case is created, all the information of the test case will be converted into Xml form as content storage, in which the version ID field will be set to the returned version ID Id and saved to the database Case Content table.
进一步的,如果不是第一个版本,则查询当前数据库中已保存的最新测试用例的版本标识,并自动自增版本号作为当前的版本标识,其中,自动自增版本号的逻辑如下:如果是小修改,则将最后一位数字自增,比如:由1.1新增到1.2,如果是大修改,则第一个数字自增,最后一个数字重新设置为1,比如:由1.3新增2.1。其中,上述版本号的确定,可以是由服务器根据用户修改的内容多少来确定,也可以是由用户通过终端设备向服务器发送携带有版本号的修改消息,服务器根据该修改消息中的版本号来确定的。Further, if it is not the first version, query the version ID of the latest test case saved in the current database, and automatically increment the version number as the current version ID. The logic of the auto-increment version number is as follows: if yes If it is a small modification, the last digit will be incremented automatically, for example: from 1.1 to 1.2, if it is a major modification, the first digit will be incremented automatically, and the last digit will be reset to 1, for example: 2.1 will be added from 1.3. The determination of the above version number may be determined by the server according to the content modified by the user, or the user may send a modification message carrying the version number to the server through the terminal device, and the server may determine the modification message according to the version number in the modification message. definite.
在本实施例中,由于服务器在确定出待保存测试用例的版本标识与最新测试用例的版本标识不同时,则从数据库中获取最新测试用例,以确定待保存测试用例与最新测试用例之间的差异数据,由此可以避免直接采用待保存测试用例覆盖最新测试用例的现象。In this embodiment, when the server determines that the version identifier of the test case to be saved is different from the version identifier of the latest test case, the server obtains the latest test case from the database to determine the difference between the test case to be saved and the latest test case. Difference data, thus avoiding the phenomenon of directly using the test case to be saved to cover the latest test case.
步骤202:服务器确定待保存测试用例与最新测试用例的至少一个差异数据,以及与差异数据对应的差异类型,该差异类型包括增加类型、删除类型和修改类型中的至少一种。Step 202: The server determines at least one difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data, where the difference type includes at least one of addition type, deletion type and modification type.
在本步骤中,服务器在确定出待保存测试用例不是第一个版本的测试用例,且待保存测试用例的版本标识与最新测试用例的版本标识不同时,将比较获取到的待保存测试用例与最新测试用例之间的至少一个差异数据以及与每个差异数据相对应的差异类型。其中,差异数据也可以理解为待保存测试用例与最新测试用例之间不同的数据。In this step, the server compares the obtained test case to be saved with the At least one variance data between the latest test cases and the variance type corresponding to each variance data. Among them, the difference data can also be understood as different data between the test case to be saved and the latest test case.
在一种可能的实现方式中,可以将待保存测试用例与最新测试用例进行比对,确定待保存测试用例与最新测试用例的最长公共子序列,分别将待保存测试用例和最新测试用例与最长公共子序列进行比对,将待保存测试用例与最长公共子序列之间不同的数据,以及最新测试用例与最长公共子序列之间不同的数据,确定为至少一个差异数据,然后根据至少一个差异数据与最长公共子序列,确定与差异数据对应的差异类型。In a possible implementation manner, the test case to be saved and the latest test case may be compared to determine the longest common subsequence of the test case to be saved and the latest test case, and the test case to be saved and the latest test case are compared with the latest test case respectively. The longest common subsequence is compared, and the different data between the test case to be saved and the longest common subsequence, as well as the different data between the latest test case and the longest common subsequence, are determined as at least one difference data, and then A difference type corresponding to the difference data is determined according to the at least one difference data and the longest common subsequence.
具体的,本申请实施例中,可以通过Myers差分算法,确定待保存测试用例与最新测试用例的至少一个差异数据,以及与每个差异数据对应的差异类型。Specifically, in the embodiment of the present application, at least one difference data between the test case to be saved and the latest test case, and the difference type corresponding to each difference data can be determined by the Myers difference algorithm.
其中,Myers差分算法,是一种文本差异比对的算法,通过比对新、旧两个数据集的差异,生成旧数据到新数据的最小变动。主要是解决最长公共子序列(Longest Common Subsequence,LCS)的问题。Among them, the Myers difference algorithm is a text difference comparison algorithm. By comparing the differences between the new and old data sets, the minimum change from the old data to the new data is generated. Mainly to solve the longest common subsequence (Longest Common Subsequence, LCS) problem.
具体的,服务器首先将待保存测试用例和最新测试用例按每一行内容拆分成字符串,从而得到两个数据集,分别是源数据集original和修订数据集revised。然后使用Google DiffUtils框架工具类中实现的Myers差分算法处理上述数据集,即输入源数据集original和修订数据集revised,经过算法运算后,可以获取到两个数据集中每行字符串的LCS,从而可以获取到每行差异信息Delta列表。每行差异信息Delta列表中包括了每行源数据集original比较的不同的字符串集合original diff和每行修订数据集revised比较的不同的字符串集合revised diff和每行开始的位置position,然后再根据比较的差异字符串信息得出操作类型,也即差异类型。Specifically, the server first splits the test case to be saved and the latest test case into strings according to the content of each line, thereby obtaining two data sets, namely the original data set original and the revised data set revised. Then use the Myers difference algorithm implemented in the Google DiffUtils framework tool class to process the above data sets, that is, the input source data set original and the revised data set revised. After the algorithm operation, the LCS of each line of strings in the two data sets can be obtained, thus You can get the Delta list of difference information for each line. Each line of difference information Delta list includes a different string set original diff compared with each line of source data set original diff and a different string set revised diff compared with each line revised data set revised diff and the starting position of each line, and then The operation type is obtained according to the compared difference string information, that is, the difference type.
其中,Google DiffUtils框架工具类是Google提供的一个Myers差分算法实现工具类。通过比对两个数据集,返回差异信息Deltas对象列表。Deltas对象包括了源数据和比较数据的每行字符内容和字符的position,和比较得出的操作类型,例如新增、修改和删除等。Among them, the Google DiffUtils framework tool class is a Myers difference algorithm implementation tool class provided by Google. By comparing two datasets, return a list of difference information Deltas objects. The Deltas object includes the character content and character position of each line of the source data and the comparison data, and the operation type obtained from the comparison, such as adding, modifying, and deleting.
举例来说,若待保存测试用例为“abcdefg”,最新测试用例为“defghjk”,通过将待保存测试用例与最新测试用例进行比对,确定出待保存测试用例与最新测试用例的最长公共子序列LCS为“defg”,然后将LCS与待保存测试用例“abcdefg”相比,差异数据为“abc”,且差异类型为删除类型,将LCS与最新测试用例“defghjk”相比,差异数据为“hjk”,且差异类型为增加类型。For example, if the test case to be saved is "abcdefg" and the latest test case is "defghjk", by comparing the test case to be saved with the latest test case, the longest common value between the test case to be saved and the latest test case is determined. The subsequence LCS is "defg", then the LCS is compared with the test case "abcdefg" to be saved, the difference data is "abc", and the difference type is the deletion type, and the LCS is compared with the latest test case "defghjk", the difference data is is "hjk", and the difference type is the increase type.
进一步的,可以预先在服务器中新建insertList增加类型、deleteList删除类型和changeList修改类型的列表,其分别用于保存分类的信息。在获取到差异数据之后,可以循环遍历每个差异数据以及对应的差异类型,将每个差异数据分别存储到对应的列表中,以供用户后续进行查看,从而可以方便用户操作,提高用户体验。Further, a list of the insertList addition type, the deleteList deletion type and the changeList modification type can be newly created in the server in advance, which are respectively used to save the classification information. After the difference data is obtained, each difference data and the corresponding difference type can be traversed in a loop, and each difference data is stored in a corresponding list for subsequent viewing by the user, thereby facilitating user operations and improving user experience.
在本实施例中,由于Myers差分算法在对大量数据进行处理时具有较高的性能,因此,服务器通过Myers差分算法确定出待保存测试用例与最新测试用例之间的至少一个差异数据,以及与差异数据对应的差异类型,不仅可以提高差异数据和差异类型确定的效率,而且可以提高准确性。In this embodiment, since the Myers difference algorithm has high performance when processing a large amount of data, the server determines, through the Myers difference algorithm, at least one difference data between the test case to be saved and the latest test case, and the difference between the test case and the latest test case. The difference type corresponding to the difference data can not only improve the efficiency of determining the difference data and the difference type, but also improve the accuracy.
步骤203:服务器向第一终端设备发送第一消息,该第一消息中包括差异数据和差异类型。Step 203: The server sends a first message to the first terminal device, where the first message includes difference data and a difference type.
在本步骤中,服务器在确定出待保存测试用例与最新测试用例的至少一 个差异数据以及与每个差异数据对应的差异类型后,为了使用户能通过终端设备直观的浏览其他用户对基础测试用例所作的修改,以及其他用户和该用户所修改内容之间的差异数据以及差异类型,服务器可以将确定出的差异数据以及对应的差异类型携带在第一消息中发送给第一终端设备。In this step, after the server determines at least one difference data between the test case to be saved and the latest test case and the difference type corresponding to each difference data, in order to enable the user to intuitively browse the basic test case by other users through the terminal device For the modifications made, as well as the difference data and difference types between other users and the content modified by the user, the server may send the determined difference data and corresponding difference types in the first message to the first terminal device.
示例性的,为了使不同差异类型的差异数据,以不同形式显示在第一终端设备上,服务器需要根据差异类型对差异数据进行处理。例如可以以不同的颜色显示不同类型的差异数据,如删除类型的差异数据,可以显示为红色,增加类型的差异数据,可以显示为绿色,修改类型的差异数据,可以显示为蓝色等。应理解,对于待保存测试用例和最新测试用例之间的相同数据,可以正常显示。Exemplarily, in order to display the difference data of different difference types on the first terminal device in different forms, the server needs to process the difference data according to the difference types. For example, different types of difference data can be displayed in different colors. For example, the difference data of the deletion type can be displayed in red, the difference data of the added type can be displayed in green, the difference data of the modified type can be displayed in blue, etc. It should be understood that the same data between the test case to be saved and the latest test case can be displayed normally.
如果以绿色显示增加类型的差异数据时,服务器可以通过如下方式对差异数据进行处理:If the difference data of increasing type is displayed in green, the server can process the difference data in the following ways:
INSERT_TAG_BEGIN="<span style='background:rgba(0,191,165,0.16);display:inline-block'>";INSERT_TAG_BEGIN="<span style="background:rgba(0,191,165,0.16);display:inline-block'>";
INSERT_TAG_END="</span>";INSERT_TAG_END="</span>";
如果以红色显示删除类型的差异数据时,服务器可以通过如下方式对差异数据进行处理:If the difference data of deletion type is displayed in red, the server can process the difference data in the following ways:
DELETE_TAG_BEGIN="<span style='background:rgba(226,59,59,0.16);display:inline-block'>";DELETE_TAG_BEGIN="<span style="background:rgba(226,59,59,0.16);display:inline-block'>";
DELETE_TAG_END="</span>"DELETE_TAG_END="</span>"
另外,如果是删除类型,可以选择dalta中original diff的字符列表,并在每个字符前后加上DELETE_TAG_BEGIN和DELET_TAG_END。In addition, if it is a deletion type, you can select the character list of the original diff in dalta, and add DELETE_TAG_BEGIN and DELET_TAG_END before and after each character.
如果是增加类型,可以选择dalta中revised diff的字符列表,并在每个字符前后加上INSERT_TAG_BEGIN和INSERT_TAG_END。If it is an increase type, you can select the character list of revised diff in dalta, and add INSERT_TAG_BEGIN and INSERT_TAG_END before and after each character.
如果是修改类型,可以选择dalta里面original diff和revised diff字符列表,并分别处理两者的删除和新增的内容标记。If it is a modification type, you can select the original diff and revised diff character lists in dalta, and deal with the deletion and new content marks of the two respectively.
服务器将所有处理完成的字符列表通过position字段按顺序拼接生成新的内容,以发送给第一终端设备。The server splices all processed character lists in sequence through the position field to generate new content, and sends it to the first terminal device.
示例性的,第一终端设备在接收到第一消息后,会对第一消息中的差异数据进行解析处理,并根据差异类型的不同,采用不同的方式显示差异数据。Exemplarily, after receiving the first message, the first terminal device parses and processes the difference data in the first message, and displays the difference data in different ways according to different types of differences.
例如,图4为差异数据的显示示意图,假设待保存测试用例为“abcdefg”, 最新测试用例为“defghjk”,且确定出待保存测试用例与LCS相比,差异数据为“abc”,且差异类型为删除类型,最新测试用例与LCS相比,差异数据为“hjk”,且差异类型为增加类型。如图4所示,第一终端设备会将差异数据进行拼接显示,如删除类型的差异数据,可以以斜线为背景进行显示,增加类型的差异数据,可以以横线为背景进行显示,同样的,修改类型的差异数据,可以以其他背景进行显示,只要能和删除类型和增加类型的数据进行区分即可。当然,还可以以其他方式区分不同的差异数据以及差异类型,例如,可以根据差异类型,采用不同的颜色进行显示,如删除类型的差异数据,可以显示为红色,增加类型的差异数据,可以显示为绿色,修改类型的差异数据,可以显示为蓝色等。应理解,对于待保存测试用例和最新测试用例之间的相同数据,可以正常显示。For example, Fig. 4 is a schematic diagram of the display of difference data, assuming that the test case to be saved is "abcdefg", the latest test case is "defghjk", and it is determined that the difference data between the test case to be saved and LCS is "abc", and the difference The type is the deletion type, the difference data of the latest test case compared with the LCS is "hjk", and the difference type is the addition type. As shown in Figure 4, the first terminal device will splicing and display the difference data. For example, the difference data of the deletion type can be displayed with a diagonal line as the background, and the difference data of the added type can be displayed with the horizontal line as the background. Yes, the difference data of the modification type can be displayed in other backgrounds, as long as it can be distinguished from the data of the deletion type and the addition type. Of course, different difference data and difference types can also be distinguished in other ways. For example, different colors can be used to display according to the difference type. For example, the difference data of the deletion type can be displayed in red, and the difference data of the added type can be displayed. In green, the difference data of the modification type can be displayed in blue, etc. It should be understood that the same data between the test case to be saved and the latest test case can be displayed normally.
步骤204:第一终端设备确定目标差异数据和与目标差异数据对应的目标差异类型,该目标差异数据为至少一个差异数据中的数据。Step 204: The first terminal device determines target difference data and a target difference type corresponding to the target difference data, where the target difference data is data in at least one difference data.
在本步骤中,第一终端设备在接收到差异数据之后,可以向用户显示该差异数据和对应的差异类型,用户根据自己的需求,选择想要保留的数据,因此,会通过显示界面触发第一操作指令,该第一操作指令中包括用户从至少一个差异数据中选择的目标差异数据,以及与该目标差异数据所对应的目标差异类型。In this step, after receiving the difference data, the first terminal device can display the difference data and the corresponding difference type to the user, and the user can select the data that he wants to keep according to his own needs. Therefore, the first terminal device will be triggered through the display interface. An operation instruction, the first operation instruction includes target difference data selected by the user from at least one difference data, and a target difference type corresponding to the target difference data.
例如,继续参照图4b所示,用户想要将差异数据“hjk”保留在最终的测试用例中,则可以将差异数据“hjk”确定为目标差异数据,且该目标差异数据的差异类型为增加类型。用户通过点击“hjk”,以触发第一操作指令。当然,用户还可以通过长按或者其他操作方式,触发该第一操作指令。For example, continuing to refer to Figure 4b, if the user wants to keep the difference data "hjk" in the final test case, the difference data "hjk" can be determined as the target difference data, and the difference type of the target difference data is increase type. The user triggers the first operation instruction by clicking "hjk". Of course, the user can also trigger the first operation instruction by long pressing or other operation methods.
另外,第一终端设备在接收到差异数据和差异类型之后,还可以是通过预设的规则,从差异数据中确定出目标差异数据以及与该目标差异数据对应的目标差异类型。例如,将所有差异类型为增加类型的差异数据,确定为目标差异类型等等。In addition, after receiving the difference data and the difference type, the first terminal device may also determine the target difference data and the target difference type corresponding to the target difference data from the difference data through a preset rule. For example, all the difference data whose difference type is an increase type are determined as the target difference type, and so on.
步骤205:第一终端设备向服务器发送第二消息,该第二消息中包括目标差异数据和与目标差异数据对应的目标差异类型。Step 205: The first terminal device sends a second message to the server, where the second message includes target difference data and a target difference type corresponding to the target difference data.
在本步骤中,第一终端设备在确定出目标差异数据和对应的目标差异类型后,会向服务器发送第二消息。In this step, after determining the target difference data and the corresponding target difference type, the first terminal device will send a second message to the server.
示例性的,第一终端设备在接收到用户触发的第一操作指令之后,将用 户选择的目标差异数据和目标差异数据对应的目标差异类型携带在第二消息中发送给服务器。其中,目标差异数据可以包括部分差异数据,也可以包括全部的差异数据。Exemplarily, after receiving the first operation instruction triggered by the user, the first terminal device carries the target difference data selected by the user and the target difference type corresponding to the target difference data in a second message and sends it to the server. The target difference data may include part of the difference data, or may include all the difference data.
示例性的,第一终端设备也可以将根据预设规则确定出的目标差异数据和目标差异数据对应的目标差异类型携带在第二消息中发送给服务器。Exemplarily, the first terminal device may also carry the target difference data determined according to the preset rule and the target difference type corresponding to the target difference data in the second message and send it to the server.
步骤206:服务器根据目标差异数据、目标差异类型和最新测试用例,生成目标测试用例。Step 206: The server generates a target test case according to the target difference data, the target difference type and the latest test case.
在本步骤中,服务器根据接收到的目标差异数据,该目标差异数据对应的目标差异类型以及数据库中已保存的最新测试用例,生成目标测试用例,并将该目标测试用例进行保存。由于测试人员可以根据自己的需求从至少一个差异数据中选择目标差异数据进行保存,而不是采用后保存的测试用例覆盖在先保存的测试用例,因此,可以提高目标测试用例的准确性。In this step, the server generates a target test case according to the received target difference data, the target difference type corresponding to the target difference data, and the latest test case saved in the database, and saves the target test case. Since the tester can select the target difference data from at least one difference data to save according to their own needs, instead of using the test case saved later to cover the test case saved earlier, the accuracy of the target test case can be improved.
在一种可能的实现方式中,服务器在生成目标测试用例时,若确定出与目标差异类型对应的目标差异数据为最新测试用例中的数据,则将最新测试用例确定为目标测试用例。In a possible implementation manner, when the server generates the target test case, if the target difference data corresponding to the target difference type is determined as the data in the latest test case, the latest test case is determined as the target test case.
具体的,若目标差异数据为最新测试用例中对基础测试用例进行修改后得到的数据,此时,说明用户想要保存的差异数据,全部是最新测试用例中的数据,因此,可以将最新测试用例确定为目标测试用例。Specifically, if the target difference data is the data obtained by modifying the basic test case in the latest test case, at this time, it means that the difference data that the user wants to save is all the data in the latest test case. Therefore, the latest test case can be Use cases are identified as target test cases.
示例性的,若确定出与目标差异类型对应的目标差异数据为待保存测试用例中的数据,则在最新测试用例中,对目标差异数据进行与目标差异类型对应的操作,以生成目标测试用例。Exemplarily, if it is determined that the target difference data corresponding to the target difference type is the data in the test case to be saved, in the latest test case, an operation corresponding to the target difference type is performed on the target difference data to generate the target test case. .
具体的,若目标差异数据为待保存测试用例中对基础测试用例进行修改后得到的数据,此时,说明用户想要保存的差异数据,全部是待保存测试用例中的数据,此时,可以在最新测试用例中,对目标差异数据进行与目标差异类型对应的操作。例如,若目标差异类型为增加类型,则可以在最新测试用例中新增该目标差异数据,若目标差异类型为删除类型,则可以在最新测试用例中删除该目标差异数据,若目标差异类型为修改类型,则可以在最新测试用例中对该目标差异数据进行修改。Specifically, if the target difference data is the data obtained by modifying the basic test case in the test case to be saved, at this time, it indicates that the difference data that the user wants to save is all the data in the test case to be saved. In the latest test case, the operation corresponding to the target difference type is performed on the target difference data. For example, if the target difference type is an add type, you can add the target difference data in the latest test case. If the target difference type is a delete type, you can delete the target difference data in the latest test case. If the target difference type is Modification type, the target difference data can be modified in the latest test case.
示例性的,若确定出目标差异数据中的第一数据为最新测试用例中的数据,且第二数据为待保存测试用例中的数据,则在最新测试用例中保持第一数据以及与第一数据对应的差异类型不变,且在最新测试用例中,对第二数 据进行与第二数据的差异类型对应的操作,以生成目标测试用例。Exemplarily, if it is determined that the first data in the target difference data is the data in the latest test case, and the second data is the data in the test case to be saved, then keep the first data and the first data in the latest test case. The difference type corresponding to the data remains unchanged, and in the latest test case, an operation corresponding to the difference type of the second data is performed on the second data to generate the target test case.
具体的,若第一终端设备确定出的目标差异数据中包括多个数据,其中一部分第一数据为最新测试用例中的数据,则服务器将保持这部分差异数据不变,也即在最新测试用例中继续保留这部分第一数据。另外一部分第二数据为待保存测试用例中的数据,则服务器将会根据第二数据对应的差异类型,在最新测试用例中对第二数据进行对应的操作,如增加、删除或修改,从而生成目标测试用例。Specifically, if the target difference data determined by the first terminal device includes multiple data, and a part of the first data is the data in the latest test case, the server will keep this part of the difference data unchanged, that is, in the latest test case continue to retain this part of the first data. Another part of the second data is the data in the test case to be saved, then the server will perform corresponding operations on the second data in the latest test case according to the difference type corresponding to the second data, such as adding, deleting or modifying, thereby generating target test case.
在本实施例中,服务器可以根据第一终端设备确定出的目标差异数据、该目标差异数据对应的目标差异类型以及最新测试用例,生成目标测试用例,由此可以提高目标测试用例的准确性。另外,若目标差异数据中的第一数据为最新测试用例中的数据,且第二数据为待保存测试用例中的数据时,生成的目标测试用例中包括有用户自己修改的数据,也包括有其他用户所修改的数据,从而避免了后保存的测试用例直接覆盖之前保存的测试用例的现象。In this embodiment, the server can generate the target test case according to the target difference data determined by the first terminal device, the target difference type corresponding to the target difference data, and the latest test case, thereby improving the accuracy of the target test case. In addition, if the first data in the target difference data is the data in the latest test case, and the second data is the data in the test case to be saved, the generated target test case includes the data modified by the user himself, and also includes Data modified by other users, thus avoiding the phenomenon that the later saved test case directly overwrites the previously saved test case.
本申请实施例提供的测试用例的处理方法,在检测到基础测试用例处于未加锁状态时,通过获取待保存测试用例和数据库中已保存的最新测试用例,并确定待保存测试用例与最新测试用例的至少一个差异数据,以及与差异数据对应的差异类型,然后向第一终端设备发送第一消息,该第一消息中包括差异数据和差异类型通过接收第一终端设备发送的第二消息,该第二消息中包括目标差异数据和与目标差异数据对应的目标差异类型,并根据目标差异数据、目标差异类型和最新测试用例,生成目标测试用例。由于服务器在保存待保存测试用例时,通过确定待保存测试用例与最新测试用例的至少一个差异数据,并根据第一终端设备从至少一个差异数据中确定出的目标差异数据以及对应的目标差异类型,生成目标测试用例,从而避免了现有技术中直接采用后保存的测试用例覆盖之前保存的测试用例的现象,而且可以选择性的对差异数据进行保存,从而可以提高目标测试用例的准确性。In the test case processing method provided by the embodiment of the present application, when it is detected that the basic test case is in an unlocked state, the test case to be saved and the latest test case saved in the database are obtained by obtaining the test case to be saved and the latest test case to be saved. at least one difference data of the use case, and the difference type corresponding to the difference data, and then send a first message to the first terminal device, the first message includes the difference data and the difference type by receiving the second message sent by the first terminal device, The second message includes the target difference data and the target difference type corresponding to the target difference data, and generates the target test case according to the target difference data, the target difference type and the latest test case. Since the server determines at least one difference data between the test case to be saved and the latest test case when saving the test case to be saved, and determines the target difference data from the at least one difference data by the first terminal device and the corresponding target difference type , to generate target test cases, thereby avoiding the phenomenon in the prior art that the previously saved test cases are directly used after being used to cover the previously saved test cases, and the difference data can be selectively saved, thereby improving the accuracy of the target test cases.
图5为本申请实施例提供的一种测试用例的处理方法的另一信令图,图5所示实施例在图2所示实施例的基础上,进一步对多人同时对同一测试用例进行编辑时,如何解决编辑冲突的过程,进行详细说明。如图5所示,本申请实施例提供的测试用例的处理方法包括如下步骤:FIG. 5 is another signaling diagram of a method for processing a test case provided by an embodiment of the present application. On the basis of the embodiment shown in FIG. 2, the embodiment shown in FIG. When editing, the process of how to resolve editing conflicts will be explained in detail. As shown in FIG. 5 , the processing method of the test case provided by the embodiment of the present application includes the following steps:
步骤501:第一终端设备接收用户触发的第三操作指令,该第三操作指令中包括待锁定的基础测试用例的版本标识。Step 501: The first terminal device receives a third operation instruction triggered by the user, where the third operation instruction includes the version identifier of the basic test case to be locked.
具体的,当用户对基础测试用例进行编辑时,第一终端设备会将当前编辑的基础测试用例的版本标识ID curVersionId以及该基础测试用例的数据发送给服务器,以存储到数据库redis中。若用户不想让其他用户同时对该基础测试用例进行编辑时,其可以选择对该基础测试用例进行加锁。图6为触发第三操作指令的示意图,如图6所示,用户正在对测试用例“aabbccdd”进行编辑,其可以根据自己的需求,选择对该测试用例加锁,如可以通过点击“锁定”控件,以触发第三操作指令,该第三操作指令中包括待锁定的基础测试用例的版本标识,如测试用例“aabbccdd”的版本标识curVersionId。Specifically, when the user edits the basic test case, the first terminal device will send the version ID curVersionId of the currently edited basic test case and the data of the basic test case to the server to store in the database redis. If the user does not want other users to edit the basic test case at the same time, he can choose to lock the basic test case. Figure 6 is a schematic diagram of triggering the third operation instruction. As shown in Figure 6, the user is editing the test case "aabbccdd", and he can choose to lock the test case according to his own needs, for example, he can click "Lock" control to trigger a third operation instruction, where the third operation instruction includes the version identifier of the basic test case to be locked, such as the version identifier curVersionId of the test case "aabbccdd".
其中,若用户选择了锁定基础测试用例,则表示当前只能该用户对这一基础测试用例进行编辑,而其他用户只可读不可写,而且在其他用户对应的终端设备的测试用例编辑页面中,将显示该基础测试用例已由用户锁定或者上锁等。Among them, if the user chooses to lock the basic test case, it means that currently only the user can edit the basic test case, while other users can only read but not write, and the test case editing page of the terminal device corresponding to other users is displayed. , it will show that the basic test case has been locked or locked by the user, etc.
步骤502:第一终端设备根据第三操作指令,向服务器发送第四消息,该第四消息中包括待锁定的基础测试用例的版本标识。Step 502: The first terminal device sends a fourth message to the server according to the third operation instruction, where the fourth message includes the version identifier of the basic test case to be locked.
在本步骤中,第一终端设备在接收到用户触发的第三操作指令之后,会将待锁定的基础测试用例的版本标识携带在第四消息中发送给服务器。In this step, after receiving the third operation instruction triggered by the user, the first terminal device will carry the version identifier of the basic test case to be locked in a fourth message and send it to the server.
步骤503:服务器根据第四消息,在检测到第一终端设备对应的基础测试用例处于加锁状态时,向除第一终端设备之外的第二终端设备发送锁定消息,该锁定消息中包括待锁定的基础测试用例的版本标识,锁定消息用于指示第二终端设备将第二终端设备对应的待锁定的基础测试用例设置为锁定状态。Step 503: According to the fourth message, the server, when detecting that the basic test case corresponding to the first terminal device is in a locked state, sends a locking message to the second terminal device other than the first terminal device, where the locking message includes the pending test case. The version identifier of the locked basic test case, and the locking message is used to instruct the second terminal device to set the to-be-locked basic test case corresponding to the second terminal device to a locked state.
在本步骤中,服务器根据接收到的第四消息,若确定出基础测试用例处于锁定状态,则说明用户此时不想让其他用户编辑该基础测试用例,因此,会将待锁定的基础测试用例的版本标识携带在锁定消息中发送给第二终端设备,这样,第二终端设备会将待锁定的基础测试用例设置为锁定状态。测试人员将无法通过第二终端设备对已经锁定的基础测试用例进行编辑,而只能查看该锁定的基础测试用例。In this step, if the server determines that the basic test case is in the locked state according to the fourth message received, it means that the user does not want other users to edit the basic test case at this time. The version identifier is carried in the lock message and sent to the second terminal device. In this way, the second terminal device will set the basic test case to be locked into a locked state. The tester will not be able to edit the locked basic test case through the second terminal device, but can only view the locked basic test case.
在本实施例中,用户可以根据自己的需求,将待锁定的基础测试用例进行锁定,这样,其他用户将无法编辑该待锁定的基础测试用例,由此可以避免测试用例出现数据冲突的现象。In this embodiment, the user can lock the basic test case to be locked according to his own needs, so that other users cannot edit the basic test case to be locked, thereby avoiding the phenomenon of data conflict in the test case.
进一步的,在满足预设条件时,服务器会向第二终端设备发送解锁消息,该解锁消息中包括处于锁定状态的基础测试用例的版本标识,该解锁消息用 于指示生成第一数值,并指示第二终端设备在判断出第一数值与预先存储的第二数值相同时将处于锁定状态的基础测试用例解锁;该预设条件包括处于锁定状态的基础测试用例的锁定时长超过预设时长,和/或,接收到第一终端设备发送的第五消息,该第五消息用于表示对处于锁定状态的基础测试用例进行保存。Further, when the preset conditions are met, the server will send an unlock message to the second terminal device, the unlock message includes the version identifier of the basic test case in the locked state, the unlock message is used to instruct the generation of the first value, and indicates The second terminal device unlocks the basic test case in the locked state when judging that the first value is the same as the pre-stored second value; the preset condition includes that the locking duration of the basic test case in the locked state exceeds the preset duration, and /or, a fifth message sent by the first terminal device is received, where the fifth message is used to indicate that the basic test case in the locked state is saved.
具体的,服务器可以是在通过webSocket监控出处于加锁状态的基础测试用例的锁定时长超过预设时长时,将会向第二终端设备发送解锁消息,这样,第二终端设备会根据该解锁消息,对处于锁定状态的基础测试用例解锁,由此可以防止该测试用例一直被一个用户所编辑的现象,从而可以提高用户的体验。Specifically, the server may send an unlocking message to the second terminal device when monitoring through webSocket that the locking duration of the basic test case in the locked state exceeds the preset duration, so that the second terminal device will send an unlocking message to the second terminal device according to the unlocking message. , to unlock the basic test case in the locked state, thereby preventing the phenomenon that the test case has been edited by a user all the time, thereby improving the user experience.
另外,若用户对处于锁定状态的基础测试用例编辑完成后,可以触发第四操作指令,以对该编辑完成的基础测试用例进行保存。第一终端设备在接收到用户触发的第四操作指令后,会向服务器发送第五消息,服务器根据接收到的第五消息,向第二终端设备发送解锁消息,这样,第二终端设备会根据该解锁消息,对处于锁定状态的测试用例解锁,由此可以使其他用户可以继续对该测试用例进行编辑,提高了用户的体验。In addition, if the user finishes editing the basic test case in the locked state, a fourth operation instruction may be triggered to save the edited basic test case. After receiving the fourth operation instruction triggered by the user, the first terminal device will send a fifth message to the server, and the server will send an unlock message to the second terminal device according to the received fifth message, so that the second terminal device will send an unlock message to the second terminal device according to the received fifth message. The unlock message unlocks the test case in the locked state, so that other users can continue to edit the test case, which improves the user experience.
另外,上述预设条件也可以是服务器通过webSocket监控出处于锁定状态的测试用例的锁定时长超过预设时长,以及接收到第一终端设备发送的第五消息时,向第二终端设备发送解锁消息。In addition, the above-mentioned preset condition may also be that the server monitors through webSocket that the lock duration of the test case in the locked state exceeds the preset duration, and when receiving the fifth message sent by the first terminal device, the server sends an unlock message to the second terminal device .
进一步的,该预设条件还可以包括服务器通过webSocket监控出第一终端设备退出了对处于锁定状态的测试用例进行编辑的界面。Further, the preset condition may further include that the server monitors through the webSocket that the first terminal device exits the interface for editing the test case in the locked state.
下面,对服务器实现分布式锁以及解锁的方式进行说明,其中,分布式锁是指当在分布式的系统下,数据只有一份(或有限制),此时需要利用锁的技术控制某一时刻修改数据的进程数。The following describes how the server implements distributed locks and unlocks. Among them, distributed locks refer to when there is only one copy (or limited) of data in a distributed system, and the lock technology needs to be used to control a certain The number of processes that modify data at any time.
具体的,服务器可以基于redis实现分布式锁,示例性的,可以基于如下redis命令来实现:SET key value[EX seconds][PX milliseconds][NX|XX],其中,EX seconds表示过期时间,单位为秒,PX milliseconds表示过期时间,单位为毫秒,NX为仅当key不存在时设置值,XX为仅当key存在时设置值。Specifically, the server can implement distributed locks based on redis. Exemplarily, it can be implemented based on the following redis commands: SET key value[EX seconds][PX milliseconds][NX|XX], where EX seconds represents the expiration time, in units of is seconds, PX milliseconds represents the expiration time in milliseconds, NX is the value set only when the key does not exist, and XX is the value set only when the key exists.
其实现思想为:获取锁的时候,把待锁定测试用例的版本标识Id加上“_LOCK”拼接作为key,锁的value值是随机生成的唯一识别码(Universally Unique Identifier,UUID),通过该value值可以在释放锁的时候判断该锁是否 是自己的。另外,通过设置参数NX,并为锁添加一个超时时间expire Time Units,如果监控出锁定状态超时,则自动释放锁,也即长时间没有操作或者编辑锁定后的测试用例时,将自动释放锁。The implementation idea is: when acquiring the lock, the version ID of the test case to be locked is spliced with "_LOCK" as the key, and the value of the lock is a randomly generated unique identifier (Universally Unique Identifier, UUID). The value can determine whether the lock is own when the lock is released. In addition, by setting the parameter NX, and adding a timeout time expire Time Units to the lock, if the monitoring of the lock status is overtime, the lock will be released automatically, that is, when there is no operation for a long time or the locked test case is edited, the lock will be released automatically.
第二终端设备在释放锁时,会随机生成第一数值value值,在判断出该第一数值与预先存储的第二数值相同时,可以确定出该锁时自己的,从而执行释放锁的操作。本申请中在释放锁时,并不是直接用删除key这种方式,因为直接删除key的方式,会导致所有的第二终端设备都会解锁,从而导致某些不需要解锁的测试用例被解锁,造成用户体验不好。When the second terminal device releases the lock, it will randomly generate the first value value. When it is judged that the first value is the same as the second value stored in advance, it can determine that the lock is its own, so as to execute the operation of releasing the lock. . In this application, when releasing the lock, the method of deleting the key is not directly used, because the method of directly deleting the key will cause all the second terminal devices to be unlocked, which will cause some test cases that do not need to be unlocked to be unlocked, resulting in Bad user experience.
示例性的,图6为对待锁定测试用例进行加锁和解锁的示意图,如图6所示,若该系统中包括分布式服务器集群,也即包括多个服务器A、B和C,该分布式服务器集群中的redis组件可以缓存测试用例的版本信息以及测试用例的内容。服务器集群会根据待锁定测试用例的版本标识和用户标识(ID),从服务器集群中确定一台服务器与第一终端设备建立webSocket连接,例如可以确定服务器B与第一终端设备建立webSocket连接。服务器B可以根据onOpen存储建立连接的webSocket,并根据测试用例的版本信息获取redis中的测试用例的内容,并发送给第一终端设备。另外,还可以根据onClose移除建立的webSocket连接,并存储测试用例的版本信息的解锁信息,并存储到redis,同时会向第二终端设备发送解锁消息。服务器B还可以根据onMessage监听第一终端设备发送的信息,并对redis中的测试用例上锁或者解锁,例如监听第一终端设备当前是否退出对测试用例的编辑,或者是否触发了对测试用例的保存消息,或者监听用户通过第一终端设备对该测试用例的编辑时间是否超时等等。Exemplarily, Fig. 6 is a schematic diagram of locking and unlocking the test case to be locked. As shown in Fig. 6, if the system includes a distributed server cluster, that is, includes multiple servers A, B and C, the distributed The redis component in the server cluster can cache the version information of the test case and the content of the test case. The server cluster will determine a server from the server cluster to establish a webSocket connection with the first terminal device according to the version identification and user identification (ID) of the test case to be locked. For example, it can be determined that server B establishes a webSocket connection with the first terminal device. Server B can store the connected webSocket according to onOpen, obtain the content of the test case in redis according to the version information of the test case, and send it to the first terminal device. In addition, the established webSocket connection can also be removed according to onClose, and the unlock information of the version information of the test case is stored, and stored in redis, and an unlock message is sent to the second terminal device at the same time. Server B can also monitor the information sent by the first terminal device according to onMessage, and lock or unlock the test case in redis, for example, monitor whether the first terminal device currently quits editing the test case, or whether the test case is triggered Save the message, or monitor whether the editing time of the test case by the user through the first terminal device times out, and so on.
对于第一终端设备来说,其在和服务器建立webSocket连接时,首先需要对该webSocket进行初始化。示例性的,可以通过如下方式实现webSocket初始化:webSocket=new webSocket(SocketUrl+“/webSocket/”+contentId+“/”+username)。初始化完成之后,会通过webSocket.onMessage监听服务器发送的待锁定的基础测试用例的状态信息,并根据该待锁定的基础测试用例的状态信息显示是否需要上锁。另外,还可以通过webSocket.send(待锁定测试用例的状态信息)发送待锁定的基础测试用例的状态信息给服务器,以通知服务器该待锁定的基础测试用例需要上锁,或者可以通过webSocket.send(处于锁定状态的测试用例的状态信息)发送处于锁定状态的基础测试用例的状态 信息给服务器,以通知服务器该处于锁定状态的基础测试用例需要解锁。进一步的,第一终端设备还可以通过webSocket.onclose来监听服务器的状态,以处理服务器中断后的断线重连操作。For the first terminal device, when establishing a webSocket connection with the server, the webSocket needs to be initialized first. Exemplarily, webSocket initialization may be implemented in the following manner: webSocket=new webSocket(SocketUrl+“/webSocket/”+contentId+“/”+username). After the initialization is completed, it will monitor the status information of the basic test case to be locked sent by the server through webSocket.onMessage, and display whether it needs to be locked according to the status information of the basic test case to be locked. In addition, you can also send the status information of the basic test case to be locked to the server through webSocket.send (status information of the test case to be locked) to notify the server that the basic test case to be locked needs to be locked, or you can use webSocket.send (Status information of the test case in the locked state) Send the state information of the basic test case in the locked state to the server to notify the server that the basic test case in the locked state needs to be unlocked. Further, the first terminal device can also monitor the state of the server through webSocket.onclose, so as to process the disconnection and reconnection operation after the server is interrupted.
在本申请实施例中,服务器在检测到第一终端设备对应的基础测试用例处于加锁状态时,可以控制将第二终端设备上的基础测试用例进行锁定,从而可以避免多个用户同时对同一基础测试用例进行编辑时,造成数据冲突的现象。进一步的,在确定出满足预设条件时,服务器会向第二终端设备发送解锁消息,以将处于锁定状态的基础测试用例解锁,从而可以保证其他用户也可以继续对该基础测试用例进行编辑,提高了用户的体验。In this embodiment of the present application, when detecting that the basic test case corresponding to the first terminal device is in a locked state, the server may control to lock the basic test case on the second terminal device, thereby preventing multiple users from simultaneously When the basic test case is edited, the phenomenon of data conflict is caused. Further, when it is determined that the preset condition is met, the server will send an unlock message to the second terminal device to unlock the basic test case in the locked state, so as to ensure that other users can also continue to edit the basic test case. Improve user experience.
进一步的,在上述各实施例的基础上,还可以将每个用户修改的测试用例版本均进行保存,这样,用户可以根据版本标识查询出所有用户修改的历史版本测试用例的数据。示例性的,若用户选择回滚查看之前的某个版本的测试用例时,服务器将会复制该历史版本的测试用例的数据,并生成新的测试用例,从而创建测试用例内容,并保存为新的版本标识。Further, on the basis of the above embodiments, the version of the test case modified by each user can also be saved, so that the user can query the data of all historical versions of the test case modified by the user according to the version identifier. Exemplarily, if the user chooses to roll back and view a test case of a previous version, the server will copy the test case data of the historical version and generate a new test case, thereby creating the test case content and saving it as a new test case. version ID.
在本实施例中,不仅可以根据差异数据生成目标测试用例,而且可以将所有用户所修改的测试用例均进行保存,这样用户可以方便的查看任意历史版本的测试用例,由此可以提高用户的体验。In this embodiment, not only can the target test case be generated according to the difference data, but also all the test cases modified by the user can be saved, so that the user can conveniently view the test cases of any historical version, thereby improving the user experience .
图7为本申请实施例提供的一种测试用例的处理方法的另一信令图,如图7所示,该方法包括:FIG. 7 is another signaling diagram of a method for processing a test case provided by an embodiment of the present application. As shown in FIG. 7 , the method includes:
步骤701:第一终端设备接收用户触发的第五操作指令,该第五操作指令用于指示是否需要对测试用例进行锁定。Step 701: The first terminal device receives a fifth operation instruction triggered by the user, where the fifth operation instruction is used to indicate whether the test case needs to be locked.
其中,用户可以通过第一终端设备对测试用例进行编辑,若用户根据自己需求,需要对该待锁定测试用例进行单人编辑时,可以向第一终端设备发送第五操作指令,该第五操作指令用于指示需要对测试用例进行锁定,且该第五操作指令中包括待锁定测试用例的版本标识,其中,该第五操作指令的触发方式与实现原理与前述实施例中的第三操作指令类似,此处不再赘述。The user can edit the test case through the first terminal device. If the user needs to edit the test case to be locked by one person according to his own needs, he can send a fifth operation instruction to the first terminal device. The fifth operation instruction The instruction is used to indicate that the test case needs to be locked, and the fifth operation instruction includes the version identifier of the test case to be locked, wherein the triggering method and implementation principle of the fifth operation instruction are the same as the third operation instruction in the foregoing embodiment. similar, and will not be repeated here.
若第五操作指令用于指示不需要对测试用例进行锁定,则说明该测试用例允许多人同时进行编辑。If the fifth operation instruction is used to indicate that the test case does not need to be locked, it means that the test case allows multiple people to edit at the same time.
其中,若需要对测试用例进行锁定,则执行步骤702,否则,执行步骤705。Wherein, if the test case needs to be locked, step 702 is performed; otherwise, step 705 is performed.
步骤702:第一终端设备向服务器发送第四消息,该第四消息中包括待锁 定测试用例的版本标识。Step 702: The first terminal device sends a fourth message to the server, where the fourth message includes the version identifier of the test case to be locked.
步骤703:服务器根据第四消息,向除第一终端设备之外的第二终端设备发送锁定消息,该锁定消息中包括待锁定测试用例的版本标识,锁定消息用于指示第二终端设备将待锁定测试用例设置为锁定状态。Step 703: The server sends a lock message to the second terminal device other than the first terminal device according to the fourth message, where the lock message includes the version identifier of the test case to be locked, and the lock message is used to indicate that the second terminal device will Locked test cases are set to locked state.
步骤704:服务器监听是否满足预设条件,在监听到满足预设条件时,向第二终端设备发送解锁消息,该解锁消息中包括处于锁定状态的测试用例的版本标识,解锁消息用于指示第二终端设备将处于锁定状态的测试用例解锁。Step 704: The server monitors whether the preset conditions are met, and when the preset conditions are met, sends an unlock message to the second terminal device, where the unlock message includes the version identifier of the test case in the locked state, and the unlock message is used to indicate the first The second terminal device unlocks the test case in the locked state.
其中,预设条件包括如下至少一个:处于锁定状态的测试用例的锁定时长超过预设时长、接收到第一终端设备发送的第五消息和监听到第一终端设备退出对处于锁定状态的测试用例的编辑界面。The preset conditions include at least one of the following: the lock duration of the test case in the locked state exceeds the preset duration, the fifth message sent by the first terminal device is received, and the test case in the locked state is monitored after the first terminal device exits editing interface.
如果监听到第一终端设备不满足预设条件时,将等待用户通过第一终端设备继续对该测试用例进行编辑,直至满足预设条件时,将对该处于锁定状态的测试用例解锁。If it is monitored that the first terminal device does not meet the preset condition, the user will wait for the user to continue editing the test case through the first terminal device, and when the preset condition is met, the locked test case will be unlocked.
另外,用户通过第一终端设备对编辑完成的测试用例进行保存时,第一终端设备会将编辑完成的测试用例发送给服务器,服务器将为该测试用例创建新版本,并保存该测试用例。In addition, when the user saves the edited test case through the first terminal device, the first terminal device will send the edited test case to the server, and the server will create a new version of the test case and save the test case.
步骤705:第一终端设备向服务器发送第三消息,该第三消息中包括待保存测试用例以及待保存测试用例的版本标识。Step 705: The first terminal device sends a third message to the server, where the third message includes the test case to be saved and the version identifier of the test case to be saved.
其中,若同一个测试用例允许多人同时编辑时,当有用户编辑完成并进行保存时,会通过第一终端设备向服务器发送第三消息。Wherein, if the same test case allows multiple people to edit at the same time, when a user completes the editing and saves it, a third message will be sent to the server through the first terminal device.
步骤706:服务器根据第三消息,获取最新测试用例的版本标识。Step 706: The server obtains the version identifier of the latest test case according to the third message.
步骤707:若服务器确定出待保存测试用例的版本标识与最新测试用例的版本标识不同,则从数据库中获取最新测试用例。Step 707: If the server determines that the version identifier of the test case to be saved is different from the version identifier of the latest test case, the server obtains the latest test case from the database.
其中,若待保存测试用例的版本标识与最新测试用例的版本标识不同,则说明之前已经有用户对该测试用例进行了编辑并保存,也即存在数据冲突,此时,就需要从数据库中获取最新测试用例。Among them, if the version identifier of the test case to be saved is different from the version identifier of the latest test case, it means that a user has edited and saved the test case before, that is, there is a data conflict, at this time, it needs to be obtained from the database. Latest test case.
步骤708:服务器确定待保存测试用例与最新测试用例的至少一个差异数据,以及与差异数据对应的差异类型。Step 708: The server determines at least one difference data between the test case to be saved and the latest test case, and the difference type corresponding to the difference data.
其中,差异类型包括增加类型、删除类型和修改类型中的至少一种。The difference type includes at least one of an addition type, a deletion type, and a modification type.
步骤709:服务器向第一终端设备发送第一消息,该第一消息中包括差异数据和所述差异类型。Step 709: The server sends a first message to the first terminal device, where the first message includes difference data and the difference type.
步骤710:第一终端设备显示差异数据和差异类型。Step 710: The first terminal device displays the difference data and the difference type.
步骤711:第一终端设备接收用户触发的第一操作指令,该第一操作指令中包括目标差异数据和与目标差异数据对应的目标差异类型,目标差异数据为至少一个差异数据中的数据。Step 711: The first terminal device receives a first operation instruction triggered by the user, the first operation instruction includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is data in at least one difference data.
步骤712:第一终端设备根据第一操作指令,向服务器发送第二消息,第二消息中包括目标差异数据和目标差异类型。Step 712: The first terminal device sends a second message to the server according to the first operation instruction, where the second message includes the target difference data and the target difference type.
步骤713:服务器根据目标差异数据、目标差异类型和最新测试用例,生成目标测试用例。Step 713: The server generates a target test case according to the target difference data, the target difference type and the latest test case.
其中,服务器生成目标测试用例之后,会为该目标测试用例创建新的版本标识,并进行保存。Among them, after the server generates the target test case, it will create a new version identifier for the target test case and save it.
本申请实施例提供的测试用例的处理方法,一方面,由于服务器在保存待保存测试用例时,通过确定待保存测试用例与最新测试用例的至少一个差异数据,并根据用户从至少一个差异数据中选择的目标差异数据以及对应的目标差异类型,生成目标测试用例,从而避免了现有技术中直接采用后保存的测试用例覆盖之前保存的测试用例的现象,而且用户会根据自己的需求选择性的对差异数据进行保存,从而可以提高目标测试用例的准确性。另一方面,服务器可以根据用户发送的需求信息,为测试用例加锁,这样可以避免多人同时对同一个测试用例进行编辑时,造成的数据冲突。In the test case processing method provided by the embodiment of the present application, on the one hand, when the server saves the test case to be saved, it determines at least one difference data between the test case to be saved and the latest test case, and selects the difference data from the at least one difference data according to the user. The selected target difference data and the corresponding target difference type are used to generate target test cases, thereby avoiding the phenomenon that the test cases saved before being directly adopted in the prior art overwrite the previously saved test cases, and users can choose according to their own needs. The difference data is saved so that the accuracy of the target test case can be improved. On the other hand, the server can lock the test case according to the demand information sent by the user, which can avoid data conflicts caused when multiple people edit the same test case at the same time.
图8为本申请实施例提供的测试用例的处理装置的一示意图,如图8所示,该测试用例的处理装置80包括:FIG. 8 is a schematic diagram of a processing device for a test case provided by an embodiment of the present application. As shown in FIG. 8 , the processing device 80 for the test case includes:
处理模块801,用于获取待保存测试用例和数据库中已保存的最新测试用例,所述待保存测试用例和所述最新测试用例为分别对基础测试用例进行修改后得到的;The processing module 801 is configured to acquire the test case to be saved and the latest test case saved in the database, the test case to be saved and the latest test case are obtained by modifying the basic test case respectively;
所述处理模块801,还用于确定所述待保存测试用例与所述最新测试用例的至少一个差异数据,以及与所述差异数据对应的差异类型,所述差异类型包括增加类型、删除类型和修改类型中的至少一种;The processing module 801 is further configured to determine at least one difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data, and the difference type includes an addition type, a deletion type, and a difference type. at least one of the modification types;
发送模块802,用于向第一终端设备发送第一消息,所述第一消息中包括所述差异数据和所述差异类型,所述第一消息用于指示所述第一终端设备显示所述差异数据和所述差异类型;A sending module 802, configured to send a first message to a first terminal device, where the first message includes the difference data and the difference type, and the first message is used to instruct the first terminal device to display the difference discrepancy data and the type of discrepancy;
接收模块803,用于接收所述第一终端设备发送的第二消息,所述第二消 息中包括目标差异数据和与所述目标差异数据对应的目标差异类型,所述目标差异数据为所述至少一个差异数据中的数据;A receiving module 803, configured to receive a second message sent by the first terminal device, where the second message includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is the data in at least one difference data;
所述处理模块801,还用于根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。The processing module 801 is further configured to generate a target test case according to the target difference data, the target difference type and the latest test case.
可选的,所述处理模块801,具体用于:Optionally, the processing module 801 is specifically used for:
接收所述第一终端设备发送的第三消息,所述第三消息中包括所述待保存测试用例以及所述待保存测试用例的版本标识;receiving a third message sent by the first terminal device, where the third message includes the test case to be saved and the version identifier of the test case to be saved;
根据所述第三消息,获取所述最新测试用例的版本标识;obtaining the version identifier of the latest test case according to the third message;
若所述待保存测试用例的版本标识与所述最新测试用例的版本标识不同,则从所述数据库中获取所述最新测试用例。If the version identifier of the test case to be saved is different from the version identifier of the latest test case, the latest test case is acquired from the database.
可选的,所述处理模块801,具体用于:Optionally, the processing module 801 is specifically used for:
通过Myers差分算法,确定所述待保存测试用例与所述最新测试用例的至少一个差异数据,以及与所述差异数据对应的差异类型。At least one difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data are determined by the Myers difference algorithm.
可选的,所述处理模块801,具体用于:Optionally, the processing module 801 is specifically used for:
若确定出与所述目标差异类型对应的所述目标差异数据为所述最新测试用例中的数据,则将所述最新测试用例确定为所述目标测试用例;或者,If it is determined that the target difference data corresponding to the target difference type is data in the latest test case, then the latest test case is determined to be the target test case; or,
若确定出与所述目标差异类型对应的所述目标差异数据为所述待保存测试用例中的数据,则在所述最新测试用例中,对所述目标差异数据进行与所述目标差异类型对应的操作,以生成所述目标测试用例;或者,If it is determined that the target difference data corresponding to the target difference type is the data in the test case to be saved, then in the latest test case, the target difference data corresponding to the target difference type is performed operations to generate the target test case; or,
若确定出所述目标差异数据中的第一数据为所述最新测试用例中的数据,且第二数据为所述待保存测试用例中的数据,则在所述最新测试用例中保持所述第一数据以及与所述第一数据对应的差异类型不变,且在所述最新测试用例中,对所述第二数据进行与所述第二数据的差异类型对应的操作,以生成所述目标测试用例。If it is determined that the first data in the target difference data is the data in the latest test case, and the second data is the data in the to-be-saved test case, keep the first data in the latest test case A piece of data and a difference type corresponding to the first data remain unchanged, and in the latest test case, an operation corresponding to the difference type of the second data is performed on the second data to generate the target test case.
可选的,所述接收模块803,还用于接收所述第一终端设备发送的第四消息,所述第四消息中包括待锁定测试用例的版本标识;Optionally, the receiving module 803 is further configured to receive a fourth message sent by the first terminal device, where the fourth message includes a version identifier of the test case to be locked;
所述发送模块802,还用于根据所述第四消息,向除所述第一终端设备之外的第二终端设备发送锁定消息,所述锁定消息中包括所述待锁定测试用例的版本标识,所述锁定消息用于指示所述第二终端设备将所述待锁定测试用例设置为锁定状态。The sending module 802 is further configured to send a lock message to a second terminal device other than the first terminal device according to the fourth message, where the lock message includes the version identifier of the test case to be locked , the lock message is used to instruct the second terminal device to set the to-be-locked test case to a locked state.
可选的,所述发送模块802,还用于在满足预设条件时,向所述第二终端 设备发送解锁消息,所述解锁消息中包括处于锁定状态的测试用例的版本标识,所述解锁消息用于指示所述第二终端设备将所述处于锁定状态的测试用例解锁;所述预设条件包括所述处于锁定状态的测试用例的锁定时长超过预设时长,和/或,接收到所述第一终端设备发送的第五消息,所述第五消息用于表示对所述处于锁定状态的测试用例进行保存。Optionally, the sending module 802 is further configured to send an unlock message to the second terminal device when a preset condition is met, where the unlock message includes the version identifier of the test case in the locked state, and the unlock message The message is used to instruct the second terminal device to unlock the test case in the locked state; the preset condition includes that the locking duration of the test case in the locked state exceeds the preset duration, and/or receiving all The fifth message sent by the first terminal device is used to indicate that the test case in the locked state is saved.
本申请实施例提供的测试用例的处理装置80,可以执行上述任一实施例中的测试用例的处理方法的技术方案,其实现原理以及有益效果与测试用例的处理方法的实现原理及有益效果类似,可参见测试用例的处理方法的实现原理及有益效果,此处不再进行赘述。The test case processing device 80 provided in the embodiment of the present application can execute the technical solution of the test case processing method in any of the above embodiments, and its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the test case processing method , please refer to the implementation principle and beneficial effect of the processing method of the test case, which will not be repeated here.
图9为本申请实施例提供的测试用例的处理装置的一示意图,如图9所示,该测试用例的处理装置90包括:FIG. 9 is a schematic diagram of a processing device for a test case provided by an embodiment of the present application. As shown in FIG. 9 , the processing device 90 for the test case includes:
接收模块901,用于接收服务器发送的第一消息,所述第一消息中包括至少一个差异数据和每个差异数据对应的差异类型,所述差异数据为待保存测试用例与最新测试用例之间的差异数据,所述待保存测试用例和所述最新测试用例为对基础测试用例进行修改后得到的;The receiving module 901 is configured to receive a first message sent by the server, where the first message includes at least one difference data and a difference type corresponding to each difference data, and the difference data is the difference between the test case to be saved and the latest test case The difference data of the test case to be saved and the latest test case are obtained by modifying the basic test case;
显示模块902,用于显示所述差异数据和所述差异类型;a display module 902, configured to display the difference data and the difference type;
所述接收模块901,还用于接收用户触发的第一操作指令,所述第一操作指令中包括目标差异数据和与所述目标差异数据对应的目标差异类型,所述目标差异数据为所述至少一个差异数据中的数据;The receiving module 901 is further configured to receive a first operation instruction triggered by a user, where the first operation instruction includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is the data in at least one difference data;
发送模块903,用于根据所述第一操作指令,向所述服务器发送所述第二消息,所述第二消息中包括所述目标差异数据和所述目标差异类型,所述第二消息用于指示所述服务器根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。The sending module 903 is configured to send the second message to the server according to the first operation instruction, where the second message includes the target difference data and the target difference type, and the second message uses for instructing the server to generate a target test case according to the target difference data, the target difference type and the latest test case.
可选的,所述接收模块901,还用于接收用户触发的第二操作指令,所述第二操作指令用于对所述待保存测试用例进行保存;Optionally, the receiving module 901 is further configured to receive a second operation instruction triggered by a user, where the second operation instruction is used to save the to-be-saved test case;
所述发送模块903,还用于根据所述第二操作指令,向所述服务器发送第三消息,所述第三消息中包括所述待保存测试用例以及所述待保存测试用例的版本标识,所述第三消息用于指示所述服务器获取所述最新测试用例的版本标识,并在所述待保存测试用例的版本标识与所述最新测试用例的版本标识不同时,从所述数据库中获取所述最新测试用例。The sending module 903 is further configured to send a third message to the server according to the second operation instruction, where the third message includes the test case to be saved and the version identifier of the test case to be saved, The third message is used to instruct the server to obtain the version identifier of the latest test case, and obtain from the database when the version identifier of the test case to be saved is different from the version identifier of the latest test case The latest test case described.
可选的,所述接收模块901,还用于接收所述用户触发的第三操作指令, 所述第三操作指令中包括待锁定测试用例的版本标识;Optionally, the receiving module 901 is further configured to receive a third operation instruction triggered by the user, where the third operation instruction includes the version identifier of the test case to be locked;
所述发送模块903,还用于根据所述第三操作指令,向所述服务器发送第四消息,所述第四消息中包括待锁定测试用例的版本标识,所述第四消息用于指示所述服务器向除所述终端设备之外的第二终端设备发送锁定消息,所述锁定消息中包括所述待锁定测试用例的版本标识,所述锁定消息用于指示所述第二终端设备将所述待锁定测试用例设置为锁定状态。The sending module 903 is further configured to send a fourth message to the server according to the third operation instruction, where the fourth message includes the version identifier of the test case to be locked, and the fourth message is used to indicate the The server sends a lock message to a second terminal device other than the terminal device, where the lock message includes the version identifier of the test case to be locked, and the lock message is used to instruct the second terminal device to The test case to be locked is set to the locked state.
可选的,所述接收模块901,还用于接收所述用户触发的第四操作指令,所述第四操作指令用于指示对处于锁定状态的测试用例进行保存;Optionally, the receiving module 901 is further configured to receive a fourth operation instruction triggered by the user, where the fourth operation instruction is used to instruct to save the test case in the locked state;
所述发送模块903,还用于根据所述第四操作指令,向所述服务器发送第五消息,所述第五消息用于指示所述服务器向所述第二终端设备发送解锁消息,所述解锁消息中包括处于锁定状态的测试用例的版本标识,所述解锁消息用于指示所述第二终端设备将所述处于锁定状态的测试用例解锁。The sending module 903 is further configured to send a fifth message to the server according to the fourth operation instruction, where the fifth message is used to instruct the server to send an unlock message to the second terminal device, the The unlock message includes the version identifier of the test case in the locked state, and the unlock message is used to instruct the second terminal device to unlock the test case in the locked state.
本申请实施例提供的测试用例的处理装置90,可以执行上述任一实施例中的测试用例的处理方法的技术方案,其实现原理以及有益效果与测试用例的处理方法的实现原理及有益效果类似,可参见测试用例的处理方法的实现原理及有益效果,此处不再进行赘述。The device 90 for processing test cases provided by the embodiments of the present application can execute the technical solutions of the methods for processing test cases in any of the above embodiments, and its implementation principle and beneficial effects are similar to those of the method for processing test cases. , please refer to the implementation principle and beneficial effect of the processing method of the test case, which will not be repeated here.
需要说明的是,应理解以上设备的各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些模块可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块通过处理元件调用软件的形式实现,部分模块通过硬件的形式实现。例如,确定模块可以为单独设立的处理元件,也可以集成在上述设备的某一个芯片中实现,此外,也可以以程序代码的形式存储于上述设备的存储器中,由上述设备的某一个处理元件调用并执行以上处理模块的功能。其它模块的实现与之类似。此外这些模块全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件可以是一种集成电路,具有信号的处理能力。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。It should be noted that it should be understood that the division of each module of the above device is only a division of logical functions, and may be fully or partially integrated into a physical entity in actual implementation, or may be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also all be implemented in hardware; some modules can also be implemented in the form of calling software through processing elements, and some modules can be implemented in hardware. For example, the determination module may be a separately established processing element, or it may be integrated into a certain chip of the above-mentioned device, and in addition, it may be stored in the memory of the above-mentioned device in the form of program code, and a certain processing element of the above-mentioned device may be used for the determination module. Call and execute the function of the above processing module. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, and can also be implemented independently. The processing element described here may be an integrated circuit with signal processing capability. In the implementation process, each step of the above-mentioned method or each of the above-mentioned modules can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
例如,以上这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(application specific integrated circuit,ASIC),或,一个或多个微处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(field programmable gate array,FPGA)等。再 如,当以上某个模块通过处理元件调度程序代码的形式实现时,该处理元件可以是通用处理器,例如中央处理器(central processing unit,CPU)或其它可以调用程序代码的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital) signal processor, DSP), or, one or more field programmable gate arrays (field programmable gate array, FPGA), etc. For another example, when a certain module above is implemented in the form of a processing element dispatcher code, the processing element may be a general-purpose processor, such as a central processing unit (central processing unit, CPU) or other processors that can invoke program codes. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘solid state disk(SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)), and the like.
图10为本申请实施例提供的一种服务器实施例的结构示意图。如图10所示,该服务器可以包括:处理器1001、存储器1002、通信接口1003和系统总线1004,所述存储器1002和所述通信接口1003通过所述系统总线1004与所述处理器1001连接并完成相互间的通信,所述存储器1002用于存储计算机执行指令,所述通信接口1003用于和其他设备进行通信,所述处理器1001执行所述计算机程序时实现如上述实施例所示的测试用例的处理方法的技术方案。FIG. 10 is a schematic structural diagram of an embodiment of a server according to an embodiment of the present application. As shown in FIG. 10 , the server may include: a processor 1001 , a memory 1002 , a communication interface 1003 and a system bus 1004 , the memory 1002 and the communication interface 1003 are connected to the processor 1001 through the system bus 1004 and To complete the mutual communication, the memory 1002 is used to store computer execution instructions, the communication interface 1003 is used to communicate with other devices, and the processor 1001 implements the tests shown in the above embodiments when executing the computer program The technical solution of the processing method of the use case.
在该图10中,上述的处理器1001可以是通用处理器,包括中央处理器CPU、网络处理器(network processor,NP)等;还可以是数字信号处理器DSP、专用集成电路ASIC、现场可编程门阵列FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。In FIG. 10 , the above-mentioned processor 1001 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field-based processor, etc. Program a gate array FPGA or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components.
存储器1002可能包含随机存取存储器(random access memory,RAM),也可能包括只读存储器(read-only memory,RAM),还可能包括非易失性存 储器(non-volatile memory),例如至少一个磁盘存储器。The memory 1002 may include random access memory (RAM), may include read-only memory (RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
通信接口1003用于实现数据库访问装置与其他设备(例如客户端、读写库和只读库)之间的通信。The communication interface 1003 is used to realize the communication between the database access device and other devices (eg client, read-write library and read-only library).
系统总线1004可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。系统总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The system bus 1004 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, or the like. The system bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
图11为本申请实施例提供的一种终端设备实施例的结构示意图。如图11所示,该终端设备可以包括:处理器1101、存储器1102、通信接口1103和系统总线1104,所述存储器1102和所述通信接口1103通过所述系统总线1104与所述处理器1101连接并完成相互间的通信,所述存储器1102用于存储计算机执行指令,所述通信接口1103用于和其他设备进行通信,所述处理器1101执行所述计算机程序时实现如上述实施例所示的测试用例的处理方法的技术方案。FIG. 11 is a schematic structural diagram of an embodiment of a terminal device according to an embodiment of the application. As shown in FIG. 11 , the terminal device may include: a processor 1101 , a memory 1102 , a communication interface 1103 and a system bus 1104 , the memory 1102 and the communication interface 1103 are connected to the processor 1101 through the system bus 1104 and complete the mutual communication, the memory 1102 is used to store computer execution instructions, the communication interface 1103 is used to communicate with other devices, and the processor 1101 implements the above-mentioned embodiments when executing the computer program. The technical scheme of the processing method of the test case.
在该图11中,上述的处理器1101可以是通用处理器,包括中央处理器CPU、网络处理器(network processor,NP)等;还可以是数字信号处理器DSP、专用集成电路ASIC、现场可编程门阵列FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。In FIG. 11 , the above-mentioned processor 1101 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field Program a gate array FPGA or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components.
存储器1102可能包含随机存取存储器(random access memory,RAM),也可能包括只读存储器(read-only memory,RAM),还可能包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 1102 may include random access memory (RAM), may also include read-only memory (RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
通信接口1103用于实现数据库访问装置与其他设备(例如客户端、读写库和只读库)之间的通信。The communication interface 1103 is used to realize the communication between the database access device and other devices (eg client, read-write library and read-only library).
系统总线1104可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。系统总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The system bus 1104 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, or the like. The system bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
可选的,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机指令,当该计算机指令在计算机上运行时,使得 计算机执行如上述实施例所示的测试用例的处理方法的技术方案。Optionally, an embodiment of the present application further provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the computer can be executed as shown in the foregoing embodiments. The technical scheme of the processing method of the test case.
可选的,本申请实施例还提供一种运行指令的芯片,所述芯片用于执行上述实施例所示的测试用例的处理方法的技术方案。Optionally, an embodiment of the present application further provides a chip for running an instruction, where the chip is used to execute the technical solution of the processing method of the test case shown in the foregoing embodiment.
本申请实施例还提供一种程序产品,所述程序产品包括计算机程序,所述计算机程序存储在计算机可读存储介质中,至少一个处理器可以从所述计算机可读存储介质读取所述计算机程序,所述至少一个处理器执行所述计算机程序时可实现上述实施例所示的测试用例的处理方法的技术方案。An embodiment of the present application further provides a program product, where the program product includes a computer program, the computer program is stored in a computer-readable storage medium, and at least one processor can read the computer from the computer-readable storage medium A program, when the at least one processor executes the computer program, the technical solutions of the test case processing methods shown in the foregoing embodiments can be implemented.
本领域技术人员在考虑说明书及实践这里公开的申请后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求书指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the applications disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or techniques in the technical field not disclosed by the present disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求书来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (17)

  1. 一种测试用例的处理方法,其特征在于,应用于服务器,所述方法包括:A test case processing method, characterized in that, applied to a server, the method comprising:
    若检测到基础测试用例处于未加锁状态,则获取待保存测试用例和数据库中已保存的最新测试用例,所述待保存测试用例和所述最新测试用例为分别对所述基础测试用例进行修改后得到的;If it is detected that the basic test case is in an unlocked state, the test case to be saved and the latest test case saved in the database are obtained, and the test case to be saved and the latest test case are respectively modified for the basic test case obtained after
    确定所述待保存测试用例与所述最新测试用例的至少一个差异数据,以及与所述差异数据对应的差异类型,所述差异类型包括增加类型、删除类型和修改类型中的至少一种;determining at least one difference data between the to-be-saved test case and the latest test case, and a difference type corresponding to the difference data, where the difference type includes at least one of an addition type, a deletion type, and a modification type;
    向第一终端设备发送第一消息,所述第一消息中包括所述差异数据和所述差异类型;接收所述第一终端设备发送的第二消息,所述第二消息中包括目标差异数据和与所述目标差异数据对应的目标差异类型,所述目标差异数据为所述至少一个差异数据中的数据;Send a first message to a first terminal device, where the first message includes the difference data and the difference type; receive a second message sent by the first terminal device, where the second message includes target difference data and a target difference type corresponding to the target difference data, the target difference data being data in the at least one difference data;
    根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。A target test case is generated according to the target difference data, the target difference type and the latest test case.
  2. 根据权利要求1所述的方法,其特征在于,所述获取待保存测试用例和数据库中已保存的最新测试用例,包括:The method according to claim 1, wherein the acquiring the test case to be saved and the latest test case saved in the database comprises:
    接收所述第一终端设备发送的第三消息,所述第三消息中包括所述待保存测试用例以及所述待保存测试用例的版本标识;receiving a third message sent by the first terminal device, where the third message includes the test case to be saved and the version identifier of the test case to be saved;
    根据所述第三消息,获取所述最新测试用例的版本标识;obtaining the version identifier of the latest test case according to the third message;
    若所述待保存测试用例的版本标识与所述最新测试用例的版本标识不同,则从所述数据库中获取所述最新测试用例。If the version identifier of the test case to be saved is different from the version identifier of the latest test case, the latest test case is acquired from the database.
  3. 根据权利要求1所述的方法,其特征在于,所述确定所述待保存测试用例与所述最新测试用例的至少一个差异数据,以及与所述差异数据对应的差异类型,包括:The method according to claim 1, wherein the determining at least one difference data between the test case to be saved and the latest test case, and the difference type corresponding to the difference data, comprises:
    将所述待保存测试用例与所述最新测试用例进行比对,确定所述待保存测试用例与所述最新测试用例的最长公共子序列;Compare the test case to be saved with the latest test case, and determine the longest common subsequence of the test case to be saved and the latest test case;
    分别将所述待保存测试用例和所述最新测试用例与所述最长公共子序列进行比对,将所述待保存测试用例与所述最长公共子序列之间不同的数据,以及所述最新测试用例与所述最长公共子序列之间不同的数据,确定为所述 至少一个差异数据;Comparing the test case to be saved and the latest test case with the longest common subsequence respectively, comparing the different data between the test case to be saved and the longest common subsequence, and the The difference data between the latest test case and the longest common subsequence is determined as the at least one difference data;
    根据所述至少一个差异数据与所述最长公共子序列,确定与所述差异数据对应的差异类型。According to the at least one difference data and the longest common subsequence, a difference type corresponding to the difference data is determined.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例,包括:The method according to any one of claims 1-3, wherein the generating the target test case according to the target difference data, the target difference type and the latest test case, comprises:
    若确定出与所述目标差异类型对应的所述目标差异数据为所述最新测试用例中的数据,则将所述最新测试用例确定为所述目标测试用例;或者,If it is determined that the target difference data corresponding to the target difference type is data in the latest test case, then the latest test case is determined to be the target test case; or,
    若确定出与所述目标差异类型对应的所述目标差异数据为所述待保存测试用例中的数据,则在所述最新测试用例中,对所述目标差异数据进行与所述目标差异类型对应的操作,以生成所述目标测试用例;或者,If it is determined that the target difference data corresponding to the target difference type is the data in the test case to be saved, then in the latest test case, the target difference data corresponding to the target difference type is performed operations to generate the target test case; or,
    若确定出所述目标差异数据中的第一数据为所述最新测试用例中的数据,且第二数据为所述待保存测试用例中的数据,则在所述最新测试用例中保持所述第一数据以及与所述第一数据对应的差异类型不变,且在所述最新测试用例中,对所述第二数据进行与所述第二数据的差异类型对应的操作,以生成所述目标测试用例。If it is determined that the first data in the target difference data is the data in the latest test case, and the second data is the data in the to-be-saved test case, keep the first data in the latest test case A piece of data and a difference type corresponding to the first data remain unchanged, and in the latest test case, an operation corresponding to the difference type of the second data is performed on the second data to generate the target test case.
  5. 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-3, wherein the method further comprises:
    若检测到所述第一终端设备对应的基础测试用例处于加锁状态,则向除所述第一终端设备之外的第二终端设备发送锁定消息,所述锁定消息中包括所述基础测试用例的版本标识,所述锁定消息用于指示所述第二终端设备将所述第二终端设备对应的所述基础测试用例设置为锁定状态。If it is detected that the basic test case corresponding to the first terminal device is in a locked state, a lock message is sent to a second terminal device other than the first terminal device, where the lock message includes the basic test case The lock message is used to instruct the second terminal device to set the basic test case corresponding to the second terminal device to a locked state.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    在满足预设条件时,向所述第二终端设备发送解锁消息,所述解锁消息中包括处于锁定状态的基础测试用例的版本标识,所述解锁消息用于指示生成第一数值,并指示所述第二终端设备在判断出所述第一数值与预先存储的第二数值相同时将所述处于锁定状态的基础测试用例解锁;所述预设条件包括所述处于锁定状态的基础测试用例的锁定时长超过预设时长,和/或,接收到所述第一终端设备发送的第五消息,所述第五消息用于表示对所述处于锁定状态的基础测试用例进行保存。When the preset condition is met, an unlock message is sent to the second terminal device, where the unlock message includes the version identifier of the basic test case in the locked state, the unlock message is used to instruct the generation of the first value and the The second terminal device unlocks the basic test case in the locked state when judging that the first value is the same as the pre-stored second value; the preset condition includes the basic test case in the locked state. The locking duration exceeds a preset duration, and/or a fifth message sent by the first terminal device is received, where the fifth message is used to indicate that the basic test case in the locked state is saved.
  7. 一种测试用例的处理方法,其特征在于,应用于终端设备,所述方法包括:A method for processing a test case, characterized in that it is applied to a terminal device, the method comprising:
    接收服务器发送的第一消息,所述第一消息中包括至少一个差异数据和每个差异数据对应的差异类型,所述差异数据为待保存测试用例与最新测试用例之间的差异数据,所述待保存测试用例和所述最新测试用例为对基础测试用例进行修改后得到的;Receive the first message sent by the server, the first message includes at least one difference data and the difference type corresponding to each difference data, the difference data is the difference data between the test case to be saved and the latest test case, the The test case to be saved and the latest test case are obtained by modifying the basic test case;
    确定目标差异数据和与所述目标差异数据对应的目标差异类型,所述目标差异数据为所述至少一个差异数据中的数据;determining target difference data and a target difference type corresponding to the target difference data, where the target difference data is data in the at least one difference data;
    向所述服务器发送第二消息,所述第二消息中包括所述目标差异数据和所述目标差异类型,所述第二消息用于指示所述服务器根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。Send a second message to the server, where the second message includes the target difference data and the target difference type, and the second message is used to instruct the server to use the target difference data, the target difference Type and the latest test case, generate the target test case.
  8. 根据权利要求7所述的方法,其特征在于,所述确定目标差异数据和与所述目标差异数据对应的目标差异类型,包括:The method according to claim 7, wherein the determining the target difference data and the target difference type corresponding to the target difference data comprises:
    显示所述差异数据和所述差异类型;displaying the difference data and the difference type;
    接收用户触发的第一操作指令,所述第一操作指令中包括所述目标差异数据和所述目标差异类型。A first operation instruction triggered by a user is received, where the first operation instruction includes the target difference data and the target difference type.
  9. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method according to claim 7, wherein the method further comprises:
    接收用户触发的第二操作指令,所述第二操作指令用于对所述待保存测试用例进行保存;receiving a second operation instruction triggered by the user, where the second operation instruction is used to save the to-be-saved test case;
    根据所述第二操作指令,向所述服务器发送第三消息,所述第三消息中包括所述待保存测试用例以及所述待保存测试用例的版本标识,所述第三消息用于指示所述服务器获取所述最新测试用例的版本标识,并在所述待保存测试用例的版本标识与所述最新测试用例的版本标识不同时,从所述数据库中获取所述最新测试用例。According to the second operation instruction, a third message is sent to the server, where the third message includes the test case to be saved and the version identifier of the test case to be saved, and the third message is used to indicate the test case to be saved. The server acquires the version identifier of the latest test case, and when the version identifier of the test case to be saved is different from the version identifier of the latest test case, acquires the latest test case from the database.
  10. 根据权利要求7-9任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 7-9, wherein the method further comprises:
    接收用户触发的第三操作指令,所述第三操作指令中包括待锁定的基础测试用例的版本标识;Receive a third operation instruction triggered by the user, where the third operation instruction includes the version identifier of the basic test case to be locked;
    根据所述第三操作指令,向所述服务器发送第四消息,所述第四消息中包括所述待锁定的基础测试用例的版本标识,所述第四消息用于指示所述服务器向除所述终端设备之外的第二终端设备发送锁定消息,所述锁定消息中包括所述待锁定的基础测试用例的版本标识,所述锁定消息用于指示所述第二终端设备将所述第二终端设备对应的所述待锁定的基础测试用例设置为锁定状态。According to the third operation instruction, a fourth message is sent to the server, where the fourth message includes the version identifier of the basic test case to be locked, and the fourth message is used to instruct the server to send the A second terminal device other than the terminal device sends a lock message, where the lock message includes the version identifier of the basic test case to be locked, and the lock message is used to instruct the second terminal device to The basic test case to be locked corresponding to the terminal device is set to a locked state.
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:The method of claim 10, wherein the method further comprises:
    接收所述用户触发的第四操作指令,所述第四操作指令用于指示对处于锁定状态的基础测试用例进行保存;receiving a fourth operation instruction triggered by the user, where the fourth operation instruction is used to instruct to save the basic test case in the locked state;
    根据所述第四操作指令,向所述服务器发送第五消息,所述第五消息用于指示所述服务器向所述第二终端设备发送解锁消息,所述解锁消息中包括处于锁定状态的基础测试用例的版本标识,所述解锁消息用于指示生成第一数值,并指示所述第二终端设备在判断出所述第一数值与预先存储的第二数值相同时将所述处于锁定状态的基础测试用例解锁。According to the fourth operation instruction, a fifth message is sent to the server, where the fifth message is used to instruct the server to send an unlocking message to the second terminal device, where the unlocking message includes the basic information in a locked state The version identifier of the test case, the unlock message is used to instruct the generation of the first value, and instruct the second terminal device to lock the device in the locked state when judging that the first value is the same as the pre-stored second value. Basic test cases are unlocked.
  12. 一种测试用例的处理装置,其特征在于,包括:A processing device for a test case, characterized in that it includes:
    处理模块,用于在检测到基础测试用例处于未加锁状态时,获取待保存测试用例和数据库中已保存的最新测试用例,所述待保存测试用例和所述最新测试用例为分别对基础测试用例进行修改后得到的;The processing module is used to obtain the test case to be saved and the latest test case saved in the database when it is detected that the basic test case is in an unlocked state, and the test case to be saved and the latest test case are for the basic test case respectively. After the use case is modified;
    所述处理模块,还用于确定所述待保存测试用例与所述最新测试用例的至少一个差异数据,以及与所述差异数据对应的差异类型,所述差异类型包括增加类型、删除类型和修改类型中的至少一种;The processing module is further configured to determine at least one difference data between the test case to be saved and the latest test case, and a difference type corresponding to the difference data, where the difference type includes addition type, deletion type and modification at least one of the types;
    发送模块,用于向第一终端设备发送第一消息,所述第一消息中包括所述差异数据和所述差异类型;a sending module, configured to send a first message to a first terminal device, where the first message includes the difference data and the difference type;
    接收模块,用于接收所述第一终端设备发送的第二消息,所述第二消息中包括目标差异数据和与所述目标差异数据对应的目标差异类型,所述目标差异数据为所述至少一个差异数据中的数据;A receiving module, configured to receive a second message sent by the first terminal device, where the second message includes target difference data and a target difference type corresponding to the target difference data, and the target difference data is the at least data in a difference data;
    所述处理模块,还用于根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。The processing module is further configured to generate a target test case according to the target difference data, the target difference type and the latest test case.
  13. 一种测试用例的处理装置,其特征在于,包括:A processing device for a test case, characterized in that it includes:
    接收模块,用于接收服务器发送的第一消息,所述第一消息中包括至少一个差异数据和每个差异数据对应的差异类型,所述差异数据为待保存测试用例与最新测试用例之间的差异数据,所述待保存测试用例和所述最新测试用例为对基础测试用例进行修改后得到的;The receiving module is configured to receive a first message sent by the server, where the first message includes at least one difference data and a difference type corresponding to each difference data, and the difference data is the difference between the test case to be saved and the latest test case. Difference data, the test case to be saved and the latest test case are obtained by modifying the basic test case;
    显示模块,用于显示所述差异数据和所述差异类型;a display module for displaying the difference data and the difference type;
    处理模块,用于确定目标差异数据和与所述目标差异数据对应的目标差异类型,所述目标差异数据为所述至少一个差异数据中的数据;a processing module, configured to determine target difference data and a target difference type corresponding to the target difference data, where the target difference data is data in the at least one difference data;
    发送模块,用于向所述服务器发送第二消息,所述第二消息中包括所述 目标差异数据和所述目标差异类型,所述第二消息用于指示所述服务器根据所述目标差异数据、所述目标差异类型和所述最新测试用例,生成目标测试用例。A sending module, configured to send a second message to the server, where the second message includes the target difference data and the target difference type, and the second message is used to instruct the server according to the target difference data , the target difference type and the latest test case to generate a target test case.
  14. 一种服务器,其特征在于,包括:A server, characterized in that it includes:
    收发器;transceiver;
    处理器;processor;
    存储器;以及memory; and
    计算机程序;Computer program;
    其中,所述计算机程序被存储在所述存储器中,并且被配置为由所述处理器执行,所述计算机程序包括用于执行如权利要求1-6任一项所述的方法的指令。wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of any of claims 1-6.
  15. 一种终端设备,其特征在于,包括:A terminal device, characterized in that it includes:
    收发器;transceiver;
    显示器;monitor;
    处理器;processor;
    存储器;以及memory; and
    计算机程序;Computer program;
    其中,所述计算机程序被存储在所述存储器中,并且被配置为由所述处理器执行,所述计算机程序包括用于执行如权利要求7-11任一项所述的方法的指令。wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of any of claims 7-11.
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序使得电子设备执行权利要求1-11任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and the computer program causes an electronic device to execute the method of any one of claims 1-11.
  17. 一种计算机程序产品,包括计算机程序,其特征在于,该计算机程序被处理器执行时实现权利要求1-11任一项所述的方法。A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the method of any one of claims 1-11 is implemented.
PCT/CN2021/138935 2020-12-22 2021-12-16 Method and apparatus for processing test cases, and storage medium WO2022135276A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011530719.8A CN112783760B (en) 2020-12-22 2020-12-22 Processing method and device for test cases and storage medium
CN202011530719.8 2020-12-22

Publications (1)

Publication Number Publication Date
WO2022135276A1 true WO2022135276A1 (en) 2022-06-30

Family

ID=75751807

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/138935 WO2022135276A1 (en) 2020-12-22 2021-12-16 Method and apparatus for processing test cases, and storage medium

Country Status (2)

Country Link
CN (1) CN112783760B (en)
WO (1) WO2022135276A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115460101A (en) * 2022-08-02 2022-12-09 北京达佳互联信息技术有限公司 Network service management method, device, equipment and storage medium
CN116841913A (en) * 2023-08-31 2023-10-03 美云智数科技有限公司 Test case generation method and device, electronic equipment and storage medium
CN117806981A (en) * 2024-03-01 2024-04-02 中国空气动力研究与发展中心计算空气动力研究所 CFD software automatic testing method and system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112783760B (en) * 2020-12-22 2024-05-28 深圳前海微众银行股份有限公司 Processing method and device for test cases and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6393437B1 (en) * 1998-01-27 2002-05-21 Microsoft Corporation Web developer isolation techniques
CN101521608A (en) * 2009-01-22 2009-09-02 厦门东南融通系统工程有限公司 Method for edition management of test case
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN111984307A (en) * 2020-08-24 2020-11-24 北京思特奇信息技术股份有限公司 Processing method and device for automatically repairing baseline version
CN112783760A (en) * 2020-12-22 2021-05-11 深圳前海微众银行股份有限公司 Test case processing method and device and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6715108B1 (en) * 1999-10-12 2004-03-30 Worldcom, Inc. Method of and system for managing test case versions
CN112069073A (en) * 2020-09-07 2020-12-11 深圳创维-Rgb电子有限公司 Test case management method, terminal and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6393437B1 (en) * 1998-01-27 2002-05-21 Microsoft Corporation Web developer isolation techniques
CN101521608A (en) * 2009-01-22 2009-09-02 厦门东南融通系统工程有限公司 Method for edition management of test case
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN111984307A (en) * 2020-08-24 2020-11-24 北京思特奇信息技术股份有限公司 Processing method and device for automatically repairing baseline version
CN112783760A (en) * 2020-12-22 2021-05-11 深圳前海微众银行股份有限公司 Test case processing method and device and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115460101A (en) * 2022-08-02 2022-12-09 北京达佳互联信息技术有限公司 Network service management method, device, equipment and storage medium
CN115460101B (en) * 2022-08-02 2024-06-11 北京达佳互联信息技术有限公司 Network service management method, device, equipment and storage medium
CN116841913A (en) * 2023-08-31 2023-10-03 美云智数科技有限公司 Test case generation method and device, electronic equipment and storage medium
CN116841913B (en) * 2023-08-31 2023-12-29 美云智数科技有限公司 Test case generation method and device, electronic equipment and storage medium
CN117806981A (en) * 2024-03-01 2024-04-02 中国空气动力研究与发展中心计算空气动力研究所 CFD software automatic testing method and system
CN117806981B (en) * 2024-03-01 2024-05-07 中国空气动力研究与发展中心计算空气动力研究所 CFD software automatic testing method and system

Also Published As

Publication number Publication date
CN112783760B (en) 2024-05-28
CN112783760A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
WO2022135276A1 (en) Method and apparatus for processing test cases, and storage medium
US11093377B2 (en) Systems and methods for testing source code
US9430449B2 (en) Systems, methods, and media for managing editable previews of webpages
US10885060B2 (en) On-demand file synchronization
WO2018233364A1 (en) Index updating method and system, and related device
US20090259993A1 (en) Sandbox Support for Metadata in Running Applications
JP2017535842A (en) Simplify calling the import procedure to transfer data from the data source to the data target
US20090077085A1 (en) Substitute database replication tables
US20230153289A1 (en) Application driven data change conflict handling system
US20230116336A1 (en) API Governance Enforcement Architecture
CN114564852A (en) Operation method of FMEA data node and electronic equipment
US10901984B2 (en) Enhanced batch updates on records and related records system and method
JP7221652B2 (en) External change detection
CN115658794B (en) Data query method, device, computer equipment and storage medium
US10764204B2 (en) Cloud extensibility framework
EP4030280A1 (en) Seamless lifecycle stability for extensible software features
US20220345517A1 (en) Unified application management for heterogeneous application delivery
CN107018005B (en) Event triggering method, event management system and system
WO2022134161A1 (en) Consortium blockchain node management system, method and apparatus, electronic device, and storage medium
CN114143187B (en) Intelligent platform interface network address management method, system, terminal and storage medium
US20230179569A1 (en) Systems and methods for verifying a firewall for a cloud provider
CN113220605B (en) Distributed cache management method and device and electronic equipment
US20230401230A1 (en) Database systems and related replication monitoring methods
US10594838B2 (en) Configuration data as code
CN113220605A (en) Distributed cache management method and device and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21909272

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 31.10.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21909272

Country of ref document: EP

Kind code of ref document: A1