Test case synchronization method and device, electronic equipment and readable storage medium

By providing a combination of test case specifications and writing tools on the test platform, the problem of insufficient flexibility in writing test cases in the existing technology is solved, custom and efficient test case synchronization is achieved, and testing efficiency is improved.

CN118897789APending Publication Date: 2024-11-05ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310512005.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

In the existing automated testing technology, the test case writing method is insufficient, cannot be customized, and is not flexible enough, resulting in low testing efficiency.

Method used

By providing test case specifications on the test platform and combining test case writing tools, responding to test case synchronization requests, traversing the directory to parse use cases, determining whether the use cases comply with the specifications, synchronizing the use cases that comply with the specifications to the database, and adding use cases that do not comply with the specifications to the Error collection, providing error prompts.

Benefits of technology

It realizes the design and flexible combination of custom test cases, improves testing efficiency and enhances the applicability of test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118897789A_ABST
    Figure CN118897789A_ABST
Patent Text Reader

Abstract

The invention provides a test case synchronization method and device, electronic equipment and a readable storage medium, and the method comprises the steps: responding to a test case synchronization request, traversing at least one test case directory, and analyzing at least one test case from the at least one test case directory; determining whether the at least one test case conforms to the test case specification or not; and adding the test cases which do not accord with the test case specifications to an error test case set, and synchronizing the test cases which accord with the test case specifications to a database corresponding to the test platform to complete the synchronization of the test cases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automated testing technology, and in particular to a test case synchronization method, device, electronic device and readable storage medium. Background Art

[0002] In the existing automated testing technology, automated test cases are generally written in the following two ways: One way is to use a test case writing tool to write test cases on a unit test framework. This method is implemented through coding, and the applicability of the use case scenario is strong, but the execution is not flexible enough. Generally, test cases can only be executed according to the directory provided by the test case writing tool, and it is difficult to arbitrarily specify test cases from the directory for execution.

[0003] Another way is to write test cases on the test platform, encapsulate the fields required by the test cases through the interface provided by the test platform, and directly enter the fields on the interface to create test cases. This method is not very applicable because the test cases are entered on the interface, and custom design test cases cannot be made. Summary of the invention

[0004] The present application provides a test case synchronization method, which is applied to a test platform, wherein the test platform provides a test case specification, the test platform is connected to a test case writing tool, the test case writing tool includes at least one test case directory, and the test case directory stores at least one test case, the method comprising:

[0005] In response to a test case synchronization request, traverse the at least one test case directory and parse at least one test case from the at least one test case directory;

[0006] determining whether the at least one test case complies with the test case specification;

[0007] The test cases that do not conform to the test case specification are added to the error test case set, and the test cases that conform to the test case specification are synchronized to the database corresponding to the test platform to complete the test case synchronization.

[0008] Optionally, the method further includes:

[0009] If the error test case set includes an error test case, error information corresponding to the error test case will be given to the user as an error prompt.

[0010] Optionally, the test case directory includes at least one function module subdirectory; the function module subdirectory stores at least one test case; the test case specification includes a test case name specification, a function module name specification and a test case comment format specification;

[0011] Determining whether the test case complies with the test case specification includes:

[0012] Determine whether the function module name complies with the function module name specification;

[0013] If the function module name complies with the function module name specification, further determining that the at least one test case name complies with the test case name specification;

[0014] If the test case name complies with the test case name specification, further determining whether the comments in the test case comply with the test case comment format specification;

[0015] If the comments in the test case comply with the test case comment format specification, it is determined that the test case complies with the test case specification provided by the test platform.

[0016] Optionally, adding the test case that does not meet the test case specification to the error test case set includes:

[0017] If the at least one functional module name does not conform to the functional module name specification, the test case is added to the error test case set, and / or; if the test case name does not conform to the test case name specification, the test case is added to the error test case set, and / or;

[0018] If the comment in the test case does not comply with the test case comment format specification, the test case is added to an error test case set.

[0019] Optionally, synchronizing the test case that complies with the test case specification to a database corresponding to the test platform includes:

[0020] Parsing the function module name and the test case name from the test case that meets the test case specification;

[0021] Based on the function module name and the test case name, the test case is synchronized to the database corresponding to the test platform.

[0022] The present application also provides a test case synchronization device, which is applied to a test platform, wherein the test platform provides a test case specification, the test platform is connected to a test case writing tool, the test case writing tool includes at least one test case directory, and the test case directory stores at least one test case, the device includes:

[0023] A test case parsing unit, configured to traverse the at least one test case directory in response to a test case synchronization request, and parse at least one test case from the at least one test case directory;

[0024] a test case detection unit, configured to determine whether the at least one test case complies with the test case specification;

[0025] The test case synchronization unit is used to add the test cases that do not meet the test case specifications to the error test case set, and synchronize the test cases that meet the test case specifications to the database corresponding to the test platform to complete the test case synchronization.

[0026] Optionally, the device further comprises:

[0027] The error prompt unit is used to provide an error prompt to the user with error information corresponding to the error test case if the error test case set includes an error test case.

[0028] Optionally, the test case directory includes at least one function module subdirectory; the function module subdirectory stores at least one test case; the test case specification includes a test case name specification, a function module name specification and a test case comment format specification;

[0029] The test case detection unit is further used to determine whether the function module name complies with the function module name specification;

[0030] If the function module name complies with the function module name specification, further determining that the at least one test case name complies with the test case name specification;

[0031] If the test case name complies with the test case name specification, further determining whether the comments in the test case comply with the test case comment format specification;

[0032] If the comments in the test case comply with the test case comment format specification, it is determined that the test case complies with the test case specification provided by the test platform.

[0033] Optionally, the test case synchronization unit is further used to

[0034] If the at least one functional module name does not conform to the functional module name specification, the test case is added to the error test case set, and / or; if the test case name does not conform to the test case name specification, the test case is added to the error test case set, and / or;

[0035] If the comment in the test case does not comply with the test case comment format specification, the test case is added to an error test case set.

[0036] Optionally, the test case synchronization unit is further used to parse out a function module name and a test case name from the test case that complies with the test case specification;

[0037] Based on the function module name and the test case name, the test case is synchronized to the database corresponding to the test platform.

[0038] The present application also provides an electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;

[0039] The memory stores machine-readable instructions, and the processor executes the above method by calling the machine-readable instructions.

[0040] The present application also provides a computer-readable storage medium, which stores machine-readable instructions. When the machine-readable instructions are called and executed by a processor, the above method is implemented.

[0041] In the scheme recorded in the above embodiment, test cases are written in advance according to the test case specifications of the test platform through a test case writing tool, and the test cases are further synchronized to the test platform. Not only can the design cases be customized at will, which has strong applicability, but also the test cases can be flexibly combined for testing to improve testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flowchart of a test case synchronization method shown in an exemplary embodiment.

[0043] Figure 2 It is a schematic diagram of a test case directory shown in an exemplary embodiment.

[0044] Figure 3 It is a schematic diagram of another test case directory shown in an exemplary embodiment.

[0045] Figure 4 The figure is a hardware structure diagram of an electronic device in which a test case synchronization device is located, showing an exemplary embodiment.

[0046] Figure 5 The invention is a block diagram of a test case synchronization device shown in an exemplary embodiment. DETAILED DESCRIPTION

[0047] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0048] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0049] At present, the existing test case writing method is to write test cases in test case writing tools, although multiple test cases can be customized and the applicability is strong, but the execution is not flexible enough. Writing test cases on the test platform is convenient and fast, but the applicability is not strong.

[0050] In view of this, the present application proposes a technical solution for writing test cases in a test case writing tool and synchronizing them to a test platform for testing.

[0051] During implementation, in response to a test case synchronization request, the at least one test case directory may be traversed to parse out at least one test case from the at least one test case directory;

[0052] determining whether the at least one test case complies with the test case specification;

[0053] The test cases that do not conform to the test case specification are added to the error test case set, and the test cases that conform to the test case specification are synchronized to the database corresponding to the test platform to complete the test case synchronization.

[0054] In the scheme recorded in the above embodiment, test cases are written in advance according to the test case specifications of the test platform through a test case writing tool, and the test cases are further synchronized to the test platform. Not only can the design cases be customized at will, which has strong applicability, but also the test cases can be flexibly combined for testing to improve testing efficiency.

[0055] See also Figure 1 , Figure 1 The present invention is a flowchart of a test case synchronization method provided by an exemplary embodiment. The method is applied to a test platform, the test platform provides a test case specification, the test platform is connected to a test case writing tool, the test case writing tool includes at least one test case directory, and the test case directory stores at least one test case.

[0056] Among them, the test platform can specifically be a system or tool for software testing, etc., or it can be a business development platform that includes testing functions, and the test module in the development platform can also be used as the test platform in this specification, which is not specifically limited in this specification.

[0057] The test platform provides a test case specification, which is used to standardize the overall structure of the test case to facilitate the subsequent synchronization process and improve the efficiency of test case synchronization.

[0058] The test case writing tool is used by a user to write test cases, and may be, for example, a test case writing tool provided by Unittest or a test case writing tool provided by TestNG.

[0059] The test case writing tool includes at least one test case directory, and the test case directory can store test cases according to the functional classification of the test cases. For example, test cases related to the interface are stored in directory 1, and test cases related to the UI are stored in directory 2.

[0060] The test platform is connected to a test case writing tool. After the user writes a test case using the test case writing tool, the user can synchronize the test case written using the test case writing tool to the test platform through an interface provided by the test platform.

[0061] The method may include the following steps:

[0062] Step 102: In response to a test case synchronization request, traverse the at least one test case directory and parse out at least one test case from the at least one test case directory.

[0063] In this specification, the user can synchronize the test cases through the test case synchronization button in the interface provided by the test platform. The test platform can respond to the test case synchronization request initiated by the user, traverse the test case directory of the test case writing tool, and parse the test cases therefrom.

[0064] Among them, the test case writing tool can have multiple directories classified according to the functions of the test cases, each directory classified according to the function can also have multiple sub-directories related to the functional modules, and each sub-directory related to the functional module can store a test case file of at least one test case.

[0065] See also Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a test case directory shown in an exemplary embodiment. Figure 2As shown, the root directory of the test case writing tool has an interface test directory and a UI test directory, the interface test directory has a function module 1 subdirectory and a function module 2 subdirectory, and the function module 1 subdirectory has test case 1 and test case 2.

[0066] In actual applications, each of the multiple directories classified according to the functions of the test cases may also have subdirectories related to the actual project, and each project subdirectory contains at least one functional module subdirectory. When actually writing the test case, one may be used as a writing unit. It should be noted that the project subdirectory may not contain a functional module subdirectory, but directly contain at least one test case.

[0067] See also Figure 3 , Figure 3 A schematic diagram of a test case directory is shown in an exemplary embodiment. Figure 3 As shown, the root directory of the test case writing tool has an interface test directory and a UI test directory, the interface test directory has a project subdirectory project directory 1, under which there is a function module 1 subdirectory, and the function module 1 subdirectory has test case 1. At the same time, test case 2 is also directly included in project directory 1.

[0068] It should be noted that the above example is only a possible implementation method including a project sub-directory. The user can further determine whether to include a project sub-directory or a function module sub-directory according to actual needs, and this is not specifically limited in this specification.

[0069] Among them, when the project subdirectory is included but the function module subdirectory is not included, a test case specification for the project subdirectory can be further set to determine whether the project subdirectory name meets the test case specification for the project subdirectory. The test case specification is similar to the test case specification for the function module subdirectory below, and will not be repeated here.

[0070] The user may select at least one subdirectory in the test case directory through an interface provided by the test platform, so that the test platform traverses the subdirectory selected by the user and parses at least one test case therefrom.

[0071] The test platform may traverse the test case directory in the order of the sub-directories in the test case directory, and parse out at least one test case therefrom.

[0072] Step 104: Determine whether the at least one test case complies with the test case specification.

[0073] After the test platform parses out at least one test case, it can determine whether the test case complies with the test case specification provided by the test platform.

[0074] The test case specifications provided by the test platform may specifically include test case name specifications, function module name specifications, and test case comment format specifications, etc.

[0075] The test platform can determine whether the parsed test case is a legal test case based on the test platform specification, and if it is a legal test case, it can be synchronized to the test platform for testing. The test platform can parse the information contained in the test case through the test case name, the test case function module name, and the test case comment format specification, and based on these test case names and function module names, the test case can be synchronized to the database corresponding to the test platform.

[0076] In one implementation, the test case specification includes a test case name specification, a function module name specification, and a test case comment format specification.

[0077] The function module name can be Figure 2 The subdirectory name of the test case shown, for example, Figure 2 The "Functional Module 1" in the example can be used as the name of the functional module. The test case name can be Figure 2 The subdirectory names of the test case directory are classified according to the test case function, for example, Figure 2 "Test Case 1" in the example can be used as the test case name.

[0078] The test case annotation format refers to the format used by users to add annotations when writing test cases. The test platform can parse the annotations in the test case through the preset test case annotation format, and the annotations can include description information of the test case and developer information of the test case, etc.

[0079] The test case specification may specify different test case names, test case functional module names, and test case comment formats according to actual needs, which are not specifically limited in this specification.

[0080] After parsing out at least one test case, the test platform can determine whether the function module name of the test case complies with the function module name specification;

[0081] For example, the test platform analyzes the following Figure 2 The test case 1 shown can determine whether the function module name corresponding to the test case 1 complies with the function module name specification.

[0082] The specific method for determining whether the test case function module name complies with the function module name specification is not specifically limited in this specification. For example, string matching or the like can be used to determine whether the format of the test case name is the same as the test case name specification.

[0083] After determining that the function module name of the test case complies with the function module name specification, it can be further determined whether the test case name "test case 1" complies with the test case name specification.

[0084] The specific method for determining whether the test case name complies with the test case name specification is not specifically limited in this specification. For example, whether the format of the test case name is the same as the test case name specification can be determined by string matching or the like.

[0085] If the function module name and the test case name of the test case both conform to the above test case specification, it can be further determined whether the comments in the test case conform to the test case comment format specification.

[0086] For example, the test platform analyzes the following Figure 2 For the test case 1 shown, after determining that the function module name "Functional Module 1" of the test case 1 complies with the function module name and the test case name "Test Case 1" complies with the test case name specification, the corresponding comments can be parsed from the corresponding test case file in each function module based on the comment format specified in the test case comment format specification. If the parsed comments include various comment contents specified in the test case comment format specification, it can be determined that the comments in the test case comply with the test case comment format specification.

[0087] For example, in actual applications, you can obtain the annotation information in a specific test case. If the test case author does not add any annotations, you can directly add the test case to the error test case collection and note the error message "This test case has no annotations"; for another example, if when annotating the test case, if the annotations for the class or method in the test case are not annotated in accordance with the test case specifications, you can also directly add the test case to the error test case collection and note the error message "Class annotation error, or method annotation error" and so on.

[0088] If the comments in the test case comply with the test case comment format specification, it is determined that the test case complies with the test case specification provided by the test platform.

[0089] By successively determining whether the test case name, the test case function module name, and the test case annotation format conform to the test case specification provided by the platform, it can be ensured that the test case written in the test platform can run smoothly on the test platform to prevent omissions in subsequent automated testing.

[0090] Step 106, adding the test cases that do not conform to the test case specification to the error test case set, and synchronizing the test cases that conform to the test case specification to the database corresponding to the test platform to complete the test case synchronization.

[0091] In the above determination of whether a test case complies with the test case specification, if there is a test case that does not comply with the test case specification, the test case may be added to an error test case set to facilitate user positioning and adjustment of the test case.

[0092] The test cases that meet the test case specifications are synchronized to the database corresponding to the test platform to complete the test case synchronization.

[0093] In one implementation, it may be further determined whether the test case name complies with the test case name specification, whether the function module name complies with the function module name specification, and whether the comments in the test case comply with the test case comment format specification.

[0094] If the test case name does not comply with the test case name specification, the test case can be added to the error test case set; if the function module corresponding to the test case does not comply with the function module name specification, the test case can be added to the error test case set; if the comments in the test case do not comply with the test case comment format specification, the test case can be added to the error test case set.

[0095] In one implementation, if the error test case set includes an error test case, error information corresponding to the error test case is provided as an error prompt to the user.

[0096] Among them, the error message corresponding to the error case can be set according to which test case specification the test case does not comply with, and the error message can be prompted to the user through the interface provided by the test platform to facilitate the user to locate and modify it.

[0097] For example, if the test case name does not comply with the test case name specification, then the error message can be set to "test case name error"; if the test case function module name does not comply with the function module name specification, then the error message can be set to "test case function module name error"; if the test case comment format does not comply with the function module name specification, then the error message can be set to "test case comment format error".

[0098] In actual application, when the test platform receives the test case synchronized by the test case writing tool, the test case writing tool will send status code information to the test platform, wherein the status code information can be used to indicate whether the test case to be synchronized contains an erroneous test case.

[0099] For example, when the status code is 1, it means that the error test case set contains an error test case, and the error test case set can be displayed to the user through the interface provided by the test platform, which is convenient for the user to locate and modify. When the status code is 0, it means that the error test case set does not contain an error test case, so the normal test case can be directly synchronized to the database.

[0100] In one embodiment, the database corresponding to the test platform establishes several data tables according to the function module names and test case names. The test platform can parse the function module names and test case names from the test cases that meet the test case specifications, and based on the test case names and test case function module names, synchronize the test cases to the data tables in the database.

[0101] If the database contains a data table corresponding to the function module directory name and the test case name, the test case corresponding to the test case name can be directly inserted into the data table. If it does not contain a data table based on the function module name and the test case name, a new data table can be created and the test case can be inserted into the data table.

[0102] For example, in actual application, after parsing the test case, the function module name corresponding to the test case and the test case name can be parsed at the same time. In some embodiments, the project name corresponding to the test case may also be parsed. When inserting the test case into the database, it can be determined whether there is a data table corresponding to the project name in the database. If there is no data table corresponding to the project, a new data table corresponding to the project can be created, and the name of the data table can be named as the project name of the test case; if there is a data table corresponding to the project, the test case can be directly inserted into the data table corresponding to the project. In the above-mentioned insertion process, if the database returns an error message during the insertion process, the database can be rolled back to the data between the synchronization storage, and the error message of the data is returned to the front-end interface of the test platform to facilitate positioning and modification. When all test cases are synchronized, the database foreign key constraints can be turned on, the transaction is submitted, and the synchronization success information is returned to the front-end interface of the test platform to complete the synchronization for the test case.

[0103] In the scheme recorded in the above embodiment, test cases are written in advance according to the test case specifications of the test platform through a test case writing tool, and the test cases are further synchronized to the test platform. Not only can the design cases be customized at will, which has strong applicability, but also the test cases can be flexibly combined for testing to improve testing efficiency.

[0104] Corresponding to the above-mentioned embodiment of the test case synchronization method, this specification also provides an embodiment of a test case synchronization device.

[0105] See also Figure 4 , Figure 4 It is a hardware structure diagram of an electronic device where a test case synchronization device is located, shown in an exemplary embodiment. At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and of course may also include hardware required for other services. One or more embodiments of this specification can be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0106] See also Figure 5 , Figure 5 The block diagram of a test case synchronization device is shown in an exemplary embodiment. The test case synchronization device can be applied to Figure 3In the electronic device shown in the figure, the technical solution of this specification is implemented. Among them, the above-mentioned test case synchronization device may include:

[0107] A test case parsing unit 502, configured to traverse the at least one test case directory in response to a test case synchronization request, and parse at least one test case from the at least one test case directory;

[0108] A test case detection unit 504, configured to determine whether the at least one test case complies with the test case specification;

[0109] The test case synchronization unit 506 is used to add the test cases that do not meet the test case specifications to the error test case set, and synchronize the test cases that meet the test case specifications to the database corresponding to the test platform to complete the test case synchronization.

[0110] In this embodiment, the device further includes:

[0111] The error prompt unit is used to provide an error prompt to the user with error information corresponding to the error test case if the error test case set includes an error test case.

[0112] In this embodiment, the test case directory includes at least one function module subdirectory; the function module subdirectory stores at least one test case; the test case specification includes a test case name specification, a function module name specification and a test case comment format specification;

[0113] The test case detection unit is further used to determine whether the function module name complies with the function module name specification;

[0114] If the function module name complies with the function module name specification, further determining that the at least one test case name complies with the test case name specification;

[0115] If the test case name complies with the test case name specification, further determining whether the comments in the test case comply with the test case comment format specification;

[0116] If the comments in the test case comply with the test case comment format specification, it is determined that the test case complies with the test case specification provided by the test platform.

[0117] In this embodiment, the test case synchronization unit is further used to

[0118] If the at least one functional module name does not conform to the functional module name specification, the test case is added to the error test case set, and / or; if the test case name does not conform to the test case name specification, the test case is added to the error test case set, and / or;

[0119] If the comment in the test case does not comply with the test case comment format specification, the test case is added to an error test case set.

[0120] In this embodiment, the test case synchronization unit further

[0121] The test case synchronization unit is further used to parse the function module name and the test case name from the test case that meets the test case specification;

[0122] Based on the function module name and the test case name, the test case is synchronized to the database corresponding to the test platform.

[0123] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0124] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.

[0125] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0126] This specification also provides an embodiment of a computer-readable storage medium. The computer-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the test case synchronization method provided in any embodiment of this specification can be implemented.

[0127] The computer-readable storage medium provided in the embodiments of this specification may specifically include, but is not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical fiber card. That is, the readable storage medium includes a readable medium that can store or transmit information.

[0128] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0129] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0130] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0131] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0132] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0133] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0134] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "one", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0135] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0136] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A test case synchronization method, It is characterized in that Applied to a test platform, the test platform provides a test case specification, the test platform is connected to a test case writing tool, the test case writing tool includes at least one test case directory, the test case directory stores at least one test case, the method includes: In response to a test case synchronization request, traverse the at least one test case directory and parse at least one test case from the at least one test case directory; determining whether the at least one test case complies with the test case specification; The test cases that do not conform to the test case specification are added to the error test case set, and the test cases that conform to the test case specification are synchronized to the database corresponding to the test platform to complete the test case synchronization.

2. The method according to claim 1, It is characterized in that The method further comprises: If the error test case set includes an error test case, error information corresponding to the error test case will be given to the user as an error prompt.

3. The method according to claim 1, It is characterized in that The test case directory includes at least one function module subdirectory; the function module subdirectory stores at least one test case; the test case specification includes a test case name specification, a function module name specification and a test case comment format specification; Determining whether the test case complies with the test case specification includes: Determine whether the function module name complies with the function module name specification; If the function module name complies with the function module name specification, further determining that the at least one test case name complies with the test case name specification; If the test case name complies with the test case name specification, further determining whether the comments in the test case comply with the test case comment format specification; If the comments in the test case comply with the test case comment format specification, it is determined that the test case complies with the test case specification provided by the test platform.

4. The method according to claim 3, It is characterized in that The adding the test cases that do not meet the test case specification to the error test case set includes: If the at least one functional module name does not conform to the functional module name specification, the test case is added to the error test case set, and / or; if the test case name does not conform to the test case name specification, the test case is added to the error test case set, and / or; If the comment in the test case does not comply with the test case comment format specification, the test case is added to an error test case set.

5. The method according to claim 3, It is characterized in that The step of synchronizing the test cases that meet the test case specification to a database corresponding to the test platform includes: Parsing the function module name and the test case name from the test case that meets the test case specification; Based on the function module name and the test case name, the test case is synchronized to the database corresponding to the test platform.

6. A test case synchronization device, It is characterized in that Applied to a test platform, the test platform provides a test case specification, the test platform is connected to a test case writing tool, the test case writing tool includes at least one test case directory, the test case directory stores at least one test case, and the device includes: A test case parsing unit, configured to traverse the at least one test case directory in response to a test case synchronization request, and parse at least one test case from the at least one test case directory; a test case detection unit, configured to determine whether the at least one test case complies with the test case specification; The test case synchronization unit is used to add the test cases that do not meet the test case specifications to the error test case set, and synchronize the test cases that meet the test case specifications to the database corresponding to the test platform to complete the test case synchronization.

7. The device according to claim 6, It is characterized in that The device also includes: The error prompt unit is used to provide an error prompt to the user with error information corresponding to the error test case if the error test case set contains an error test case.

8. The device according to claim 6, It is characterized in that The test case directory includes at least one function module subdirectory; the function module subdirectory stores at least one test case; the test case specification includes a test case name specification, a function module name specification and a test case comment format specification; The test case detection unit is further used to determine whether the function module name complies with the function module name specification; If the function module name complies with the function module name specification, further determining that the at least one test case name complies with the test case name specification; If the test case name complies with the test case name specification, further determining whether the comments in the test case comply with the test case comment format specification; If the comments in the test case comply with the test case comment format specification, it is determined that the test case complies with the test case specification provided by the test platform.

9. The device according to claim 8, It is characterized in that The test case synchronization unit is further configured to add the test case to a set of error test cases if the name of the at least one function module does not conform to the function module name specification, and / or; if the test case name does not conform to the test case name specification, add the test case to a set of error test cases, and / or; If the comment in the test case does not comply with the test case comment format specification, the test case is added to an error test case set.

10. The device according to claim 8, It is characterized in that The test case synchronization unit is further used to parse the function module name and the test case name from the test case that meets the test case specification; Based on the function module name and the test case name, the test case is synchronized to the database corresponding to the test platform.

11. An electronic device, It is characterized in that It includes a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the method according to any one of claims 1 to 5 by calling the machine-readable instructions.

12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by the processor, the method according to any one of claims 1 to 5 is implemented.