CN112783760B - Processing method and device for test cases and storage medium - Google Patents

Processing method and device for test cases and storage medium Download PDF

Info

Publication number
CN112783760B
CN112783760B CN202011530719.8A CN202011530719A CN112783760B CN 112783760 B CN112783760 B CN 112783760B CN 202011530719 A CN202011530719 A CN 202011530719A CN 112783760 B CN112783760 B CN 112783760B
Authority
CN
China
Prior art keywords
test case
saved
difference data
latest
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011530719.8A
Other languages
Chinese (zh)
Other versions
CN112783760A (en
Inventor
骆春光
王惠惠
曾庆熙
曾波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202011530719.8A priority Critical patent/CN112783760B/en
Publication of CN112783760A publication Critical patent/CN112783760A/en
Priority to PCT/CN2021/138935 priority patent/WO2022135276A1/en
Application granted granted Critical
Publication of CN112783760B publication Critical patent/CN112783760B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/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

Landscapes

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

Abstract

The application provides a processing method, a device and a storage medium of a test case, wherein the method comprises the following steps: acquiring a test case to be stored and a latest test case stored in a database; determining at least one difference data of the test case to be stored and the latest test case and a difference type corresponding to the difference data; sending a first message to a first terminal device, wherein the first message comprises difference data and a difference type, and the first message is used for indicating the first terminal device to display the difference data and the difference type; receiving a second message sent by the first terminal equipment, wherein the second message comprises 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; and generating the target test case according to the target difference data, the target difference type and the latest test case. The application can improve the accuracy of the target test case.

Description

Processing method and device for test cases and storage medium
Technical Field
The present application relates to computer technology, and in particular, to a method and apparatus for processing test cases, and a storage medium.
Background
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 changing to the financial technology (Fintech), but due to the requirements of security and real-time performance of the financial industry, higher requirements are also put forward on the service request technology. Currently, in the field of financial science and technology, in order to ensure accuracy of a program or an application, a test case is generally required to automatically test the program or the application.
In the prior art, since the functions of the program or the application are continuously changed, in order to ensure the accuracy of the test, the test cases need to be edited or modified, when a plurality of users edit the same test case, the test cases stored later can cover the test cases stored before, so that the users cannot view the modification made to the test cases in the version stored before, and the test cases stored later directly cover the test cases stored before, which can affect the accuracy of the test cases stored finally.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a processing method, a device and a storage medium of a test case, which not only can enable a user to check the modification of the test case in a previous saved version, but also can improve the accuracy of the finally saved test case.
In a first aspect, an embodiment of the present application provides a method for processing a test case, which is applied to a server, where the method includes:
if the basic test case is detected to be in an unlocked state, acquiring the test case to be saved and the latest test case saved in a database, wherein the test case to be saved and the latest test case are obtained by respectively modifying the basic test case;
Determining at least one difference data of the test case to be saved and the latest test case and a difference type corresponding to the difference data, wherein the difference type comprises at least one of an addition type, a deletion type and a modification type;
Sending a first message to a first terminal device, wherein the first message comprises the difference data and the difference type;
Receiving a second message sent by the first terminal device, wherein the second message comprises target difference data and a target difference type corresponding to the target difference data, and the target difference data is data in the at least one difference data;
and generating a target test case according to the target difference data, the target difference type and the latest test case.
Optionally, the obtaining the latest test case to be saved in the test case and the database includes:
Receiving a third message sent by the first terminal equipment, wherein the third message comprises the test case to be stored and a version identifier of the test case to be stored;
according to the third message, the version identification of the latest test case is obtained;
And if the version identifier of the test case to be stored is different from the version identifier of the latest test case, acquiring the latest test case from the database.
Optionally, the determining 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 includes:
comparing the test case to be saved with the latest test case, and determining the longest public subsequence of the test case to be saved and the latest test case;
comparing the test case to be saved with the latest test case and the longest public subsequence respectively, and determining different data between the test case to be saved and the longest public subsequence and different data between the latest test case and the longest public subsequence as the at least one difference data;
and determining a difference type corresponding to the difference data according to the at least one difference data and the longest common subsequence.
Optionally, the generating the target test case according to the target difference data, the target difference type and the latest test case includes:
if the target difference data corresponding to the target difference type is determined to be the data in the latest test case, determining the latest test case as the target test case; or alternatively
If the target difference data corresponding to the target difference type is determined to be the data in the test case to be stored, performing an operation corresponding to the target difference type on the target difference data in the latest test case to generate the target test case; or alternatively
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, the first data and the difference type corresponding to the first data are kept unchanged in the latest test case, 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 comprises:
if the basic test case corresponding to the first terminal equipment is detected to be in a locking state, a locking message is sent to second terminal equipment except the first terminal equipment, the locking message comprises a version identifier of the basic test case, and the locking message is used for indicating the second terminal equipment to set the basic test case corresponding to the second terminal equipment to be in the locking state.
Optionally, the method further comprises:
When a preset condition is met, an unlocking message is sent to the second terminal equipment, wherein the unlocking message comprises a version identifier of a basic test case in a locked state, and the unlocking message is used for indicating to generate a first numerical value and indicating the second terminal equipment to unlock the basic test case in the locked state when judging that the first numerical value is identical to a second numerical value stored in advance; the preset conditions include that the locking time of the basic test case in the locked state exceeds a preset time, and/or a fifth message sent by the first terminal device is received, where the fifth message is used for indicating that the basic test case in the locked state is stored.
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, where the method includes:
Receiving a first message sent by a server, wherein the first message comprises at least one piece of difference data and a difference type corresponding to each piece of difference data, the difference data is the difference data between a test case to be stored and a latest test case, and the test case to be stored and the latest test case are obtained after the basic test case is modified;
Determining target difference data and a target difference type corresponding to the target difference data, wherein the target difference data is data in the at least one difference data;
The second message is sent to the server, the second message comprises the target difference data and the target difference type, and the second message is used for indicating the server to generate a target test case according to the target difference data, the target difference type and the latest test case.
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;
And receiving a first operation instruction triggered by a user, wherein the first operation instruction comprises the target difference data and the target difference type.
Optionally, the method further comprises:
receiving a second operation instruction triggered by a user, wherein the second operation instruction is used for storing the test case to be stored;
According to the second operation instruction, a third message is sent to the server, wherein the third message comprises the test case to be saved and the version identifier of the test case to be saved, the third message is used for indicating the server to obtain the version identifier of the latest test case, and the latest test case is obtained 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.
Optionally, the method further comprises:
Receiving a third operation instruction triggered by the user, wherein the third operation instruction comprises a version identifier of a basic test case to be locked;
According to the third operation instruction, a fourth message is sent to the server, the fourth message comprises a version identifier of the basic test case to be locked, the fourth message is used for indicating the server to send a locking message to a second terminal device except the terminal device, the locking message comprises the version identifier of the basic test case to be locked, and the locking message is used for indicating the second terminal device to set the basic test case to be locked corresponding to the second terminal device into a locking state.
Optionally, the method further comprises:
receiving a fourth operation instruction triggered by the user, wherein the fourth operation instruction is used for indicating to store the basic test case in a locked state;
according to the fourth operation instruction, a fifth message is sent to the server, the fifth message is used for indicating the server to send an unlocking message to the second terminal device, the unlocking message comprises a version identifier of the basic test case in a locked state, the unlocking message is used for indicating to generate a first numerical value, and the second terminal device is indicated to unlock the basic test case in the locked state when judging that the first numerical value is identical to a pre-stored second numerical value.
In a third aspect, an embodiment of the present application provides a processing apparatus for a test case, including:
The processing module is used for acquiring a test case to be stored and a latest test case stored in the database when the basic test case is detected to be in an unlocked state, wherein the test case to be stored and the latest test case are obtained by respectively modifying the basic test case;
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 at least one of an add type, a delete type, and a modify type;
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;
The receiving module is used for receiving a second message sent by the first terminal equipment, wherein the second message comprises target difference data and a target difference type corresponding to the target difference data, and the target difference data is data in the at least one 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 configured to:
Receiving a third message sent by the first terminal equipment, wherein the third message comprises the test case to be stored and a version identifier of the test case to be stored;
according to the third message, the version identification of the latest test case is obtained;
And if the version identifier of the test case to be stored is different from the version identifier of the latest test case, acquiring the latest test case from the database.
Optionally, the processing module is specifically configured to:
comparing the test case to be saved with the latest test case, and determining the longest public subsequence of the test case to be saved and the latest test case;
comparing the test case to be saved with the latest test case and the longest public subsequence respectively, and determining different data between the test case to be saved and the longest public subsequence and different data between the latest test case and the longest public subsequence as the at least one difference data;
and determining a difference type corresponding to the difference data according to the at least one difference data and the longest common subsequence.
Optionally, the processing module is specifically configured to:
if the target difference data corresponding to the target difference type is determined to be the data in the latest test case, determining the latest test case as the target test case; or alternatively
If the target difference data corresponding to the target difference type is determined to be the data in the test case to be stored, performing an operation corresponding to the target difference type on the target difference data in the latest test case to generate the target test case; or alternatively
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, the first data and the difference type corresponding to the first data are kept unchanged in the latest test case, 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.
Alternatively to this, the method may comprise,
The sending module is further configured to send a locking message to a second terminal device other than the first terminal device when detecting that the basic test case corresponding to the first terminal device is in a locked state, where the locking message includes a version identifier of the basic test case, and the locking message is used to instruct the second terminal device to set the basic test case corresponding to the second terminal device to the locked state.
Optionally, the sending module is further configured to send an unlocking message to the second terminal device when a preset condition is met, where the unlocking message includes a version identifier of the basic test case in a locked state, and the unlocking message is used to instruct to generate a first value, and instruct the second terminal device to unlock the basic test case in the locked state when the first value is determined to be the same as a second value stored in advance; the preset conditions include that the locking time of the basic test case in the locked state exceeds a preset time, and/or a fifth message sent by the first terminal device is received, where the fifth message is used for indicating that the basic test case in the locked state is stored.
In a fourth aspect, an embodiment of the present application provides a processing apparatus for a test case, including:
The system comprises a receiving module, a storage module and a processing module, wherein the receiving module is used for receiving a first message sent by a server, the first message comprises at least one piece of difference data and a difference type corresponding to each piece of difference data, the difference data are difference data between a test case to be stored and a latest test case, and the test case to be stored and the latest test case are obtained after the basic test case is modified;
the processing module is used for determining target difference data and a target difference type corresponding to the target difference data, wherein the target difference data is data in the at least one difference data;
the sending module is 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 configured to instruct the server to generate a target test case according to the target difference data, the target difference type, and the latest test case.
Optionally, the apparatus further includes: a display module;
The display module is used 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 a user, where the second operation instruction is used to store the test case to be stored;
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 a version identifier of the test case to be saved, and the third message is used to instruct the server to obtain the version identifier of the latest test case, and obtain the latest test case 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.
Optionally, the receiving module is further configured to receive a third operation instruction triggered by the user, where the third operation instruction includes a 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 a version identifier of the basic test case to be locked, the fourth message is used to instruct the server to send a locking message to a second terminal device other than the terminal device, the locking message includes the version identifier of the basic test case to be locked, and the locking message is used to instruct the second terminal device to 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 the 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, the unlocking message includes a version identifier of the basic test case in a locked state, and the unlocking message is used to instruct generation of a first value and instruct the second terminal device to unlock the basic test case in the locked state when it is determined that the first value is identical to a second value stored in advance.
In a fifth aspect, an embodiment of the present application provides a server, including: a transceiver; a processor; a memory; 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 according to 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; 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 according to the second aspect.
In a seventh aspect, an embodiment of the present application provides a computer readable storage medium storing a computer program, the computer program causing a server to perform the method according to the first aspect or causing a terminal device to perform the method according to the second aspect.
In an eighth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements a method as described in the first or second aspect.
According to the processing method, the processing device and the storage medium for the test cases, when the condition that the basic test cases are in an unlocked state is detected, the latest test cases stored in the test cases to be stored and the database are obtained, at least one difference data of the test cases to be stored and the latest test cases and the difference type corresponding to the difference data are determined, then a first message is sent to the first terminal equipment, the first message comprises the difference data and the difference type, and a second message sent by the first terminal equipment is received, the second message comprises the target difference data and the target difference type corresponding to the target difference data, and the target test cases are generated according to the target difference data, the target difference type and the latest test cases. When the server saves the test cases to be saved, the target test cases are generated by determining at least one difference data of the test cases to be saved and the latest test cases and according to the target difference data determined by the terminal equipment and the corresponding target difference types, so that the phenomenon that the test cases saved before the post-saved test cases are directly adopted in the prior art is avoided, the difference data are saved selectively, and the accuracy of the target test cases can be improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive faculty for a person skilled in the art.
FIG. 1 is a system architecture diagram of a test case processing method according to an embodiment of the present application;
FIG. 2 is a signaling diagram of a method for processing a test case according to an embodiment of the present application;
FIG. 3 is a schematic trigger diagram of a second operation instruction;
FIG. 4 is a schematic diagram showing difference data;
FIG. 5 is another signaling diagram of a method for processing a test case according to 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 according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a processing device for test cases according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a processing device for a test case according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a server embodiment according to 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 present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "first," "second," "third," and "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In order to help those skilled in the art to better understand the technical solutions of the present application, the following description will explain relevant contents related to the technical solutions of the present application.
(1) The automatic test is to automatically simulate the real operation of the execution interface according to the use scene of the system and test whether the function is correct.
(2) Test Case (Test Case) refers to the description of a specific software product for testing tasks, and reflects testing schemes, methods, technologies and strategies. The content of the method comprises a test target, a test environment, input data, test steps, expected results, test scripts and the like.
(3) Redis is a high-performance key-value data storage database based on memory implementation.
The processing method of the test case provided by the embodiment of the application can be applied to a scene of adopting the test case to automatically test the program or the application, or a scene of how to effectively manage the test case when a plurality of users edit or modify the same test case.
In the above scenario, multiple testers may be allowed to modify or edit the test case, i.e., multiple testers may edit the same test case at the same time. In the prior art, when a plurality of users edit the same test case, the test case is usually saved according to the time sequence of editing, so that the test case saved later will cover the test case saved earlier. For example, if the user a and the user B edit the same test case through different terminal devices, respectively, and if the user a completes editing first, the edited test case may be saved. After the user B finishes editing, when the server receives a storage instruction sent by the user B through the terminal equipment, the test case edited by the user B is directly covered by the test case edited by the user A, so that the user cannot check the test case edited by the user A. In addition, since the test case edited by the user B directly covers the test case edited by the user a, if the accuracy of the test case edited by the user B is not high, the accuracy of the finally stored test case is directly affected.
In view of the above problems, the embodiments of the present application provide a method for processing test cases, where multiple persons edit or modify the same test case at the same time, and when the modification is completed and the test case is stored, if there is a stored test case before, that is, when a data conflict occurs, the contents of multiple persons modified may be stored, for example, the contents of multiple persons modified may be stored in the test case of the same version, so that the user can check the contents, and thus, the situation that the test case stored later directly covers the test case stored earlier can be avoided. In addition, when a plurality of testers modify the same test case, most of the phenomenon that the modified content is the same may exist, in order to save storage space, the modified content of a plurality of testers may be compared, if difference data exists, that is, when different content is modified, target difference data may be determined from the difference data, specifically, the target difference data may be displayed through an interface, and the testers may determine a portion to be reserved according to the difference data. Therefore, on one hand, the later-stored test cases can not be directly covered with the previously-stored test cases according to the sequence of the storage time, and the user can also check the previously-stored test cases. On the other hand, the user can select the part to be reserved according to the difference data, so that the accuracy of the finally-stored test case can be improved.
Before describing the scheme of the processing method of the test case of the present application, the system architecture of the present application is first explained according to fig. 1.
Fig. 1 is a system architecture diagram of a processing method of a test case according to 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. The user a may edit or modify the test case through the first terminal device 101, and the users B, C and D may edit or modify the test case through the second terminal devices 102, 103, and 104, respectively, and the test case edited or modified by the user through the terminal devices may be stored in a database of the server 105, where the database may be a Redis database, or may be an SQL database, or of course, may be 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 formed by a plurality of servers.
Taking the scenario of testing a system as an example, a user a may test the system by using a test case 1.1 through a terminal device 101, and may modify the test case 1.1 during the test, and similarly, a user B, a user C, and a user D may test the system by using the test case 1.1 through terminal devices 102, 103, and 104, respectively, and may modify the test case 1.1 during the test. That is, multiple users may modify the same test case at the same time, and the users may send the modified test case to the server 105 through the respective corresponding terminal devices, so as to save the test case modified by each user. In addition, in order to enable the user to view the modification made by other users to the test cases, when determining that at least two users have saved the test cases, the server 105 compares differences between the test cases and sends difference data to the terminal device for display, so that the user can determine the test cases that the user wants to save according to the difference data, and thus generate the target test cases for saving. The target test case is used for testing the system.
It should be understood that in the system architecture shown in fig. 1, the number of users, first terminal device 101, second terminal devices 102, 103 and 104, and server 105 are merely exemplary, and that a greater or lesser number is within the scope of the present application. Also, in the example operational scenario described above, the user may access a network using various devices, such as a Personal computer, server, tablet, cell phone, palm top (Personal DIGITAL ASSISTANT, PDA), notebook, or any other computing device having networking capabilities. While server 105 may be implemented with one server or group of servers having more processing power and higher security. The above-described networks 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 Radio Service (GPRS), code division multiple access (Code Division Multiple Access, CDMA), 2G/3G/4G/5G cellular network), satellite communication network, and so forth.
After understanding the system architecture of the present application, the scheme of the processing method of the test case of the present application will be described in detail with reference to fig. 2.
Fig. 2 is a signaling diagram of a processing method of a test case according to an embodiment of the present application, where, as shown in fig. 2, the processing method of a test case according to an embodiment of the present application includes the following steps:
step 201: if the basic test case is detected to be in an unlocked state, the server acquires the test case to be stored and the latest test case stored in the database.
The test cases to be saved and the latest test cases are obtained by respectively modifying the basic test cases.
In this step, the server may monitor whether the base test case is in a locked state through webSocket.
The test case to be saved and the latest test case are obtained by modifying the same basic test case for different users. The modification completion time of the latest test case is earlier than that of the test case to be saved, so that the latest test case is the test case which is modified and saved in the database, and the test case to be saved is the test case which 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 when a data conflict occurs, that is, when the user has modified and saved the test case, the server will acquire the test case to be saved and the latest test case saved in the database. Therefore, in one possible implementation manner, after receiving a second operation instruction triggered by a user and used for storing the test case to be stored, the first terminal device sends a third message to the server, where the third message includes the test case to be stored and a version identifier of the test case to be stored, and the server obtains the version identifier of the latest test case according to the third message, and if the version identifier of the test case to be stored is different from the version identifier of the latest test case, the latest test case is obtained from the database.
Specifically, fig. 3 is a schematic triggering diagram of the second operation instruction, as shown in fig. 3, after the user modifies the basic test case through the terminal device, the user may save the modified test case by triggering a "save" control on the operation interface, where the modified test case is the test case to be saved. The terminal equipment receives a second operation instruction triggered by the user, carries the test case to be saved and the version identifier of the test case to be saved in a third message and sends the third message to the server, and the server acquires the version identifier of the latest test case saved in the database according to the third message.
When the server stores the modified test case, if the version identification of the test case to be stored is determined to be the same as the version identification of the latest test case stored in the database, the user does not store the test case before description, at the moment, no data conflict exists, and the server modifies the version identification of the test case to be stored according to the version identification of the latest test case, and stores the test case to be stored.
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, the server indicates that the user already saves the modified test case before the description, and at the moment, data conflict exists, and the server acquires the latest test case from the database.
For example, the user a and the user B modify the basic test case with the version identifier of 1.1 through different terminal devices, after the modification of the user a is completed, a save message is sent to the server through the terminal device, where the save message includes the test case with the modification of the user a completed and the version identifier of 1.1, the server will obtain the version identifier of the latest test case stored in the database, if the version identifier of the latest test case is also 1.1, it is described that no other user modifies and saves the test case before, and the server uses the automatic self-increasing version number as the version identifier of the current test case, for example, modifies to 1.2, and at this time, the test case after the modification of the user a is the latest test case saved in the database, and the version identifier of the latest test case is 1.2.
After the modification of the user B is finished, a save message is sent to a server through a corresponding terminal device, the save message comprises the test case with the modified user B and the version identification 1.1, the server acquires the version identification of the latest test case stored in the database, the version identification of the latest test case acquired at the moment is 1.2, the version identification is different from the version identification of the test case to be saved, other users save the test case before the description, the server acquires the latest test case with the version identification 1.2, and the test case with the modified user B to be saved is determined as the test case to be saved.
When the Version identifier of the test case is updated, the server generally determines whether the Version identifier is the first Version, if so, the server sets the current Version identifier for the test case, generally defaults the Version identifier of the test case to 1.1, saves the set Version identifier in a database Version table, and returns the Version identifier to the terminal device. In addition, after the Content of the test Case is created, all information of the test Case is converted into an Xml form to be stored as the Content, wherein a version identifier (version ID) field is set as a returned version identifier ID, and the version identifier ID is stored in a database Case Content table.
Further, if the version is not the first version, the version identifier of the latest test case stored in the current database is queried, and the automatic self-increasing version number is used as the current version identifier, wherein the logic of the automatic self-increasing version number is as follows: if a small modification, the last digit is self-incremented, such as: newly added from 1.1 to 1.2, if it is a big modification, the first digit is self-added and the last digit is reset to 1, such as: 2.1 is added from 1.3. The determination of the version number may be determined by the server according to the content modified by the user, or may be determined by the server according to the version number in a modification message that is sent by the user to the server through the terminal device and that carries the version number.
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 latest test case is acquired from the database to determine difference data between the test case to be saved and the latest test case, so that a phenomenon that the latest test case is directly covered by the test case to be saved can be avoided.
Step 202: the server determines at least one difference data of the test case to be saved and the latest test case, and a difference type corresponding to the difference data, wherein the difference type comprises at least one of an addition type, a deletion type and a modification type.
In this step, when it is determined that the test case to be saved is not the first version of the test case and the version identifier of the test case to be saved is different from the version identifier of the latest test case, the server compares at least one difference data between the acquired test case to be saved and the latest test case with a difference type corresponding to each difference data. The difference data may be understood as data different between the test case to be saved and the latest test case.
In one possible implementation manner, the test case to be saved and the latest test case can be compared, the longest public subsequence of the test case to be saved and the latest test case can be determined, the test case to be saved and the latest test case are respectively compared with the longest public subsequence, different data between the test case to be saved and the longest public subsequence and different data between the latest test case and the longest public subsequence are determined to be at least one difference data, and then the difference type corresponding to the difference data is determined according to the at least one difference data and the longest public subsequence.
Specifically, in the embodiment of the application, at least one difference data of the test case to be saved and the latest test case and the difference type corresponding to each difference data can be determined through a Myers difference algorithm.
The Myers difference algorithm is an algorithm for comparing text differences, and generates minimum change from old data to new data by comparing differences of new and old data sets. Mainly solves the problem of the longest common subsequence (Longest Common Subsequence, LCS).
Specifically, the server first splits the test case to be saved and the latest test case into character strings according to each row of content, so as to obtain two data sets, namely a source data set original and a revised data set revised. Then, the data sets, namely the input source data set original and the revised data set revised, are processed by using a Myers differential algorithm implemented in Google DiffUtils framework tool class, and after algorithm operation, LCS of each row of character strings in the two data sets can be obtained, so that a Delta list of each row of differential information can be obtained. The Delta list of each row of difference information includes a different string set origin diff compared with each row of source data set origin and a different string set REVISED DIFF compared with each row of revision data set revised and a position of the beginning of each row, and then the operation type, that is, the difference type, is obtained according to the compared difference string information.
Wherein Google DiffUtils framework tool class is a Myers differential algorithm implementation tool class provided by Google. And (5) returning a difference information Deltas object list by comparing the two data sets. The Deltas object includes the content of each line of characters and the position of the characters of the source data and the comparison data, and the operation types obtained by the comparison, such as addition, modification, deletion, and the like.
For example, if the test case to be saved is abcdefg, the latest test case is defghjk, the longest common subsequence LCS of the test case to be saved and the latest test case are defg by comparing the test case to be saved and the latest test case, then the LCS are compared with the test case to be saved, the difference data is abc, the difference type is a deletion type, the LCS are compared with the latest test case defghjk, the difference data is hjk, and the difference type is an addition type.
Further, a list of types of addition INSERTLIST, deletion DELETELIST, and modification CHANGELIST, which are used to hold classified information, respectively, may be newly built INSERTLIST in the server in advance. After the difference data is obtained, each difference data and the corresponding difference type can be circularly traversed, and each difference data is respectively stored in the corresponding list for subsequent checking by a user, so that the operation of the user can be facilitated, and the user experience is improved.
In this embodiment, since the Myers differential algorithm has higher performance when processing a large amount of data, the server determines at least one differential data between the test case to be saved and the latest test case and the differential type corresponding to the differential data through the Myers differential algorithm, so that not only can the efficiency of determining the differential data and the differential type be improved, but also the accuracy can be improved.
Step 203: the server sends a first message to the first terminal device, wherein the first message comprises difference data and difference types.
In this step, after determining at least one difference data of the test case to be saved and the latest test case and a difference type corresponding to each difference data, the server may carry the determined difference data and the corresponding difference type in the first message and send the first message to the first terminal device in order to enable the user to intuitively browse modifications made by other users to the basic test case and the difference data and the difference type between other users and the content modified by the user through the terminal device.
For example, in order for the difference data of different difference types to be displayed in different forms on the first terminal device, the server needs to process the difference data according to the difference types. For example, different types of difference data may be displayed in different colors, such as delete type of difference data, add type of difference data, green, modify type of difference data, blue, and the like. It should be appreciated that the same data between the test case to be saved and the latest test case may be displayed normally.
If the added type of difference data is displayed in green, the server may process the difference data as follows:
INSERT_TAG_BEGIN="<span
style='background:rgba(0,191,165,0.16);display:inline-block'>";
INSERT_TAG_END="</span>";
If the difference data of the deletion type is displayed in red, the server may process the difference data as follows:
DELETE_TAG_BEGIN="<span
style='background:rgba(226,59,59,0.16);display:inline-block'>";
DELETE_TAG_END="</span>"
In addition, if of the DELETE type, a list of characters of the original diff in dalta may be selected and delete_tag_begin and DELET _tag_end added before and after each character.
If of the increment type, a list of REVISED DIFF characters in dalta may be selected, with an INSERT_TAG_BEGIN and INSERT_TAG_END added before and after each character.
If of the modified type, the original diff and REVISED DIFF character list in dalta can be selected and the deleted and added content tags of the two can be processed respectively.
And the server sequentially splices all the processed character lists through the position field to generate new content, and sends the new content to the first terminal equipment.
The first terminal device analyzes the difference data in the first message after receiving the first message, and displays the difference data in different manners according to different difference types.
For example, fig. 4 is a schematic diagram showing difference data, assuming that a test case to be saved is abcdefg, a latest test case is defghjk, and it is determined that the test case to be saved is abc compared with LCS, the difference type is delete type, the latest test case is hjk compared with LCS, and the difference type is add type. As shown in fig. 4, the first terminal device may display the difference data in a spliced manner, for example, delete the difference data, display the difference data in an increased type by using a diagonal line as a background, display the difference data in a modified type by using a horizontal line as a background, and display the difference data in other backgrounds, so long as the difference data can be distinguished from the delete type and the increased type data. Of course, different difference data and difference types may be distinguished in other manners, for example, different colors may be used for display according to the difference type, such as deleting the difference data of the type, displaying the difference data of the type in red, adding the difference data of the type, displaying the difference data of the type in green, modifying the difference data of the type in blue, and the like. It should be appreciated that the same data between the test case to be saved and the latest test case may be displayed normally.
Step 204: the first terminal equipment determines target difference data and a target difference type corresponding to the target difference data, wherein the target difference data is data in at least one difference data.
In this step, after receiving the difference data, the first terminal device may display the difference data and the corresponding difference type to the user, where the user selects the data that wants to be retained according to his own requirement, so that a first operation instruction may be triggered through the display interface, where 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.
For example, with continued reference to FIG. 4, if the user wants to retain the discrepancy data "hjk" in the final test case, the discrepancy data "hjk" may be determined to be the target discrepancy data, and the discrepancy type of the target discrepancy data is the increment type. The user triggers the first operation instruction by clicking on "hjk". Of course, the user may trigger the first operation instruction by pressing for a long time or other operation manners.
In addition, after receiving the difference data and the difference type, the first terminal device may determine, according to a preset rule, the target difference data and the target difference type corresponding to the target difference data from the difference data. For example, difference data in which all difference types are added types, a target difference type, and the like are determined.
Step 205: the first terminal device sends a second message to the server, wherein the second message comprises target difference data and a target difference type corresponding to the target difference data.
In this step, the first terminal device sends a second message to the server after determining the target difference data and the corresponding target difference type.
The first terminal device receives the first operation instruction triggered by the user, and then sends the target difference data selected by the user and the target difference type corresponding to the target difference data to the server in a second message. The target difference data may include part of the difference data or may include all of the difference data.
The first terminal device may also send the target difference data determined according to the preset rule and the target difference type corresponding to the target difference data to the server in the second message.
Step 206: and the server generates a target test case according to the target difference data, the target difference type and the latest test case.
In the 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 stored in the database, and stores the target test case. Because the tester can select target difference data from at least one difference data to store according to the own requirement, rather than adopting the later-stored test case to cover the previously-stored test case, the accuracy of the target test case can be improved.
In one possible implementation manner, when the server generates the target test case, if it determines that the target difference data corresponding to the target difference type is data in the latest test case, the latest test case is determined to be the target test case.
Specifically, if the target difference data is data obtained by modifying the basic test case in the latest test case, at this time, it is explained that the difference data which the user wants to save are all data in the latest test case, so that the latest test case can be determined as the target test case.
If it is determined that the target difference data corresponding to the target difference type is 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 data obtained by modifying the basic test case in the test case to be saved, at this time, it is indicated that the difference data which the user wants to save is all data in the test case to be saved, and at this time, the operation corresponding to the target difference type can be performed on the target difference data in the latest test case. For example, if the target difference type is an add type, the target difference data may be newly added to the latest test case, if the target difference type is a delete type, the target difference data may be deleted from the latest test case, and if the target difference type is a modify type, the target difference data may be modified from the latest test case.
If the first data in the target difference data is determined to be the data in the latest test case and the second data is the data in the test case to be stored, the first data and the difference type corresponding to the first data are kept unchanged in the latest test case, and in the latest test case, the second data is subjected to an operation corresponding to the difference type of the second data so as to generate the target test case.
Specifically, if the target difference data determined by the first terminal device includes a plurality of data, and a part of the first data is data in the latest test case, the server keeps the part of the difference data unchanged, that is, the part of the first data is kept in the latest test case. And if the other part of the second data is the data in the test case to be stored, the server performs corresponding operations, such as addition, deletion or modification, on the second data in the latest test case according to the difference type corresponding to the second data, so as to generate the target test case.
In this embodiment, the server may 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, so that accuracy of the target test case may be improved. 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 comprises the data modified by the user and also comprises the data modified by other users, so that the phenomenon that the test case saved later directly covers the test case saved before is avoided.
According to the processing method of the test case, when the basic test case is detected to be in an unlocked state, the latest test case stored in the test case to be stored and the latest test case stored in the database is obtained, at least one difference data of the test case to be stored and the latest test case and the difference type corresponding to the difference data are determined, then a first message is sent to the first terminal equipment, the first message comprises the difference data and the difference type, the second message sent by the first terminal equipment is received, the second message comprises 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, the target test case is generated by determining at least one difference data of the test case to be saved and the latest test case and according to the target difference data and the corresponding target difference type determined from the at least one difference data by the first terminal equipment, so that the phenomenon that the test case saved before the test case saved after the direct adoption of the test case in the prior art is covered is avoided, the difference data can be saved selectively, and the accuracy of the target test case can be improved.
Fig. 5 is another signaling diagram of a processing method of a test case according to an embodiment of the present application, and the embodiment shown in fig. 5 further describes in detail how to resolve a process of editing conflicts when multiple persons edit the same test case at the same time based on the embodiment shown in fig. 2. As shown in fig. 5, the processing method of the test case provided by the embodiment of the application includes the following steps:
step 501: the first terminal equipment receives a third operation instruction triggered by a user, wherein the third operation instruction comprises a version identifier of a basic test case to be locked.
Specifically, when the user edits the basic test case, the first terminal device may send the version identifier ID curVersionId of the currently edited basic test case and the data of the basic test case to the server, so as to store the data in the database redis. If the user does not want other users to edit the basic test case at the same time, the user can select to lock the basic test case. Fig. 6 is a schematic diagram of triggering a third operation instruction, as shown in fig. 6, in which a user is editing a test case "aabbccdd", and may choose to lock the test case according to his own requirement, for example, by clicking a "lock" control, so as to trigger the third operation instruction, where the third operation instruction includes a version identifier of the basic test case to be locked, such as a version identifier curVersionId of the test case "aabbccdd".
If the user selects to lock the basic test case, the user can only edit the basic test case currently, and other users can only read and cannot write, and in the test case editing page of the terminal equipment corresponding to other users, the basic test case is displayed to be locked or locked by the user, and the like.
Step 502: and the first terminal equipment sends a fourth message to the server according to the third operation instruction, wherein the fourth message comprises the version identification 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 carries the version identifier of the basic test case to be locked in the fourth message and sends the fourth message to the server.
Step 503: according to the fourth message, when the server detects that the basic test case corresponding to the first terminal equipment is in the locking state, a locking message is sent to second terminal equipment except the first terminal equipment, the locking message comprises a version identifier of the basic test case to be locked, and the locking message is used for indicating the second terminal equipment to set the basic test case to be locked corresponding to the second terminal equipment to be in the locking state.
In this step, if the server determines that the basic test case is in the locked state according to the received fourth message, it is explained that the user does not want to let other users edit the basic test case at this time, so that the version identifier of the basic test case to be locked is carried in the locked message and sent to the second terminal device, and in this way, the second terminal device sets the basic test case to be locked in the locked state. The tester cannot edit the locked basic test case through the second terminal device, but only can check the locked basic test case.
In this embodiment, the user may 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 occurrence of data collision of the test case.
Further, when a preset condition is met, the server sends an unlocking message to the second terminal device, wherein the unlocking message comprises a version identifier of the basic test case in a locked state, and the unlocking message is used for indicating to generate a first numerical value and indicating the second terminal device to unlock the basic test case in the locked state when judging that the first numerical value is identical to a second numerical value stored in advance; the preset condition includes that the locking time of the basic test case in the locked state exceeds the preset time, and/or a fifth message sent by the first terminal equipment is received, wherein the fifth message is used for indicating that the basic test case in the locked state is stored.
Specifically, when the lock duration of the basic test case in the locked state is monitored to exceed the preset duration through webSocket, the server may send an unlocking message to the second terminal device, so that the second terminal device unlocks the basic test case in the locked state according to the unlocking message, thereby preventing the phenomenon that the test case is edited by a user all the time, and improving the experience of the user.
In addition, if the user edits the basic test case in the locked state, a fourth operation instruction may be triggered to save the edited basic test case. After receiving a fourth operation instruction triggered by the user, the first terminal device sends a fifth message to the server, and the server sends an unlocking message to the second terminal device according to the received fifth message, so that the second terminal device unlocks the test case in the locked state according to the unlocking message, and other users can edit the test case continuously, and user experience is improved.
In addition, the preset condition may be that the server monitors, through webSocket, that the locking 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, sends an unlocking message to the second terminal device.
Further, the preset condition may further include that the server monitors that the first terminal device exits the interface for editing the test case in the locked state through webSocket.
In the following, a manner of realizing a distributed lock and unlocking a server is described, where the distributed lock refers to that when there is only one copy (or limitation) of data in a distributed system, the number of processes of modifying the data at a time needs to be controlled by using the lock technology.
In particular, the server may implement a distributed lock based on redis, which may be implemented, for example, based on the following redis commands: SET key value [ EX seconds ] [ PX milliseconds ] [ nx|xx ], wherein EX seconds represents an expiration time in seconds, PX milliseconds represents an expiration time in milliseconds, NX is a SET value only when a key is not present, XX is a SET value only when a key is present.
The realization idea is as follows: when the LOCK is obtained, the version identifier Id of the test case to be locked is added with the 'LOCK' to be spliced to be used as a key, the value of the LOCK is a unique identification code (Universally Unique Identifier, UUID) which is randomly generated, and whether the LOCK is self can be judged when the LOCK is released through the value. In addition, by setting the parameter NX and adding a timeout period expire Time Units to the lock, if the lock state is monitored to be timeout, the lock is automatically released, that is, when the locked test case is not operated for a long time or edited, the lock is automatically released.
When the second terminal device releases the lock, a first value is randomly generated, and when the first value is judged to be the same as a second value stored in advance, the second terminal device can determine the second terminal device to release the lock, so that the lock releasing operation is executed. In the application, when the lock is released, the key is not directly deleted, and because the key is directly deleted, all second terminal equipment can be unlocked, so that certain test cases which do not need to be unlocked are unlocked, and the user experience is poor.
For example, fig. 6 is a schematic diagram of locking and unlocking a test case to be locked, as shown in fig. 6, if the system includes a distributed server cluster, that is, includes a plurality of servers A, B and C, a redis component in the distributed server cluster may cache version information of the test case and contents of the test case. The server cluster determines that a server establishes webSocket connection with the first terminal device from the server cluster according to the version identifier and the user Identifier (ID) of the test case to be locked, for example, it may be determined that the server B establishes webSocket connection with the first terminal device. The server B may establish connection webSocket according to the onOpen storage, obtain the content of the test case in the redis according to the version information of the test case, and send the content to the first terminal device. In addition, the established webSocket connection may be removed according to onClose, and the unlocking information of the version information of the test case may be stored and stored in redis, and meanwhile, the unlocking message may be sent to the second terminal device. The server B may also monitor, according to onMessage, information sent by the first terminal device, and lock or unlock the test case in redis, for example, monitor whether the first terminal device currently exits editing the test case, or whether a save message for the test case is triggered, or monitor whether the editing time of the test case by the user through the first terminal device is overtime, or so on.
For the first terminal device to first initialize webSocket when it establishes webSocket a connection with the server. Illustratively, webSocket initialization may be accomplished as follows: webSocket = new webSocket (SocketUrl + "/webSocket/" + contentId + "/" +username). After the initialization is completed, the state information of the basic test case to be locked, which is sent by the server, is monitored through websocket.onmessage, and whether locking is needed or not is displayed according to the state information of the basic test case to be locked. In addition, the state information of the basic test case to be locked can be sent to the server through websocket.send (the state information of the test case to be locked), so as to inform the server that the basic test case to be locked needs to be locked, or the state information of the basic test case in the locked state can be sent to the server through websocket.send (the state information of the test case in the locked state), so as to inform the server that the basic test case in the locked state needs to be unlocked. Furthermore, the first terminal device may monitor the state of the server through websocket.
In the embodiment of the application, when the server detects that the basic test case corresponding to the first terminal equipment is in the locking state, the server can control the basic test case on the second terminal equipment to be locked, so that the phenomenon of data conflict caused when a plurality of users edit the same basic test case at the same time can be avoided. Further, when it is determined that the preset condition is met, the server sends an unlocking message to the second terminal device to unlock the basic test case in the locked state, so that other users can be guaranteed to edit the basic test case continuously, and user experience is improved.
Furthermore, on the basis of the above embodiments, the test case version modified by each user may be stored, so that the user may query the data of all the historical version test cases modified by the user according to the version identifier. For example, if the user selects to rollback to view a test case of a previous version, the server copies the data of the test case of the historical version and generates a new test case, thereby creating test case content and storing the test case content as a new version identifier.
In this embodiment, not only can the target test cases 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 check the test cases of any history version, and the user experience can be improved.
Fig. 7 is another signaling diagram of a processing method of a test case according to an embodiment of the present application, as shown in fig. 7, where the method includes:
Step 701: and the first terminal equipment receives a fifth operation instruction triggered by the user, wherein the fifth operation instruction is used for indicating whether the test case needs to be locked or not.
If the user needs to edit the test case to be locked by a single person according to his own needs, a fifth operation instruction may be sent to the first terminal device, where the fifth operation instruction is used to indicate that the test case needs to be locked, and the fifth operation instruction includes a version identifier of the test case to be locked, where a triggering manner of the fifth operation instruction is similar to a third operation instruction in the foregoing embodiment, and details are not repeated herein.
If the fifth operation instruction is used for indicating that the test case does not need to be locked, the test case is indicated to allow multiple people to edit at the same time.
If the test case needs to be locked, step 702 is executed, otherwise, step 705 is executed.
Step 702: the first terminal device sends a fourth message to the server, wherein the fourth message comprises the version identification of the test case to be locked.
Step 703: and the server sends a locking message to a second terminal device except the first terminal device according to the fourth message, wherein the locking message comprises the version identification of the test case to be locked, and the locking message is used for indicating the second terminal device to set the test case to be locked into a locking state.
Step 704: the server monitors whether the preset condition is met, and when the preset condition is met, the server sends an unlocking message to the second terminal equipment, wherein the unlocking message comprises the version identification of the test case in the locked state, and the unlocking message is used for indicating the second terminal equipment to unlock the test case in the locked state.
Wherein the preset conditions include at least one of: the locking time of the test case in the locking state exceeds the preset time, a fifth message sent by the first terminal equipment is received, and the first terminal equipment is monitored to exit the editing interface of the test case in the locking state.
If the first terminal equipment is monitored not to meet the preset condition, waiting for the user to continuously edit the test case through the first terminal equipment until the preset condition is met, and unlocking the test case in the locked state.
In addition, when the user saves the edited test case through the first terminal equipment, the first terminal equipment sends the edited test case to the server, and the server creates a new version for the test case and saves the test case.
Step 705: the first terminal equipment sends a third message to the server, wherein the third message comprises the test case to be saved and the version identification of the test case to be saved.
If the same test case allows multiple persons to edit at the same time, when the user finishes editing and saves the test case, a third message is sent to the server through the first terminal equipment.
Step 706: and the server acquires the version identification 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 latest test case is acquired from the database.
If the version identifier of the test case to be saved is different from the version identifier of the latest test case, the fact that the user edits and saves the test case before the fact that data conflict exists is explained, and at the moment, the latest test case needs to be acquired from a database.
Step 708: the server determines at least one difference data of the test case to be saved and the latest test case and a difference type corresponding to the difference data.
Wherein the difference type includes at least one of an add type, a delete type, and a modify type.
Step 709: the server sends a first message to the first terminal device, wherein the first message comprises difference data and the difference type.
Step 710: the first terminal device displays the difference data and the difference type.
Step 711: the method comprises the steps that first operation instructions triggered by a user are received by first terminal equipment, the first operation instructions comprise target difference data and target difference types corresponding to the target difference data, and the target difference data are data in at least one difference data.
Step 712: and the first terminal equipment sends a second message to the server according to the first operation instruction, wherein the second message comprises target difference data and target difference types.
Step 713: and the server generates a target test case according to the target difference data, the target difference type and the latest test case.
After the server generates the target test case, a new version identifier is created for the target test case and stored.
According to the processing method of the test cases, on one hand, when the server stores the test cases to be stored, the target test cases are generated according to the target difference data selected by the user from the at least one difference data and the corresponding target difference types by determining at least one difference data of the test cases to be stored and the latest test cases, so that the phenomenon that the test cases stored before the test cases stored after the user are directly adopted in the prior art are covered is avoided, the user can selectively store the difference data according to own requirements, and the accuracy of the target test cases can be improved. On the other hand, the server can lock the test cases according to the requirement information sent by the user, so that data conflict caused when a plurality of people edit the same test case at the same time can be avoided.
Fig. 8 is a schematic diagram of a processing apparatus for a test case according to an embodiment of the present application, and as shown in fig. 8, the processing apparatus 80 for a test case includes:
The processing module 801 is configured to obtain a test case to be saved and a latest test case saved in a database, where the test case to be saved and the latest test case are obtained by modifying a 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, where the difference type includes at least one of an add type, a delete type, and a modify type;
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 data and the difference type;
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 data in the 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.
Optionally, the processing module 801 is specifically configured to:
Receiving a third message sent by the first terminal equipment, wherein the third message comprises the test case to be stored and a version identifier of the test case to be stored;
according to the third message, the version identification of the latest test case is obtained;
And if the version identifier of the test case to be stored is different from the version identifier of the latest test case, acquiring the latest test case from the database.
Optionally, the processing module 801 is specifically configured to:
And determining at least one difference data of the test case to be saved and the latest test case and a difference type corresponding to the difference data through a Myers difference algorithm.
Optionally, the processing module 801 is specifically configured to:
if the target difference data corresponding to the target difference type is determined to be the data in the latest test case, determining the latest test case as the target test case; or alternatively
If the target difference data corresponding to the target difference type is determined to be the data in the test case to be stored, performing an operation corresponding to the target difference type on the target difference data in the latest test case to generate the target test case; or alternatively
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, the first data and the difference type corresponding to the first data are kept unchanged in the latest test case, 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 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 locking message to a second terminal device other than the first terminal device according to the fourth message, where the locking message includes a version identifier of the test case to be locked, and the locking message is used to instruct the second terminal device to set the test case to be locked to a locked state.
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 a version identifier of the test case in a locked state, and the unlock 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 time of the test case in the locked state exceeds a preset time, and/or a fifth message sent by the first terminal device is received, where the fifth message is used for indicating that the test case in the locked state is stored.
The processing device 80 for test cases provided in the embodiment of the present application may execute the technical scheme of the processing method for test cases in any of the embodiments, and the implementation principle and the beneficial effects of the processing device for test cases are similar to those of the processing method for test cases, and can refer to the implementation principle and the beneficial effects of the processing method for test cases, which are not described herein.
Fig. 9 is a schematic diagram of a processing apparatus for a test case according to an embodiment of the present application, and as shown in fig. 9, a processing apparatus 90 for a test case includes:
The receiving module 901 is configured to receive a first message sent by a server, where the first message includes at least one difference data and a difference type corresponding to each difference data, where the difference data is difference data between a test case to be saved and a latest test case, and the test case to be saved and the latest test case are obtained after a basic test case is modified;
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 data in the 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 is used to instruct the server to generate a target test case according to the target difference data, the target difference type, and the latest test case.
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 store the test case to be stored;
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 a version identifier of the test case to be saved, and the third message is used to instruct the server to obtain the version identifier of the latest test case, and obtain the latest test case 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.
Optionally, the receiving module 901 is further configured to receive a third operation instruction triggered by the user, where the third operation instruction includes a 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 a version identifier of the test case to be locked, the fourth message is used to instruct the server to send a locking message to a second terminal device other than the terminal device, the locking message includes the version identifier of the test case to be locked, and the locking message is used to instruct the second terminal device to set the test case to be locked to a locked state.
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;
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 unlock message includes a version identifier of the test case in a locked state, and the unlock message is used to instruct the second terminal device to unlock the test case in the locked state.
The processing device 90 for test cases provided in the embodiment of the present application may execute the technical scheme of the processing method for test cases in any of the embodiments, and the implementation principle and the beneficial effects of the processing device for test cases are similar to those of the processing method for test cases, and can refer to the implementation principle and the beneficial effects of the processing method for test cases, which are not described herein.
It should be noted that, it should be understood that the division of the modules of the above device is merely a division of a logic function, and may be fully or partially integrated into a physical entity or may be physically separated. And these modules may all be implemented in software in the form of calls by the processing element; or can be realized in hardware; the method can also be realized in a form of calling software by a processing element, and the method can be realized in a form of hardware by a part of modules. For example, the determining module may be a processing element that is set up separately, may be implemented in a chip of the above-mentioned device, or may be stored in a memory of the above-mentioned device in the form of program codes, and may be called by a processing element of the above-mentioned device and execute the functions of the above-mentioned processing module. The implementation of the other modules is similar. In addition, all or part of the modules can be integrated together or can be independently implemented. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in a software form.
For example, the modules above may be one or more integrated circuits configured to implement the methods above, such as: one or more Application SPECIFIC INTEGRATED Circuits (ASIC), or one or more microprocessors (DIGITAL SIGNAL processors, DSP), or one or more field programmable gate arrays (field programmable GATE ARRAY, FPGA), etc. For another example, when a module above is implemented in the form of processing element scheduler code, the processing element may be a general purpose processor, such as a central processing unit (central processing unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
Fig. 10 is a schematic structural diagram of a server embodiment according to an embodiment of the present application. As shown in fig. 10, the server may include: the system comprises a processor 1001, a memory 1002, a communication interface 1003 and a system bus 1004, wherein the memory 1002 and the communication interface 1003 are connected with the processor 1001 through the system bus 1004 and complete communication with each other, the memory 1002 is used for storing computer execution instructions, the communication interface 1003 is used for communicating with other devices, and the processor 1001 realizes the technical scheme of the processing method of the test case shown in the embodiment when executing the computer program.
In fig. 10, the processor 1001 may be a general-purpose processor including a central processing unit CPU, a network processor (network processor, NP), and the like; but may also be a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
The memory 1002 may include random access memory (random access memory, RAM), read-only memory (RAM), and non-volatile memory (non-volatile memory), such as at least one disk memory.
The communication interface 1003 is used to enable communication between the database access apparatus and other devices (e.g., a client, a read-write library, and a read-only library).
The system bus 1004 may be a peripheral component interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The system bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figures are shown with only one bold line, but not with 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 present application. As shown in fig. 11, the terminal device may include: the system comprises a processor 1101, a memory 1102, a communication interface 1103 and a system bus 1104, wherein the memory 1102 and the communication interface 1103 are connected with the processor 1101 through the system bus 1104 and complete communication with each other, the memory 1102 is used for storing computer execution instructions, the communication interface 1103 is used for communicating with other devices, and the processor 1101 executes the computer program to realize the technical scheme of the processing method of the test case shown in the embodiment.
In fig. 11, the processor 1101 may be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), and the like; but may also be a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
The memory 1102 may include random access memory (random access memory, RAM), read-only memory (RAM), and non-volatile memory (non-volatile memory), such as at least one disk memory.
The communication interface 1103 is used to enable communication between the database access apparatus and other devices (e.g., clients, read-write libraries, and read-only libraries).
The system bus 1104 may be a peripheral component interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The system bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figures are shown with only one bold line, but not with 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, where when the computer instructions run on a computer, the computer is caused to execute the technical solution of the method for processing a test case as shown in the foregoing embodiment.
Optionally, the embodiment of the present application further provides a chip for executing an instruction, where the chip is configured to execute the technical scheme of the processing method of the test case shown in the foregoing embodiment.
The embodiment of the application also provides a program product, which comprises a computer program, the computer program is stored in a computer readable storage medium, at least one processor can read the computer program from the computer readable storage medium, and the at least one processor can realize the technical scheme of the processing method of the test case shown in the embodiment when executing the computer program.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a 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 arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (15)

1. A method for processing a test case, the method being applied to a server, the method comprising:
if the basic test case is detected to be in an unlocked state, acquiring the test case to be saved and the latest test case saved in a database, wherein the test case to be saved and the latest test case are obtained by respectively modifying the basic test case;
Determining at least one difference data of the test case to be saved and the latest test case and a difference type corresponding to the difference data, wherein the difference type comprises at least one of an addition type, a deletion type and a modification type;
sending a first message to a first terminal device, wherein the first message comprises the difference data and the difference type; receiving a second message sent by the first terminal device, wherein the second message comprises target difference data and a target difference type corresponding to the target difference data, and the target difference data is data in the at least one difference data;
Generating a target test case according to the target difference data, the target difference type and the latest test case;
The obtaining the latest test case to be saved in the test case and the database comprises the following steps:
Receiving a third message sent by the first terminal equipment, wherein the third message comprises the test case to be stored and a version identifier of the test case to be stored;
according to the third message, the version identification of the latest test case is obtained;
If the version identifier of the test case to be stored is different from the version identifier of the latest test case, acquiring the latest test case from the database, and taking the automatic self-increasing version number as the version identifier of the latest test case;
wherein the method further comprises:
If the version identifier of the test case to be saved is the same as the version identifier of the latest test case, modifying the version identifier of the test case to be saved according to the version identifier of the latest test case, and storing the test case to be saved, wherein the method specifically comprises the following steps: when the Version identifier of the test case to be saved is updated, judging whether the Version identifier of the test case to be saved is a first Version or not, if so, setting a current Version identifier for the test case to be saved, and saving the set Version identifier into a database Version table; otherwise, if the version is not the first version, inquiring the version identifier of the latest test case stored in the current database, and automatically adding the version number as the current version identifier, wherein the method specifically comprises the following steps: determining according to the quantity of the content modified by the user, wherein the more the content is modified, the larger the version identification change is, and the less the content is modified, the smaller the version identification change is;
The determining 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 comprises the following steps:
comparing the test case to be saved with the latest test case, and determining the longest public subsequence of the test case to be saved and the latest test case;
comparing the test case to be saved with the latest test case and the longest public subsequence respectively, and determining different data between the test case to be saved and the longest public subsequence and different data between the latest test case and the longest public subsequence as the at least one difference data;
and determining a difference type corresponding to the difference data according to the at least one difference data and the longest common subsequence.
2. The method of claim 1, wherein generating the target test case based on the target difference data, the target difference type, and the latest test case comprises:
if the target difference data corresponding to the target difference type is determined to be the data in the latest test case, determining the latest test case as the target test case; or alternatively
If the target difference data corresponding to the target difference type is determined to be the data in the test case to be stored, performing an operation corresponding to the target difference type on the target difference data in the latest test case to generate the target test case; or alternatively
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, the first data and the difference type corresponding to the first data are kept unchanged in the latest test case, 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.
3. The method according to claim 1, wherein the method further comprises:
if the basic test case corresponding to the first terminal equipment is detected to be in a locking state, a locking message is sent to second terminal equipment except the first terminal equipment, the locking message comprises a version identifier of the basic test case, and the locking message is used for indicating the second terminal equipment to set the basic test case corresponding to the second terminal equipment to be in the locking state.
4. A method according to claim 3, characterized in that the method further comprises:
When a preset condition is met, an unlocking message is sent to the second terminal equipment, wherein the unlocking message comprises a version identifier of a basic test case in a locked state, and the unlocking message is used for indicating to generate a first numerical value and indicating the second terminal equipment to unlock the basic test case in the locked state when judging that the first numerical value is identical to a second numerical value stored in advance; the preset conditions include that the locking time of the basic test case in the locked state exceeds a preset time, and/or a fifth message sent by the first terminal device is received, where the fifth message is used for indicating that the basic test case in the locked state is stored.
5. The processing method of the test case is characterized by being applied to terminal equipment, and comprises the following steps:
Receiving a first message sent by a server, wherein the first message comprises at least one piece of difference data and a difference type corresponding to each piece of difference data, the difference data is the difference data between a test case to be stored and a latest test case, and the test case to be stored and the latest test case are obtained after the basic test case is modified;
Determining target difference data and a target difference type corresponding to the target difference data, wherein the target difference data is data in the at least one difference data;
sending a second message to the server, wherein the second message comprises the target difference data and the target difference type, and the second message is used for indicating the server to generate a target test case according to the target difference data, the target difference type and the latest test case;
The test case to be saved and the latest test case are obtained by the server in the following manner:
Receiving a third message sent by first terminal equipment, wherein the third message comprises the test case to be saved and a version identifier of the test case to be saved;
according to the third message, the version identification of the latest test case is obtained;
If the version identifier of the test case to be stored is different from the version identifier of the latest test case, acquiring the latest test case from a database, and taking an automatic self-increasing version number as the version identifier of the latest test case;
If the version identifier of the test case to be saved is the same as the version identifier of the latest test case, modifying the version identifier of the test case to be saved according to the version identifier of the latest test case, and storing the test case to be saved, wherein the method specifically comprises the following steps: when the Version identifier of the test case to be saved is updated, judging whether the Version identifier of the test case to be saved is a first Version or not, if so, setting a current Version identifier for the test case to be saved, and saving the set Version identifier into a database Version table; otherwise, if the version is not the first version, inquiring the version identifier of the latest test case stored in the current database, and automatically adding the version number as the current version identifier, wherein the method specifically comprises the following steps: determining according to the quantity of the content modified by the user, wherein the more the content is modified, the larger the version identification change is, and the less the content is modified, the smaller the version identification change is;
wherein, the at least one difference data and the difference type corresponding to each difference data are determined by the server through the following steps:
comparing the test case to be saved with the latest test case, and determining the longest public subsequence of the test case to be saved and the latest test case;
comparing the test case to be saved with the latest test case and the longest public subsequence respectively, and determining different data between the test case to be saved and the longest public subsequence and different data between the latest test case and the longest public subsequence as the at least one difference data;
and determining a difference type corresponding to the difference data according to the at least one difference data and the longest common subsequence.
6. The method of claim 5, 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;
And receiving a first operation instruction triggered by a user, wherein the first operation instruction comprises the target difference data and the target difference type.
7. The method of claim 5, wherein the method further comprises:
receiving a second operation instruction triggered by a user, wherein the second operation instruction is used for storing the test case to be stored;
According to the second operation instruction, a third message is sent to the server, wherein the third message comprises the test case to be saved and the version identifier of the test case to be saved, the third message is used for indicating the server to obtain the version identifier of the latest test case, and the latest test case is obtained 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.
8. The method according to any one of claims 5-7, further comprising:
receiving a third operation instruction triggered by a user, wherein the third operation instruction comprises a version identifier of a basic test case to be locked;
According to the third operation instruction, a fourth message is sent to the server, the fourth message comprises a version identifier of the basic test case to be locked, the fourth message is used for indicating the server to send a locking message to a second terminal device except the terminal device, the locking message comprises the version identifier of the basic test case to be locked, and the locking message is used for indicating the second terminal device to set the basic test case to be locked corresponding to the second terminal device to be in a locking state.
9. The method of claim 8, wherein the method further comprises:
receiving a fourth operation instruction triggered by the user, wherein the fourth operation instruction is used for indicating to store the basic test case in a locked state;
according to the fourth operation instruction, a fifth message is sent to the server, the fifth message is used for indicating the server to send an unlocking message to the second terminal device, the unlocking message comprises a version identifier of the basic test case in a locked state, the unlocking message is used for indicating to generate a first numerical value, and the second terminal device is indicated to unlock the basic test case in the locked state when judging that the first numerical value is identical to a pre-stored second numerical value.
10. A test case processing apparatus, comprising:
The processing module is used for acquiring a test case to be stored and a latest test case stored in the database when the basic test case is detected to be in an unlocked state, wherein the test case to be stored and the latest test case are obtained by respectively modifying the basic test case;
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 at least one of an add type, a delete type, and a modify type;
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;
The receiving module is used for receiving a second message sent by the first terminal equipment, wherein the second message comprises target difference data and a target difference type corresponding to the target difference data, and the target difference data is data in the at least one difference data;
the processing module is further used for generating a target test case according to the target difference data, the target difference type and the latest test case;
The obtaining the latest test case to be saved in the test case and the database comprises the following steps:
Receiving a third message sent by the first terminal equipment, wherein the third message comprises the test case to be stored and a version identifier of the test case to be stored;
according to the third message, the version identification of the latest test case is obtained;
If the version identifier of the test case to be stored is different from the version identifier of the latest test case, acquiring the latest test case from the database, and taking the automatic self-increasing version number as the version identifier of the latest test case;
If the version identifier of the test case to be saved is the same as the version identifier of the latest test case, modifying the version identifier of the test case to be saved according to the version identifier of the latest test case, and storing the test case to be saved, wherein the method specifically comprises the following steps: when the Version identifier of the test case to be saved is updated, judging whether the Version identifier of the test case to be saved is a first Version or not, if so, setting a current Version identifier for the test case to be saved, and saving the set Version identifier into a database Version table; otherwise, if the version is not the first version, inquiring the version identifier of the latest test case stored in the current database, and automatically adding the version number as the current version identifier, wherein the method specifically comprises the following steps: determining according to the quantity of the content modified by the user, wherein the more the content is modified, the larger the version identification change is, and the less the content is modified, the smaller the version identification change is;
The determining 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 comprises the following steps:
comparing the test case to be saved with the latest test case, and determining the longest public subsequence of the test case to be saved and the latest test case;
comparing the test case to be saved with the latest test case and the longest public subsequence respectively, and determining different data between the test case to be saved and the longest public subsequence and different data between the latest test case and the longest public subsequence as the at least one difference data;
and determining a difference type corresponding to the difference data according to the at least one difference data and the longest common subsequence.
11. A test case processing apparatus, comprising:
The system comprises a receiving module, a storage module and a processing module, wherein the receiving module is used for receiving a first message sent by a server, the first message comprises at least one piece of difference data and a difference type corresponding to each piece of difference data, the difference data are difference data between a test case to be stored and a latest test case, and the test case to be stored and the latest test case are obtained after the basic test case is modified;
The display module is used for displaying the difference data and the difference type;
the processing module is used for determining target difference data and a target difference type corresponding to the target difference data, wherein the target difference data is data in the at least one difference data;
the sending module is used for sending a second message to the server, wherein the second message comprises the target difference data and the target difference type, and the second message is used for indicating the server to generate a target test case according to the target difference data, the target difference type and the latest test case;
The test case to be saved and the latest test case are obtained by the server in the following manner:
Receiving a third message sent by first terminal equipment, wherein the third message comprises the test case to be saved and a version identifier of the test case to be saved;
according to the third message, the version identification of the latest test case is obtained;
If the version identifier of the test case to be stored is different from the version identifier of the latest test case, acquiring the latest test case from a database, and taking an automatic self-increasing version number as the version identifier of the latest test case;
If the version identifier of the test case to be saved is the same as the version identifier of the latest test case, modifying the version identifier of the test case to be saved according to the version identifier of the latest test case, and storing the test case to be saved, wherein the method specifically comprises the following steps: when the Version identifier of the test case to be saved is updated, judging whether the Version identifier of the test case to be saved is a first Version or not, if so, setting a current Version identifier for the test case to be saved, and saving the set Version identifier into a database Version table; otherwise, if the version is not the first version, inquiring the version identifier of the latest test case stored in the current database, and automatically adding the version number as the current version identifier, wherein the method specifically comprises the following steps: determining according to the quantity of the content modified by the user, wherein the more the content is modified, the larger the version identification change is, and the less the content is modified, the smaller the version identification change is;
wherein, the at least one difference data and the difference type corresponding to each difference data are determined by the server through the following steps:
comparing the test case to be saved with the latest test case, and determining the longest public subsequence of the test case to be saved and the latest test case;
comparing the test case to be saved with the latest test case and the longest public subsequence respectively, and determining different data between the test case to be saved and the longest public subsequence and different data between the latest test case and the longest public subsequence as the at least one difference data;
and determining a difference type corresponding to the difference data according to the at least one difference data and the longest common subsequence.
12. A server, comprising:
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 any of claims 1-4.
13. A terminal device, comprising:
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 any of claims 5-9.
14. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program, which causes an electronic device to perform the method of any one of claims 1-9.
15. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the method of any of claims 1-9.
CN202011530719.8A 2020-12-22 2020-12-22 Processing method and device for test cases and storage medium Active CN112783760B (en)

Priority Applications (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
PCT/CN2021/138935 WO2022135276A1 (en) 2020-12-22 2021-12-16 Method and apparatus for processing test cases, and storage medium

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN112783760A CN112783760A (en) 2021-05-11
CN112783760B true CN112783760B (en) 2024-05-28

Family

ID=75751807

Family Applications (1)

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

Country Status (2)

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

Families Citing this family (4)

* 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
CN115460101B (en) * 2022-08-02 2024-06-11 北京达佳互联信息技术有限公司 Network service management method, device, equipment and storage medium
CN116841913B (en) * 2023-08-31 2023-12-29 美云智数科技有限公司 Test case generation method and device, electronic equipment and storage medium
CN117806981B (en) * 2024-03-01 2024-05-07 中国空气动力研究与发展中心计算空气动力研究所 CFD software automatic testing method and system

Citations (4)

* 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
US6715108B1 (en) * 1999-10-12 2004-03-30 Worldcom, Inc. Method of and system for managing test case versions
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN112069073A (en) * 2020-09-07 2020-12-11 深圳创维-Rgb电子有限公司 Test case management method, terminal and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101521608A (en) * 2009-01-22 2009-09-02 厦门东南融通系统工程有限公司 Method for edition management of test case
CN111984307A (en) * 2020-08-24 2020-11-24 北京思特奇信息技术股份有限公司 Processing method and device for automatically repairing baseline version
CN112783760B (en) * 2020-12-22 2024-05-28 深圳前海微众银行股份有限公司 Processing method and device for test cases and storage medium

Patent Citations (4)

* 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
US6715108B1 (en) * 1999-10-12 2004-03-30 Worldcom, Inc. Method of and system for managing test case versions
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN112069073A (en) * 2020-09-07 2020-12-11 深圳创维-Rgb电子有限公司 Test case management method, terminal and storage medium

Also Published As

Publication number Publication date
CN112783760A (en) 2021-05-11
WO2022135276A1 (en) 2022-06-30

Similar Documents

Publication Publication Date Title
CN112783760B (en) Processing method and device for test cases and storage medium
EP3435235B1 (en) Method and device for executing data recovery operation
CN105700939A (en) Method and system for multi-thread synchronization in distributed system
CN112256318B (en) Construction method and equipment for dependent product
CN110673933A (en) ZooKeeper-based distributed asynchronous queue implementation method, device, equipment and medium
CN114564852A (en) Operation method of FMEA data node and electronic equipment
CN107102995B (en) Method and device for determining SQL execution plan
CN112416957A (en) Data increment updating method and device based on data model layer and computer equipment
CN111857984A (en) Job calling processing method and device in bank system and computer equipment
CN109766317B (en) File deletion method, device, equipment and storage medium
CN112000670B (en) Multithreading program data unified management method and system and electronic equipment
US10764204B2 (en) Cloud extensibility framework
CN115220992A (en) Interface change monitoring method and device, computer equipment and storage medium
CN114756362A (en) Resource quota management method and system, intelligent terminal and storage medium
US20050198005A1 (en) Systems and methods for controlling access to an object
CN111813501A (en) Data deleting method, device, equipment and storage medium
CN114143187B (en) Intelligent platform interface network address management method, system, terminal and storage medium
CN112882922B (en) Test method and related device
WO2022027600A1 (en) Game engine resource processing method and apparatus, and electronic device and computer-readable storage medium
CN117354321A (en) Service data mirroring method and device, storage medium and electronic device
CN116382929A (en) Distributed lock processing method, device, electronic equipment and storage medium
WO2020223845A1 (en) Resource adding method, management device, and computer storage medium
CN114255004A (en) Transaction processing method, device, equipment and storage medium
CN117667250A (en) Application program model data loading method and device
CN117725052A (en) Index creation method, apparatus, computer device, and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant