Switch test management method, device, electronic device and storage medium
By obtaining logs and numbers from the switch defect library, generating and executing test scripts, filtering and updating the defect library, the problems of inefficient switch testing and inflexible defect library are solved, and efficient and accurate sharing of test results and quality control are achieved.
Patent Information
- Application Number
- CN202211634511.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-12-19
AI Technical Summary
The existing switch testing technology is inefficient, and the automated test results require manual summary and analysis, resulting in more repeated test work, inflexible defect databases, difficult to share, and potentially hidden dangers to quality problems.
By obtaining test case logs and use case numbers from the switch defect library, a parsable format file is generated, a test script is generated based on the preset test script template, and executed on the switch, obtaining test log information, filtering error logs to update the defect library, and using the machine Learn to optimize test scripts and defect libraries.
It improves the efficiency of switch testing, reduces dependence on manuals, enhances the flexibility and accuracy of defect libraries, saves verification time, and ensures timely updates of quality issues.
Smart Images

Figure CN116016270B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of switch testing, and in particular to a switch testing management method, a switch testing management device, an electronic device and a storage medium. Background Art
[0002] With the development of the Internet, the quality requirements for switch products are getting higher and higher, and the iteration efficiency of switch products is also higher. As an important part of ensuring product quality, testing work has become more and more important. After each test, it will take a lot of time to complete the summary of the test work. However, due to the wide variety of switch products and the varying complexity of the testing work, when multiple products are delivered at the same time, it is easy to cause deficiencies due to a large amount of repeated testing work, and inadequate testing, leaving serious hidden dangers for quality problems.
[0003] Although many testing activities have been automated, the results of automated testing still need to be manually summarized and analyzed. The analysis results cannot be shared, which makes automated testing less efficient. In order to improve the accuracy of automated testing, reduce the dependence of log analysis on manual work, and improve the effectiveness and flexibility of the defect library, Summary of the invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a switch test management method, a switch test management device, an electronic device and a storage medium that overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect of the present invention, an embodiment of the present invention discloses a switch test management method, comprising:
[0006] When testing a switch, obtain the test case log and case number from the switch defect library;
[0007] Binding the test case log and the case number to generate a parsable format file;
[0008] Generate a test script according to the parseable format file and a preset test script template, and distribute the test script to multiple different types of switches to be tested;
[0009] During the process of the switch to be tested executing the test script, obtaining test log information generated by the switch to be tested;
[0010] Filtering the test log information according to the parseable format file to generate error log information;
[0011] The switch defect database is updated using the error log information.
[0012] Optionally, the method further comprises:
[0013] Receiving a test script template extension instruction, wherein the test script template instruction includes extension data;
[0014] The preset test script template is updated using the extended data.
[0015] Optionally, the method further comprises:
[0016] After generating the test script, generating test script notification information according to the test script;
[0017] In response to a confirmation operation on the test script notification information, the step of distributing the test script to a plurality of different types of switches to be tested is performed.
[0018] Optionally, the method further comprises:
[0019] Get historical switch test logs;
[0020] The switch defect library is constructed according to the historical switch test log.
[0021] Optionally, the binding of the test case log and the test case number to generate a parsable format file includes:
[0022] Determining the use case number;
[0023] Associating the test case log with the case number;
[0024] The associated test case log and the case number are written into a preset parsable format data group to generate the parsable format file.
[0025] Optionally, filtering the test log information according to the parsable format file to generate error log information includes:
[0026] Comparing the parsable format file with the test log information;
[0027] When the test log information includes an error reporting identifier that matches the parsable format file, the test log information is determined to be the error reporting log information.
[0028] Optionally, the updating the switch defect library by using the error log information includes:
[0029] Determining target error log information according to the target keyword of the error log information;
[0030] According to the principle of machine learning, the use case number and the error use case corresponding to the target error log information are converted into a parsable format file to be updated;
[0031] The parsable format file to be updated is written into the switch defect library to complete the update of the switch defect library.
[0032] In a second aspect of the present invention, an embodiment of the present invention further discloses a switch test management device, including:
[0033] The first acquisition module is used to obtain the test case log and the case number from the switch defect library when performing switch testing;
[0034] A binding module, used for binding the test case log and the test case number to generate a parsable format file;
[0035] A test distribution module, used to generate a test script according to the parseable format file and a preset test script template, and distribute the test script to multiple different types of switches to be tested;
[0036] A second acquisition module, configured to acquire test log information generated by the switch to be tested during the process of the switch to be tested executing the test script;
[0037] A screening module, used for screening the test log information according to the parsable format file to generate error log information;
[0038] The first updating module is used to update the switch defect library using the error log information.
[0039] In the third aspect of the present invention, an embodiment of the present invention further discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the switch test management method as described above when executed by the processor.
[0040] In a fourth aspect of the present invention, an embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the switch test management method described above are implemented.
[0041] The embodiments of the present invention include the following advantages:
[0042] The embodiment of the present invention obtains the test case log and case number from the switch defect library when testing the switch; binds the test case log and the case number to generate a parsable format file; generates a test script based on the parsable format file and a preset test script template, and distributes the test script to multiple different types of switches to be tested; obtains the test log information generated by the switch to be tested during the execution of the test script by the switch to be tested; filters the test log information based on the parsable format file to generate error log information; and updates the switch defect library with the error log information. By generating a test script based on the known problem types of different switches in the switch defect library, distributing it to the switch to be tested for execution, comparing and analyzing the log information in the test process with the known problems, and updating the analysis results to the defect library, the time of the tester to verify a known problem of a switch in other types of switches is saved, and the test efficiency is improved; and the newly discovered problems are classified into the switch defect library, and the switch defect library is updated, thereby improving the flexibility of the switch defect library. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a flow chart of steps of an embodiment of a switch test management method of the present invention;
[0044] Figure 2 is a flowchart of another switch test management method embodiment of the present invention;
[0045] Figure 3 is a flow chart of steps of an example of a switch test management method of the present invention;
[0046] Figure 4 It is a schematic diagram of script generation of an example of a switch test management method of the present invention;
[0047] Figure 5 It is a structural block diagram of an embodiment of a switch test management device of the present invention;
[0048] Figure 6 is a structural block diagram of an electronic device provided by an embodiment of the present invention;
[0049] Figure 7 It is a structural block diagram of a storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] Reference Figure 1, shows a flow chart of steps of an embodiment of a switch test management method of the present invention, and the switch test management method may specifically include the following steps:
[0052] Step 101, when testing a switch, obtaining a test case log and a test case number from a switch defect library;
[0053] The switch defect library stores files of vulnerabilities (BUGs) found during the testing of various types of switches. The file includes at least a test case log and a case number. Among them, the switch defect library can be divided into switch defect library 1, switch defect library 2, switch defect library 3...switch defect library N according to the type of switch; N is a positive integer. When calling, all switch defect libraries are called at the same time, that is, switch defect library 1, switch defect library 2, switch defect library 3...switch defect library N are all called. In addition, the use of pure numbers to identify the division of the switch defect library is only an example of an embodiment of the present invention. The division identification of the switch defect library can also be in the form of pure letters, a combination of numbers and letters, etc.; no specific limitation is made to this.
[0054] When testing a switch, the test case log and the case number can be obtained from the data corresponding to the storage address (interval) of the switch defect library. The storage address (interval) can be a local storage space of a server connected to the switch, or a cloud storage space of a cloud space connected to the switch and the server, which is not specifically limited in the embodiment of the present invention.
[0055] Step 102, binding the test case log and the case number to generate a parsable format file;
[0056] After obtaining the test case log and the case number, the test case log and the case number can be bound to generate a parsable format file, so that it can be directly read and parsed for testing the switch. The parsable format file can be an HTML (Hyper Text Markup Language) file or a JSON (JavaScript Object Notation) file. JSON is a text-based, language-independent lightweight data exchange format. It is based on a subset of ECMAScript (the js specification formulated by the European Computer Manufacturers Association) and uses a text format that is completely independent of the programming language to store and represent data. The concise and clear hierarchical structure makes it easy for machines to parse and generate, and effectively improves network transmission efficiency. HTML is an identifying language. It includes a series of tags. Through these tags, the document format on the network can be unified, and the scattered Internet resources can be connected into a logical whole. HTML files are descriptive texts composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc. Hypertext is a way of organizing information. It associates text, graphics and other information media in the text through hyperlinks. These interrelated information media may be in the same text, or in other files, or in files on a computer that is geographically far away. This way of organizing information connects information resources distributed in different locations in a random way, making it easier to retrieve information.
[0057] Step 103, generating a test script according to the parsable format file and a preset test script template, and distributing the test script to multiple different types of switches to be tested;
[0058] The preset test script template contains the script template, data interface template, distribution rule template and other templates required for the test script to generate test script code; the preset test script template can be modified through modification / expansion instructions to achieve the update of the preset test script template.
[0059] After obtaining the parsable format file, the data obtained by parsing the parsable format file can be written into a preset test script template to generate a test script, which includes a series of instructions for being executed by the switch to be tested to test the switch to be tested. After the test script is generated, it can be distributed to the switch to be tested according to the characteristic features of each switch to be tested, such as IP (Internet Protocol) address, device identification code, test type (if some functions are unique to a certain type of switch, those that are not involved in the distribution will not be tested), etc., to test the switch to be tested.
[0060] Step 104, obtaining test log information generated by the switch to be tested during the process of the switch to be tested executing the test script;
[0061] After receiving the test script, the switch to be tested executes the test script to start the test. During the process of the switch to be tested executing the test script, the switch to be tested generates a test log. The test log information generated by the switch to be tested can be obtained from the storage address (interval) of the switch to be tested where the test log is stored.
[0062] Step 105, filtering the test log information according to the parseable format file to generate error log information;
[0063] In the obtained test log information, a parsable format file is used to compare with the log information of the error situation recorded therein, and the matching test log information is screened out to generate error log information.
[0064] In addition, when the parsable format file is compared with the log information of the error recorded therein, it is found that there is no match, and the error log information may be empty information, that is, the error log information does not contain data that actually changes the switch defect library.
[0065] Step 106: Use the error log information to update the switch defect database.
[0066] When the error log information is filtered out, it means that new switch defects have been found during this test, and other switches can also be tested in the future. To this end, the switch defect library is updated and supplemented with error log information, so that more content can be tested during the test and the verification results are more reliable.
[0067] In addition, when the error log information is empty, it means that no new switch defects were found in this test, and the current switch defect library is complete. When the switch defect library is updated with empty error log information, the content of the updated switch defect library is empty. Alternatively, when it is detected that the error log information is empty, the switch defect library is not updated and the current switch defect library is used.
[0068] The embodiment of the present invention obtains the test case log and case number from the switch defect library when testing the switch; binds the test case log and the case number to generate a parsable format file; generates a test script based on the parsable format file and a preset test script template, and distributes the test script to multiple different types of switches to be tested; obtains the test log information generated by the switch to be tested during the execution of the test script by the switch to be tested; filters the test log information based on the parsable format file to generate error log information; and updates the switch defect library with the error log information. By generating a test script based on the known problem types of different switches in the switch defect library, distributing it to the switch to be tested for execution, comparing and analyzing the log information in the test process with the known problems, and updating the analysis results to the defect library, the time of the tester to verify a known problem of a switch in other types of switches is saved, and the test efficiency is improved; and the newly discovered problems are classified into the switch defect library, and the switch defect library is updated, thereby improving the flexibility of the switch defect library.
[0069] Reference Figure 2 , shows a flow chart of steps of another switch test management method embodiment of the present invention, the switch test management method may specifically include the following steps:
[0070] Step 201, obtaining historical switch test logs;
[0071] The embodiment of the present invention can be applied to a switch test management terminal. The switch test management terminal is connected to multiple switches. The connection between the switch test management terminal and the switch can be a wired connection, such as connecting through a physical cable such as an optical fiber, a twisted pair, etc.; or a wireless connection, such as connecting the switch test management terminal and the switch to the same wireless local area network WLAN.
[0072] The switch test management terminal can obtain the historical switch test log. The historical switch test log is the test log generated by the switch when the switch was tested in the past. The tester can input the historical switch test log into the switch test management terminal through an external storage hard disk or the like, so that the switch test management terminal obtains the historical switch test log; or when the switch test management terminal is connected to the switch, the test log of each switch is obtained from the storage address (interval) where the test log of each switch is stored as the historical switch test log.
[0073] Step 202, constructing the switch defect library according to the historical switch test log;
[0074] After obtaining the historical switch test log, the possible defects of the switch can be determined based on the log analysis results in the historical switch test log, so as to record the test cases corresponding to all defects and build a switch defect library.
[0075] Step 203, when testing the switch, obtain the test case log and the case number from the switch defect library;
[0076] After the switch defect database is built, the switch test management terminal can start testing the switch to be tested.
[0077] When performing switch testing, the switch test management terminal obtains the test case log and the case number from the switch defect library.
[0078] Step 204, binding the test case log and the case number to generate a parsable format file;
[0079] After obtaining the test case log and the case number, it is necessary to bind the test case log and the case number, and generate a parsable format file so that it can be parsed and read during the test script generation process to improve the test efficiency. The parsable format file can be an HTML file or a JSON file. In a preferred example, the parsable format file is a JSON file.
[0080] In an optional embodiment of the present invention, the binding of the test case log and the test case number to generate a parsable format file may specifically include the following sub-steps:
[0081] Sub-step S2041, determining the use case number;
[0082] In actual applications, there may be multiple test case logs and test case numbers. In this case, the specific value of the test case number currently used can be determined first. And according to the number of test case logs, all the test case numbers are determined in ascending order.
[0083] Sub-step S2042, associating the test case log with the case number;
[0084] The acquired test case logs are associated with the case number to form a mapping relationship. It should be noted that when there are defect associations corresponding to two or more test case logs among the acquired test case logs, these two or more test case logs can be associated with one case number; a separate case number can be used; there is no specific limitation on this.
[0085] Sub-step S2043, writing the associated test case log and the case number into a preset parsable format data group to generate the parsable format file.
[0086] The associated test case log and case number are written into the preset parseable format data group of the parseable format according to the data frame corresponding to the parseable format of the parseable format file to generate a parseable format file. The test case log and case number are used as one of the function group data of the parseable format file for subsequent use.
[0087] The combined sub-steps S2041 to S2043 use exemplary codes to illustrate the process of binding the test case log and the case number. Here, the example of binding the acquired test case log and the case number to generate a JSON file (parseable format file) is used as an example:
[0088] data={
[0089] "case_number_1":{
[0090] "log_level":{
[0091] "log_info1":"XXX",
[0092] "log_info2":"XXX",
[0093] "log_info3":"XXX",
[0094] }
[0095] },
[0096] "case_number_2":{
[0097] "log_level":{
[0098] "log_info1":"XXX",
[0099] "log_info2":"XXX",
[0100] "log_info3":"XXX",
[0101] }
[0102] }
[0103] }
[0104] Through the above steps, all the acquired test case logs and case numbers are bound and written into a JSON file to generate a parsable format file.
[0105] Step 205, generating a test script according to the parseable format file and a preset test script template;
[0106] The preset test script template is a test script template for different types of switches in the same type of test scenario. After obtaining the parseable format file, the parseable format file is parsed, data is read, and the data is written into the preset test script template to generate a test script.
[0107] In addition, for different types of switches in the preset test script template, even if the same test case is used, different test scripts will be generated due to the difference in type, but the test content of these test scripts is the same, and only the type of switch used is different. Take the server upgrade Maxwell (change data capture software) and Victoria (hard disk detection and repair software) test as an example: Maxwell and Victoria are distinguished by IP address, and the corresponding upgrade image is written according to the different IP addresses to generate different upgrade test scripts.
[0108] Step 206, after generating the test script, generating test script notification information according to the test script;
[0109] After the test script is generated, test script notification information can be generated based on the information of the test script. The test script notification information is used to inform the tester to generate a new test script. The tester can use the test script notification information to determine whether the newly generated test script is correct or whether there are any modifications.
[0110] In addition, the switch test management terminal can have a built-in display component or an external display component; the test script notification information can be sent to the display component, the display component visualizes the test script notification information, and displays the test script notification information. The tester can directly view the test script notification information through the display component.
[0111] Step 207, in response to a confirmation operation on the test script notification information, distributing the test script to multiple different types of switches to be tested;
[0112] After viewing the test script notification information, the tester can perform confirmation operations on the test script notification information; the confirmation operations include but are not limited to click operations, voice confirmation command operations, and touch operations; technical personnel in this field can also set different confirmation operations according to actual needs, and there is no specific limitation on this.
[0113] The switch test management terminal can receive a confirmation operation for the test script notification information, and in response to the confirmation operation for the test script notification information, distribute corresponding test scripts to multiple different types of switches to be tested according to the characteristic features of each switch, so that multiple different types of switches to be tested can be tested for the same test scenario.
[0114] Step 208, obtaining test log information generated by the switch to be tested during the process of the switch to be tested executing the test script;
[0115] After receiving the test script, the switch to be tested starts to execute the test script for testing; during the process of each switch to be tested executing the test script for testing, the switch test management terminal obtains the test log information generated by each switch to be tested from the storage address (interval) where the test log information of each switch to be tested is stored, so as to determine whether an error occurs during the test process.
[0116] Step 209, filtering the test log information according to the parseable format file to generate error log information;
[0117] After obtaining the test log information, it can be determined whether there is test log information with related errors according to the parseable format file, and the test log information can be screened to generate error log information.
[0118] In an optional embodiment of the present invention, filtering the test log information according to the parseable format file to generate the error log information may specifically include the following sub-steps:
[0119] Sub-step S2091, comparing the parsable format file with the test log information;
[0120] In actual applications, the test log information will record the test cases used in the test, and there will also be records of the test cases in the parseable format file. To this end, the parseable format file can be compared with the test log information to compare whether the test cases recorded in the parseable format file are consistent with the test cases recorded in the test log information, and whether there is an error indicator in the test log information. Among them, the error indicator can be represented by a specific field keyword. For example, when a field is "0", there is an error indicator.
[0121] Sub-step S2092: when the test log information includes an error identification that matches the parsable format file, determining that the test log information is the error log information.
[0122] When the test cases recorded in the parsable format file are compared with the test cases recorded in the test log information and they are consistent, and there is an error identifier in the test log information, it can be determined that the test log information includes an error identifier that matches the parsable format file. At this time, it can be determined that the test log information with the error identifier is error log information.
[0123] Step 210, using the error log information to update the switch defect database;
[0124] The error log information screened out after the test is used to extract the key information, and then the key information is sorted out and the switch defect library is updated to keep the switch defect library fresh and flexible.
[0125] In an optional embodiment of the present invention, the updating of the switch defect database by using the error log information may specifically include the following sub-steps:
[0126] Sub-step S2101, determining target error log information according to the target keyword of the error log information;
[0127] The error log information will record a variety of error information, and the target error log information required can be determined according to the target keyword of the error log information. For example, if the target keyword is "error", the log information corresponding to the "error" item can be searched in the error log information as the target error log information.
[0128] Sub-step S2102, converting the use case number and the error use case corresponding to the target error log information into a parsable format file to be updated according to the principle of machine learning;
[0129] According to the principles of machine learning, the new target error log is converted into a parsable file based on the case number and log information. Specifically, based on the existing switch defect library, as a basic data preprocessing, the existing problems are obtained, and according to the existing template, an automated test script for this problem is generated. Through the above distribution rules, a large number of repeated tests are carried out, and the generated test script is continuously trained. At the same time, the test process (such as the time consumed by the test process) is recorded. According to the results of each test, the case number and the wrong case are continuously optimized to improve the accuracy and efficiency of the test. When the predetermined expectations are met (such as the accuracy rate reaches more than 99%, different expectations can be set through expansion), the generated script is used as an ideal script to create a new parsable format file to be updated (when the newly generated script is too different from the initial one, such as the difference is greater than 60%, this number can also be modified through settings to gradually replace the previous template as the new template).
[0130] Sub-step S2103, writing the to-be-updated parsable format file into the switch defect library to complete the update of the switch defect library.
[0131] The parsable format file to be updated is written into the switch defect library, and the switch defect library is stored according to the storage rule, thereby completing the update of the switch defect library.
[0132] Step 211, receiving a test script template extension instruction, wherein the test script template instruction includes extension data;
[0133] In an embodiment of the present invention, when it is necessary to expand the preset test script template, such as expanding the use case rules, dynamically adding or removing the switch to be tested, etc., the tester inputs the test script template expansion instruction to the switch test management terminal. The switch test management terminal receives the test script template expansion instruction. The test script template instruction includes expansion data; such as dynamically adding a switch to be tested, the expansion data includes adding the switch to be tested operation, and the switch identifier corresponding to the added switch to be tested.
[0134] Step 212: Use the extended data to update the preset test script template.
[0135] The preset test script template is updated with extended data. After the update is completed, the new preset test script template is subsequently used to generate the test script, thereby improving the flexibility of the test script template.
[0136] The embodiment of the present invention obtains historical switch test logs; builds the switch defect library according to the historical switch test logs; when performing switch testing, obtains test case logs and case numbers from the switch defect library; binds the test case logs and the case numbers to generate a parsable format file; generates a test script according to the parsable format file and a preset test script template; after generating the test script, generates test script notification information according to the test script; in response to a confirmation operation on the test script notification information, distributes the test script to multiple different types of switches to be tested; in the process of executing the test script on the switch to be tested, obtains the test log information generated by the switch to be tested; filters the test log information according to the parsable format file to generate error log information; uses the error log information to update the switch defect library; receives a test script template extension instruction, the test script template instruction includes extension data; and uses the extension data to update the preset test script template. By automatically generating and executing test scripts based on the known problem types of different switches in the switch defect library, comparing and analyzing the log information during the test process with the known problems, and updating the analysis results to the switch defect library, it saves testers' time in verifying a known problem of one switch on other types of switches. In addition, newly discovered problems can be classified into the switch defect library through machine learning, which improves test efficiency and flexibility of the switch defect library and reduces labor costs.
[0137] In order to enable those skilled in the art to better understand the embodiments of the present invention, the embodiments of the present invention are described below by using an example:
[0138] Reference Figure 3 , showing a flow chart of steps of an example of a switch test management method of the present invention;
[0139] 1. Build a defect library for each type of switch (switch defect library).
[0140] 2. The automated platform (test management terminal) based on the defect library obtains the use case log information and use case number of the bug (vulnerability) in the defect library, binds them, writes them into a parsable file format, and sets the test script template for the same test scenario of different types of switches in the system. Maxwell and Victoria are distinguished by IP, and different upgrade images are written according to different IP addresses, specifically:
[0141] {
[0142] "ip":"XXX"
[0143] {
[0144] "target":"bios",
[0145] "imagepath":"XXX.inspur",
[0146] "isupdate":"1",
[0147] }
[0148] }
[0149] Generate test scripts and distribute them to each switch to be tested.
[0150] Among them, refer to Figure 4 , showing a script generation schematic diagram of an example of a switch test management method;
[0151] Obtain the use case log information and use case number from the defect library and bind them, obtain the log analysis results, determine the newly added use case log information and use case number; write all use case log information and use case numbers into a parsable format file, which is in JSON, HTML, etc. Then input the data in the parsable format file into the rules and code templates in the test script template to output the test script.
[0152] 3. Log collection.
[0153] The generated parseable JSON file is compared with the logs collected during the test. If the collected logs contain log information indicating JSON file errors, the logs that appear in the test logs are filtered out and the testers are notified.
[0154] 4. Analyze the logs and fill in the results.
[0155] In the collected logs, new error logs are collected based on the keywords of the error log mark. According to the principles of machine learning, the new error logs are converted into parsable files based on the use case number and log information, written into the defect library, and updated to a parsable JSON file for re-testing.
[0156] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0157] Reference Figure 5, shows a structural block diagram of an embodiment of a switch test management device of the present invention, and the switch test management device may specifically include the following modules:
[0158] The first acquisition module 501 is used to acquire the test case log and the case number from the switch defect library when performing switch testing;
[0159] A binding module 502, used to bind the test case log and the case number to generate a parsable format file;
[0160] A test distribution module 503, configured to generate a test script according to the parsable format file and a preset test script template, and distribute the test script to multiple different types of switches to be tested;
[0161] The second acquisition module 504 is used to acquire the test log information generated by the switch to be tested during the process of the switch to be tested executing the test script;
[0162] A screening module 505 is used to screen the test log information according to the parsable format file and generate error log information;
[0163] The first updating module 506 is configured to update the switch defect database using the error log information.
[0164] In an optional embodiment of the present invention, the device further comprises:
[0165] A receiving module, used for receiving a test script template extension instruction, wherein the test script template instruction includes extension data;
[0166] The second updating module is used to update the preset test script template using the extended data.
[0167] In an optional embodiment of the present invention, the device further comprises:
[0168] A test script notification information generating module, used to generate test script notification information according to the test script after generating the test script;
[0169] The response module is used to execute the step of distributing the test script to multiple different types of switches to be tested in response to a confirmation operation on the test script notification information.
[0170] In an optional embodiment of the present invention, the device further comprises:
[0171] The third acquisition module is used to obtain historical switch test logs;
[0172] A construction module is used to construct the switch defect library according to the historical switch test log.
[0173] In an optional embodiment of the present invention, the binding module 502 includes:
[0174] A use case number determination submodule, used to determine the use case number;
[0175] An association submodule, used to associate the test case log with the case number;
[0176] The writing submodule is used to write the associated test case log and the case number into a preset parsable format data group to generate the parsable format file.
[0177] In an optional embodiment of the present invention, the screening module 505 includes:
[0178] A comparison submodule, used for comparing the parsable format file with the test log information;
[0179] The screening submodule is used to determine that the test log information is the error log information when the test log information includes an error identifier that matches the parsable format file.
[0180] In an optional embodiment of the present invention, the first updating module 506 includes:
[0181] A target error log information determination submodule, used to determine the target error log information according to the target keyword of the error log information;
[0182] A conversion submodule, used to convert the use case number and error use case corresponding to the target error log information into a parsable format file to be updated according to the principle of machine learning;
[0183] The updating submodule is used to write the parsable format file to be updated into the switch defect library to complete the update of the switch defect library.
[0184] The embodiment of the present invention generates a test script according to the known problem types of different switches in the switch defect library, distributes it to the switches to be tested for execution, compares and analyzes the log information in the test process with the known problems, and updates the analysis results to the defect library, thereby saving the time of testers in verifying a known problem of a switch on other types of switches and improving the test efficiency; and newly discovered problems are classified into the switch defect library, the switch defect library is updated, and the flexibility of the switch defect library is improved.
[0185] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0186] An embodiment of the present invention further provides an electronic device, including:
[0187] A processor 601 and a storage medium 602, wherein the storage medium 602 stores a computer program executable by the processor 601, and when the electronic device is running, the processor 601 executes the computer program to execute the switch test management method as described in any one of the embodiments of the present invention. The specific implementation method and technical effect are similar to those of the method embodiment, and will not be repeated here.
[0188] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0189] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0190] The embodiment of the present invention further provides a computer-readable storage medium 701, on which a computer program is stored, and the computer program is executed by a processor to execute the switch test management method as described in any one of the embodiments of the present invention. The specific implementation method and technical effect are similar to those of the method embodiment, and will not be repeated here.
[0191] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0192] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0193] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0194] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0195] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0196] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0197] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal 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, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0198] The switch test management method, device, electronic device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A switch test management method, characterized in that: include: When testing a switch, obtain the test case log and case number from the switch defect library; Binding the test case log and the case number to generate a parsable format file; Generate a test script according to the parseable format file and a preset test script template, and distribute the test script to multiple different types of switches to be tested; During the process of the switch to be tested executing the test script, obtaining test log information generated by the switch to be tested; Filtering the test log information according to the parseable format file to generate error log information; Using the error log information to update the switch defect library; The step of updating the switch defect database by using the error log information includes: Determining target error log information according to the target keyword of the error log information; According to the principle of machine learning, the use case number and the error use case corresponding to the target error log information are converted into a parsable format file to be updated; The parsable format file to be updated is written into the switch defect library to complete the update of the switch defect library.
2. The method according to claim 1, characterized in that: The method further comprises: Receiving a test script template extension instruction, wherein the test script template instruction includes extension data; The preset test script template is updated using the extended data.
3. The method according to claim 1, characterized in that The method further comprises: After generating the test script, generating test script notification information according to the test script; In response to a confirmation operation on the test script notification information, the step of distributing the test script to a plurality of different types of switches to be tested is performed.
4. The method according to claim 1, characterized in that: The method further comprises: Get historical switch test logs; The switch defect library is constructed according to the historical switch test log.
5. The method according to any one of claims 1 to 4, characterized in that: The binding of the test case log and the case number to generate a parsable format file includes: Determining the use case number; Associating the test case log with the case number; The associated test case log and the case number are written into a preset parsable format data group to generate the parsable format file.
6. The method according to any one of claims 1 to 4, characterized in that: The step of filtering the test log information according to the parseable format file to generate error log information includes: Comparing the parsable format file with the test log information; When the test log information includes an error reporting identifier that matches the parsable format file, the test log information is determined to be the error reporting log information.
7. A switch test management device, characterized in that: include: The first acquisition module is used to obtain the test case log and the case number from the switch defect library when performing switch testing; A binding module, used for binding the test case log and the test case number to generate a parsable format file; A test distribution module, used to generate a test script according to the parseable format file and a preset test script template, and distribute the test script to multiple different types of switches to be tested; A second acquisition module, configured to acquire test log information generated by the switch to be tested during the process of the switch to be tested executing the test script; A screening module, used for screening the test log information according to the parsable format file to generate error log information; A first updating module, configured to update the switch defect library using the error log information; The first update module includes: A target error log information determination submodule, used to determine the target error log information according to the target keyword of the error log information; A conversion submodule, used to convert the use case number and error use case corresponding to the target error log information into a parsable format file to be updated according to the principle of machine learning; The updating submodule is used to write the parsable format file to be updated into the switch defect library to complete the update of the switch defect library.
8. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the switch test management method according to any one of claims 1 to 6 when executed by the processor.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the switch test management method according to any one of claims 1 to 6 are implemented.
