CN116016270B - Switch test management method, device, electronic device and storage medium - Google Patents
Switch test management method, device, electronic device and storage medium Download PDFInfo
- Publication number
- CN116016270B CN116016270B CN202211634511.XA CN202211634511A CN116016270B CN 116016270 B CN116016270 B CN 116016270B CN 202211634511 A CN202211634511 A CN 202211634511A CN 116016270 B CN116016270 B CN 116016270B
- Authority
- CN
- China
- Prior art keywords
- test
- switch
- log information
- format file
- test script
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 392
- 238000007726 management method Methods 0.000 title claims abstract description 46
- 238000013515 script Methods 0.000 claims abstract description 146
- 230000007547 defect Effects 0.000 claims abstract description 101
- 238000000034 method Methods 0.000 claims abstract description 56
- 230000008569 process Effects 0.000 claims abstract description 29
- 238000012216 screening Methods 0.000 claims abstract description 8
- 238000004590 computer program Methods 0.000 claims description 19
- 238000012790 confirmation Methods 0.000 claims description 11
- 238000010801 machine learning Methods 0.000 claims description 8
- 238000001914 filtration Methods 0.000 claims description 7
- 230000004044 response Effects 0.000 claims description 7
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 12
- 238000012545 processing Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 230000001174 ascending effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000013102 re-test Methods 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及交换机测试技术领域,特别是涉及一种交换机测试管理方法、一种交换机测试管理装置、一种电子设备和存储介质。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
随着互联网的发展,对交换机产品的质量要求越来越高,对交换机产品的迭代效率也产生较高的要求,作为保证产品质量的重要环节的测试工作,也就显得愈发重要。在每一次测试结束后,会需要大量的时间完成对测试工作的总结。而由于交换机产品的种类繁多、测试工作的复杂程度不一,在多产品同时交付的情况下,容易因大量重复测试工作造成不足,测试不充分,给质量问题留下严重隐患。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.
尽管许多测试活动已采用自动化的方式进行,但自动化的测试结果还需要人工进行汇总、分析,分析结果不能共享,使自动化测试的效率较低,为了提高自动化测试的准确率,降低日志分析对人工的依赖,提高缺陷库的有效性和灵活性。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
鉴于上述问题,提出了本发明实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种交换机测试管理方法、一种交换机测试管理装置、一种电子设备和存储介质。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.
在本发明的第一个方面,本发明实施例公开了一种交换机测试管理方法,包括:In a first aspect of the present invention, an embodiment of the present invention discloses a switch test management method, comprising:
在进行交换机测试时,从交换机缺陷库中获取测试用例日志和用例编号;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;
采用所述报错日志信息更新所述交换机缺陷库。The switch defect database is updated using the error log information.
可选地,所述方法还包括:Optionally, 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.
可选地,所述方法还包括:Optionally, 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.
可选地,所述方法还包括:Optionally, the method further comprises:
获取历史交换机测试日志;Get historical switch test logs;
依据所述历史交换机测试日志构建所述交换机缺陷库。The switch defect library is constructed according to the historical switch test log.
可选地,所述绑定所述测试用例日志和所述用例编号,生成可解析格式文件,包括:Optionally, the binding of the test case log and the test 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.
可选地,所述依据所述可解析格式文件筛选所述测试日志信息,生成报错日志信息,包括:Optionally, filtering the test log information according to the parsable 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.
可选地,所述采用所述报错日志信息更新所述交换机缺陷库,包括:Optionally, the updating the switch defect library 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.
在本发明的第二个方面,本发明实施例还公开了一种交换机测试管理装置,包括:In a second aspect of the present invention, an embodiment of the present invention further discloses a switch test management device, including:
第一获取模块,用于在进行交换机测试时,从交换机缺陷库中获取测试用例日志和用例编号;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;
第一更新模块,用于采用所述报错日志信息更新所述交换机缺陷库。The first updating module is used to update the switch defect library using the error log information.
在本发明的第三个方面,本发明实施例还公开了一种电子设备,包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如上所述的交换机测试管理方法的步骤。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.
在本发明的第四个方面,本发明实施例还公开了一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如上所述的交换机测试管理方法的步骤。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.
本发明实施例包括以下优点:The embodiments of the present invention include the following advantages:
本发明实施例通过在进行交换机测试时,从交换机缺陷库中获取测试用例日志和用例编号;绑定所述测试用例日志和所述用例编号,生成可解析格式文件;依据所述可解析格式文件和预设测试脚本模板,生成测试脚本,并向多种不同类型的待测试交换机分发所述测试脚本;在所述待测试交换机执行所述测试脚本的过程中,获取所述待测试交换机生成的测试日志信息;依据所述可解析格式文件筛选所述测试日志信息,生成报错日志信息;采用所述报错日志信息更新所述交换机缺陷库。通过根据交换机缺陷库中不同交换机已知问题类型,生成测试脚本、并分发至待测试交换机中执行,将测试过程中的日志信息与已知问题进行对比、分析,并将分析结果更新至缺陷库,节省了测试人员对一种交换机已知问题在其他类型交换机验证的时间,提高了测试效率;并且将新发现的问题,归入交换机缺陷库中,更新交换机缺陷库,提高交换机缺陷库的灵活性。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
图1是本发明的一种交换机测试管理方法实施例的步骤流程图;FIG1 is a flow chart of steps of an embodiment of a switch test management method of the present invention;
图2是本发明的另一种交换机测试管理方法实施例的步骤流程图;FIG2 is a flow chart of steps of another switch test management method embodiment of the present invention;
图3是本发明的一种交换机测试管理方法示例的步骤流程图;3 is a flow chart of steps of an example of a switch test management method of the present invention;
图4是本发明的一种交换机测试管理方法示例的脚本生成示意图;FIG4 is a schematic diagram of script generation of an example of a switch test management method of the present invention;
图5是本发明的一种交换机测试管理装置实施例的结构框图;5 is a structural block diagram of an embodiment of a switch test management device of the present invention;
图6是本发明实施例提供的一种电子设备的结构框图;FIG6 is a structural block diagram of an electronic device provided by an embodiment of the present invention;
图7是本发明实施例提供的一种存储介质的结构框图。FIG. 7 is a structural block diagram of a storage medium provided by an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。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.
参照图1,示出了本发明的一种交换机测试管理方法实施例的步骤流程图,所述交换机测试管理方法具体可以包括如下步骤:1, a flow chart of a switch test management method embodiment of the present invention is shown. The switch test management method may specifically include the following steps:
步骤101,在进行交换机测试时,从交换机缺陷库中获取测试用例日志和用例编号;Step 101, when testing a switch, obtaining a test case log and a test case number from a switch defect library;
交换机缺陷库中存储着多种类型交换机的测试过程中发现漏洞(BUG)的文件。该文件至少包括测试用例日志和用例编号。其中,交换机缺陷库可以按照交换机的类型,划分为交换机缺陷库1、交换机缺陷库2、交换机缺陷库3…交换机缺陷库N;N为正整数。在调用时,则是同时调用全部交换机缺陷库,即将交换机缺陷库1、交换机缺陷库2、交换机缺陷库3…交换机缺陷库N全部进行调用。此外,对于交换机缺陷库的划分采用纯数字进行标识仅为本发明实施例的举例说明,交换机缺陷库的划分标识还可以采用纯字母、数字与字母组合等方式;对此不作具体限定。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.
在进行交换机测试时,可以从交换机缺陷库的存储地址(区间)对应的数据中获取测试用例日志和用例编号。该存储地址(区间)可以是与交换机连接的服务器的本地存储空间,还可以是与交换机和服务器连接的云空间的云存储空间,本发明实施例对此不作具体限定。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.
步骤102,绑定所述测试用例日志和所述用例编号,生成可解析格式文件;Step 102, binding the test case log and the case number to generate a parsable format file;
在得到测试用例日志和用例编号后,可以将测试用例日志和用例编号进行绑定,生成可解析格式文件,以便于后续可以直接读取解析用于对交换机进行测试。该可解析格式文件可以是HTML(Hyper Text Markup Language,超文本标记语言)文件、JSON(JavaScript Object Notation,JS对象简谱)文件。JSON是一种基于文本,独立于语言的轻量级数据交换格式。它基于ECMAScript(European Computer ManufacturersAssociation,欧洲计算机协会制定的js规范)的一个子集,采用完全独立于编程语言的文本格式来存储和表示数据。简洁和清晰的层次结构使得其易于机器解析和生成,并有效地提升网络传输效率。HTML是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet(因特网)资源连接为一个逻辑整体。HTML文件是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。超文本是一种组织信息的方式,它通过超级链接方法将文本中的文字、图表与其他信息媒体相关联。这些相互关联的信息媒体可能在同一文本中,也可能是其他文件,或是地理位置相距遥远的某台计算机上的文件。这种组织信息方式将分布在不同位置的信息资源用随机方式进行连接,为检索信息提供方便。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.
步骤103,依据所述可解析格式文件和预设测试脚本模板,生成测试脚本,并向多种不同类型的待测试交换机分发所述测试脚本;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;
预设测试脚本模板中记载有脚本模板、数据接口模板、分发规则模板等于测试脚本进行测试脚本代码生成所需的模板;该预设测试脚本模板可以通过修改/拓展指令进行修改后,以实现对预设测试脚本模板的更新。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.
在得到可解析格式文件后,可以将解析该可解析格式文件得到数据写入到预设测试脚本模板中,生成测试脚本,该测试脚本包括一系列指令,用于被待测试交换机执行,对待测试交换机进行测试。并且在生成测试脚本后,可以根据每个待测试交换机标志性特点,如IP(Internet Protocol,网际互连协议)地址、设备识别码、测试的类型(如有部分功能是某一类型交换机特有的,在分发时不涉及此功能的将不会被测试)等,分发至待测试交换机中,以对待测试交换机进行测试。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.
步骤104,在所述待测试交换机执行所述测试脚本的过程中,获取所述待测试交换机生成的测试日志信息;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;
待测试交换机在接收到测试脚本后,执行测试脚本以开始进行测试。在待测试交换机执行测试脚本的过程中,待测试交换机会生成测试日志。可以从待测试交换机的存储测试日志的存储地址(区间)中获取待测试交换机生成的测试日志信息。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.
步骤105,依据所述可解析格式文件筛选所述测试日志信息,生成报错日志信息;Step 105, filtering the test log information according to the parseable format file to generate error log information;
在获取到的测试日志信息中,采用可解析格式文件与其记载的发生错误情况的日志信息进行对比,将匹配的测试日志信息筛选出来,生成报错日志信息。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.
此外,当采用可解析格式文件与其记载的发生错误情况的日志信息进行对比时,发现并不存在匹配的情况,报错日志信息可以为空信息,即报错日志信息并不存在实质改变交换机缺陷库的数据。In addition, when the parsable format file is compared with the log information of the error situation 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.
步骤106,采用所述报错日志信息更新所述交换机缺陷库。Step 106: Use the error log information to update the switch defect database.
在筛选出报错日志信息时,说明在本次测试过程中,发现了新的交换机缺陷,可以在后续时,对其他交换机也要进行测试。为此,采用报错日志信息更新交换机缺陷库,对交换机缺陷库进行补充,使得测试的过程中测试的内容可以更多,验证结果更加可靠。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.
此外,当报错日志信息为空时,说明本次测试并未发现新的交换机缺陷,当前的交换机缺陷库完善,采用空的报错日志信息更新交换机缺陷库时,更新交换机缺陷库的内容即为空,或者,当检测到报错日志信息为空时,不对交换机缺陷库进行更新,沿用当前的交换机缺陷库。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.
本发明实施例通过在进行交换机测试时,从交换机缺陷库中获取测试用例日志和用例编号;绑定所述测试用例日志和所述用例编号,生成可解析格式文件;依据所述可解析格式文件和预设测试脚本模板,生成测试脚本,并向多种不同类型的待测试交换机分发所述测试脚本;在所述待测试交换机执行所述测试脚本的过程中,获取所述待测试交换机生成的测试日志信息;依据所述可解析格式文件筛选所述测试日志信息,生成报错日志信息;采用所述报错日志信息更新所述交换机缺陷库。通过根据交换机缺陷库中不同交换机已知问题类型,生成测试脚本、并分发至待测试交换机中执行,将测试过程中的日志信息与已知问题进行对比、分析,并将分析结果更新至缺陷库,节省了测试人员对一种交换机已知问题在其他类型交换机验证的时间,提高了测试效率;并且将新发现的问题,归入交换机缺陷库中,更新交换机缺陷库,提高交换机缺陷库的灵活性。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.
参照图2,示出了本发明的另一种交换机测试管理方法实施例的步骤流程图,所述交换机测试管理方法具体可以包括如下步骤:2, there is shown a flowchart of another switch test management method embodiment of the present invention, wherein the switch test management method may specifically include the following steps:
步骤201,获取历史交换机测试日志;Step 201, obtaining historical switch test logs;
本发明实施例可以应用于交换机测试管理终端中。该交换机测试管理终端与多个交换机进行连接。交换机测试管理终端与交换机的连接可以是有线连接,如通过光纤,双绞线等有实体线缆的方式进行连接;也可以是无线连接,如通过将交换机测试管理终端与交换机接入同一无线局域网WLAN等方式进行连接。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.
交换机测试管理终端可以获取历史交换机测试日志。该历史交换机测试日志为过往针对交换机进行测试时,交换机产生的测试日志。测试人员可以通过外接存储硬盘等方式将历史交换机测试日志输入交换机测试管理终端,使得交换机测试管理终端获取历史交换机测试日志;也可以是当交换机测试管理终端与交换机连接后,从各个交换机存储测试日志的存储地址(区间)中获取各个交换机的测试日志作为历史交换机测试日志。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.
步骤202,依据所述历史交换机测试日志构建所述交换机缺陷库;Step 202, constructing the switch defect library according to the historical switch test log;
在得到历史交换机测试日志后,可以基于历史交换机测试日志中的日志分析结果,确定交换机可能出现的缺陷,从而将全部缺陷对应的测试用例进行记载,构建生成交换机缺陷库。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.
步骤203,在进行交换机测试时,从交换机缺陷库中获取测试用例日志和用例编号;Step 203, when testing the switch, obtain the test case log and the case number from the switch defect library;
构建完交换机缺陷库后,交换机测试管理终端可以开始对待测试的交换机进行测试。After the switch defect database is built, the switch test management terminal can start testing the switch to be tested.
在进行交换机测试时,交换机测试管理终端从交换机缺陷库中,获取测试用例日志和用例编号。When performing switch testing, the switch test management terminal obtains the test case log and the case number from the switch defect library.
步骤204,绑定所述测试用例日志和所述用例编号,生成可解析格式文件;Step 204, binding the test case log and the case number to generate a parsable format file;
得到测试用例日志和用例编号后,需要将测试用例日志和用例编号进行绑定,并且生成可解析格式文件,以便于在测试脚本生成的过程中解析读取,提高测试效率。其中该可解析格式文件可以为HTML文件、JSON文件。在一优选示例中,可解析格式文件为JSON文件。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.
在本发明的一可选实施例中,所述绑定所述测试用例日志和所述用例编号,生成可解析格式文件具体可以包括如下子步骤: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:
子步骤S2041,确定所述用例编号;Sub-step S2041, determining the use case number;
在实际应用中,测试用例日志和用例编号会存在多个,此时可以先确定当前所使用的用例编号的具体值。并且根据测试用例日志的数量,顺序递增确定全部用例编号。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.
子步骤S2042,将所述测试用例日志与所述用例编号关联;Sub-step S2042, associating the test case log with the case number;
将获取到的测试用例日志与用例编号进行关联,形成映射关系。需要说明的是,当获取到的测试用例日志之间存在两个或两个以上的测试用例日志对应的缺陷关联时,可以将这两个或两个以上的测试用例日志与一个用例编号进行关联;可以采用单独的用例编号;对此不作具体限定。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.
子步骤S2043,将关联后的所述测试用例日志与所述用例编号,写入预设可解析格式数据组,生成所述可解析格式文件。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.
将关联后的测试用例日志与用例编号,按照可解析格式文件的可解析格式对应的数据框架,写入到该中可解析格式预设可解析格式数据组中,生成可解析格式文件。令测试用例日志与用例编号作为可解析格式文件其中一个函数组数据;便于后续使用。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.
联合子步骤S2041~子步骤S2043,采用示例性的代码,举例说明绑定测试用例日志和用例编号的过程。其中,以将获取到的测试用例日志和用例编号绑定,生成JSON文件(可解析格式文件)为例进行说明: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:
data={data={
"case_number_1":{"case_number_1":{
"log_level":{"log_level":{
"log_info1":"XXX","log_info1":"XXX",
"log_info2":"XXX","log_info2":"XXX",
"log_info3":"XXX","log_info3":"XXX",
}}
},},
"case_number_2":{"case_number_2":{
"log_level":{"log_level":{
"log_info1":"XXX","log_info1":"XXX",
"log_info2":"XXX","log_info2":"XXX",
"log_info3":"XXX","log_info3":"XXX",
}}
}}
}}
通过上述步骤将全部获取到的测试用例日志和用例编号进行绑定,写入JSON文件中,以生成可解析格式文件。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.
步骤205,依据所述可解析格式文件和预设测试脚本模板,生成测试脚本;Step 205, generating a test script according to the parseable format file and a preset test script template;
预设测试脚本模板为不同类型的交换机在同一类测试场景的测试脚本模板。在得到可解析格式文件后,解析该可解析格式文件,读取数据,并将该数写入预设测试脚本模板中,生成测试脚本。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.
此外,预设测试脚本模板中对于不同类型的交换机,即使是采用相同从测试用例,也会因类型的区别产生不同的测试脚本,但这些测试脚本测试内容相同,只区别于使用的交换机类型。以服务器升级Maxwell(变更数据抓取软件)和Victoria(硬盘检测修复软件)测试为例:以IP地址区分Maxwell和Victoria,根据IP地址不同写入对应的升级镜像,生成不同的升级测试脚本。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.
步骤206,在生成所述测试脚本后,依据所述测试脚本生成测试脚本通知信息;Step 206, after generating the test script, generating test script notification information according to the test script;
生成测试脚本后,可以依据测试脚本的信息生成测试脚本通知信息,该测试脚本通知信息用于告知测试人员生成新的测试脚本,测试人员可以通过测试脚本通知信息确定新生成的测试脚本是否正确,或者是否存在修改的地方。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.
此外,交换机测试管理终端可以内置显示组件或者外接显示组件;可以将该测试脚本通知信息发送至该显示组件中,显示组件对测试脚本通知信息进行可视化处理,将测试脚本通知信息进行显示,测试人员可以直接通过显示组件查看测试脚本通知信息。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.
步骤207,响应于针对所述测试脚本通知信息的确认操作,向多种不同类型的待测试交换机分发所述测试脚本;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;
测试人员可以在查看到测试脚本通知信息后,针对测试脚本通知信息进行确认操作;该确认操作包括但不限于点击操作,语音确认指令操作,触控操作;本领域技术人员还可以根据实际需求设置不同的确认操作,对此不作具体限定。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.
交换机测试管理终端可以接收针对测试脚本通知信息的确认操作,并且响应于针对所述测试脚本通知信息的确认操作,按照根据每个交换机标志性特点,向多种不同类型的待测试交换机分发对应的测试脚本,以使多种不同类型的待测试交换机针对同一测试场景进行测试。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.
步骤208,在所述待测试交换机执行所述测试脚本的过程中,获取所述待测试交换机生成的测试日志信息;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;
待测试交换机在接收到测试脚本后,开始执行测试脚本进行测试;在各待测试交换机执行测试脚本进行测试过程中,交换机测试管理终端从各个待测试交换机存储测试日志信息的存储地址(区间)中,获取各个待测试交换机生成的测试日志信息,以便于确定测试过程中是否发生错误。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.
步骤209,依据所述可解析格式文件筛选所述测试日志信息,生成报错日志信息;Step 209, filtering the test log information according to the parseable format file to generate error log information;
在得到测试日志信息后,可以依据可解析格式文件判断是否存在与其相关报错的测试日志信息,对测试日志信息进筛选,生成报错日志信息。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.
在本发明的一可选实施例中,所述依据所述可解析格式文件筛选所述测试日志信息,生成报错日志信息具体可以包括如下子步骤: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:
子步骤S2091,将所述可解析格式文件与所述测试日志信息进行对比;Sub-step S2091, comparing the parsable format file with the test log information;
在实际应用中,测试日志信息会记载测试是所使用的测试用例,可解析格式文件中也会存在对测试用例的记载。为此,可以将可解析格式文件与测试日志信息进行对比,对比可解析格式文件中记载的测试用例和测试日志信息中记载的测试用例是否一致,且测试日志信息中存在报错标识。其中,该报错标识可以采用特定字段关键字表征。如某字段为“0”时,即为存在报错标识。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.
子步骤S2092,当所述测试日志信息包括与所述可解析格式文件匹配的报错标识时,确定所述测试日志信息为所述报错日志信息。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.
当对比可解析格式文件中记载的测试用例和测试日志信息中记载的测试用例一致,且测试日志信息中存在报错标识,即可以确定测试日志信息包括与可解析格式文件匹配的报错标识,此时,可以确定该存在报错标识的测试日志信息为报错日志信息。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.
步骤210,采用所述报错日志信息更新所述交换机缺陷库;Step 210, using the error log information to update the switch defect database;
采用测试后筛选出来的报错日志信息,提取出关键信息后,将关键信息整理后更新交换机缺陷库,以使交换机缺陷库保持鲜活度以及灵活性。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.
在本发明的一可选实施例中,所述采用所述报错日志信息更新所述交换机缺陷库具体可以包括如下子步骤: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:
子步骤S2101,根据所述报错日志信息的目标关键字,确定目标报错日志信息;Sub-step S2101, determining target error log information according to the target keyword of the error log information;
报错日志信息中会记载报错的多种信息内容,可以根据报错日志信息的目标关键字,确定出所需要的目标报错日志信息。举例而言,目标关键字为“error”,可以在报错日志信息中查询“error”项对应记载日志信息为目标报错日志信息。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.
子步骤S2102,根据机器学习的原则将所述目标报错日志信息对应的用例编号和错误用例,转化为待更新可解析格式文件;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;
根据机器学习的原则将新的目标报错日志根据用例编号跟日志信息转化为可解析的文件。具体地根据已有的交换机缺陷库,作为一个基础数据预处理获取已出现的问题,根据现有模板,生成一个针对此问题自动化测试脚本,通过上述的分发规则,进行大量重复测试,不断训练生成的测试脚本,同时记录测试的过程(如测试过程消耗的时间),根据每次测试的结果,不断优化确定错误的用例编号和错误用例,提高其测试的准确率及效率,当达到预定期望后(如准确率达到99%以上,可通过扩展的方式设置不同的期望),将生成的脚本作为一个理想的脚本建立一个新的待更新可解析格式文件(当新生成的脚本与初始差异过大时,如差异度大于60%,此数也可通过设置修改,逐步替换之前模板作为新的模板),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).
子步骤S2103,将所述待更新可解析格式文件写入所述交换机缺陷库,以完成所述交换机缺陷库更新。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.
将待更新可解析格式文件写入交换机缺陷库中,交换机缺陷库按照存储规则进行存储,完成对交换机缺陷库的更新。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.
步骤211,接收测试脚本模板拓展指令,所述测试脚本模板指令包括拓展数据;Step 211, receiving a test script template extension instruction, wherein the test script template instruction includes extension data;
在本发明实施例中,当需要对预设测试脚本模板进行拓展,如用例规则拓展,动态增加、移除待测试交换机等时,测试人员向交换机测试管理终端输入测试脚本模板拓展指令。交换机测试管理终端接收测试脚本模板拓展指令。其中,测试脚本模板指令包括拓展数据;如动态增加待测试交换机,拓展数据包括增加待测试交换机操作,和增加的待测试交换机对应的交换机标识。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.
步骤212,采用所述拓展数据更新所述预设测试脚本模板。Step 212: Use the extended data to update the preset test script template.
采用拓展数据更新预设测试脚本模板,在更新完成后,后续采用新的预设测试脚本模板生成测试脚本,提高测试脚本模板的灵活性。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.
本发明实施例通过获取历史交换机测试日志;依据所述历史交换机测试日志构建所述交换机缺陷库;在进行交换机测试时,从交换机缺陷库中获取测试用例日志和用例编号;绑定所述测试用例日志和所述用例编号,生成可解析格式文件;依据所述可解析格式文件和预设测试脚本模板,生成测试脚本;在生成所述测试脚本后,依据所述测试脚本生成测试脚本通知信息;响应于针对所述测试脚本通知信息的确认操作,向多种不同类型的待测试交换机分发所述测试脚本;在所述待测试交换机执行所述测试脚本的过程中,获取所述待测试交换机生成的测试日志信息;依据所述可解析格式文件筛选所述测试日志信息,生成报错日志信息;采用所述报错日志信息更新所述交换机缺陷库;接收测试脚本模板拓展指令,所述测试脚本模板指令包括拓展数据;采用所述拓展数据更新所述预设测试脚本模板。通过根据交换机缺陷库中不同交换机已知问题类型,自动生成测试脚本、并自动执行,将测试过程中的日志信息与已知问题进行对比、分析,并将分析结果更新至交换机缺陷库,节省了测试人员对一种交换机已知问题在其他类型交换机验证的时间,并且可以通过机器学习将新发现的问题,归入交换机缺陷库中,提高了测试效率和交换机缺陷库灵活性、降低了人力的成本。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.
为了使本领域技术人员能够更好地理解本发明实施例,下面通过一个例子对本发明实施例加以说明: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:
参照图3,示出了本发明的一种交换机测试管理方法示例的步骤流程图;3, there is shown a flow chart of steps of an example of a switch test management method of the present invention;
1、构建各类型交换机的缺陷库(交换机缺陷库)。1. Build a defect library for each type of switch (switch defect library).
2、基于缺陷库的自动化平台(测试管理终端)获取缺陷库中出现bug(漏洞)的用例日志信息与用例编号,并进行绑定,写入可解析的文件格式中,在系统中设置不同种交换机同一类测试场景的测试脚本模板。以IP区分Maxwell和Victoria,根据IP地址不同写入不同的升级镜像,具体为: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:
{{
"ip":"XXX""ip":"XXX"
{{
"target":"bios","target":"bios",
"imagepath":"XXX.inspur","imagepath":"XXX.inspur",
"isupdate":"1","isupdate":"1",
}}
}}
生成测试脚本并分发至各待测试的交换机中。Generate test scripts and distribute them to each switch to be tested.
其中,参照图4,示出了一种交换机测试管理方法示例的脚本生成示意图;4, a schematic diagram of script generation of an example of a switch test management method is shown;
从缺陷库中获取用例日志信息与用例编号并进行绑定,获取日志分析结果,确定新增的用例日志信息与用例编号;将全部用例日志信息与用例编号写入可解析格式文件中,该可解析格式文件为JSON、HTML等格式。然后将该可解析格式文件中的数据输入到测试脚本模板中的规则和代码模板,从而输出测试脚本。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.
3、日志收集。3. Log collection.
将生成的可解析JSON文件,与测试过程中收集的日志进行对比,收集的日志出现JSON文件报错的日志信息,则将测试日志中出现的日志筛选出来,并通知测试人员。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.
4、日志分析,并将结果回填。4. Analyze the logs and fill in the results.
在收集的日志中根据错误日志标志的关键字收集出现新的报错日志,根据机器学习的原则将新的报错日志根据用例编号跟日志信息转化为可解析的文件,写入缺陷库中,并更新至可解析的JSON文件中,供再次测试使用。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.
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。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.
参照图5,示出了本发明的一种交换机测试管理装置实施例的结构框图,所述交换机测试管理装置具体可以包括如下模块:5, a structural block diagram of an embodiment of a switch test management device of the present invention is shown, and the switch test management device may specifically include the following modules:
第一获取模块501,用于在进行交换机测试时,从交换机缺陷库中获取测试用例日志和用例编号;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;
绑定模块502,用于绑定所述测试用例日志和所述用例编号,生成可解析格式文件;A binding module 502, used to bind the test case log and the case number to generate a parsable format file;
测试分发模块503,用于依据所述可解析格式文件和预设测试脚本模板,生成测试脚本,并向多种不同类型的待测试交换机分发所述测试脚本;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;
第二获取模块504,用于在所述待测试交换机执行所述测试脚本的过程中,获取所述待测试交换机生成的测试日志信息;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;
筛选模块505,用于依据所述可解析格式文件筛选所述测试日志信息,生成报错日志信息;A screening module 505 is used to screen the test log information according to the parsable format file and generate error log information;
第一更新模块506,用于采用所述报错日志信息更新所述交换机缺陷库。The first updating module 506 is configured to update the switch defect database using the error log information.
在本发明的一可选实施例中,所述装置还包括:In an optional embodiment of the present invention, the device further comprises:
接收模块,用于接收测试脚本模板拓展指令,所述测试脚本模板指令包括拓展数据;A receiving module, used for receiving a test script template extension instruction, wherein the test script template instruction includes extension data;
第二更新模块,用于采用所述拓展数据更新所述预设测试脚本模板。The second updating module is used to update the preset test script template using the extended data.
在本发明的一可选实施例中,所述装置还包括:In an optional embodiment of the present invention, the device further comprises:
测试脚本通知信息生成模块,用于在生成所述测试脚本后,依据所述测试脚本生成测试脚本通知信息;A test script notification information generating module, used to generate test script notification information according to the test script after generating the test script;
响应模块,用于响应于针对所述测试脚本通知信息的确认操作,执行所述向多种不同类型的待测试交换机分发所述测试脚本的步骤。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.
在本发明的一可选实施例中,所述装置还包括:In an optional embodiment of the present invention, the device further comprises:
第三获取模块,用于获取历史交换机测试日志;The third acquisition module is used to obtain historical switch test logs;
构建模块,用于依据所述历史交换机测试日志构建所述交换机缺陷库。A construction module is used to construct the switch defect library according to the historical switch test log.
在本发明的一可选实施例中,所述绑定模块502包括:In an optional embodiment of the present invention, the binding module 502 includes:
用例编号确定子模块,用于确定所述用例编号;A use case number determination submodule, used to determine the use case number;
关联子模块,用于将所述测试用例日志与所述用例编号关联;An association submodule, used to associate the test case log with the case number;
写入子模块,用于将关联后的所述测试用例日志与所述用例编号,写入预设可解析格式数据组,生成所述可解析格式文件。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.
在本发明的一可选实施例中,所述筛选模块505包括:In an optional embodiment of the present invention, the screening module 505 includes:
对比子模块,用于将所述可解析格式文件与所述测试日志信息进行对比;A comparison submodule, used for comparing the parsable format file with the test log information;
筛选子模块,用于当所述测试日志信息包括与所述可解析格式文件匹配的报错标识时,确定所述测试日志信息为所述报错日志信息。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.
在本发明的一可选实施例中,所述第一更新模块506包括:In an optional embodiment of the present invention, the first updating module 506 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.
本发明实施例通过根据交换机缺陷库中不同交换机已知问题类型,生成测试脚本、并分发至待测试交换机中执行,将测试过程中的日志信息与已知问题进行对比、分析,并将分析结果更新至缺陷库,节省了测试人员对一种交换机已知问题在其他类型交换机验证的时间,提高了测试效率;并且将新发现的问题,归入交换机缺陷库中,更新交换机缺陷库,提高交换机缺陷库的灵活性。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.
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。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.
本发明实施例还提供了一种电子设备,包括:An embodiment of the present invention further provides an electronic device, including:
处理器601和存储介质602,所述存储介质602存储有所述处理器601可执行的计算机程序,当电子设备运行时,所述处理器601执行所述计算机程序,以执行如本发明实施例任一项所述的交换机测试管理方法。具体实现方式和技术效果与方法实施例部分类似,这里不再赘述。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.
存储器可以包括随机存取存储器(Random Access Memory,简称RAM),也可以包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。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.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application SpecificIntegrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。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.
本发明实施例还提供了一种计算机可读存储介质701,所述存储介质701上存储有计算机程序,所述计算机程序被处理器运行时执行如本发明实施例任一项所述的交换机测试管理方法。具体实现方式和技术效果与方法实施例部分类似,这里不再赘述。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.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。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.
本领域内的技术人员应明白,本发明实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。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.
本发明实施例是参照根据本发明实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。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 box in the flowchart and/or block diagram, as well as the combination of the processes and/or boxes 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 a device for implementing the functions specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct 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 that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。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 computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。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.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。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.
以上对本发明所提供的一种交换机测试管理方法、装置、电子设备和存储介质,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。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 (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211634511.XA CN116016270B (en) | 2022-12-19 | 2022-12-19 | Switch test management method, device, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211634511.XA CN116016270B (en) | 2022-12-19 | 2022-12-19 | Switch test management method, device, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116016270A CN116016270A (en) | 2023-04-25 |
CN116016270B true CN116016270B (en) | 2024-11-05 |
Family
ID=86027554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211634511.XA Active CN116016270B (en) | 2022-12-19 | 2022-12-19 | Switch test management method, device, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116016270B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116566873A (en) * | 2023-05-18 | 2023-08-08 | 浪潮思科网络科技有限公司 | An ELK-based automated log analysis method, system, and storage medium |
CN117370216A (en) * | 2023-12-08 | 2024-01-09 | 天津华来科技股份有限公司 | Callback interface performance test method based on python language |
CN119893550B (en) * | 2025-03-28 | 2025-06-24 | 深圳信息通信研究院 | WLAN interoperability test method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108268348A (en) * | 2017-12-08 | 2018-07-10 | 广州视源电子科技股份有限公司 | Interface testing method and device, mobile terminal and storage medium |
CN109446104A (en) * | 2018-11-16 | 2019-03-08 | 郑州云海信息技术有限公司 | A kind of testing case management and device based on big data |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10552294B2 (en) * | 2017-03-31 | 2020-02-04 | Commvault Systems, Inc. | Management of internet of things devices |
CN112463580B (en) * | 2019-09-09 | 2024-07-12 | 英业达科技有限公司 | Test system based on virtualization device and method thereof |
CN111026669B (en) * | 2019-12-11 | 2023-08-18 | 广州品唯软件有限公司 | Test log management method, test log management device and storage medium |
CN114968818A (en) * | 2022-06-24 | 2022-08-30 | 深圳万兴软件有限公司 | Automated test management method, device, terminal device and storage medium |
-
2022
- 2022-12-19 CN CN202211634511.XA patent/CN116016270B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108268348A (en) * | 2017-12-08 | 2018-07-10 | 广州视源电子科技股份有限公司 | Interface testing method and device, mobile terminal and storage medium |
CN109446104A (en) * | 2018-11-16 | 2019-03-08 | 郑州云海信息技术有限公司 | A kind of testing case management and device based on big data |
Also Published As
Publication number | Publication date |
---|---|
CN116016270A (en) | 2023-04-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11797298B2 (en) | Automating identification of code snippets for library suggestion models | |
US11494181B2 (en) | Automating generation of library suggestion engine models | |
CN116016270B (en) | Switch test management method, device, electronic device and storage medium | |
CN110928772B (en) | A test method and device | |
CN111382070B (en) | Compatibility testing method and device, storage medium and computer equipment | |
US9251046B2 (en) | Method and system for generating and processing black box test cases | |
CN108446190B (en) | Interface test method and device | |
CN107665171B (en) | Automatic regression testing method and device | |
US20080313616A1 (en) | Methods and systems for testing tool with comparative testing | |
US20110016452A1 (en) | Method and system for identifying regression test cases for a software | |
CN104239219B (en) | Software defect positioning technology on-line evaluating and experimenting platform and method based on coverage | |
US9037552B2 (en) | Methods for analyzing a database and devices thereof | |
US11436133B2 (en) | Comparable user interface object identifications | |
Corea et al. | A taxonomy of business rule organizing approaches in regard to business process compliance | |
CN115454702A (en) | Log fault analysis method and device, storage medium and electronic equipment | |
WO2016190869A1 (en) | Determining potential test actions | |
CN119201210A (en) | A code review method and device | |
CN119336641A (en) | White box testing method and device, storage medium, and computer equipment | |
Fawad et al. | Android Source Code Smells: A Systematic Literature Review | |
CN118656357A (en) | Data migration method, device, electronic device, storage medium and product | |
CN116955140A (en) | SDK test method, device, equipment and storage medium | |
CN118897668B (en) | Public code library management method, system, equipment and medium | |
CN119848881B (en) | Intelligent code review method and system | |
Anderson | Modeling and analysis of SQL queries in PHP systems | |
CN118535461A (en) | A test script generation method and device, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |