Server testing method and device and storage medium

By obtaining the server's test case and interface information and determining the target interface type and use cases, the automated testing problems caused by BMC interface differences are solved and the testing efficiency is improved.

CN120371707APending Publication Date: 2025-07-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510495098.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

Different customers have different management requirements for BMC, which leads to differences in the BMC interface. Existing automated test cases cannot adapt to interface changes, resulting in extended automation testing cycles and reducing project delivery efficiency.

Method used

By obtaining the server's test cases, determining the interface address and return value format of the interface to be tested, determining the target interface type based on this information, and then determining the corresponding target test cases to complete the server's automated testing.

Benefits of technology

Reduce the workload of manual modifications, improve the progress of automated testing and project delivery efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371707A_ABST
    Figure CN120371707A_ABST
Patent Text Reader

Abstract

The invention provides a server test method and device and a storage medium, a test case of a server is acquired, first interface information of the server is determined based on the test case, and the first interface information comprises an interface address and a return value format of a to-be-tested interface in the server; determining a target interface type of the to-be-tested interface based on an interface address and a return value format of the to-be-tested interface in the first interface information; and determining a target test case corresponding to the to-be-tested interface based on the target interface type of the to-be-tested interface, and completing the test of the server based on the target test case. According to the method, the target test case corresponding to the to-be-tested interface is determined based on the target interface type corresponding to the to-be-tested interface, so that the workload of manual modification is reduced, and the automatic test progress and the project delivery efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data processing, and in particular, to a server testing method, apparatus, and storage medium. Background Art

[0002] The BMC (Baseboard Management Controller) can monitor key components such as the CPU and memory of the server in real time even when the operating system crashes through independent power supply and the IPMI protocol, and provide fault warnings and log records. Among them, when the server is operated and maintained, it is necessary to perform batch detection on the server through automation. Based on this, performing automated testing through the interface provided by the BMC meets the customer's needs better than manually viewing the page. Among them, different customers have different control requirements for the BMC, which results in multiple customized versions of the BMC. At the same time, the BMC interfaces of different customers are also different, resulting in the inability to use the corresponding test cases, and thus unable to perform automated testing. For example, the asset management page is partially modified according to its own needs, and the original displayed component details may be moved to other pages for display, resulting in the invalidation and inability to run of some test cases and automated scripts. Therefore, it is necessary to analyze the interfaces of the BMC to complete the subsequent automated testing of the server when the interfaces are determined to be correct, thereby accelerating the progress of automated testing and improving the delivery efficiency of the project.

[0003] In the related art, the interfaces are tested according to the return values of each interface of the server to be tested and the corresponding verification specifications to obtain the test results. However, when the interfaces in the server to be tested change, it is necessary to confirm the problem while automatically executing, and then perform the test after manually redeveloping the automated test code, resulting in an extended cycle of automated testing and a reduction in the delivery efficiency of the project. Summary of the Invention

[0004] The present disclosure provides a server testing method, apparatus, and storage medium, which can determine the target test cases corresponding to the interfaces to be tested based on the target interface types of the interfaces to be tested, reduce the workload of manual modification, and effectively improve the progress of automated testing and the delivery efficiency of the project.

[0005] To solve the above technical problems, the present disclosure provides a server testing method, including:

[0006] Obtain the test cases of the server, and determine the first interface information of the server based on the test cases, where the first interface information includes the interface address and return value format of the interfaces to be tested in the server;

[0007] Determine the target interface type of the interface to be tested based on the interface address and return value format of the interface to be tested in the first interface information;

[0008] Based on the target interface type of the interface to be tested, determine the target test case corresponding to the interface to be tested, and complete the test of the server based on the target test case.

[0009] An embodiment of the present disclosure also provides an interface testing device, including:

[0010] A first determination unit, configured to obtain test cases of a server, and determine first interface information of the server based on the test cases, where the first interface information includes the interface address and return value format of an interface to be tested in the server;

[0011] A second determination unit, configured to determine the target interface type of the interface to be tested based on the interface address and return value format of the interface to be tested in the first interface information;

[0012] A test unit, configured to determine the target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested, and complete the test of the server based on the target test case.

[0013] An embodiment of the present disclosure also provides an electronic device, including:

[0014] A memory, configured to store a computer program;

[0015] A processor, configured to implement the steps of any server testing method provided by the embodiments of the present disclosure when executing the computer program.

[0016] An embodiment of the present disclosure also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any server testing method provided by the embodiments of the present disclosure are implemented.

[0017] An embodiment of the present disclosure also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any server testing method provided by the embodiments of the present disclosure are implemented.

[0018] A server testing method provided by the present disclosure includes: obtaining a test case of a server, and determining first interface information of the server based on the test case, where the first interface information includes an interface address and a return value format of an interface to be tested in the server; determining a target interface type of the interface to be tested based on the interface address and the return value format of the interface to be tested in the first interface information; determining a target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested, and completing the test of the server based on the target test case. Among them, determining the target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested reduces the workload of manual modification and effectively improves the progress of automated testing and the delivery efficiency of the project.

[0019] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0021] Figure 1 It is a schematic flowchart of a server testing method provided by an embodiment of the present disclosure;

[0022] Figure 2 It is a schematic flowchart of another server testing method provided by an embodiment of the present disclosure;

[0023] Figure 3 It is a schematic flowchart of yet another server testing method provided by an embodiment of the present disclosure;

[0024] Figure 4 It is a schematic flowchart of yet another server testing method provided by an embodiment of the present disclosure;

[0025] Figure 5 It is a schematic flowchart of yet another server testing method provided by an embodiment of the present disclosure;

[0026] Figure 6 It is a schematic flowchart of yet another server testing method provided by an embodiment of the present disclosure;

[0027] Figure 7 It is a schematic flowchart of yet another server testing method provided by an embodiment of the present disclosure;

[0028] Figure 8 It is a schematic structural diagram of a server testing device provided by an embodiment of the present disclosure;

[0029] Figure 9Schematic diagram of another server testing device provided by an embodiment of the present disclosure;

[0030] Figure 10 Schematic diagram of another server testing device provided by an embodiment of the present disclosure;

[0031] Figure 11 Schematic diagram of another server testing device provided by an embodiment of the present disclosure. Detailed implementation manners

[0032] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0033] Figure 1 is a flowchart of a server testing method provided according to an embodiment of the present disclosure. As Figure 1 shown, the method may include the following steps:

[0034] Step 101: Obtain a test case of the server, and determine first interface information of the server based on the test case.

[0035] In some embodiments, the test case of the server may be obtained through a database. Among them, in some embodiments, after obtaining the test case of the server, the URL addresses of the interfaces used in the test case may be de-duplicated to obtain the first interface information of the server, so that the interfaces to be tested in the first interface information are all those required in the test case, and at the same time, the URL addresses corresponding to the interface addresses in the first interface information are all different, thus avoiding subsequent repetitive matching and verification work.

[0036] In some embodiments, the above first interface information may include the interface serial number, interface address, and return value format (such as int (integer)) of the interface to be tested.

[0037] Step 102: Determine the target interface type of the interface to be tested based on the interface address and return value format of the interface to be tested in the first interface information.

[0038] In some embodiments, based on the interface address and return value format of the interface to be tested in the first interface information, the address change result and return value format change result of the interface to be tested can be obtained, and based on the address change result and return value format change result, the target interface type of the interface to be tested can be determined, so that the test cases corresponding to the interface to be tested can be processed according to the target interface type of the interface to be tested, and the target test cases for automated testing can be obtained.

[0039] In some embodiments, the above target interface types may include a first interface type, a second interface type, a third interface type, and a fourth interface type.

[0040] Step 103: Based on the target interface type of the interface to be tested, determine the target test cases corresponding to the interface to be tested, and complete the test of the server based on the target test cases.

[0041] In some embodiments, based on the target interface type of the interface to be tested, corresponding processing can be performed on the interface to be tested to determine the target test cases corresponding to the interface to be tested, and the test of the server can be completed based on the target test cases, so that the situation where the automated test of the server cannot work and manual error location occurs due to changes in the interface address and / or return value format can be avoided, the workload of manual modification can be reduced, and the automated test progress and project delivery efficiency can be effectively improved.

[0042] The server testing method provided by the embodiments of the present disclosure obtains the test cases of the server, determines the first interface information of the server based on the test cases, where the first interface information includes the interface address and return value format of the interface to be tested in the server; determines the target interface type of the interface to be tested based on the interface address and return value format of the interface to be tested in the first interface information; determines the target test cases corresponding to the interface to be tested based on the target interface type of the interface to be tested, and completes the test of the server based on the target test cases. Among them, determining the target test cases corresponding to the interface to be tested based on the target interface type of the interface to be tested reduces the workload of manual modification and effectively improves the automated test progress and project delivery efficiency.

[0043] In some embodiments, as a refinement of step 103, as Figure 2 shown, it may further include:

[0044] Step 201: Based on the interface address and return value format of the interface to be tested in the first interface information, obtain the change result of the interface to be tested, where the change result includes an address change result and a return value format change result.

[0045] In some embodiments, a tool (such as BrowserMob Proxy) can be used to obtain the actual interface addresses and actual return value formats of all interfaces and save them to a database, and compare the actual interface addresses and actual return value formats of the interfaces to be tested with the interface addresses and return value formats in the first interface information to obtain the address change result and return value format change result of the interfaces to be tested.

[0046] In some embodiments, if the actual interface address of the interface to be tested is the same as the interface address in the first interface information, the address change result is unchanged; if the actual interface address of the interface to be tested is different from the interface address in the first interface information, the address change result is changed.

[0047] In some embodiments, if the actual return value format of the interface to be tested is the same as the return value format in the first interface information, the return value format change result is unchanged; if the actual return value format of the interface to be tested is different from the return value format in the first interface information, the return value format change result is changed. For example, assume that the return value format corresponding to the interface to be tested in the first information is int (integer type), but the actual return value format of this interface to be tested is float (floating point type). At this time, the actual return value format of the interface to be tested is different from the return value format in the first interface information, so it is determined that the return value format change result is changed.

[0048] Step 202, based on the address change result and return value format change result of the interface to be tested, determine the target interface type of the interface to be tested.

[0049] In some embodiments, after obtaining the address change result and return value format change result of the interface to be tested through the above steps, the target interface type of the interface to be tested can be determined based on the address change result and return value format change result of the interface to be tested, so that the test cases corresponding to the interface to be tested can be processed according to the target interface type of the interface to be tested to obtain the target test cases for automated testing.

[0050] In some embodiments, the method for determining the target interface type of the interface to be tested based on the address change result and return value format change result of the interface to be tested may include the following steps:

[0051] Step 2021, if the address change result of the interface to be tested is unchanged and the return value format change result is unchanged, determine that the target interface type of the interface to be tested is the first interface type;

[0052] Step 2022, if the address change result of the interface to be tested is unchanged and the return value format change result is changed, determine that the target interface type of the interface to be tested is the second interface type;

[0053] In step 2023, if the address change result of the interface to be tested indicates a change and the return value format change result indicates no change, determine that the target interface type of the interface to be tested is the third interface type.

[0054] In step 2024, except for the interfaces to be tested that belong to the first interface type, the second interface type, and the third interface type, the target interface type of the remaining interfaces to be tested is the fourth interface type.

[0055] In some embodiments, based on the address change result and the return value format change result of the interface to be tested, the target interface type to which the interface to be tested belongs can be determined, so that the test cases corresponding to the interface to be tested can be processed according to the target interface type, without comparing and processing each interface to be tested one by one, reducing the time required for test case inspection and improving the progress of automated testing.

[0056] In some embodiments, as a refinement of step 103, as Figure 3 shown, it may further include:

[0057] In step 301, if the target interface type of the interface to be tested is the first interface type, determine the test case corresponding to the interface to be tested as the target test case corresponding to the interface to be tested.

[0058] In some embodiments, if the target interface type of the interface to be tested is the first interface type, it indicates that neither the interface address nor the return value format of the interface to be tested has changed. At this time, the test case corresponding to the interface to be tested does not need to be modified. Based on this, determine the test case corresponding to the interface to be tested as the target test case corresponding to the interface to be tested.

[0059] In some embodiments, as a refinement of step 103, as Figure 4 shown, it may further include:

[0060] In step 401, if the target interface type of the interface to be tested is the second interface type, determine whether the return value format of the interface to be tested needs to change.

[0061] In some embodiments, if the target interface type of the interface to be tested is the second interface type, at this time, the address of the interface to be tested has not changed and the return value format has changed. It is necessary to determine whether the return value format of the interface to be tested needs to change to determine whether the interface to be tested has a program problem caused by human typo.

[0062] In some embodiments, the interface information change table in the database can be obtained, and whether the return value format of the interface to be tested needs to change can be determined through the interface information change table. Among them, the interface information change table can include the interface serial number, change type, content before change, and content after change of the interface to be tested. By way of example, the interface information change table includes 19, return value format, int, and float.

[0063] In some embodiments, it is queried through the interface information change table whether the return value of the interface to be tested has changed. If the interface information change table has changed, it is necessary to determine whether the changed return value format is consistent with the actual return value format. If they are consistent, it is determined that the return value format of the interface to be tested needs to change; otherwise, it is determined that the return value format of the interface to be tested does not need to change. At this time, it can be determined that the interface to be tested has a program problem caused by a human typo. If there is no change in the interface information change table, it is determined that the return value format of the interface to be tested does not need to change. At this time, it can be determined that the interface to be tested has a program problem caused by a human typo.

[0064] In some embodiments, it can be manually determined whether the return value format of the interface to be tested needs to change.

[0065] Step 402, if the return value format needs to change, update the test case corresponding to the interface to be tested, and determine the updated test case as the target test case corresponding to the interface to be tested; otherwise, modify the return value format in the test case corresponding to the interface to be tested, and determine the modified test case as the target test case corresponding to the interface to be tested.

[0066] In some embodiments, if the return value format needs to change, it means that the return value format needs to be updated to the actual return value format. Then, it is necessary to manually update the test case corresponding to the interface to be tested, and determine the updated test case as the target test case corresponding to the interface to be tested; otherwise, modify the return value format in the test case corresponding to the interface to be tested to the actual return value format, and determine the modified test case as the target test case corresponding to the interface to be tested.

[0067] In some embodiments, if the target interface type of the interface to be tested is the second interface type, the target test case corresponding to the interface to be tested can be obtained through the above steps, which reduces the time required for test case inspection and improves the automation test progress.

[0068] In some embodiments, as a refinement of step 103, as Figure 5 shown, it may further include:

[0069] Step 501, if the target interface type of the interface to be tested is the third interface type, determine whether the interface address of the interface to be tested needs to change.

[0070] In some embodiments, if the target interface type of the interface to be tested is the third interface type, and at this time the address of the interface to be tested changes while the return value format remains unchanged, it is necessary to determine whether the address of the interface to be tested needs to change, so as to determine whether the address change of the interface to be tested is caused by version iteration, customization, or human typo.

[0071] In some embodiments, the interface information change table in the database can be obtained, and it can be determined whether the interface address of the interface to be tested needs to change through the interface information change table. For the detailed introduction of this part, reference can be made to the detailed introduction in step 401 above, and the embodiments of the present disclosure will not elaborate here.

[0072] In some embodiments, it can be determined manually whether the interface address of the interface to be tested needs to change.

[0073] Step 502, if the interface address needs to change, determine the existing target interface corresponding to the interface to be tested, and replace the interface address in the test case corresponding to the target interface with the interface address of the interface to be tested, and determine the replaced test case as the target test case corresponding to the interface to be tested; otherwise, modify the interface address in the test case corresponding to the interface to be tested, and determine the modified test case as the target test case corresponding to the interface to be tested.

[0074] In some embodiments, if the interface address needs to change, it means that different versions may require different addresses to meet the requirements of version iteration or customization. At this time, it is necessary to determine the existing target interface corresponding to the interface to be tested in the first interface type, and replace the interface address in the test case corresponding to the target interface with the interface address of the interface to be tested, and determine the replaced test case as the target test case corresponding to the interface to be tested; otherwise, modify the interface address in the test case corresponding to the interface to be tested to the actual interface address, and determine the modified test case as the target test case corresponding to the interface to be tested.

[0075] In some embodiments, if the target interface type of the interface to be tested is the third interface type, the target test case corresponding to the interface to be tested can be obtained through the above steps, which reduces the time required for test case inspection and improves the progress of automated testing.

[0076] In some embodiments, as a refinement of step 103, as Figure 6 shown, it may further include:

[0077] Step 601, determine whether there is a to-be-tested interface whose target interface type is the fourth interface type.

[0078] In some embodiments, it is necessary to determine whether there is a to-be-tested interface whose target interface type is the fourth interface type to determine whether there is a missing situation in the url address in the test case.

[0079] Step 602, if there is a to-be-tested interface whose target interface type is the fourth interface type, obtain the second interface information of the server, where the second interface information is the interface addresses and return value formats of all interfaces in the server.

[0080] In some embodiments, if there is a to-be-tested interface whose target interface type is the fourth interface type, it means that both the interface address and the return value format of the to-be-tested interface have changed. Then, it is necessary to determine the changed test interface of the to-be-tested interface in the second interface information of the server, and determine the target test case of the to-be-tested interface based on the changed test interface.

[0081] In some embodiments, the web pages in the server can be monitored, and tools (such as BrowserMobProxy) can be used to record all Get and Post request interfaces of the web pages, and the interface addresses and return value formats are saved in the database, so as to obtain the second interface information of the server. Among them, the above second interface information may also include interface serial numbers.

[0082] In some embodiments, if there is no to-be-tested interface whose target interface type is the fourth interface type, it means that the interface addresses in the to-be-tested cases have all been divided, and there is no need to perform subsequent steps.

[0083] Step 603, based on the second interface information, determine the candidate test interface set of the to-be-tested interface.

[0084] In some embodiments, after obtaining the second interface information through the above steps, the candidate test interface set of the to-be-tested interface can be determined through the interfaces in the second interface information, so as to determine the changed interface of the to-be-tested interface through the candidate test interface set.

[0085] In some embodiments, both the interface address and the return value format corresponding to the interface belonging to the fourth interface type have changed, while the interface addresses corresponding to the interfaces belonging to the first interface type and the second interface type have not changed. Based on this, the candidate test interface set of the to-be-tested interface belonging to the fourth interface type can be the remaining interfaces in the second interface information after removing the interfaces belonging to the first interface type and the second interface type.

[0086] Step 604, based on the interface addresses and return value formats of the candidate test interfaces in the candidate test interface set, determine the target candidate test interface of the to-be-tested interface.

[0087] In some embodiments, based on the interface address and return value format of candidate test interfaces in a candidate test interface set and the interface address and return value format of the interface to be tested, the first similarity score and the second similarity score of the candidate test interfaces can be determined respectively, and based on the first similarity score and the second similarity score, the target candidate test interface of the interface to be tested can be determined.

[0088] Step 605: Based on the interface address and return value format of the target candidate test interface, determine the target test case corresponding to the interface to be tested.

[0089] In some embodiments, after determining the target candidate test interface through the above steps, the target interface after the change of the interface to be tested can be determined based on the target candidate test interface, and based on the interface address and return value format of this target interface, the test cases corresponding to the interface to be tested can be updated manually, and the updated test cases can be determined as the target test cases corresponding to the interface to be tested.

[0090] In some embodiments, a tester or project personnel can determine the target interface after the change of the interface to be tested based on the target candidate test interface.

[0091] In some embodiments, if there is an interface to be tested whose target interface type is the fourth interface type, the target candidate test interface corresponding to this interface to be tested can be obtained through the above steps, and based on the interface address and return value format of the target candidate test interface, the target test case corresponding to the interface to be tested can be determined, without comparing and processing each interface to be tested one by one, reducing the time required for test case inspection and the workload of manual modification, and improving the progress of automated testing.

[0092] In some embodiments, as a refinement of step 604, as Figure 7 shown, it may further include:

[0093] Step 701: Based on the interface address and return value format of candidate test interfaces in a candidate test interface set and the interface address and return value format of the interface to be tested, determine the first similarity score and the second similarity score of the candidate test interfaces respectively.

[0094] In some embodiments, the method for respectively determining the first similarity score and the second similarity score of the candidate test interfaces based on the interface address and return value format of candidate test interfaces in a candidate test interface set and the interface address and return value format of the interface to be tested may include the following steps:

[0095] Step 7011: Based on the interface address and return value format of candidate test interfaces in a candidate test interface set, determine the first keyword list and the second keyword list corresponding to the candidate test interfaces respectively.

[0096] In some embodiments, the method for determining the first keyword list corresponding to a candidate test interface based on the interface address of the candidate test interface in the candidate test interface set may include: splitting the interface address based on a first symbol to obtain an address list, partitioning the address list based on a second symbol to obtain a corresponding double-layer nested list, and sequentially extracting keywords in the double-layer nested list, and determining the set of extracted keywords as the first keyword list corresponding to the candidate test interface. Wherein, the first symbol may include ": " and " / ", and the second symbol may include "_".

[0097] Exemplarily, in some embodiments, assume that the interface address of the candidate test interface is: http:100.1.10.10:device_info / cpu_info / core_info. After splitting the interface address based on the first symbol, the obtained address list is [http, 100.1.10.10, device_info, cpu_info, core_info]. After partitioning the address list based on the second symbol, the obtained double-layer nested list is [http, 100.1.10.10, [device, info], [cpu, info], [core, info]]. Then, extract keywords in the double-layer nested list in the order from left to right, and determine the set of extracted keywords as the first keyword list corresponding to the candidate test interface as {http, 100.1.10.10, device, info, cpu, info, core, info}.

[0098] In some embodiments, the method for determining the second keyword list corresponding to a candidate test interface based on the return value format of the candidate test interface in the candidate test interface set may include: splitting the return value format and return result of the candidate test interface through a third symbol to obtain a split result, and sequentially extracting keywords in the split result, and determining the set of extracted keywords as the second keyword list corresponding to the candidate test interface. Wherein, the above-mentioned third symbol may include "{}", "“”", "‘’", ",", and line breaks.

[0099] Exemplarily, the above second keyword list is {int, float}.

[0100] Step 7012, based on the interface address and return value format of the interface to be tested, determine the third keyword list and the fourth keyword list corresponding to the interface to be tested respectively.

[0101] In some embodiments, the method of determining the third keyword list and the fourth keyword list corresponding to the interface to be tested based on the interface address and return value format of the interface to be tested is the same as the method of step 7011 above, and the embodiments of the present disclosure will not elaborate herein.

[0102] Step 7013: Determine the first similarity score of the candidate test interface based on the first keyword list and the third keyword list.

[0103] In some embodiments, after obtaining the first keyword list and the third keyword list through the above steps, the first similarity score of the candidate test interface can be determined based on the first keyword list and the third keyword list.

[0104] Specifically, in some embodiments, the method of determining the first similarity score of the candidate test interface based on the first keyword list and the third keyword list may include: removing the invalid keywords in the first keyword list and the third keyword list respectively based on the invalid keyword set to obtain the processed first keyword list and the processed third keyword list, and determining the first similarity score of the candidate test interface through a similarity calculation formula based on the processed first keyword list and the processed third keyword list, where the similarity calculation formula is:

[0105]

[0106] where Score is the first similarity score, n is the total number of keywords, i is the position of the keyword, k i is the i-th keyword in the processed first keyword list, m i is the i-th keyword in the processed third keyword list, sim is a similarity function (such as a cosine similarity function), and 10 a is the set full score (if it is a hundred-point system, then a is 2).

[0107] In some embodiments, the above invalid keyword set can be set as needed. By way of example, the invalid keyword set includes info and data.

[0108] Step 7014: Determine the second similarity score of the candidate test interface based on the second keyword list and the fourth keyword list.

[0109] In some embodiments, after obtaining the second keyword list and the fourth keyword list through the above steps, the second similarity score of the candidate test interface can be determined based on the second keyword list and the fourth keyword list.

[0110] Specifically, in some embodiments, the method for determining the second similarity score of a candidate test interface based on the second keyword list and the fourth keyword list may include: determining the second similarity score of the candidate test interface through a similarity calculation formula based on the second keyword list and the fourth keyword list.

[0111] For the introduction of the similarity calculation formula, reference can be made to the detailed introduction in the above embodiments, and it will not be elaborated herein in the embodiments of the present disclosure.

[0112] Step 702, determining the target candidate test interface of the interface to be tested based on the first similarity score and the second similarity score.

[0113] In some embodiments, after obtaining the first similarity score and the second similarity score of each candidate test interface in the candidate test interface set through the above steps, the target candidate test interface of the interface to be tested can be determined based on the first similarity score and the second similarity score.

[0114] In some embodiments, the method for determining the target candidate test interface of the interface to be tested based on the first similarity score and the second similarity score may include: adding the first similarity score and the second similarity score to obtain a target similarity score, performing a descending order sorting based on the target similarity score, and determining the candidate test interfaces with a preset threshold ranked at the top in the obtained descending order sorting result as the target candidate test interfaces of the interface to be tested. Among them, the preset threshold can be set as needed. For example, the preset threshold is 3.

[0115] In some embodiments, based on the first similarity score and the second similarity score of the candidate test interfaces in the candidate test interface set, the target candidate test interface after the change of the interface to be tested is obtained, without the need for manual backtracking search, reducing the workload of manual modification and improving the progress of automated testing.

[0116] To implement the server testing method provided by the embodiments of the present disclosure, the embodiments of the present disclosure also provide a server testing device. As Figure 8 shown, the server testing device includes:

[0117] The first determination unit 81 is configured to obtain a test case of the server and determine the first interface information of the server based on the test case, where the first interface information includes the interface address and the return value format of the interface to be tested in the server;

[0118] The second determination unit 82 is configured to determine the target interface type of the interface to be tested based on the interface address and the return value format of the interface to be tested in the first interface information;

[0119] A test unit 83 is configured to determine a target test case corresponding to an interface to be tested based on the target interface type of the interface to be tested, and complete the test of the server based on the target test case.

[0120] The server test device provided by the embodiments of the present disclosure obtains a test case of the server, and determines first interface information of the server based on the test case, where the first interface information includes the interface address and return value format of the interface to be tested in the server; determines the target interface type of the interface to be tested based on the interface address and return value format of the interface to be tested in the first interface information; determines the target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested, and completes the test of the server based on the target test case. Among them, determining the target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested reduces the workload of manual modification, and effectively improves the progress of automated testing and the delivery efficiency of the project.

[0121] Further, in a possible implementation manner of the embodiments of the present disclosure, as Figure 9 shown, the second determination unit 82 includes:

[0122] An acquisition module 821 is configured to obtain a change result of the interface to be tested based on the interface address and return value format of the interface to be tested in the first interface information, where the change result includes an address change result and a return value format change result;

[0123] A determination module 822 is configured to determine the target interface type of the interface to be tested based on the address change result and return value format change result of the interface to be tested.

[0124] Among them, the determination module 822 is specifically configured to:

[0125] If the address change result of the interface to be tested is unchanged and the return value format change result is unchanged, determine that the target interface type of the interface to be tested is the first interface type;

[0126] If the address change result of the interface to be tested is unchanged and the return value format change result is changed, determine that the target interface type of the interface to be tested is the second interface type;

[0127] If the address change result of the interface to be tested is changed and the return value format change result is unchanged, determine that the target interface type of the interface to be tested is the third interface type;

[0128] Except for the interfaces to be tested belonging to the first interface type, the second interface type, and the third interface type, the target interface type of the remaining interfaces to be tested is the fourth interface type.

[0129] Further, in a possible implementation manner of the embodiments of the present disclosure, as Figure 10 shown, the test unit 83 includes:

[0130] A determination module 831, configured to determine whether the return value format of the interface to be tested needs to change if the target interface type of the interface to be tested is the second interface type;

[0131] A processing module 832, configured to update the test cases corresponding to the interface to be tested if the return value format needs to change, and determine the updated test cases as the target test cases corresponding to the interface to be tested; otherwise, modify the return value format in the test cases corresponding to the interface to be tested, and determine the modified test cases as the target test cases corresponding to the interface to be tested.

[0132] Wherein, the above determination module 831 is further configured to:

[0133] If the target interface type of the interface to be tested is the third interface type, determine whether the interface address of the interface to be tested needs to change.

[0134] Further, the above processing module 832 is further configured to:

[0135] If the interface address needs to change, determine the existing target interface corresponding to the interface to be tested, and replace the interface address in the test cases corresponding to the target interface with the interface address of the interface to be tested, and determine the replaced test cases as the target test cases corresponding to the interface to be tested; otherwise, modify the interface address in the test cases corresponding to the interface to be tested, and determine the modified test cases as the target test cases corresponding to the interface to be tested.

[0136] Further, in a possible implementation manner of the embodiments of the present disclosure, as Figure 11 shown, the test unit 83 includes:

[0137] A first determination module 831, configured to determine whether there is an interface to be tested whose target interface type is the fourth interface type;

[0138] An acquisition module 832, configured to acquire second interface information of the server if there is an interface to be tested whose target interface type is the fourth interface type, where the second interface information is the interface addresses and return value formats of all interfaces in the server;

[0139] A second determination module 833, configured to determine a candidate test interface set of the interface to be tested based on the second interface information;

[0140] A third determination module 834, configured to determine a target candidate test interface of the interface to be tested based on the interface addresses and return value formats of the candidate test interfaces in the candidate test interface set;

[0141] The fourth determination module 835 is configured to determine a target test case corresponding to the interface to be tested based on the interface address and return value format of the target candidate test interface.

[0142] Among them, the above-mentioned third determination module 834 is specifically configured to:

[0143] Based on the interface address and return value format of the candidate test interfaces in the candidate test interface set and the interface address and return value format of the interface to be tested, respectively determine the first similarity score and the second similarity score of the candidate test interfaces;

[0144] Based on the first similarity score and the second similarity score, determine the target candidate test interface of the interface to be tested.

[0145] Furthermore, the above-mentioned third determination module 834 is further configured to:

[0146] Based on the interface address and return value format of the candidate test interfaces in the candidate test interface set, respectively determine the first keyword list and the second keyword list corresponding to the candidate test interfaces;

[0147] Based on the interface address and return value format of the interface to be tested, respectively determine the third keyword list and the fourth keyword list corresponding to the interface to be tested;

[0148] Based on the first keyword list and the third keyword list, determine the first similarity score of the candidate test interface;

[0149] Based on the second keyword list and the fourth keyword list, determine the second similarity score of the candidate test interface.

[0150] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM), random access memories (RAM), mobile hard disks, magnetic disks, or optical discs that can store computer programs.

[0151] The embodiments of the present disclosure also provide a computer program product. The above-mentioned computer program product includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned server test method embodiments are implemented.

[0152] The embodiments of the present disclosure also provide another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned server test method embodiments are implemented.

[0153] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.

[0154] The above has provided a detailed introduction to a server testing method, apparatus, and system provided by the present disclosure. Specific examples have been used herein to elaborate on the principles and implementation manners of the present disclosure. The description of the above embodiments is only used to help understand the method and its core idea of the present disclosure. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present disclosure, several improvements and modifications can be made to the present disclosure, and these improvements and modifications also fall within the protection scope of the claims of the present disclosure.

Claims

1. A server testing method, characterized in that, Including: Obtain test cases of the server, and determine first interface information of the server based on the test cases, where the first interface information includes an interface address and a return value format of an interface to be tested in the server; Determine a target interface type of the interface to be tested based on the interface address and the return value format of the interface to be tested in the first interface information; Determine a target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested, and complete the test of the server based on the target test case.

2. The server testing method according to claim 1, characterized in that, The determining the target interface type of the interface to be tested based on the interface address and the return value format of the interface to be tested in the first interface information includes: Obtain a change result of the interface to be tested based on the interface address and the return value format of the interface to be tested in the first interface information, where the change result includes an address change result and a return value format change result; Determine the target interface type of the interface to be tested based on the address change result and the return value format change result of the interface to be tested.

3. The server testing method according to claim 2, wherein The determining the target interface type of the interface to be tested based on the address change result and the return value format change result of the interface to be tested includes: If the address change result of the interface to be tested is unchanged and the return value format change result is unchanged, determine that the target interface type of the interface to be tested is a first interface type; If the address change result of the interface to be tested is unchanged and the return value format change result is changed, determine that the target interface type of the interface to be tested is a second interface type; If the address change result of the interface to be tested is changed and the return value format change result is unchanged, determine that the target interface type of the interface to be tested is a third interface type; Excluding the interfaces to be tested belonging to the first interface type, the second interface type, and the third interface type, the target interface type of the remaining interfaces to be tested is a fourth interface type.

4. The server testing method according to claim 3, wherein The determining the target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested includes: If the target interface type of the interface to be tested is a second interface type, determine whether the return value format of the interface to be tested needs to be changed; If the return value format needs to be changed, update the test case corresponding to the interface to be tested, and determine the updated test case as the target test case corresponding to the interface to be tested; otherwise, modify the return value format in the test case corresponding to the interface to be tested, and determine the modified test case as the target test case corresponding to the interface to be tested.

5. The server testing method according to claim 3, wherein The determining the target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested includes: If the target interface type of the interface to be tested is a third interface type, determine whether the interface address of the interface to be tested needs to be changed; If the interface address needs to be changed, determine the existing target interface corresponding to the interface to be tested, and replace the interface address in the test case corresponding to the target interface with the interface address of the interface to be tested, and determine the test case after replacement as the target test case corresponding to the interface to be tested; otherwise, modify the interface address in the test case corresponding to the interface to be tested, and determine the test case after modification as the target test case corresponding to the interface to be tested.

6. The server testing method according to claim 3, wherein The determining the target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested includes: Determine whether there is an interface to be tested with the target interface type being the fourth interface type; If there is an interface to be tested with the target interface type being the fourth interface type, obtain the second interface information of the server, where the second interface information is the interface address and return value format of all interfaces in the server; Based on the second interface information, determine the candidate test interface set of the interface to be tested; Based on the interface address and return value format of the candidate test interfaces in the candidate test interface set, determine the target candidate test interface of the interface to be tested; Based on the interface address and return value format of the target candidate test interface, determine the target test case corresponding to the interface to be tested.

7. The server testing method according to claim 6, wherein The determining the target candidate test interface of the interface to be tested based on the interface address and return value format of the candidate test interfaces in the candidate test interface set includes: Based on the interface address and return value format of the candidate test interfaces in the candidate test interface set and the interface address and return value format of the interface to be tested, respectively determine the first similarity score and the second similarity score of the candidate test interfaces; Based on the first similarity score and the second similarity score, determine the target candidate test interface of the interface to be tested.

8. The server testing method according to claim 7, wherein The respectively determining the first similarity score and the second similarity score of the candidate test interfaces based on the interface address and return value format of the candidate test interfaces in the candidate test interface set and the interface address and return value format of the interface to be tested includes: Based on the interface address and return value format of the candidate test interfaces in the candidate test interface set, respectively determine the first keyword list and the second keyword list corresponding to the candidate test interfaces; Based on the interface address and return value format of the interface to be tested, respectively determine the third keyword list and the fourth keyword list corresponding to the interface to be tested; Based on the first keyword list and the third keyword list, determine the first similarity score of the candidate test interfaces; Based on the second keyword list and the fourth keyword list, determine the second similarity score of the candidate test interfaces.

9. An interface testing device, characterized in that, including: The first determining unit is configured to obtain the test case of the server, and determine the first interface information of the server based on the test case, where the first interface information includes the interface address and return value format of the interface to be tested in the server; A second determination unit, configured to determine a target interface type of the interface to be tested based on the interface address and return value format of the interface to be tested in the first interface information; A test unit, configured to determine a target test case corresponding to the interface to be tested based on the target interface type of the interface to be tested, and complete the test of the server based on the target test case.

10. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to implement the steps of the server test method according to any one of claims 1 to 8 when executing the computer program.

11. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the server test method according to any one of claims 1 to 8 when executed by a processor.

12. A computer program product comprising a computer program, characterized in that, The computer program implements the steps of the server test method according to any one of claims 1 to 8 when executed by a processor.