Disclosure of Invention
In order to solve the problems of low efficiency, high cost and the like of the conventional software testing technical scheme, the invention can provide a method, a device, computer equipment and a storage medium for automatically optimizing testing activities, thereby achieving a plurality of technical purposes of improving the software testing efficiency, reducing or even avoiding repetitive labor and the like.
To achieve the above technical objects, the present invention provides a method for automatically optimizing a test activity, which may include, but is not limited to, one or more of the following steps.
And reading the number of the target test case, wherein the execution result of the target test case is failure.
And executing a command for searching a defect question list matched with the target test case from a defect library by taking the number as a search condition.
And converting the target test case into a new defect question sheet based on the element mapping relation according to the defect question sheet which is not matched with the target test case, and storing the sheet number of the new defect question sheet in the execution result of the target test case.
Or storing the single number of the defect question list in the execution result of the target test case according to the matched defect question list.
Further, the converting the target test case into a new defect question sheet based on the element mapping relationship includes:
and acquiring first element information contained in the target test case.
And correspondingly converting the first element information into second element information.
And writing the second element information into a preset blank question list to form a new defect question list.
Further, the converting the target test case into a new defect question list further comprises:
and writing the additional element information into the preset blank question list to form a new defect question list.
Further, before reading the number of the target test case, the method further includes:
and reading the execution log information formed after the execution of the plurality of test cases.
And analyzing the execution log information, and taking at least one test case with a failed execution result as a target test case according to an analysis result.
To achieve the above technical objects, the present invention can also provide a method for automatically optimizing a test activity, which may include, but is not limited to, one or more of the following steps.
The sheet number of the target defect question sheet is read.
And executing a command for searching the test case matched with the target defect question sheet from a case library by taking the single number as a search condition.
And converting the target defect question list into a new test case based on the element mapping relation according to the test case which is not matched with the target defect question list, and storing the serial number of the new test case in the target defect question list.
Or storing the serial number of the test case in the target defect question list according to the searched matched test case.
Further, the converting the target defect question sheet into a new test case based on the element mapping relationship includes:
and acquiring second element information contained in the target defect question list.
And correspondingly converting the second element information into first element information.
And writing the first element information into a preset blank case to form a new test case.
Further, the converting the target defect question sheet into a new test case based on the element mapping relationship includes:
and acquiring second element information contained in the target defect question list.
And modifying the first element information contained in the test case obtained by screening according to the second element information.
And taking the test case with the modified first factor information as a new test case.
Further, the converting the target defect question sheet into a new test case includes:
and acquiring the reproduction probability value of the target defect question list.
And converting the target defect question sheet into a new test case according to the probability value greater than or equal to a preset probability value.
To achieve the above technical objects, the present invention can also provide an apparatus for automatically optimizing test activities, which may include, but is not limited to, a number reading module, a defect searching module, an intelligent mapping module, and a single number storage module.
And the number reading module is used for reading the number of the target test case. And the execution result of the target test case is failure.
And the defect searching module is used for executing a command of searching a defect question list matched with the target test case from a defect library by taking the number as a searching condition.
And the intelligent mapping module is used for converting the target test case into a new defect question sheet based on the element mapping relation according to the defect question sheet which is not searched and matched.
And the single number storage module is used for storing the single number of the new defect question list in the execution result of the target test case according to the defect question list which is not matched with the defect question list. Or the single number of the defect question list is stored in the execution result of the target test case according to the matched defect question list.
To achieve the above technical objects, the present invention can also provide an apparatus for automatically optimizing test activities, which may include, but is not limited to, a single number reading module, a use case searching module, an intelligent mapping module, and a number storage module.
And the single number reading module is used for reading the single number of the target defect question list.
And the case searching module is used for executing a command for searching the test case matched with the target defect question sheet from a case library by taking the single number as a searching condition.
And the intelligent mapping module is used for converting the target defect question sheet into a new test case based on the element mapping relation according to the test case which is not searched and matched.
The serial number storage module is used for storing the serial number of the new test case in the target defect question sheet according to the test case which is not matched with the test case; or the serial number of the test case is stored in the target defect question sheet according to the searched matched test case.
To achieve the above technical object, the present invention may further provide a computer device, which includes a memory and a processor, wherein the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to execute the steps of the method for automatically optimizing test activities according to any embodiment of the present invention.
To achieve the above technical object, the present invention can also provide a storage medium storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to perform the steps of the method for automatically optimizing a test activity according to any one of the embodiments of the present invention.
The invention has the beneficial effects that: the invention can avoid the repetitive work of the same or similar problems under different test stages, for example, avoid the repeated input work of the tester to the two times of data of the associated test case and the defect question sheet, thereby improving the working efficiency of software test, improving the timeliness of the output of the test case and the generation of the defect question sheet, and greatly saving the manpower input and the test cost.
According to the invention, the software test defect library and the application library are effectively and intelligently integrated through the new defect question list rich defect library automatically generated by the test cases and the new test case rich application library automatically generated by the defect question list.
Detailed Description
The following describes and explains a method, an apparatus, a computer device and a storage medium for automatic optimization of test activities according to embodiments of the present invention in detail with reference to the drawings of the specification.
The test case (TestCase) is a file for describing a test task of a specific software product, and is used for embodying a test scheme, a method, a technology, a strategy and the like; the defect question list of the invention is a file which is formed after the defect is found during the test execution and is used for describing the content of the related defect, and the defect (Bug) question list of the invention is stored in a defect library. The invention aims to enrich the test case library and the defect library, improve the use efficiency of the test case library and the defect library and provide a plurality of technical schemes for automatically optimizing software test activities.
As shown in FIG. 1, and in conjunction with FIG. 2, one or more embodiments of the invention can provide a method for automatic optimization of test activities. Specifically, the method includes a process of converting the test case into a defect question list, and specifically may include, but is not limited to, one or more of the following steps.
First, the number of the target test case is read, and the execution result of the target test case in this embodiment is failure (fail). It is understood that the execution result of the test case includes both success (pass) and failure, and the flow of the present invention is triggered when the verification result is failure after the test task is issued.
Optionally, in some embodiments of the present invention, before reading the number of the target test case, the method further includes: reading the execution log information formed after the execution of the plurality of test cases, analyzing the current execution log information, and taking at least one test case with a failed execution result as a target test case according to an analysis result.
Next, a command to search for a defect question sheet matching the target test case from the defect library is executed with the number as a search condition (key). Specifically, when the test case fails to be executed, the number of the failed test case is used for searching the Bug single number related to the number in the defect library.
Finally, according to the matched defect question list which is not found, converting the target test case into a new defect question list based on the element mapping relation, and storing the single number of the new defect question list in the execution result of the target test case; or, according to the found matched defect question list (namely, finding the associated Bug list number), indicating that the test case still has an unsolved problem, namely, case test block (block), storing the list number of the matched defect question list in the execution result of the target test case, and at this time, not generating a new defect question list.
Specifically, the method for converting the target test case into the new defect question sheet based on the element mapping relationship in the embodiment of the invention comprises the following steps:
and acquiring first element information contained in the target test case. The first element information in this embodiment includes a case number, a test module, a title of the case, a priority of the case, a preset condition, a test input, a test step, and an expected result, that is, eight elements of the test case shown in fig. 2.
The first element information is correspondingly converted into the second element information, which may include, but is not limited to, a problem attribution module for converting the test module into a defect question list, a test step for converting the preset conditions and the test step into the defect question list, a priority of the use case being converted into a severity of the defect question list, an expected result being converted into a result influence of the defect question list, a title of the use case being converted into a brief description of the defect question list, a test input of the use case being converted into a trigger factor of the defect question list, and a number of the use case being converted into a single number of the defect question list (or a single number being determined by a separate generation method), but is not limited thereto. The second element information comprises a problem attribution module, a test step, severity, result influence, brief description, trigger factors, a single number and the like.
The conversion between the first element information and the second element information of the present embodiment is performed in at least one of the following ways. (1) Direct conversion: the content is directly mapped, for example, the case number can be directly converted into a single number of a defect question sheet, the test module is directly converted into a problem attribution module, and the like. (2) Regular matching: for example, the title of the test case can be converted into a brief description of a defect question list in a regular matching mode; (3) and (3) weighted conversion: such as converting test case priorities to severity of defect problem tickets (or effect or cause blockages), etc. It should be understood that, on the basis of the technical solution of the present invention, the filling of the small part of the detailed content can also be assisted manually.
And automatically writing the second element information into a preset blank question list to form a new defect question list. More specifically, converting the target test case into a new defect question sheet further comprises: and writing the additional element information into the preset blank question list on the basis of automatically writing the second element information into the preset blank question list to form a new defect question list. The additional element information in the present embodiment includes, but is not limited to, acquired version information, question whether or not reproducing information, trigger information, preliminary positioning information, and the like. The preset blank question list is a question list with a standard question list format but no specific content.
As shown in FIG. 3, and in conjunction with FIG. 4, one or more further embodiments of the present invention can provide a method for automatic optimization of test activities. Specifically, the method may include a process of converting the defect question sheet into a test case, specifically including, but not limited to, one or more of the following steps.
Firstly, the invention takes the defect question list newly submitted at present as the target defect question list and reads the list number of the target defect question list. The target defect question list sources in this embodiment include, but are not limited to, a test case execution process, a divergence test, a major question list synchronization process, and an online question processing process.
Secondly, a command for searching a test case matched with the target defect question list from a case library is executed by taking the single number as a search condition. In this embodiment, if the triggering condition of the process is that a new defect question list is generated, the list number of the defect question list is used as a basis for determining whether there is a corresponding test case.
Finally, according to the test cases which are not matched with each other and are not found, converting the target defect question list into a new test case based on the element mapping relation, and storing the number of the new test case in the target defect question list; or storing the serial number of the test case in the target defect question list according to the searched matched test case.
Optionally, converting the target defect question sheet into a new test case includes: and acquiring a reproduction probability value of the target defect question list, and converting the target defect question list into a new test case according to the reproduction probability value being greater than or equal to a preset probability value, wherein the preset probability value may be 63% for example, although not limited thereto. Specifically, in the embodiment, the target defect question sheet is converted into a new test case under the condition that the conditional probability occurs, and the probability corresponding to the occurrence of the conditional probability can be equal to the preset probability value; and converting the target defect question sheet into a new test case under the condition that the condition necessarily occurs, wherein the corresponding probability is larger than the preset probability value. And under the condition that the test case is difficult to reproduce or irregularly appears, the current Bug question list is not suitable for generating the test case, and the conversion process is cancelled. Wherein the corresponding probability which is difficult to reproduce and irregular is less than the preset probability value.
Optionally, some embodiments of the present invention convert the target defect question sheet into a new test case based on the element mapping relationship, including:
and acquiring second element information contained in the target defect question list. The second element information of the invention comprises a problem attribution module, a test step, severity, result influence, brief description, trigger factors, a single number and the like.
Searching the case library according to the second element information without corresponding results, correspondingly converting the second element information into the first element information, this step may include, but is not limited to, converting the problem attribution module of the defect question list into a test module, converting the test step of the defect question list into a preset condition and a test step, converting the severity of the defect question list into a priority of a use case, converting the result impact of the defect question list into an expected result, converting the brief description of the defect question list into a title of a use case, converting the trigger of the defect question list into a test input of a use case, converting the single number of the defect question list into a use case number (or determining a use case number by a separate generation method), although not limited thereto, the first element information may include a case number, a test module, a title of the case, a priority of the case, a preset condition, a test input, a test step, and an expected result.
Writing the first element information into a preset blank case to form a new test case, and storing the obtained new test case in a case library. The preset blank case refers to a test case which has a standard case format but has no specific content.
Optionally, in other embodiments of the present invention, converting the target defect question sheet into a new test case based on the element mapping relationship includes: acquiring second element information contained in the target defect question sheet, searching a corresponding result in the case library according to the second element information, screening out a proper test case, modifying first element information contained in the test case obtained through screening according to the second element information, and taking the test case with the modified first element information as a new test case. By the method, the data writing amount of the formed new test case can be reduced, and the content needing to be modified can be positioned according to the content matching. The second element information comprises a problem attribution module, a test step, severity, result influence, brief description, trigger factors and a single number, and the first element information comprises a case number, a test module, a title of a case, priority of the case, a preset condition, test input, a test step and an expected result.
It should be appreciated that embodiments of the present invention can be implemented in conjunction with use-case management tools and defect management tools. The use case management tools include HP ALM, Rational CQ, TestLink, ATQ, etc., and the defect management tools include Tracup, Bugtrags, Bugzilla, JIRA, etc.
As shown in fig. 5, the method for automatically optimizing a test activity is based on the same technical concept, and one or more embodiments of the present invention can provide an apparatus for automatically optimizing a test activity. The device comprises but is not limited to a number reading module, a defect searching module, an intelligent mapping module and a single number storage module.
The number reading module is used for reading the number of the target test case; the execution result of the target test case is failure.
The number reading module is specifically used for reading execution log information formed after a plurality of test cases are executed, analyzing the execution log information, and taking at least one test case with a failed execution result as a target test case according to an analysis result.
And the defect searching module is used for executing a command of searching a defect question list matched with the target test case from the defect library by taking the serial number as a searching condition.
And the intelligent mapping module is used for converting the target test case into a new defect question list based on the element mapping relation according to the matching defect question list which is not found. The intelligent mapping module is specifically used for acquiring first element information contained in the target test case, correspondingly converting the first element information into second element information, and writing the second element information into a preset blank question list to form a new defect question list. In addition, the intelligent mapping module can also be used for writing the additional element information into a preset blank question list so as to form a new defect question list. The intelligent mapping module in some embodiments of the present invention may have several working modes, that is, the conversion between the first element information and the second element information in this embodiment adopts at least one of the following modes. (1) Direct conversion: the content is directly mapped, for example, the case number can be directly converted into a single number of a defect question sheet, the test module is directly converted into a problem attribution module, and the like. (2) Regular matching: for example, the title of the test case can be converted into a brief description of a defect question list in a regular matching mode; (3) and (3) weighted conversion: such as converting test case priorities to severity of defect problem tickets (or effect or cause blockages), etc. It should be understood that, on the basis of the technical solution of the present invention, the filling of the small part of the detailed content can also be assisted manually.
The single number storage module is used for storing the single number of the new defect question list into the execution result of the target test case according to the matched defect question list which is not found; or the single number of the defect question list is stored in the execution result of the target test case according to the matched defect question list.
As shown in fig. 6, the method for automatically optimizing a test activity is based on the same technical concept, and one or more embodiments of the present invention can provide an apparatus for automatically optimizing a test activity. The device comprises but not limited to a single number reading module, a use case searching module, an intelligent mapping module and a number storage module.
The single number reading module is used for reading the single number of the target defect question list.
The case searching module is used for executing a command of searching a test case matched with the target defect question sheet from the case library by taking the single number as a searching condition.
And the intelligent mapping module is used for converting the target defect question sheet into a new test case based on the element mapping relation according to the test case which is not searched and matched.
Specifically, the intelligent mapping module in the embodiment of the present invention is configured to obtain a probability value of the target defect question list, and convert the target defect question list into a new test case according to the probability value of the target defect question list being greater than or equal to a preset probability value.
Optionally, the intelligent mapping module of the present invention may be specifically configured to obtain second element information included in the target defect question sheet, convert the second element information into first element information, and write the first element information into a preset blank case to form a new test case.
Optionally, the intelligent mapping module in another embodiment of the present invention is specifically configured to obtain second element information included in the target defect question sheet, modify, according to the second element information, first element information included in the test case obtained through the screening, and use the test case with the modified first element information as a new test case.
The serial number storage module is used for storing the serial number of the new test case in the target defect question list according to the test case which is not matched with the serial number storage module; or the serial number of the test case is stored in the target defect question list according to the searched matched test case.
As shown in fig. 7, based on the same technical concept as the method for automatically optimizing test activities in the present invention, one or more embodiments of the present invention can further provide a computer device, where the computer device includes a memory and a processor, the memory stores computer-readable instructions, and the computer-readable instructions, when executed by the processor, cause the processor to perform the steps of the method for automatically optimizing test activities in any embodiment of the present invention; the detailed steps of the automatic test activity optimization method are described in detail in this specification, and are not described herein again.
Based on the same technical concept as the method for automatically optimizing test activities in the present invention, one or more embodiments of the present invention can also provide a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the method for automatically optimizing test activities in any of the embodiments of the present invention; the detailed steps of the automatic test activity optimization method are described in detail in this specification, and are not described herein again.
In conclusion, the invention can reduce repeated work and improve work efficiency. And a supplementary test case is generated while the Bug is input into the defect library, so that the problem of repeated workload of twice input of the same information is avoided, and the efficiency of software test work is greatly improved. The method has the effect of better timeliness, the test cases can be generated simultaneously along with the Bug problem list, the speed of outputting the test cases is higher than that of outputting the test cases in a conventional mode, and the problem of test case omission is avoided. The invention can intelligently fuse the test case library and the defect library, furthest reduces the case supplement after the test omission of the pure human brain or manual tracking test design, and also avoids the problem that the data which does not pass through the same test point is repeatedly evaluated.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable storage medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer cartridge (magnetic device), a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM-Only Memory, or flash Memory), an optical fiber device, and a portable Compact Disc Read-Only Memory (CDROM). Additionally, the computer-readable storage medium may even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic Gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic Gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "the present embodiment," "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and simplifications made in the spirit of the present invention are intended to be included in the scope of the present invention.