WO2018000607A1 - Method and electronic apparatus for identifying test case failure causes - Google Patents

Method and electronic apparatus for identifying test case failure causes Download PDF

Info

Publication number
WO2018000607A1
WO2018000607A1 PCT/CN2016/099946 CN2016099946W WO2018000607A1 WO 2018000607 A1 WO2018000607 A1 WO 2018000607A1 CN 2016099946 W CN2016099946 W CN 2016099946W WO 2018000607 A1 WO2018000607 A1 WO 2018000607A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
result
expected
business data
valid
Prior art date
Application number
PCT/CN2016/099946
Other languages
French (fr)
Chinese (zh)
Inventor
杨彩花
Original Assignee
乐视控股(北京)有限公司
乐视电子商务(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 乐视控股(北京)有限公司, 乐视电子商务(北京)有限公司 filed Critical 乐视控股(北京)有限公司
Publication of WO2018000607A1 publication Critical patent/WO2018000607A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Definitions

  • the present invention relates to the field of test monitoring technologies, and in particular, to a method and an electronic device for identifying a cause of failure of a test case.
  • test case in software engineering is a set of conditions or variables used by a tester to determine whether an application or software system is working correctly. It is a set of test inputs, execution conditions, and conditions for a particular target. Expected results to test a program path or verify that a particular requirement is met.
  • the system automatically sends out the test result email every day. If there is a failure in the test case, manual intervention is required to determine whether the test failure is caused by an interface exception or a business data change.
  • business data changes frequently. Many times, after the business data has just been changed, the business personnel modify or update the business data again, resulting in a slower monitoring interface; an increase in the number of use cases. At the time, the cost of investing in people will also increase; it is more frequent and time-consuming to manually confirm changes.
  • the embodiment of the present application provides a method and an electronic device for identifying a cause of failure of a test case, thereby overcoming the defect of inefficiency of the existing test monitoring.
  • an embodiment of the present invention provides a method for identifying a cause of failure of a test case, including: obtaining a test case in which the test fails, and obtaining a test result of the test case; selecting and testing the test result.
  • the effective test result corresponding to the expected result of the use case; compare the effective test result with the expected result to determine whether the valid test result is the same as the business data in the expected result; when the business data is different, mark the failure reason of the test case as Business data changes.
  • the method further includes: saving the business data of the valid test result to the expected copy file; and when the business data of the valid test result is correct, using the expected copy file as the original expectation The file, the business data in which the expected result is stored in the original expected file.
  • the method further includes: comparing the effective test result with the expected result to determine whether the valid test result is the same as the service data type in the expected result; and when the service data type is different, the test case is used. The reason for the failure is marked as a change in the business data type.
  • the method further includes: sending the test result of the test failure to the vulnerability management system.
  • selecting valid test results corresponding to the expected results of the test case in the test result includes: determining an expected result identifier, identifying the expected result as an identifier of the expected result of the test case; determining the test result A valid test result that is consistent with the expected result identification.
  • an embodiment of the present invention further provides an identification test case.
  • the device for failure causes, comprising: an obtaining module, configured to obtain a test case in which the test fails, and obtain a test result of the test case; and a selection module, configured to select a valid test result corresponding to the expected result of the test case in the test result.
  • a comparison module for comparing the effective test result with the expected result to determine whether the valid test result is the same as the business data in the expected result;
  • a tagging module is used to mark the failure reason of the test case as a business data change when the business data is different.
  • the apparatus when the service data is different, the apparatus further includes: a saving module, configured to save the service data of the valid test result to the expected copy file; and a replacement module, the service data used in the valid test result
  • the expected copy file is the original expected file, and the business data with the expected results in the original expected file.
  • the comparison module is further configured to: compare and compare the valid test result with the expected result, determine whether the valid test result is the same as the service data type in the expected result; and the marking module is further configured to: in the service data When the types are different, mark the failure reason of the test case as a business data type change.
  • the device when the service data type is different, the device further includes: a sending module, configured to send the test result of the test failure to the vulnerability management system.
  • the selecting module includes: a determining unit, configured to determine an expected result identifier, the expected result identifier is an identifier of an expected result of the test case; and the selecting unit is configured to determine that the test result is consistent with the expected result identifier Effective test results.
  • an embodiment of the present invention provides an electronic device, including: at least one processor; and a memory communicably coupled to the at least one processor; wherein the memory is stored
  • the at least one processor executes instructions that are executed by the at least one processor to cause the at least one processor to perform the methods described in the various aspects above.
  • an embodiment of the present application further provides a non-transitory computer readable storage medium storing computer executable instructions, the computer executable The instructions are for performing the methods described in the various aspects above.
  • an embodiment of the present invention provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions
  • the program instructions When the program instructions are executed by a computer, the computer is caused to perform the methods described in the various aspects above.
  • the method and the electronic device for identifying the cause of the failure of the test case can compare the effective test result with the expected result by selecting an effective test result corresponding to the expected result in the test result of the test case.
  • Process to determine the cause of the failure of the test case omits the manual operation steps, can automatically identify the cause of the failure and mark the reason, facilitates subsequent marking of the errors, saves the maintenance staff's working time, can improve the positioning problem and fix the speed and efficiency of the problem.
  • the business data change triggers the test failure the latest business data is automatically obtained by replacing the original expected file in time to test the maintenance personnel to quickly locate the latest business data.
  • the test result of the test failure is sent to the vulnerability management system, and the technician can obtain the test result in question in time, so that the subsequent technician can perform corresponding software improvement or update on the test result of the test failure.
  • FIG. 1 is a flow chart of a first method for identifying a cause of failure of a test case in an embodiment of the present invention
  • FIG. 2 is a flow chart of a second method for identifying a cause of failure of a test case in an embodiment of the present invention
  • FIG. 3 is a flowchart of a third method for identifying a cause of failure of a test case in an embodiment of the present invention
  • FIG. 4 is a first structural diagram of an apparatus for identifying a cause of failure of a test case in an embodiment of the present invention
  • FIG. 5 is a second structural diagram of an apparatus for identifying a cause of failure of a test case in an embodiment of the present invention
  • FIG. 6 is a third structural diagram of an apparatus for identifying a cause of failure of a test case in an embodiment of the present invention.
  • FIG. 7 is a structural diagram of a module selected in the embodiment of the present invention.
  • FIG. 8 is a structural diagram of a network device in an embodiment of the present invention.
  • a method for identifying a cause of failure of a test case provided by an embodiment of the present invention is performed by an electronic device, as shown in FIG. 1 , including steps 101-104:
  • Step 101 Obtain a test case in which the test fails, and obtain a test result of the test case.
  • test case for testing an application or system is set in advance.
  • a test failure notification is issued and the test case of the test failure is marked, and the test case in which the test fails is obtained.
  • each test case corresponds to one test result, and in step 101, the test result of the test case in which the test fails is simultaneously obtained.
  • test case A is a case where the test fails, and the test result is "abce”, then the test case A is determined in step 101, and the test result "abce" is determined.
  • Step 102 Select a valid test result corresponding to the expected result of the test case in the test result.
  • one or more results may be included in the test result.
  • a useful test result that is, an effective test result
  • the effective test result is part or all of the test result.
  • each test case has an expected result, that is, the result of the test case output is expected; according to the expected result, the tester's attention result can be determined, and then the test case can be selected and tested.
  • the expected results correspond to the effective test results.
  • the expected expected results of the test case include “expected result A” and “expected result B”, and the expected result does not focus on other results; and the test results output after executing the test case include “test result a”, “test result b” , “test result c” and “test result d”, wherein the result A corresponds to the result a, and the result B corresponds to the result b.
  • the expected result does not pay attention to other results, only the results corresponding to the expected result, that is, “test result a” and “test result b” are selected in step 102, so "test result a” and “test result” b" as a valid test result.
  • an ID is assigned to each test result, that is, a test result identifier; at the same time, an ID is assigned to the expected result, that is, an expected result identifier; and the test result identifier and the expected result identifier adopt the same identification manner.
  • the above step 102 "selecting valid test results corresponding to the expected results of the test cases in the test results" specifically includes steps A1-A2:
  • Step A1 Determine an expected result identifier, and the expected result identifier is an identifier of an expected result of the test case.
  • Step A2 Determine a valid test result in the test result that is consistent with the expected result identifier.
  • the tester is concerned with "01 expected result”, “02 expected result” and “04 expected result”, among which "01”, “02", “04” are the corresponding expected results.
  • logo the test results that are consistent with the expected result identifiers "01”, “02", and “04", that is, “01 test result”, “02 test result”, and “04 test result” are determined, and the Three “01 test results”, “02 test results” and “04 test results” were taken as valid test results.
  • Step 103 Compare the valid test result with the expected result to determine whether the valid test result is the same as the business data in the expected result.
  • the difference between the effective test result and the expected result can be determined by comparing the effective test result with the expected result, thereby determining the business data in the effective test result and the business data in the expected result. Is it the same?
  • the diff command can be used to compare the difference between the contents of the two files or directories.
  • the diff command can be used to compare the effective test result with the expected result, and the diff result is saved, and the diff result can be used to determine the two. Whether the business data changes.
  • Step 104 Mark the failure reason of the test case as the service data change when the service data is different.
  • the cause of the failure of the test case may be automatically determined as the service data changes.
  • the failure reason of the test case is marked as the service data change, and then the failure reason may be targeted. Perform the appropriate processing.
  • comparing the valid test results with the expected results also includes comparing the business data types of the two. Specifically, referring to FIG. 2, the method further includes:
  • Step 105 Comparing the effective test result with the expected result, determining that there is Whether the result of the validity test is the same as the type of business data in the expected result;
  • Step 106 When the service data types are different, the failure reason for marking the test case is a change of the service data type.
  • the "comparing the effective test result and the expected result" in steps 102 and 104 can be performed simultaneously, that is, after the comparison process is performed, it can be determined whether the service data and/or the service data type has changed.
  • the diff command can be used to compare the effective test result with the expected result, and the diff result is saved. According to the diff result, it can be determined whether the service data between the two changes, and whether the service data type changes.
  • the method for identifying the cause of the failure of the test case provided by the embodiment of the present invention, by selecting the effective test result corresponding to the expected result in the test result of the test case, thereby comparing the effective test result with the expected result, thereby Determine the reason for the failure of the test case.
  • the method omits the manual operation steps, can automatically identify the cause of the failure and mark the reason, facilitates subsequent marking of the errors, saves the maintenance staff's working time, can improve the positioning problem and fix the speed and efficiency of the problem.
  • step 104 when the service data is different, the method further includes steps B1-B2:
  • Step B1 Save the business data of the valid test result to the expected copy file.
  • Step B2 When the business data of the valid test result is correct, the expected copy file is taken as the original expected file, and the business data of the expected result is stored in the original expected file.
  • the business data of the expected result is stored in the original expected file, and in step 103, “determining whether the valid test result is the same as the business data in the expected result” may be the effective test result and the expected result stored in the original expected file. The results were compared.
  • the expected copy file is used to save the valid test result.
  • the expected copy file is the same format as the original expected file, or the expected copy file is different from the original expected file, and the former has valid test results. The latter has the expected results.
  • the service can be considered The data change is normal and reasonable.
  • the expected copy file is used as the original expected file; if the original expected file is still needed during the subsequent test, the data in the original expected file is substantially the valid test result saved in step B1.
  • Business data When the business data change triggers the test failure, by replacing the original expected file in time, the latest business data can be automatically obtained to test the maintenance personnel to quickly locate the latest business data.
  • step 106 when the service data types are different, the method further includes: sending the test result of the test failure to the vulnerability management system.
  • the vulnerability management system is a bug management system, and the vulnerability management system supports people with different permissions or different positions to log in. After the test result of the test failure is sent to the vulnerability management system, it is convenient for the subsequent technician to perform corresponding software improvement or update on the test result of the test failure, and the technician can obtain the test result in question in time.
  • the effective test result and the expected result are compared, and at the same time, whether the valid test result and the service data and the service data type in the expected result are the same.
  • steps 301-309 refer to FIG. 3, including steps 301-309:
  • Step 301 Acquire a test case in which the test fails, and obtain a test result of the test case.
  • Step 302 Determine an expected result identifier, the expected result identifier being an identifier of an expected result of the test case.
  • Step 303 Determine a valid test result in the test result that is consistent with the expected result identifier.
  • Step 304 Compare the effective test result with the expected result, and perform step 305 and step 308, respectively.
  • Step 305 Determine whether the valid test result is the same as the business data in the expected result.
  • Step 306 When the service data is different, mark the failure reason of the test case as The business data changes and the business data of the valid test results is saved to the expected copy file.
  • Step 307 When the business data of the valid test result is correct, the expected copy file is used as the original expected file, and the business data of the expected result is stored in the original expected file.
  • Step 308 Determine whether the valid test result is the same as the service data type in the expected result.
  • Step 309 When the service data types are different, the failure reason for marking the test case is a change of the service data type, and the test result of the test failure is sent to the vulnerability management system.
  • the method for identifying the cause of failure of the test case can select the effective test result corresponding to the expected result in the test result of the test case, and then compare and compare the effective test result with the expected result to determine The reason for the failure of the test case.
  • the method omits the manual operation steps, can automatically identify the cause of the failure and mark, facilitates subsequent marking of the errors, saves the maintenance staff's working time, can improve the positioning problem and fix the speed and efficiency of the problem.
  • the business data change triggers the test failure the latest business data is automatically obtained by replacing the original expected file in time to test the maintenance personnel to quickly locate the latest business data.
  • the test result of the test failure is sent to the vulnerability management system, and the technician can obtain the test result in question in time, so that the subsequent technician can perform corresponding software improvement or update on the test result of the test failure.
  • the method flow for identifying the cause of the failure of the test case is described in detail above.
  • the method can also be implemented by the corresponding device.
  • the structure and function of the device are described in detail below.
  • An embodiment of the present invention further provides an apparatus for identifying a cause of failure of a test case.
  • the method includes: an obtaining module 41, a selecting module 42, a comparing module 43, and a marking module 44.
  • the obtaining module 41 is configured to obtain a test case in which the test fails, and obtain a test result of the test case;
  • the module 42 is configured to select a valid test result corresponding to the expected result of the test case in the test result
  • the comparing module 43 is configured to compare the effective test result with the expected result, Determine whether the valid test results are the same as the business data in the expected results;
  • the marking module 44 is configured to mark the failure reason of the test case as a business data change when the service data is different.
  • the device when the service data is different, as shown in FIG. 5, the device further includes: a saving module 45 and a replacement module 46.
  • a saving module 45 configured to save the business data of the valid test result to the expected copy file
  • the replacement module 46 is configured to use the expected copy file as the original expected file when the business data of the valid test result is correct, and the business data with the expected result in the original expected file.
  • the comparison module 43 is further configured to: compare the valid test result with the expected result, and determine whether the valid test result is the same as the service data type in the expected result;
  • the marking module 44 is further configured to: When the business data types are different, the failure reason of the test case is marked as a change in the business data type.
  • the apparatus further includes: a sending module 47, configured to send the test result of the test failure to the vulnerability management system.
  • the selection module 42 includes: a determining unit 421 and a selecting unit 422.
  • a determining unit 421, configured to determine an expected result identifier, where the expected result is identified as an identifier of an expected result of the test case;
  • the selecting unit 422 is configured to determine a valid test result in the test result that is consistent with the expected result identifier.
  • a method and apparatus for identifying a cause of failure of a test case provided by an embodiment of the present invention, by selecting an effective test result corresponding to an expected result in a test result of the test case, thereby comparing the effective test result with the expected result To determine the cause of the failure of the test case.
  • This method omits the manual operation steps, and can automatically identify the cause of the failure and mark the cause. It is convenient to mark the errors in the following, which saves the maintenance staff's working time, can improve the positioning problem and fix the speed and efficiency of the problem.
  • the business data change triggers the test failure
  • the latest business data is automatically obtained by replacing the original expected file in time to test the maintenance personnel to quickly locate the latest business data.
  • the test result of the test failure is sent to the vulnerability management system, and the technician can obtain the test result in question in time, so that the subsequent technician can perform corresponding software improvement or update on the test result of the test failure.
  • the embodiment of the present application further provides a non-transitory computer storage medium, where the computer storage medium stores computer executable instructions, which can execute the method in any of the foregoing method embodiments.
  • FIG. 8 is a block diagram showing the structure of a network device according to another embodiment of the present invention.
  • the network device 1100 may be a host server having a computing capability, a personal computer PC, or a portable computer or terminal that can be carried.
  • the specific embodiments of the present invention do not limit the specific implementation of the computing node.
  • the network device 1100 includes a processor 1110, a communications interface 1120, a memory array 1130, and a bus 1140.
  • the processor 1110, the communication interface 1120, and the memory 1130 complete communication with each other through the bus 1140.
  • the communication interface 1120 is configured to communicate with a network element, where the network element includes, for example, a virtual machine management center, shared storage, and the like.
  • the processor 1110 is configured to execute a program.
  • the processor 1110 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
  • ASIC Application Specific Integrated Circuit
  • the memory 1130 is used to store files.
  • the memory 1130 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • Memory 1130 can also be a memory array.
  • the memory 1130 may also be partitioned, and the blocks may be combined into a virtual volume according to certain rules.
  • the above program may be program code including computer operating instructions. This program can be used to:
  • a method for identifying a cause of failure of a test case comprising: obtaining a test case in which the test fails, and obtaining a test result of the test case; and selecting an effective test corresponding to the expected result of the test case in the test result. Result; compare the effective test result with the expected result to determine whether the valid test result is the same as the business data in the expected result; when the business data is different, mark the failure reason of the test case as the business data change.
  • the method further includes: saving the business data of the valid test result to the expected copy file; and when the business data of the valid test result is correct, using the expected copy file as the original expectation The file, the business data in which the expected result is stored in the original expected file.
  • the method further includes: comparing the effective test result with the expected result to determine whether the valid test result is the same as the service data type in the expected result; and when the service data type is different, the test case is used. The reason for the failure is marked as a change in the business data type.
  • the method further includes: sending the test result of the test failure to the vulnerability management system.
  • selecting valid test results corresponding to the expected results of the test case in the test result includes: determining an expected result identifier, identifying the expected result as an identifier of the expected result of the test case; determining the test result A valid test result that is consistent with the expected result identification.
  • the electronic device of the embodiment of the present application exists in various forms, including but not limited to:
  • Mobile communication devices These devices are characterized by mobile communication capabilities and Voice and data communication are the main goals.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
  • Ultra-mobile PC devices These devices belong to the category of personal computers, have computing and processing functions, and generally have mobile Internet access.
  • Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
  • Portable entertainment devices These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
  • the server A device that provides computing services.
  • the server consists of a processor, hard disk, memory, system bus, etc.
  • the server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power, stability, and reliability. Security, scalability, manageability and other aspects are high.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
  • the method for identifying the cause of the failure of the test case obtaineds the test case of the test failure, and obtains the test result of the test case; and selects the expected result corresponding to the test case in the test result.
  • Effective test result comparing the effective test result with the expected result, determining the effective test result and the expected result Whether the business data in the same is the same; when the business data is different, the failure reason of the test case is marked as a change of the business data, and the beneficial effect is achieved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

A method and electronic apparatus for identifying test case failure causes. The method comprises: acquiring a test case that has failed a test and acquiring test results of the test case (101); selecting, from the test results, an effective test result corresponding to an expected result of the test case (102); comparing the effective test result with the expected result to determine whether service data of the effective test result is identical to service data of the expected result (103); and if the service data are different, recording the cause of failure of the test case as a change in service data (104). The method can remove a step of manual operation, automatically identify the cause of failure, and perform cause recording to facilitate subsequent recording of errors in the cause, thereby saving time of maintenance personnel and increasing the speed and efficiency of locating and fixing a problem.

Description

一种识别测试用例失败原因的方法及电子设备Method and electronic device for identifying cause of failure of test case
交叉引用cross reference
本申请要求在2016年6月30日提交中国专利局、申请号为201610509913.5、发明名称为“一种识别测试用例失败原因的方法及装置”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201610509913.5, entitled "A Method and Apparatus for Identifying Failure Causes of Test Case Failure", submitted to the Chinese Patent Office on June 30, 2016, the entire contents of which are hereby incorporated by reference. The citations are incorporated herein by reference.
技术领域Technical field
本发明涉及测试监控技术领域,特别涉及一种识别测试用例失败原因的方法及电子设备。The present invention relates to the field of test monitoring technologies, and in particular, to a method and an electronic device for identifying a cause of failure of a test case.
背景技术Background technique
在软件工程中的测试用例(test case)是由测试者用于确定应用或软件系统是否正确工作的一组条件或变量,其是为某个特殊目标而编制的一组测试输入、执行条件以及预期结果,以便测试某个程序路径或核实是否满足某个特定需求。A test case in software engineering is a set of conditions or variables used by a tester to determine whether an application or software system is working correctly. It is a set of test inputs, execution conditions, and conditions for a particular target. Expected results to test a program path or verify that a particular requirement is met.
在实现本发明过程中,发明人发现现有技术中至少存在如下问题:In the process of implementing the present invention, the inventors have found that at least the following problems exist in the prior art:
现有根据测试用例进行测试监控时,系统每天定时自动发出测试结果邮件,如果测试用例中有失败的case,则需要人工介入去判断本次测试失败是接口异常还是业务数据变化引起的。特别的,例如在公司活动期间,业务数据变更频繁,很多时候是在刚改完业务数据之后,业务人员就再次修改或者更新了业务数据,从而导致监控接口慢慢变多;用例数量增大的时候,投入的人时成本也会增高;由人工确认变化会比较频繁,耗时耗力。When the test is monitored according to the test case, the system automatically sends out the test result email every day. If there is a failure in the test case, manual intervention is required to determine whether the test failure is caused by an interface exception or a business data change. In particular, during business activities, for example, business data changes frequently. Many times, after the business data has just been changed, the business personnel modify or update the business data again, resulting in a slower monitoring interface; an increase in the number of use cases. At the time, the cost of investing in people will also increase; it is more frequent and time-consuming to manually confirm changes.
公开于该背景技术部分的信息仅仅旨在增加对本发明的总体背景的理解,而不应当被视为承认或以任何形式暗示该信息构成已为本领域一 般技术人员所公知的现有技术。The information disclosed in this Background section is only intended to increase the understanding of the general background of the invention and should not be construed as an admission The prior art is well known to those skilled in the art.
发明内容Summary of the invention
本申请实施例提供了一种识别测试用例失败原因的方法及电子设备,从而克服现有测试监控效率低下的缺陷。The embodiment of the present application provides a method and an electronic device for identifying a cause of failure of a test case, thereby overcoming the defect of inefficiency of the existing test monitoring.
第一方面,为实现上述目的,本发明实施例提供了一种识别测试用例失败原因的方法,包括:获取测试失败的测试用例,并获取测试用例的测试结果;在测试结果中选取出与测试用例的预期结果相对应的有效测试结果;对有效测试结果和预期结果进行比较处理,确定有效测试结果与预期结果中的业务数据是否相同;在业务数据不同时,将测试用例的失败原因标记为业务数据变化。In a first aspect, in order to achieve the above object, an embodiment of the present invention provides a method for identifying a cause of failure of a test case, including: obtaining a test case in which the test fails, and obtaining a test result of the test case; selecting and testing the test result. The effective test result corresponding to the expected result of the use case; compare the effective test result with the expected result to determine whether the valid test result is the same as the business data in the expected result; when the business data is different, mark the failure reason of the test case as Business data changes.
在一种可能的实现方式中,在业务数据不同时,该方法还包括:将有效测试结果的业务数据保存至预期副本文件;在有效测试结果的业务数据正确时,将预期副本文件作为原始预期文件,原始预期文件中存有预期结果的业务数据。In a possible implementation manner, when the service data is different, the method further includes: saving the business data of the valid test result to the expected copy file; and when the business data of the valid test result is correct, using the expected copy file as the original expectation The file, the business data in which the expected result is stored in the original expected file.
在一种可能的实现方式中,该方法还包括:对有效测试结果和预期结果进行比较处理,确定有效测试结果与预期结果中的业务数据类型是否相同;在业务数据类型不同时,将测试用例的失败原因标记为业务数据类型变化。In a possible implementation manner, the method further includes: comparing the effective test result with the expected result to determine whether the valid test result is the same as the service data type in the expected result; and when the service data type is different, the test case is used. The reason for the failure is marked as a change in the business data type.
在一种可能的实现方式中,在业务数据类型不同时,该方法还包括:将测试失败的测试结果发送至漏洞管理系统。In a possible implementation manner, when the service data types are different, the method further includes: sending the test result of the test failure to the vulnerability management system.
在一种可能的实现方式中,在测试结果中选取与测试用例的预期结果相对应的有效测试结果,包括:确定预期结果标识,预期结果标识为测试用例的预期结果的标识;确定测试结果中与预期结果标识相一致的有效测试结果。In a possible implementation manner, selecting valid test results corresponding to the expected results of the test case in the test result includes: determining an expected result identifier, identifying the expected result as an identifier of the expected result of the test case; determining the test result A valid test result that is consistent with the expected result identification.
基于同样的发明构思,本发明实施例还提供一种识别测试用例 失败原因的装置,包括:获取模块,用于获取测试失败的测试用例,并获取测试用例的测试结果;选取模块,用于在测试结果中选取出与测试用例的预期结果相对应的有效测试结果;比较模块,用于对有效测试结果和预期结果进行比较处理,确定有效测试结果与预期结果中的业务数据是否相同;Based on the same inventive concept, an embodiment of the present invention further provides an identification test case. The device for failure causes, comprising: an obtaining module, configured to obtain a test case in which the test fails, and obtain a test result of the test case; and a selection module, configured to select a valid test result corresponding to the expected result of the test case in the test result. a comparison module for comparing the effective test result with the expected result to determine whether the valid test result is the same as the business data in the expected result;
标记模块,用于在业务数据不同时,将测试用例的失败原因标记为业务数据变化。A tagging module is used to mark the failure reason of the test case as a business data change when the business data is different.
在一种可能的实现方式中,在业务数据不同时,该装置还包括:保存模块,用于将有效测试结果的业务数据保存至预期副本文件;替换模块,用于在有效测试结果的业务数据正确时,将预期副本文件作为原始预期文件,原始预期文件中存有预期结果的业务数据。In a possible implementation manner, when the service data is different, the apparatus further includes: a saving module, configured to save the service data of the valid test result to the expected copy file; and a replacement module, the service data used in the valid test result When correct, the expected copy file is the original expected file, and the business data with the expected results in the original expected file.
在一种可能的实现方式中,比较模块还用于:对有效测试结果和预期结果进行比较处理,确定有效测试结果与预期结果中的业务数据类型是否相同;标记模块还用于:在业务数据类型不同时,将测试用例的失败原因标记为业务数据类型变化。In a possible implementation manner, the comparison module is further configured to: compare and compare the valid test result with the expected result, determine whether the valid test result is the same as the service data type in the expected result; and the marking module is further configured to: in the service data When the types are different, mark the failure reason of the test case as a business data type change.
在一种可能的实现方式中,在业务数据类型不同时,该装置还包括:发送模块,用于将测试失败的测试结果发送至漏洞管理系统。In a possible implementation, when the service data type is different, the device further includes: a sending module, configured to send the test result of the test failure to the vulnerability management system.
在一种可能的实现方式中,选取模块包括:确定单元,用于确定预期结果标识,预期结果标识为测试用例的预期结果的标识;选取单元,用于确定测试结果中与预期结果标识相一致的有效测试结果。In a possible implementation manner, the selecting module includes: a determining unit, configured to determine an expected result identifier, the expected result identifier is an identifier of an expected result of the test case; and the selecting unit is configured to determine that the test result is consistent with the expected result identifier Effective test results.
为实现上述发明目的,再一方面,本发明实施例提供了一种电子设备,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器执行以上各个方面所述的方法。In order to achieve the above object, an embodiment of the present invention provides an electronic device, including: at least one processor; and a memory communicably coupled to the at least one processor; wherein the memory is stored The at least one processor executes instructions that are executed by the at least one processor to cause the at least one processor to perform the methods described in the various aspects above.
为实现上述发明目的,再一方面,本申请实施例还提供了一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行 指令用于执行以上各个方面所述的方法。In order to achieve the above object, in another aspect, an embodiment of the present application further provides a non-transitory computer readable storage medium storing computer executable instructions, the computer executable The instructions are for performing the methods described in the various aspects above.
为实现上述发明目的,再一方面,本发明实施例提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行以上各个方面所述的方法。In order to achieve the above object, in another aspect, an embodiment of the present invention provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions When the program instructions are executed by a computer, the computer is caused to perform the methods described in the various aspects above.
本发明实施例提供的一种识别测试用例失败原因的方法及电子设备,通过在测试用例的测试结果中选取出与预期结果相对应的有效测试结果,进而可以对有效测试结果和预期结果进行对比处理,从而确定测试用例的失败原因。该方法省略了人工操作步骤,可以自动识别失败原因并进行原因标记,方便后续对其中的错误进行标记,节省了维护人员的工作时间,可以提高定位问题并修复问题的速度、效率。在业务数据变更引发测试失败时,通过及时替换原始预期文件,自动获取最新业务数据以便测试维护人员快速定位该最新的业务数据。将测试失败的测试结果发送至漏洞管理系统,技术人员可以及时获取有问题的测试结果,方便后续技术人员针对该测试失败的测试结果进行相应的软件改进或更新。The method and the electronic device for identifying the cause of the failure of the test case provided by the embodiment of the present invention can compare the effective test result with the expected result by selecting an effective test result corresponding to the expected result in the test result of the test case. Process to determine the cause of the failure of the test case. The method omits the manual operation steps, can automatically identify the cause of the failure and mark the reason, facilitates subsequent marking of the errors, saves the maintenance staff's working time, can improve the positioning problem and fix the speed and efficiency of the problem. When the business data change triggers the test failure, the latest business data is automatically obtained by replacing the original expected file in time to test the maintenance personnel to quickly locate the latest business data. The test result of the test failure is sent to the vulnerability management system, and the technician can obtain the test result in question in time, so that the subsequent technician can perform corresponding software improvement or update on the test result of the test failure.
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Other features and advantages of the invention will be set forth in the description which follows, The objectives and other advantages of the invention may be realized and obtained by means of the structure particularly pointed in the appended claims.
下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solution of the present invention will be further described in detail below through the accompanying drawings and embodiments.
附图说明DRAWINGS
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。 The one or more embodiments are exemplified by the accompanying drawings in the accompanying drawings, and FIG. The figures in the drawings do not constitute a scale limitation unless otherwise stated.
图1本发明实施例中识别测试用例失败原因的第一方法流程图;1 is a flow chart of a first method for identifying a cause of failure of a test case in an embodiment of the present invention;
图2本发明实施例中识别测试用例失败原因的第二方法流程图;2 is a flow chart of a second method for identifying a cause of failure of a test case in an embodiment of the present invention;
图3本发明实施例中识别测试用例失败原因的第三方法流程图;3 is a flowchart of a third method for identifying a cause of failure of a test case in an embodiment of the present invention;
图4本发明实施例中识别测试用例失败原因的装置的第一结构图;4 is a first structural diagram of an apparatus for identifying a cause of failure of a test case in an embodiment of the present invention;
图5本发明实施例中识别测试用例失败原因的装置的第二结构图;FIG. 5 is a second structural diagram of an apparatus for identifying a cause of failure of a test case in an embodiment of the present invention; FIG.
图6本发明实施例中识别测试用例失败原因的装置的第三结构图;6 is a third structural diagram of an apparatus for identifying a cause of failure of a test case in an embodiment of the present invention;
图7本发明实施例中选取模块的结构图;Figure 7 is a structural diagram of a module selected in the embodiment of the present invention;
图8本发明实施例中网络设备的结构图。FIG. 8 is a structural diagram of a network device in an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention. The same reference numerals in the drawings denote the same or similar elements. Although the various aspects of the embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustrative." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or preferred.
本发明实施例提供的一种识别测试用例失败原因的方法,由电子设备执行,参见图1所示,包括步骤101-104:A method for identifying a cause of failure of a test case provided by an embodiment of the present invention is performed by an electronic device, as shown in FIG. 1 , including steps 101-104:
步骤101:获取测试失败的测试用例,并获取测试用例的测试结果。 Step 101: Obtain a test case in which the test fails, and obtain a test result of the test case.
本发明实施例中,预先设置测试用例(Test Case),该测试用例用于对某一应用或者系统进行测试。在测试用例失败时会发出测试失败的通知并标记测试失败的测试用例,此时即可以获取到测试失败的测试用例。同时,每一个测试用例对应一个测试结果,在步骤101中同时获取该测试失败的测试用例的测试结果。例如,测试用例A为一个测试失败的case,其测试结果为“abce”,则步骤101中获取确定测试用例A,并确定测试结果“abce”。In the embodiment of the present invention, a test case (Test Case) for testing an application or system is set in advance. When the test case fails, a test failure notification is issued and the test case of the test failure is marked, and the test case in which the test fails is obtained. At the same time, each test case corresponds to one test result, and in step 101, the test result of the test case in which the test fails is simultaneously obtained. For example, test case A is a case where the test fails, and the test result is "abce", then the test case A is determined in step 101, and the test result "abce" is determined.
步骤102:在测试结果中选取出与测试用例的预期结果相对应的有效测试结果。Step 102: Select a valid test result corresponding to the expected result of the test case in the test result.
本发明实施例中,测试结果中可能包含一个或多个结果,此时需要在测试结果中选取有用的测试结果,即有效测试结果;该有效测试结果为测试结果中的部分结果或全部结果。其中,在设置测试用例时,每个测试用例都设有预期结果,即期望该测试用例输出的结果;根据该预期结果即可以确定测试人员关注的结果,进而可以在测试结果中选取与测试用例的预期结果相对应的有效测试结果。例如,测试用例期望的预期结果包括“预期结果A”和“预期结果B”,预期结果不关注其他结果;而在执行测试用例后输出的测试结果包括“测试结果a”、“测试结果b”、“测试结果c”和“测试结果d”,其中结果A与结果a对应,结果B与结果b对应。此时,由于预期结果不关注其他结果,则在步骤102中只选取与预期结果相对应的结果,即“测试结果a”和“测试结果b”,因此将“测试结果a”和“测试结果b”作为有效测试结果。In the embodiment of the present invention, one or more results may be included in the test result. In this case, a useful test result, that is, an effective test result, needs to be selected in the test result; the effective test result is part or all of the test result. Wherein, when setting up the test case, each test case has an expected result, that is, the result of the test case output is expected; according to the expected result, the tester's attention result can be determined, and then the test case can be selected and tested. The expected results correspond to the effective test results. For example, the expected expected results of the test case include "expected result A" and "expected result B", and the expected result does not focus on other results; and the test results output after executing the test case include "test result a", "test result b" , "test result c" and "test result d", wherein the result A corresponds to the result a, and the result B corresponds to the result b. At this time, since the expected result does not pay attention to other results, only the results corresponding to the expected result, that is, "test result a" and "test result b" are selected in step 102, so "test result a" and "test result" b" as a valid test result.
优选的,本发明实施例中,对每一个测试结果分配ID,即测试结果标识;同时,对预期结果也分配ID,即预期结果标识;且测试结果标识和预期结果标识采用同样的标识方式。上述步骤102“在测试结果中选取与测试用例的预期结果相对应的有效测试结果”具体包括步骤A1-A2:Preferably, in the embodiment of the present invention, an ID is assigned to each test result, that is, a test result identifier; at the same time, an ID is assigned to the expected result, that is, an expected result identifier; and the test result identifier and the expected result identifier adopt the same identification manner. The above step 102 "selecting valid test results corresponding to the expected results of the test cases in the test results" specifically includes steps A1-A2:
步骤A1、确定预期结果标识,预期结果标识为测试用例的预期结果的标识。 Step A1: Determine an expected result identifier, and the expected result identifier is an identifier of an expected result of the test case.
步骤A2、确定测试结果中与预期结果标识相一致的有效测试结果。Step A2: Determine a valid test result in the test result that is consistent with the expected result identifier.
具体的,对于某一个测试用例,测试人员关注的是“01预期结果”、“02预期结果”和“04预期结果”,其中的“01”、“02”、“04”为相应的预期结果标识。则在步骤A2中,确定与预期结果标识“01”、“02”、“04”相一致的测试结果,即“01测试结果”、“02测试结果”和“04测试结果”,并将该三个“01测试结果”、“02测试结果”和“04测试结果”作为有效测试结果。根据预期结果标识来选取有效测试结果,可以方便快速地定位到用户所需的测试结果。Specifically, for a test case, the tester is concerned with "01 expected result", "02 expected result" and "04 expected result", among which "01", "02", "04" are the corresponding expected results. Logo. Then, in step A2, the test results that are consistent with the expected result identifiers "01", "02", and "04", that is, "01 test result", "02 test result", and "04 test result" are determined, and the Three "01 test results", "02 test results" and "04 test results" were taken as valid test results. By selecting valid test results based on the expected result identification, it is convenient and quick to locate the test results required by the user.
步骤103:对有效测试结果和预期结果进行比较处理,确定有效测试结果与预期结果中的业务数据是否相同。Step 103: Compare the valid test result with the expected result to determine whether the valid test result is the same as the business data in the expected result.
本发明实施例中,通过对有效测试结果和预期结果进行比较处理即可以确定有效测试结果与预期结果之间的不同之处,进而可以确定有效测试结果中的业务数据与预期结果中的业务数据是否相同。具体的,diff命令可以用于比较两个文件或目录内容的差异,本发明实施例中可以使用diff命令比较有效测试结果和预期结果,同时保存diff结果,根据该diff结果即可以确定二者之间的业务数据是否发生变化。In the embodiment of the present invention, the difference between the effective test result and the expected result can be determined by comparing the effective test result with the expected result, thereby determining the business data in the effective test result and the business data in the expected result. Is it the same? Specifically, the diff command can be used to compare the difference between the contents of the two files or directories. In the embodiment of the present invention, the diff command can be used to compare the effective test result with the expected result, and the diff result is saved, and the diff result can be used to determine the two. Whether the business data changes.
步骤104:在业务数据不同时,将测试用例的失败原因标记为业务数据变化。Step 104: Mark the failure reason of the test case as the service data change when the service data is different.
在步骤103中进行比较处理后,若业务数据不同,则可以自动确定测试用例失败的原因为业务数据发生变化,此时将测试用例的失败原因标记为业务数据变化,之后即可以针对该失败原因进行相应的处理。After the comparison process is performed in step 103, if the service data is different, the cause of the failure of the test case may be automatically determined as the service data changes. At this time, the failure reason of the test case is marked as the service data change, and then the failure reason may be targeted. Perform the appropriate processing.
在一种可能的实现方式中,对有效测试结果和预期结果进行比较处理还包括比较二者的业务数据类型。具体的,参见图2所示,该方法还包括:In one possible implementation, comparing the valid test results with the expected results also includes comparing the business data types of the two. Specifically, referring to FIG. 2, the method further includes:
步骤105:对有效测试结果和预期结果进行比较处理,确定有 效测试结果与预期结果中的业务数据类型是否相同;Step 105: Comparing the effective test result with the expected result, determining that there is Whether the result of the validity test is the same as the type of business data in the expected result;
步骤106:在业务数据类型不同时,标记测试用例的失败原因为业务数据类型变化。Step 106: When the service data types are different, the failure reason for marking the test case is a change of the service data type.
其中,步骤102和步骤104中“对有效测试结果和预期结果进行比较处理”可以同时进行,即在进行比较处理之后可以确定业务数据和/或业务数据类型是否发生了变化。发明实施例中可以使用diff命令比较有效测试结果和预期结果,同时保存diff结果,根据该diff结果即可以确定二者之间的业务数据是否发生变化,也可以确定业务数据类型是否发生变化。The "comparing the effective test result and the expected result" in steps 102 and 104 can be performed simultaneously, that is, after the comparison process is performed, it can be determined whether the service data and/or the service data type has changed. In the embodiment of the present invention, the diff command can be used to compare the effective test result with the expected result, and the diff result is saved. According to the diff result, it can be determined whether the service data between the two changes, and whether the service data type changes.
本发明实施例提供的一种识别测试用例失败原因的方法,通过在测试用例的测试结果中选取出与预期结果相对应的有效测试结果,进而可以对有效测试结果和预期结果进行对比处理,从而确定测试用例的失败原因。该方法省略了人工操作步骤,可以自动识别失败原因并进行原因标记,方便后续对其中的错误进行标记,节省了维护人员的工作时间,可以提高定位问题并修复问题的速度、效率。The method for identifying the cause of the failure of the test case provided by the embodiment of the present invention, by selecting the effective test result corresponding to the expected result in the test result of the test case, thereby comparing the effective test result with the expected result, thereby Determine the reason for the failure of the test case. The method omits the manual operation steps, can automatically identify the cause of the failure and mark the reason, facilitates subsequent marking of the errors, saves the maintenance staff's working time, can improve the positioning problem and fix the speed and efficiency of the problem.
在一种可能的实现方式中,在步骤104中,当业务数据不同时,该方法还包括步骤B1-B2:In a possible implementation manner, in step 104, when the service data is different, the method further includes steps B1-B2:
步骤B1:将有效测试结果的业务数据保存至预期副本文件。Step B1: Save the business data of the valid test result to the expected copy file.
步骤B2:在有效测试结果的业务数据正确时,将预期副本文件作为原始预期文件,原始预期文件中存有预期结果的业务数据。Step B2: When the business data of the valid test result is correct, the expected copy file is taken as the original expected file, and the business data of the expected result is stored in the original expected file.
本发明实施例中,原始预期文件中存有预期结果的业务数据,在步骤103中“确定有效测试结果与预期结果中的业务数据是否相同”可以将有效测试结果与原始预期文件中存储的预期结果进行比较。同时,预期副本文件用于保存有效测试结果,该预期副本文件与原始预期文件为相同格式的文件,或者说预期副本文件与原始预期文件仅仅是其中存储的数据不同,前者存有有效测试结果,后者存有预期结果。In the embodiment of the present invention, the business data of the expected result is stored in the original expected file, and in step 103, “determining whether the valid test result is the same as the business data in the expected result” may be the effective test result and the expected result stored in the original expected file. The results were compared. At the same time, the expected copy file is used to save the valid test result. The expected copy file is the same format as the original expected file, or the expected copy file is different from the original expected file, and the former has valid test results. The latter has the expected results.
当确认该有效测试结果中的业务时局无误时,可以认为该业务 数据变化是正常合理的,此时再将预期副本文件作为原始预期文件;在之后的测试过程中若仍需要使用原始预期文件,则原始预期文件中的数据实质为步骤B1中保存的有效测试结果的业务数据。在业务数据变更引发测试失败时,通过及时替换原始预期文件,可以自动获取最新业务数据以便测试维护人员快速定位该最新的业务数据。When the business in the valid test result is confirmed to be correct, the service can be considered The data change is normal and reasonable. At this time, the expected copy file is used as the original expected file; if the original expected file is still needed during the subsequent test, the data in the original expected file is substantially the valid test result saved in step B1. Business data. When the business data change triggers the test failure, by replacing the original expected file in time, the latest business data can be automatically obtained to test the maintenance personnel to quickly locate the latest business data.
在一种可能的实现方式中,在步骤106中,当业务数据类型不同时,该方法还包括:将测试失败的测试结果发送至漏洞管理系统。In a possible implementation manner, in step 106, when the service data types are different, the method further includes: sending the test result of the test failure to the vulnerability management system.
具体的,该漏洞管理系统为bug管理系统,漏洞管理系统支持不同权限或不同职位的人员登录。在将测试失败的测试结果发送至漏洞管理系统后,方便后续技术人员针对该测试失败的测试结果进行相应的软件改进或更新,且技术人员可以及时获取有问题的测试结果。Specifically, the vulnerability management system is a bug management system, and the vulnerability management system supports people with different permissions or different positions to log in. After the test result of the test failure is sent to the vulnerability management system, it is convenient for the subsequent technician to perform corresponding software improvement or update on the test result of the test failure, and the technician can obtain the test result in question in time.
下面通过一个实施例详细介绍该方法的流程。The flow of the method will be described in detail below through an embodiment.
在本发明实施例中,对有效测试结果和预期结果进行比较处理,并同时确定有效测试结果与预期结果中的业务数据和业务数据类型是否相同。具体参见图3所示,包括步骤301-309:In the embodiment of the present invention, the effective test result and the expected result are compared, and at the same time, whether the valid test result and the service data and the service data type in the expected result are the same. For details, refer to FIG. 3, including steps 301-309:
步骤301:获取测试失败的测试用例,并获取测试用例的测试结果。Step 301: Acquire a test case in which the test fails, and obtain a test result of the test case.
步骤302:确定预期结果标识,预期结果标识为测试用例的预期结果的标识。Step 302: Determine an expected result identifier, the expected result identifier being an identifier of an expected result of the test case.
步骤303:确定测试结果中与预期结果标识相一致的有效测试结果。Step 303: Determine a valid test result in the test result that is consistent with the expected result identifier.
步骤304:对有效测试结果和预期结果进行比较处理,并分别执行步骤305和步骤308。Step 304: Compare the effective test result with the expected result, and perform step 305 and step 308, respectively.
步骤305:确定有效测试结果与预期结果中的业务数据是否相同。Step 305: Determine whether the valid test result is the same as the business data in the expected result.
步骤306:在业务数据不同时,将测试用例的失败原因标记为 业务数据变化,并将有效测试结果的业务数据保存至预期副本文件。Step 306: When the service data is different, mark the failure reason of the test case as The business data changes and the business data of the valid test results is saved to the expected copy file.
步骤307:在有效测试结果的业务数据正确时,将预期副本文件作为原始预期文件,原始预期文件中存有预期结果的业务数据。Step 307: When the business data of the valid test result is correct, the expected copy file is used as the original expected file, and the business data of the expected result is stored in the original expected file.
步骤308:确定有效测试结果与预期结果中的业务数据类型是否相同Step 308: Determine whether the valid test result is the same as the service data type in the expected result.
步骤309:在业务数据类型不同时,标记测试用例的失败原因为业务数据类型变化,并将测试失败的测试结果发送至漏洞管理系统。Step 309: When the service data types are different, the failure reason for marking the test case is a change of the service data type, and the test result of the test failure is sent to the vulnerability management system.
本发明实施例提供的一种识别测试用例失败原因的方法通过在测试用例的测试结果中选取出与预期结果相对应的有效测试结果,进而可以对有效测试结果和预期结果进行对比处理,从而确定测试用例的失败原因。该方法省略了人工操作步骤,可以自动识别失败原因并进行标记,方便后续对其中的错误进行标记,节省了维护人员的工作时间,可以提高定位问题并修复问题的速度、效率。在业务数据变更引发测试失败时,通过及时替换原始预期文件,自动获取最新业务数据以便测试维护人员快速定位该最新的业务数据。将测试失败的测试结果发送至漏洞管理系统,技术人员可以及时获取有问题的测试结果,方便后续技术人员针对该测试失败的测试结果进行相应的软件改进或更新。The method for identifying the cause of failure of the test case provided by the embodiment of the present invention can select the effective test result corresponding to the expected result in the test result of the test case, and then compare and compare the effective test result with the expected result to determine The reason for the failure of the test case. The method omits the manual operation steps, can automatically identify the cause of the failure and mark, facilitates subsequent marking of the errors, saves the maintenance staff's working time, can improve the positioning problem and fix the speed and efficiency of the problem. When the business data change triggers the test failure, the latest business data is automatically obtained by replacing the original expected file in time to test the maintenance personnel to quickly locate the latest business data. The test result of the test failure is sent to the vulnerability management system, and the technician can obtain the test result in question in time, so that the subsequent technician can perform corresponding software improvement or update on the test result of the test failure.
以上详细介绍了识别测试用例失败原因的方法流程,该方法也可以通过相应的装置实现,下面详细介绍该装置的结构和功能。The method flow for identifying the cause of the failure of the test case is described in detail above. The method can also be implemented by the corresponding device. The structure and function of the device are described in detail below.
本发明实施例还提供一种识别测试用例失败原因的装置,参见图4所示,包括:获取模块41、选取模块42、比较模块43和标记模块44。An embodiment of the present invention further provides an apparatus for identifying a cause of failure of a test case. Referring to FIG. 4, the method includes: an obtaining module 41, a selecting module 42, a comparing module 43, and a marking module 44.
获取模块41,用于获取测试失败的测试用例,并获取测试用例的测试结果;The obtaining module 41 is configured to obtain a test case in which the test fails, and obtain a test result of the test case;
选取模块42,用于在测试结果中选取出与测试用例的预期结果相对应的有效测试结果;The module 42 is configured to select a valid test result corresponding to the expected result of the test case in the test result;
比较模块43,用于对有效测试结果和预期结果进行比较处理, 确定有效测试结果与预期结果中的业务数据是否相同;The comparing module 43 is configured to compare the effective test result with the expected result, Determine whether the valid test results are the same as the business data in the expected results;
标记模块44,用于在业务数据不同时,将测试用例的失败原因标记为业务数据变化。The marking module 44 is configured to mark the failure reason of the test case as a business data change when the service data is different.
在一种可能的实现方式中,在业务数据不同时,参见图5所示,该装置还包括:保存模块45和替换模块46。In a possible implementation manner, when the service data is different, as shown in FIG. 5, the device further includes: a saving module 45 and a replacement module 46.
保存模块45,用于将有效测试结果的业务数据保存至预期副本文件;a saving module 45, configured to save the business data of the valid test result to the expected copy file;
替换模块46,用于在有效测试结果的业务数据正确时,将预期副本文件作为原始预期文件,原始预期文件中存有预期结果的业务数据。The replacement module 46 is configured to use the expected copy file as the original expected file when the business data of the valid test result is correct, and the business data with the expected result in the original expected file.
在一种可能的实现方式中,比较模块43还用于:对有效测试结果和预期结果进行比较处理,确定有效测试结果与预期结果中的业务数据类型是否相同;标记模块44还用于:在业务数据类型不同时,将测试用例的失败原因标记为业务数据类型变化。In a possible implementation, the comparison module 43 is further configured to: compare the valid test result with the expected result, and determine whether the valid test result is the same as the service data type in the expected result; the marking module 44 is further configured to: When the business data types are different, the failure reason of the test case is marked as a change in the business data type.
在一种可能的实现方式中,在业务数据类型不同时,参见图6所示,该装置还包括:发送模块47,用于将测试失败的测试结果发送至漏洞管理系统。In a possible implementation manner, when the service data types are different, as shown in FIG. 6, the apparatus further includes: a sending module 47, configured to send the test result of the test failure to the vulnerability management system.
在一种可能的实现方式中,参见图7所示,选取模块42包括:确定单元421和选取单元422。In a possible implementation manner, referring to FIG. 7, the selection module 42 includes: a determining unit 421 and a selecting unit 422.
确定单元421,用于确定预期结果标识,预期结果标识为测试用例的预期结果的标识;a determining unit 421, configured to determine an expected result identifier, where the expected result is identified as an identifier of an expected result of the test case;
选取单元422,用于确定测试结果中与预期结果标识相一致的有效测试结果。The selecting unit 422 is configured to determine a valid test result in the test result that is consistent with the expected result identifier.
本发明实施例提供的一种识别测试用例失败原因的方法及装置,通过在测试用例的测试结果中选取出与预期结果相对应的有效测试结果,进而可以对有效测试结果和预期结果进行对比处理,从而确定测试用例的失败原因。该方法省略了人工操作步骤,可以自动识别失败原因并进行原因标记, 方便后续对其中的错误进行标记,节省了维护人员的工作时间,可以提高定位问题并修复问题的速度、效率。在业务数据变更引发测试失败时,通过及时替换原始预期文件,自动获取最新业务数据以便测试维护人员快速定位该最新的业务数据。将测试失败的测试结果发送至漏洞管理系统,技术人员可以及时获取有问题的测试结果,方便后续技术人员针对该测试失败的测试结果进行相应的软件改进或更新。A method and apparatus for identifying a cause of failure of a test case provided by an embodiment of the present invention, by selecting an effective test result corresponding to an expected result in a test result of the test case, thereby comparing the effective test result with the expected result To determine the cause of the failure of the test case. This method omits the manual operation steps, and can automatically identify the cause of the failure and mark the cause. It is convenient to mark the errors in the following, which saves the maintenance staff's working time, can improve the positioning problem and fix the speed and efficiency of the problem. When the business data change triggers the test failure, the latest business data is automatically obtained by replacing the original expected file in time to test the maintenance personnel to quickly locate the latest business data. The test result of the test failure is sent to the vulnerability management system, and the technician can obtain the test result in question in time, so that the subsequent technician can perform corresponding software improvement or update on the test result of the test failure.
本申请实施例还提供了一种非暂态计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的方法。The embodiment of the present application further provides a non-transitory computer storage medium, where the computer storage medium stores computer executable instructions, which can execute the method in any of the foregoing method embodiments.
图8示出了本发明的另一个实施例的一种网络设备的结构框图。所述网络设备1100可以是具备计算能力的主机服务器、个人计算机PC、或者可携带的便携式计算机或终端等。本发明具体实施例并不对计算节点的具体实现做限定。FIG. 8 is a block diagram showing the structure of a network device according to another embodiment of the present invention. The network device 1100 may be a host server having a computing capability, a personal computer PC, or a portable computer or terminal that can be carried. The specific embodiments of the present invention do not limit the specific implementation of the computing node.
该网络设备1100包括处理器(processor)1110、通信接口(Communications Interface)1120、存储器(memory array)1130和总线1140。其中,处理器1110、通信接口1120、以及存储器1130通过总线1140完成相互间的通信。The network device 1100 includes a processor 1110, a communications interface 1120, a memory array 1130, and a bus 1140. The processor 1110, the communication interface 1120, and the memory 1130 complete communication with each other through the bus 1140.
通信接口1120用于与网元通信,其中网元包括例如虚拟机管理中心、共享存储等。The communication interface 1120 is configured to communicate with a network element, where the network element includes, for example, a virtual machine management center, shared storage, and the like.
处理器1110用于执行程序。处理器1110可能是一个中央处理器CPU,或者是专用集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 1110 is configured to execute a program. The processor 1110 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
存储器1130用于存放文件。存储器1130可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。存储器1130也可以是存储器阵列。存储器1130还可能被分块,并且所述块可按一定的规则组合成虚拟卷。 The memory 1130 is used to store files. The memory 1130 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory. Memory 1130 can also be a memory array. The memory 1130 may also be partitioned, and the blocks may be combined into a virtual volume according to certain rules.
在一种可能的实施方式中,上述程序可为包括计算机操作指令的程序代码。该程序具体可用于:In a possible implementation, the above program may be program code including computer operating instructions. This program can be used to:
在第一方面,提供一种识别测试用例失败原因的方法,包括:获取测试失败的测试用例,并获取测试用例的测试结果;在测试结果中选取出与测试用例的预期结果相对应的有效测试结果;对有效测试结果和预期结果进行比较处理,确定有效测试结果与预期结果中的业务数据是否相同;在业务数据不同时,将测试用例的失败原因标记为业务数据变化。In a first aspect, a method for identifying a cause of failure of a test case is provided, comprising: obtaining a test case in which the test fails, and obtaining a test result of the test case; and selecting an effective test corresponding to the expected result of the test case in the test result. Result; compare the effective test result with the expected result to determine whether the valid test result is the same as the business data in the expected result; when the business data is different, mark the failure reason of the test case as the business data change.
在一种可能的实现方式中,在业务数据不同时,该方法还包括:将有效测试结果的业务数据保存至预期副本文件;在有效测试结果的业务数据正确时,将预期副本文件作为原始预期文件,原始预期文件中存有预期结果的业务数据。In a possible implementation manner, when the service data is different, the method further includes: saving the business data of the valid test result to the expected copy file; and when the business data of the valid test result is correct, using the expected copy file as the original expectation The file, the business data in which the expected result is stored in the original expected file.
在一种可能的实现方式中,该方法还包括:对有效测试结果和预期结果进行比较处理,确定有效测试结果与预期结果中的业务数据类型是否相同;在业务数据类型不同时,将测试用例的失败原因标记为业务数据类型变化。In a possible implementation manner, the method further includes: comparing the effective test result with the expected result to determine whether the valid test result is the same as the service data type in the expected result; and when the service data type is different, the test case is used. The reason for the failure is marked as a change in the business data type.
在一种可能的实现方式中,在业务数据类型不同时,该方法还包括:将测试失败的测试结果发送至漏洞管理系统。In a possible implementation manner, when the service data types are different, the method further includes: sending the test result of the test failure to the vulnerability management system.
在一种可能的实现方式中,在测试结果中选取与测试用例的预期结果相对应的有效测试结果,包括:确定预期结果标识,预期结果标识为测试用例的预期结果的标识;确定测试结果中与预期结果标识相一致的有效测试结果。In a possible implementation manner, selecting valid test results corresponding to the expected results of the test case in the test result includes: determining an expected result identifier, identifying the expected result as an identifier of the expected result of the test case; determining the test result A valid test result that is consistent with the expected result identification.
上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例所提供的方法。The above products can perform the methods provided by the embodiments of the present application, and have the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiments of the present application.
本申请实施例的电子设备以多种形式存在,包括但不限于:The electronic device of the embodiment of the present application exists in various forms, including but not limited to:
移动通信设备:这类设备的特点是具备移动通信功能,并且以提 供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。Mobile communication devices: These devices are characterized by mobile communication capabilities and Voice and data communication are the main goals. Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。Ultra-mobile PC devices: These devices belong to the category of personal computers, have computing and processing functions, and generally have mobile Internet access. Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power, stability, and reliability. Security, scalability, manageability and other aspects are high.
其他具有数据交互功能的电子装置。Other electronic devices with data interaction capabilities.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。 The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
前述对本发明的具体示例性实施方案的描述是为了说明和例证的目的。这些描述并非想将本发明限定为所公开的精确形式,并且很显然,根据上述教导,可以进行很多改变和变化。对示例性实施例进行选择和描述的目的在于解释本发明的特定原理及其实际应用,从而使得本领域的技术人员能够实现并利用本发明的各种不同的示例性实施方案以及各种不同的选择和改变。本发明的范围意在由权利要求书及其等同形式所限定。The foregoing description of the specific exemplary embodiments of the present invention has The description is not intended to limit the invention to the precise forms disclosed. The embodiments were chosen and described in order to explain the particular embodiments of the invention Choose and change. The scope of the invention is intended to be defined by the claims and their equivalents.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
工业实用性Industrial applicability
本申请实施例提供的识别测试用例失败原因的方法,通过获取测试失败的测试用例,并获取所述测试用例的测试结果;在所述测试结果中选取出与所述测试用例的预期结果相对应的有效测试结果;对所述有效测试结果和所述预期结果进行比较处理,确定所述有效测试结果与所述预期结果 中的业务数据是否相同;在业务数据不同时,将所述测试用例的失败原因标记为业务数据变化,实现有益效果。 The method for identifying the cause of the failure of the test case provided by the embodiment of the present application, obtains the test case of the test failure, and obtains the test result of the test case; and selects the expected result corresponding to the test case in the test result. Effective test result; comparing the effective test result with the expected result, determining the effective test result and the expected result Whether the business data in the same is the same; when the business data is different, the failure reason of the test case is marked as a change of the business data, and the beneficial effect is achieved.

Claims (21)

  1. 一种识别测试用例失败原因的方法,由电子设备执行,其特征在于,包括:A method for identifying a cause of failure of a test case, executed by an electronic device, comprising:
    获取测试失败的测试用例,并获取所述测试用例的测试结果;Obtaining a test case in which the test fails, and obtaining a test result of the test case;
    在所述测试结果中选取出与所述测试用例的预期结果相对应的有效测试结果;Selecting valid test results corresponding to the expected results of the test cases in the test results;
    对所述有效测试结果和所述预期结果进行比较处理,确定所述有效测试结果与所述预期结果中的业务数据是否相同;Comparing the valid test result and the expected result to determine whether the valid test result is the same as the business data in the expected result;
    在业务数据不同时,将所述测试用例的失败原因标记为业务数据变化。When the business data is different, the failure reason of the test case is marked as a business data change.
  2. 根据权利要求1所述的方法,其特征在于,在业务数据不同时,所述方法还包括:The method according to claim 1, wherein when the service data is different, the method further comprises:
    将所述有效测试结果的业务数据保存至预期副本文件;Saving business data of the valid test result to an expected copy file;
    在所述有效测试结果的业务数据正确时,将所述预期副本文件作为原始预期文件,所述原始预期文件中存有所述预期结果的业务数据。When the business data of the valid test result is correct, the expected copy file is taken as the original expected file, and the business data of the expected result is stored in the original expected file.
  3. 根据权利要求1所述的方法,其特征在于,还包括:对所述有效测试结果和所述预期结果进行比较处理,确定所述有效测试结果与所述预期结果中的业务数据类型是否相同;The method according to claim 1, further comprising: comparing the effective test result and the expected result to determine whether the valid test result is the same as the service data type in the expected result;
    在业务数据类型不同时,将所述测试用例的失败原因标记为业务数据类型变化。When the business data types are different, the failure reason of the test case is marked as a business data type change.
  4. 根据权利要求3所述的方法,其特征在于,在业务数据类型不同时,所述方法还包括:The method according to claim 3, wherein when the types of service data are different, the method further comprises:
    将测试失败的测试结果发送至漏洞管理系统。Send test results that failed the test to the vulnerability management system.
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述在所述测试结果中选取与所述测试用例的预期结果相对应的有效测试结果,包括:The method according to any one of claims 1 to 4, wherein the selecting the effective test result corresponding to the expected result of the test case in the test result comprises:
    确定预期结果标识,所述预期结果标识为所述测试用例的预期结果的标识;Determining an expected result identification, the expected result identifying an identification of an expected result of the test case;
    确定所述测试结果中与所述预期结果标识相一致的有效测试结果。 Determining valid test results in the test results that are consistent with the expected result identification.
  6. 一种识别测试用例失败原因的装置,其特征在于,包括:A device for identifying a cause of failure of a test case, comprising:
    获取模块,用于获取测试失败的测试用例,并获取所述测试用例的测试结果;An obtaining module, configured to obtain a test case in which the test fails, and obtain a test result of the test case;
    选取模块,用于在所述测试结果中选取出与所述测试用例的预期结果相对应的有效测试结果;And a selection module, configured to select, in the test result, an effective test result corresponding to an expected result of the test case;
    比较模块,用于对所述有效测试结果和所述预期结果进行比较处理,确定所述有效测试结果与所述预期结果中的业务数据是否相同;a comparison module, configured to compare the effective test result with the expected result, and determine whether the valid test result is the same as the service data in the expected result;
    标记模块,用于在业务数据不同时,将所述测试用例的失败原因标记为业务数据变化。The marking module is configured to mark the failure reason of the test case as a business data change when the business data is different.
  7. 根据权利要求6所述的装置,其特征在于,在业务数据不同时,所述装置还包括:The device according to claim 6, wherein when the service data is different, the device further comprises:
    保存模块,用于将所述有效测试结果的业务数据保存至预期副本文件;a saving module, configured to save the business data of the valid test result to an expected copy file;
    替换模块,用于在所述有效测试结果的业务数据正确时,将所述预期副本文件作为原始预期文件,所述原始预期文件中存有所述预期结果的业务数据。And a replacement module, configured to: when the business data of the valid test result is correct, use the expected copy file as an original expected file, where the original expected file stores the business data of the expected result.
  8. 根据权利要求6所述的装置,其特征在于,所述比较模块还用于:对所述有效测试结果和所述预期结果进行比较处理,确定所述有效测试结果与所述预期结果中的业务数据类型是否相同;The device according to claim 6, wherein the comparing module is further configured to: compare the effective test result and the expected result, and determine a service in the valid test result and the expected result Whether the data types are the same;
    所述标记模块还用于:在业务数据类型不同时,将所述测试用例的失败原因标记为业务数据类型变化。The marking module is further configured to mark the failure reason of the test case as a service data type change when the service data types are different.
  9. 根据权利要求8所述的装置,其特征在于,在业务数据类型不同时,所述装置还包括:The device according to claim 8, wherein when the type of service data is different, the device further comprises:
    发送模块,用于将测试失败的测试结果发送至漏洞管理系统。A sending module for sending test results of the test failure to the vulnerability management system.
  10. 根据权利要求6-9任一所述的装置,其特征在于,选取模块包括:The apparatus according to any one of claims 6-9, wherein the selecting module comprises:
    确定单元,用于确定预期结果标识,所述预期结果标识为所述测试用例的预期结果的标识;a determining unit, configured to determine an expected result identifier, the expected result identifier being an identifier of an expected result of the test case;
    选取单元,用于确定所述测试结果中与所述预期结果标识相一致的有效测试结果。 And a selecting unit, configured to determine a valid test result in the test result that is consistent with the expected result identifier.
  11. 一种电子设备,包括:An electronic device comprising:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
    获取测试失败的测试用例,并获取所述测试用例的测试结果;Obtaining a test case in which the test fails, and obtaining a test result of the test case;
    在所述测试结果中选取出与所述测试用例的预期结果相对应的有效测试结果;Selecting valid test results corresponding to the expected results of the test cases in the test results;
    对所述有效测试结果和所述预期结果进行比较处理,确定所述有效测试结果与所述预期结果中的业务数据是否相同;Comparing the valid test result and the expected result to determine whether the valid test result is the same as the business data in the expected result;
    在业务数据不同时,将所述测试用例的失败原因标记为业务数据变化。When the business data is different, the failure reason of the test case is marked as a business data change.
  12. 根据权利要求11所述的电子设备,其特征在于,在业务数据不同时,所述方法还包括:The electronic device according to claim 11, wherein when the service data is different, the method further comprises:
    将所述有效测试结果的业务数据保存至预期副本文件;Saving business data of the valid test result to an expected copy file;
    在所述有效测试结果的业务数据正确时,将所述预期副本文件作为原始预期文件,所述原始预期文件中存有所述预期结果的业务数据。When the business data of the valid test result is correct, the expected copy file is taken as the original expected file, and the business data of the expected result is stored in the original expected file.
  13. 根据权利要求11所述的电子设备,其特征在于,还包括:对所述有效测试结果和所述预期结果进行比较处理,确定所述有效测试结果与所述预期结果中的业务数据类型是否相同;The electronic device according to claim 11, further comprising: comparing the valid test result and the expected result to determine whether the valid test result is the same as the service data type in the expected result ;
    在业务数据类型不同时,将所述测试用例的失败原因标记为业务数据类型变化。When the business data types are different, the failure reason of the test case is marked as a business data type change.
  14. 根据权利要求13所述的电子设备,其特征在于,在业务数据类型不同时,所述方法还包括:The electronic device according to claim 13, wherein when the types of service data are different, the method further includes:
    将测试失败的测试结果发送至漏洞管理系统。Send test results that failed the test to the vulnerability management system.
  15. 根据权利要求11-14任一所述的电子设备,其特征在于,所述在所述测试结果中选取与所述测试用例的预期结果相对应的有效测试结果,包括:The electronic device according to any one of claims 11-14, wherein the selecting the effective test result corresponding to the expected result of the test case in the test result comprises:
    确定预期结果标识,所述预期结果标识为所述测试用例的预期结果的标识; Determining an expected result identification, the expected result identifying an identification of an expected result of the test case;
    确定所述测试结果中与所述预期结果标识相一致的有效测试结果。Determining valid test results in the test results that are consistent with the expected result identification.
  16. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于:A non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer executable instructions for:
    获取测试失败的测试用例,并获取所述测试用例的测试结果;Obtaining a test case in which the test fails, and obtaining a test result of the test case;
    在所述测试结果中选取出与所述测试用例的预期结果相对应的有效测试结果;Selecting valid test results corresponding to the expected results of the test cases in the test results;
    对所述有效测试结果和所述预期结果进行比较处理,确定所述有效测试结果与所述预期结果中的业务数据是否相同;Comparing the valid test result and the expected result to determine whether the valid test result is the same as the business data in the expected result;
    在业务数据不同时,将所述测试用例的失败原因标记为业务数据变化。When the business data is different, the failure reason of the test case is marked as a business data change.
  17. 根据权利要求16所述的非暂态计算机可读存储介质,其特征在于,在业务数据不同时,所述方法还包括:The non-transitory computer readable storage medium according to claim 16, wherein when the service data is different, the method further comprises:
    将所述有效测试结果的业务数据保存至预期副本文件;Saving business data of the valid test result to an expected copy file;
    在所述有效测试结果的业务数据正确时,将所述预期副本文件作为原始预期文件,所述原始预期文件中存有所述预期结果的业务数据。When the business data of the valid test result is correct, the expected copy file is taken as the original expected file, and the business data of the expected result is stored in the original expected file.
  18. 根据权利要求16所述的非暂态计算机可读存储介质,其特征在于,还包括:对所述有效测试结果和所述预期结果进行比较处理,确定所述有效测试结果与所述预期结果中的业务数据类型是否相同;The non-transitory computer readable storage medium according to claim 16, further comprising: comparing the effective test result and the expected result, determining the valid test result and the expected result Is the business data type the same?
    在业务数据类型不同时,将所述测试用例的失败原因标记为业务数据类型变化。When the business data types are different, the failure reason of the test case is marked as a business data type change.
  19. 根据权利要求18所述的非暂态计算机可读存储介质,其特征在于,在业务数据类型不同时,所述方法还包括:The non-transitory computer readable storage medium according to claim 18, wherein when the types of service data are different, the method further comprises:
    将测试失败的测试结果发送至漏洞管理系统。Send test results that failed the test to the vulnerability management system.
  20. 根据权利要求16-19任一所述的非暂态计算机可读存储介质,其特征在于,所述在所述测试结果中选取与所述测试用例的预期结果相对应的有效测试结果,包括:The non-transitory computer readable storage medium according to any one of claims 16 to 19, wherein the selecting, in the test result, the effective test result corresponding to the expected result of the test case comprises:
    确定预期结果标识,所述预期结果标识为所述测试用例的预期结果的标识;Determining an expected result identification, the expected result identifying an identification of an expected result of the test case;
    确定所述测试结果中与所述预期结果标识相一致的有效测试结果。 Determining valid test results in the test results that are consistent with the expected result identification.
  21. 一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-5任一所述的方法。 A computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to execute The method of any of claims 1-5.
PCT/CN2016/099946 2016-06-30 2016-09-23 Method and electronic apparatus for identifying test case failure causes WO2018000607A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610509913.5 2016-06-30
CN201610509913.5A CN105930276A (en) 2016-06-30 2016-06-30 Method and device for identifying failure reasons of test cases

Publications (1)

Publication Number Publication Date
WO2018000607A1 true WO2018000607A1 (en) 2018-01-04

Family

ID=56830075

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/099946 WO2018000607A1 (en) 2016-06-30 2016-09-23 Method and electronic apparatus for identifying test case failure causes

Country Status (2)

Country Link
CN (1) CN105930276A (en)
WO (1) WO2018000607A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069416A (en) * 2019-04-29 2019-07-30 腾讯音乐娱乐科技(深圳)有限公司 A kind of test data processing method, device and relevant device
CN110716857A (en) * 2019-08-27 2020-01-21 平安普惠企业管理有限公司 Test case management method and device, computer equipment and storage medium
CN110941719A (en) * 2019-12-02 2020-03-31 中国银行股份有限公司 Data classification method, test method, device and storage medium
CN110990575A (en) * 2019-12-18 2020-04-10 斑马网络技术有限公司 Test case failure reason analysis method and device and electronic equipment
CN111209195A (en) * 2019-12-30 2020-05-29 瑞庭网络技术(上海)有限公司 Method and device for generating test case
CN112286796A (en) * 2020-09-29 2021-01-29 长沙市到家悠享网络科技有限公司 Software testing method, device and storage medium
CN112559313A (en) * 2019-09-26 2021-03-26 北京国双科技有限公司 Test case setting method and device, storage medium and electronic equipment
CN113392000A (en) * 2021-06-10 2021-09-14 卫宁健康科技集团股份有限公司 Test case execution result analysis method, device, equipment and storage medium
CN113704087A (en) * 2021-07-09 2021-11-26 奇安信科技集团股份有限公司 File service testing method and device of cross-domain transmission equipment and electronic equipment
CN114721936A (en) * 2022-02-28 2022-07-08 阿里巴巴(中国)有限公司 Data processing method, electronic device, medium, and program product

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105930276A (en) * 2016-06-30 2016-09-07 乐视控股(北京)有限公司 Method and device for identifying failure reasons of test cases
CN110297755B (en) * 2018-03-23 2023-09-12 龙芯中科技术股份有限公司 Software testing method and device
CN109271318A (en) * 2018-09-17 2019-01-25 郑州云海信息技术有限公司 A kind of method and device for the execution failure cause that test case is presented
CN113064824B (en) * 2021-03-31 2022-12-02 重庆紫光华山智安科技有限公司 Result analysis method and device, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101556550A (en) * 2009-05-22 2009-10-14 北京星网锐捷网络技术有限公司 Analysis method for automatic test log and device
CN101814052A (en) * 2010-02-04 2010-08-25 浪潮集团山东通用软件有限公司 Automatic test method
US20140013307A1 (en) * 2010-11-21 2014-01-09 Verifyter Ab Method and apparatus for automatic diagnosis of software failures
CN104516809A (en) * 2013-09-26 2015-04-15 方正宽带网络服务股份有限公司 Automated testing system and method
CN104978262A (en) * 2014-04-08 2015-10-14 中国移动通信集团公司 Terminal test method and terminal test device
CN105930276A (en) * 2016-06-30 2016-09-07 乐视控股(北京)有限公司 Method and device for identifying failure reasons of test cases

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101556550A (en) * 2009-05-22 2009-10-14 北京星网锐捷网络技术有限公司 Analysis method for automatic test log and device
CN101814052A (en) * 2010-02-04 2010-08-25 浪潮集团山东通用软件有限公司 Automatic test method
US20140013307A1 (en) * 2010-11-21 2014-01-09 Verifyter Ab Method and apparatus for automatic diagnosis of software failures
CN104516809A (en) * 2013-09-26 2015-04-15 方正宽带网络服务股份有限公司 Automated testing system and method
CN104978262A (en) * 2014-04-08 2015-10-14 中国移动通信集团公司 Terminal test method and terminal test device
CN105930276A (en) * 2016-06-30 2016-09-07 乐视控股(北京)有限公司 Method and device for identifying failure reasons of test cases

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069416B (en) * 2019-04-29 2023-05-16 腾讯音乐娱乐科技(深圳)有限公司 Test data processing method and device and related equipment
CN110069416A (en) * 2019-04-29 2019-07-30 腾讯音乐娱乐科技(深圳)有限公司 A kind of test data processing method, device and relevant device
CN110716857A (en) * 2019-08-27 2020-01-21 平安普惠企业管理有限公司 Test case management method and device, computer equipment and storage medium
CN110716857B (en) * 2019-08-27 2023-12-29 天航长鹰(江苏)科技有限公司 Test case management method, device, computer equipment and storage medium
CN112559313A (en) * 2019-09-26 2021-03-26 北京国双科技有限公司 Test case setting method and device, storage medium and electronic equipment
CN110941719A (en) * 2019-12-02 2020-03-31 中国银行股份有限公司 Data classification method, test method, device and storage medium
CN110941719B (en) * 2019-12-02 2023-12-19 中国银行股份有限公司 Data classification method, testing method, device and storage medium
CN110990575A (en) * 2019-12-18 2020-04-10 斑马网络技术有限公司 Test case failure reason analysis method and device and electronic equipment
CN110990575B (en) * 2019-12-18 2023-06-23 斑马网络技术有限公司 Test case failure cause analysis method and device and electronic equipment
CN111209195B (en) * 2019-12-30 2023-08-15 瑞庭网络技术(上海)有限公司 Method and device for generating test case
CN111209195A (en) * 2019-12-30 2020-05-29 瑞庭网络技术(上海)有限公司 Method and device for generating test case
CN112286796A (en) * 2020-09-29 2021-01-29 长沙市到家悠享网络科技有限公司 Software testing method, device and storage medium
CN113392000A (en) * 2021-06-10 2021-09-14 卫宁健康科技集团股份有限公司 Test case execution result analysis method, device, equipment and storage medium
CN113392000B (en) * 2021-06-10 2024-01-30 卫宁健康科技集团股份有限公司 Test case execution result analysis method, device, equipment and storage medium
CN113704087A (en) * 2021-07-09 2021-11-26 奇安信科技集团股份有限公司 File service testing method and device of cross-domain transmission equipment and electronic equipment
CN113704087B (en) * 2021-07-09 2024-01-19 奇安信科技集团股份有限公司 File service testing method and device of cross-domain transmission equipment and electronic equipment
CN114721936A (en) * 2022-02-28 2022-07-08 阿里巴巴(中国)有限公司 Data processing method, electronic device, medium, and program product

Also Published As

Publication number Publication date
CN105930276A (en) 2016-09-07

Similar Documents

Publication Publication Date Title
WO2018000607A1 (en) Method and electronic apparatus for identifying test case failure causes
CN108089893B (en) Method and device for determining redundant resources, terminal equipment and storage medium
WO2018120721A1 (en) Method and system for testing user interface, electronic device, and computer readable storage medium
CN107729227B (en) Application program test range determining method, system, server and storage medium
CN106575244B (en) Patching process to ensure high availability of cloud applications
US10776740B2 (en) Detecting potential root causes of data quality issues using data lineage graphs
US8661412B2 (en) Managing automated and manual application testing
WO2019052234A1 (en) Automated test method for product algorithm, and application server
US7870169B2 (en) Method for enabling traceability and recovery from errors during migration of software applications
WO2020024419A1 (en) Testing method for service scenario, electronic device and readable storage medium
US20150370694A1 (en) Automatic updating of graphical user interface element locators based on image comparison
CN110750592B (en) Data synchronization method, device and terminal equipment
CN106897197B (en) Error log duplicate removal method and device
WO2019071891A1 (en) Code coverage analysis method and application server
CN108111364B (en) Service system testing method and device
WO2019227641A1 (en) Application testing method, apparatus, terminal device and medium
US9626328B1 (en) Method and system for on-demand aggregated logging for distributed systems
US20150186126A1 (en) System and Method of Automating Installation of Applications
US20160019266A1 (en) Query generating method and query generating device
CN110727575B (en) Information processing method, system, device and storage medium
US11373004B2 (en) Report comprising a masked value
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN108228611B (en) Document information copying method and device
CN111597093B (en) Exception handling method, device and equipment thereof
CN114371866A (en) Version reconfiguration test method, device and equipment of service system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16907003

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16907003

Country of ref document: EP

Kind code of ref document: A1