CN112685324A - Method and system for generating test scheme - Google Patents

Method and system for generating test scheme Download PDF

Info

Publication number
CN112685324A
CN112685324A CN202110084287.0A CN202110084287A CN112685324A CN 112685324 A CN112685324 A CN 112685324A CN 202110084287 A CN202110084287 A CN 202110084287A CN 112685324 A CN112685324 A CN 112685324A
Authority
CN
China
Prior art keywords
test
test case
sample
target
requirement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110084287.0A
Other languages
Chinese (zh)
Other versions
CN112685324B (en
Inventor
蔡亚茹
成程
李湘河
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shengjing Intelligent Technology Jiaxing Co ltd
Original Assignee
Sany Heavy Industry Co Ltd
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 Sany Heavy Industry Co Ltd filed Critical Sany Heavy Industry Co Ltd
Priority to CN202110084287.0A priority Critical patent/CN112685324B/en
Priority claimed from CN202110084287.0A external-priority patent/CN112685324B/en
Publication of CN112685324A publication Critical patent/CN112685324A/en
Application granted granted Critical
Publication of CN112685324B publication Critical patent/CN112685324B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and a system for generating a test scheme, which comprises the following steps: calculating the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library based on a similarity calculation method; and selecting a test case sample according to the similarity, and generating a test scheme according to the selected test case sample. The invention automatically generates a set of test scheme containing a plurality of test cases, provides test reference for testers, saves the design time of the test cases in the test scheme, enhances the reusability of test case samples, reduces the working cost and improves the working efficiency.

Description

Method and system for generating test scheme
Technical Field
The invention relates to the technical field of software testing, in particular to a method and a system for generating a testing scheme.
Background
In the industrial internet, the interconnection is the foundation. Industrial internetworking has enabled the correlation of people, things and machines in industrial production, which requires extensive software engineering techniques to achieve the correlation.
With the application of more and more software development technologies to the industrial internet, better assurance of the quality of software development is increasingly required. Therefore, a test management platform suitable for industrial internet software development is urgently needed to be suitable for the rhythm of software engineering development in the industrial field, and the problems of team cooperation, test case management, defect management, test requirement management, test scheme generation, test efficiency improvement and the like in the industrial internet engineering development can be well solved.
For the existing open source test management platform or part of commercial test management platform, the management focus is on the management of the test process and problem recording, and the main line of recording after a problem is found in the test process is a defect. The process of recording or checking the defects is complicated, and the unit circulated in the test process is the defect, so that the focusing of the test requirement is inconvenient, and the test guidance scheme cannot be automatically generated according to the test requirement.
Disclosure of Invention
The invention provides a method and a system for generating a test scheme, which are used for solving the defects of complex management and low test efficiency in the test process in the prior art and realizing the automatic generation of the test guidance scheme according to the test requirement.
The invention provides a method for generating a test scheme, which comprises the following steps:
calculating the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library based on a similarity calculation method;
and selecting a test case sample according to the similarity, and generating a test scheme according to the selected test case sample.
According to the method for generating the test scheme, the characteristics of the target test requirement comprise items and sub-items to which the target test requirement belongs, keywords, classification, basic attributes and defect distribution conditions of the target test requirement;
the characteristics of the test case samples in the test case library comprise items and sub-items to which the test case samples belong, keywords of the test case samples, classification, defect number and use times.
According to the method for generating the test scheme provided by the invention, before the calculating the similarity between the feature of the target test requirement and the feature of each test case sample in the test case library based on the similarity calculation method, the method further comprises the following steps:
acquiring an incidence relation among the test demand sample, the test case sample and the test defect sample according to the classification of the test demand sample in the test demand library, the classification of the test case sample and the classification of the test defect sample in the test defect library;
searching the target test requirement from the test requirement library, and if the target test requirement is found, acquiring the test defect sample corresponding to the target test requirement according to the incidence relation;
counting the defect distribution condition of the test defect sample corresponding to the target test requirement, and taking the defect distribution condition as the defect distribution condition of the target test requirement;
obtaining a test defect sample corresponding to each test case sample according to the incidence relation;
and counting the number of the test defect samples corresponding to each test case sample, and taking the number as the defect number of each test case sample.
According to the method for generating the test scheme, the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library is calculated based on the similarity calculation method, and the method comprises the following steps:
converting the characteristics of the target test requirement and the characteristics of each test case sample into vectors based on an NLP algorithm;
and respectively calculating the similarity between the vector of the features of the target test requirement and the vector of the features of each test case sample based on the similarity calculation method.
According to the method for generating the test scheme provided by the invention, after the test case sample is selected according to the similarity and the test scheme is generated according to the selected test case sample, the method further comprises the following steps:
testing the software by using each test case sample in the test scheme to obtain the detected defects of each test case sample;
counting the detected defects to obtain a statistical result;
and generating a test suggestion according to the statistical result.
According to the method for generating the test scheme provided by the invention, the counting the measured test defects to obtain the statistical result comprises the following steps:
classifying the measured test defects based on a classification algorithm;
and counting the number and the proportion of each type of test defects.
According to the method for generating the test scheme provided by the invention, the counting the measured test defects to obtain the statistical result further comprises:
segmenting the purpose and description of each test case sample in the test scheme and the description of the tested test defects based on a segmentation algorithm;
counting the probability of the target participles of all the test case samples appearing in all the target participles of all the test case samples, and selecting the target participles of the test case samples as first keywords according to the probability of the target participles of all the test case samples appearing;
counting the probability of the occurrence of each participle of the description of all the test case samples in all the participles of the description of all the test case samples, and selecting the participle of the description of the test case samples as a second keyword according to the probability of the occurrence of each participle of the description of all the test case samples;
and counting the probability of all the participles of the description of all the tested test defects appearing in all the participles of the description of all the tested test defects, and selecting the participles of the description of the tested test defects as third key words according to the probability of all the participles of the description of all the tested test defects appearing.
The invention also provides a system for generating a test scheme, which comprises:
the similarity calculation module is used for calculating the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library based on a similarity calculation method;
and the test scheme generation module is used for selecting the test case sample according to the similarity and generating a test scheme according to the selected test case sample.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of any of the methods for generating a test scenario described above when executing the computer program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of generating a test protocol as described in any of the above.
According to the method and the system for generating the test scheme, the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library is calculated through the similarity calculation method, a set of test scheme comprising a plurality of test cases is automatically generated, the design time of the test cases in the test scheme can be saved, the reusability of the test case samples is enhanced, the working cost is reduced, and the working efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method of generating a test protocol provided by the present invention;
FIG. 2 is a schematic diagram of the test requirements, test cases and test defect management in the method for generating a test solution according to the present invention;
FIG. 3 is a schematic diagram illustrating an association relationship between a test requirement sample, a test case sample and a test defect sample in the method for generating a test scheme according to the present invention;
FIG. 4 is a schematic diagram of a system for generating a test scenario provided by the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The method of generating the test protocol of the present invention is described below in conjunction with FIG. 1. The method comprises the following steps: and step 101, calculating the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library based on a similarity calculation method.
The similarity calculation method is a method for calculating the similarity between two feature vectors, such as a cosine similarity method, a pearson correlation coefficient method, an euclidean distance method, and the like. The similarity calculation method is not particularly limited in this embodiment. The characteristics of the target test requirement include basic attribute characteristics, statistical characteristics, and the like of the target test requirement, and this embodiment does not specifically limit the characteristics. The features of the test case sample include basic attribute features, statistical features, and the like of the test case sample, and this embodiment does not specifically limit the features.
It should be noted that the characteristics of the target test requirement correspond to the characteristics of each test case sample in the test case library one to one. The target test requirement is the same as or related to the corresponding characteristics of the test case sample, so that the result of similarity calculation is more accurate. The features of the target test requirement and the test case samples are vectorized respectively to generate corresponding feature vectors, the similarity between the two feature vectors is calculated by using a similarity method, so that the similarity between the target test requirement and each test case sample in the test case library is obtained, and a data basis is provided for next step of selecting the test case samples.
And 102, selecting a test case sample according to the similarity, and generating a test scheme according to the selected test case sample.
Specifically, based on the similarity between the target test requirement and each test case sample, the test case samples meeting the requirements are selected, and then a test scheme is generated according to the selected test case samples, so that a test reference is provided for a tester. The tester can adjust the test scheme according to experience and/or the test result of the software last time, and use the adjusted test scheme to test the software again.
When the test case samples are selected according to the similarity between the target test requirement and each test case sample, the test case samples corresponding to the preset number of similarities before the numerical ranking, for example, the test case samples corresponding to the 20 similarities before the numerical ranking, may be selected to form the test scheme. In addition, a test case sample corresponding to the similarity greater than the preset threshold may also be selected, and the embodiment does not limit the manner and the number of the test case samples selected according to the similarity.
According to the embodiment, the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library is calculated through the similarity calculation method, a set of test scheme containing a plurality of test cases is automatically generated, the design time of the test cases in the test scheme can be saved, the reusability of the test case samples is enhanced, the working cost is reduced, and the working efficiency is improved.
On the basis of the above embodiment, the characteristics of the target test requirement in this embodiment include the item to which the target test requirement belongs, the sub-item, the keyword of the target test requirement, the classification, the basic attribute, and the defect distribution condition; the characteristics of the test case samples in the test case library comprise items and sub-items to which the test case samples belong, keywords of the test case samples, classification, defect number and use times.
The target test requirement and the item to which the test case sample belongs are the items to which the test requirement and the software to which the test case sample aims at belong, and the sub-items to which the target test requirement and the test case sample belong are the sub-items to which the test requirement and the test case sample aim at the item to which the software belongs. The keywords of the target test requirements and the test case samples are used for uniquely identifying the target test requirements and the test case samples, such as the numbers of the target test requirements and the test case samples. The target test requirements and the classification of the test case samples such as voice, video and text represent the test requirements and the test case samples for the voice, video and text in the software. The basic attributes of the target test requirements are as described by the target test requirements. The defect distribution condition of the target test requirement refers to the quantity distribution condition of each type of defects in the defects corresponding to the target test requirement. The defect number of the test case sample refers to the number of defects corresponding to the use of the test case sample.
The target test requirement corresponds to the items, sub-items, keywords and classifications of the test case samples. The basic attribute of the target test requirement corresponds to the using times of the test case samples, and the defect distribution condition of the target test requirement corresponds to the defect number of the test case samples.
On the basis of the foregoing embodiment, in this embodiment, the calculating a similarity between the feature of the target test requirement and the feature of each test case sample in the test case library based on the similarity calculation method further includes: acquiring an incidence relation among the test demand sample, the test case sample and the test defect sample according to the classification of the test demand sample in the test demand library, the classification of the test case sample and the classification of the test defect sample in the test defect library;
as shown in fig. 2, the embodiment records the contents of the test requirement sample, the test defect sample and the test case sample by using the requirement management, defect management and test case management module, and completes the association among the three through the classification label. And uniformly classifying the test demand samples, the test defect samples and the test case samples, and then associating the test demand samples, the test case samples or the test defect samples which are classified to be the same.
The corresponding relation of the three is that one test requirement sample corresponds to a plurality of test case samples, such as a function test sample, an interface test sample, a front end test sample, a performance test sample and the like, and a plurality of test defect samples exist. One test defect sample may belong to a plurality of items, and may correspond to a plurality of test defect samples, as shown in fig. 3.
Searching a target test requirement from a test requirement library, and if the target test requirement is searched, acquiring a test defect sample corresponding to the target test requirement according to the incidence relation; counting the defect distribution condition of a test defect sample corresponding to the target test requirement, and taking the defect distribution condition as the defect distribution condition of the target test requirement;
if the test requirement library has the test requirement sample which is the same as the target test requirement, the target test requirement can be found from the test requirement library. And acquiring one or more test defect samples corresponding to the target test requirement according to the one-to-many incidence relation between the test requirement samples and the test defect samples. And if the target test requirement is not found in the test requirement library, not performing subsequent processing.
And (4) counting the defect distribution condition of the test defect sample corresponding to the target test requirement by adopting a classification statistical method. For example, the classification of the importance of defects to software, including critical defects, medium defects, and low-level defects, is performed based on statistics of the number of critical defects, the number of medium defects, and the number of low-level defects, respectively. And taking the defect distribution condition obtained by statistics as the defect distribution condition of the target test requirement, wherein the defect distribution condition of the target test requirement is used for providing basic data for similarity calculation. The present embodiment is not limited to the category of defect classification.
Obtaining a test defect sample corresponding to each test case sample according to the incidence relation; and counting the number of the test defect samples corresponding to each test case sample, and taking the number as the defect number of each test case sample.
And acquiring one or more test defect samples corresponding to each test case sample according to the one-to-many incidence relation between the test case samples and the test defect samples. And counting the number of the test defect samples corresponding to each test case sample, wherein the counting can be directly carried out in an accumulative summation mode. And taking the number obtained by statistics as the defect number of each test case sample, wherein the defect number is used for providing basic data for similarity calculation.
On the basis of the foregoing embodiment, in this embodiment, calculating the similarity between the feature of the target test requirement and the feature of each test case sample in the test case library based on a similarity calculation method includes: converting the characteristics of the target test requirement and the characteristics of each test case sample into vectors based on an NLP (Natural Language Processing) algorithm; and respectively calculating the similarity between the vector of the characteristics of the target test requirement and the vector of the characteristics of each test case sample based on a similarity calculation method.
Specifically, the characteristics of the target test requirement are vectorized through an NLP algorithm to generate a vector A, namely
A=[a1,a2,a3,a4,a5,a6];
Wherein, a1Representing vectors generated from the items to which the target test requirements belong, a2Representing vectors generated from sub-items to which the target test requirements belong, a3Representing vectors generated from keywords of a target test requirement, a4Representing vectors generated by classification of target test requirements, a5Representing vectors generated from fundamental attributes of the target test requirements, a6Representing vectors generated from the defect distributions of the target test requirements.
Vectorizing the characteristics of the test case samples in the test case library through an NLP algorithm to generate a vector B:
B=[b1,b2,b3,b4,b5,b6];
wherein, b1Vector corresponding to item to which test case sample belongs, b2Corresponding to the vector of the sub-item to which the test case sample belongs, b3Vector of keywords corresponding to test case sample, b4Corresponding test case sampleOf the classification of b5Vector of number of times of use of corresponding test case sample, a6A vector corresponding to the number of defects of the test case sample.
The cosine similarity between the target test requirement and the vector of the features of each test case sample can be calculated by adopting a cosine similarity method, namely:
Figure BDA0002910367960000091
on the basis of the foregoing embodiment, after generating a test scheme according to a selected test case sample in this embodiment, the method further includes: testing the software by using each test case sample in the test scheme to obtain the detected defects of each test case sample; counting the measured defects to obtain a statistical result; and generating a test suggestion according to the statistical result.
Specifically, each test case sample in the test scheme is used for testing the software, and the defects actually measured by each test case sample on the software are obtained. And (4) counting various characteristics of the actually measured defects, such as counting the number and proportion of the defects with different severity levels, counting the occurrence frequency or probability of each defect, and the like. The statistical characteristics are not limited in this embodiment. After the test, the developer can maintain the software according to the test result, and test the software again after the maintenance. And generating a test suggestion according to the statistical result to provide a reference for the retest of the software.
On the basis of the foregoing embodiment, in this embodiment, the performing statistics on the measured test defects to obtain a statistical result includes: classifying the tested test defects based on a classification algorithm; and counting the number and the proportion of each type of test defects.
Specifically, sentiment analysis is performed using a classification algorithm to obtain categories of actually measured defects, such as severe defects, medium defects, and low defects. The classification algorithm in this embodiment may use a KNN (K Nearest Neighbor) algorithm. And counting the distribution of each type of test defects, including the number and the proportion of each type of test defects, as shown in table 1.
TABLE 1 example distribution of each type of test Defect
Target test requirements Number of serious defects Moderate number of defects Low number of defects State of need
A 10 2 0 High rate of serious defect
B 1 5 10 High proportion of medium defect
C 0 10 4 High defect rate
D 1 5 2 High proportion of medium defect
When the software is retested after being maintained, the retested test requirement is taken as a target test requirement, and the method in the embodiment is used for automatically generating the test scheme. And adjusting the scheme of retesting according to the test suggestion generated by the test. For example, when the proportion of the serious defects in the test suggestion is the highest, whether a test example sample with the detected serious defects exists in the retested scheme or not is checked, and if the test example sample does not exist, the test example sample is added into the retested scheme.
On the basis of the foregoing embodiment, in this embodiment, the performing statistics on the measured test defects to obtain a statistical result includes: performing word segmentation on the purpose and description of each test case sample in the test scheme and the description of the tested test defects based on a word segmentation algorithm;
the word segmentation algorithm may adopt a bar segmentation algorithm, but is not limited to the word segmentation algorithm.
Counting the probability of the target participles of all the test case samples appearing in all the target participles of all the test case samples, and selecting the target participles of the test case samples as first keywords according to the probability of the target participles of all the test case samples appearing; counting the probability of the occurrence of each participle of the description of all the test case samples in all the participles of the description of all the test case samples, and selecting the participle of the description of the test case samples as a second keyword according to the probability of the occurrence of each participle of the description of all the test case samples; and counting the probability of all the participles of the description of all the tested test defects appearing in all the participles of the description of all the tested test defects, and selecting the participles of the description of the tested test defects as third key words according to the probability of all the participles of the description of all the tested test defects appearing.
For example, there are 5 test case samples in the test scheme, and after the purpose of the 5 test case samples is participated, all participated sets of the purpose of the 5 test case samples are obtained. If any participle exists in the purposes of a plurality of test case samples, the participle exists in a participle set. And counting the frequency of each participle in the participle set. And taking a plurality of participles with highest occurrence frequency as keywords, or taking the participles with occurrence frequency more than a preset threshold value as the keywords. And counting keywords in the description of the test case sample and the description of the measured defects based on the same method. When the software is tested again, the testing personnel increase or decrease the testing samples in the scheme for testing again according to the keywords.
For example, as shown in table 2, for the description of the test case sample, the purpose of the test case, and the description of the measured test defect in the test scheme of the target test requirement a, the extracted keywords are respectively the interface data consistency test, the data consistency, and the interface data inconsistency.
TABLE 2 description of test case samples, purpose, and description example of measured defects
Figure BDA0002910367960000111
In the embodiment, the defects and the test cases which are measured after the test is performed on the automatically generated test scheme are analyzed by using the NLP algorithm, so that the test suggestion is generated, and when the software is tested again, the test reference is provided for the tester.
The system for generating a test solution provided by the present invention is described below, and the system for generating a test solution described below and the method for generating a test solution described above may be referred to correspondingly.
As shown in fig. 4, the present embodiment provides a system for generating a test solution, which includes a calculating module 401 and a generating module 402, wherein:
the calculation module 401 is configured to calculate a similarity between the feature of the target test requirement and the feature of each test case sample in the test case library based on a similarity calculation method.
The similarity calculation method is a method for calculating the similarity between two feature vectors, such as a cosine similarity method, a pearson correlation coefficient method, an euclidean distance method, and the like. The similarity calculation method is not particularly limited in this embodiment. The characteristics of the target test requirement include basic attribute characteristics, statistical characteristics, and the like of the target test requirement, and this embodiment does not specifically limit the characteristics. The features of the test case sample include basic attribute features, statistical features, and the like of the test case sample, and this embodiment does not specifically limit the features.
It should be noted that the characteristics of the target test requirement correspond to the characteristics of each test case sample in the test case library one to one. The target test requirement is the same as or related to the corresponding characteristics of the test case sample, so that the result of similarity calculation is more accurate. The features of the target test requirement and the test case samples are vectorized respectively to generate corresponding feature vectors, the similarity between the two feature vectors is calculated by using a similarity method, so that the similarity between the target test requirement and each test case sample in the test case library is obtained, and a data basis is provided for next step of selecting the test case samples.
The generating module 402 is configured to select a test case sample according to the similarity, and generate a test scheme according to the selected test case sample.
Specifically, based on the similarity between the target test requirement and each test case sample, the test case samples meeting the requirements are selected, and then a test scheme is generated according to the selected test case samples, so that a test reference is provided for a tester. The tester can adjust the test scheme according to experience and/or the test result of the software last time, and use the adjusted test scheme to test the software again.
When the test case samples are selected according to the similarity between the target test requirement and each test case sample, the test case samples corresponding to the preset number of similarities before the numerical ranking, for example, the test case samples corresponding to the 20 similarities before the numerical ranking, may be selected to form the test scheme. In addition, a test case sample corresponding to the similarity greater than the preset threshold may also be selected, and the embodiment does not limit the manner and the number of the test case samples selected according to the similarity.
According to the embodiment, the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library is calculated through the similarity calculation method, a set of test scheme containing a plurality of test cases is automatically generated, the design time of the test cases in the test scheme can be saved, the reusability of the test case samples is enhanced, the working cost is reduced, and the working efficiency is improved.
On the basis of the above embodiment, the characteristics of the target test requirement in this embodiment include the item to which the target test requirement belongs, the sub-item, the keyword of the target test requirement, the classification, the basic attribute, and the defect distribution condition; the characteristics of the test case samples in the test case library comprise items and sub-items to which the test case samples belong, keywords of the test case samples, classification, defect number and use times.
On the basis of the above embodiment, the embodiment further includes an obtaining module, configured to obtain an association relationship among the test demand sample, the test case sample, and the test defect sample according to the classification of the test demand sample in the test demand library, the classification of the test case sample, and the classification of the test defect sample in the test defect library; searching a target test requirement from a test requirement library, if the target test requirement is found, acquiring a test defect sample corresponding to the target test requirement according to the incidence relation, counting the defect distribution condition of the test defect sample corresponding to the target test requirement, and taking the defect distribution condition as the defect distribution condition of the target test requirement; and obtaining the test defect samples corresponding to each test case sample according to the incidence relation, counting the number of the test defect samples corresponding to each test case sample, and taking the number as the defect number of each test case sample.
On the basis of the foregoing embodiment, the calculating module in this embodiment is configured to: converting the characteristics of the target test requirement and the characteristics of each test case sample into vectors based on an NLP algorithm; and respectively calculating the similarity between the vector of the characteristics of the target test requirement and the vector of the characteristics of each test case sample based on a similarity calculation method.
On the basis of the above embodiment, the present embodiment further includes a supplementary module, configured to use each test case sample in the test scheme to test the software, obtain a defect measured by each test case sample, perform statistics on the measured defect, obtain a statistical result, and generate a test suggestion according to the statistical result.
On the basis of the above embodiment, the supplementary module in this embodiment is configured to: classifying the tested test defects based on a classification algorithm; and counting the number and the proportion of each type of test defects.
On the basis of the above embodiment, the supplementary module in this embodiment is configured to: performing word segmentation on the purpose and description of each test case sample in the test scheme and the description of the tested test defects based on a word segmentation algorithm; counting the probability of the target participles of all the test case samples appearing in all the target participles of all the test case samples, and selecting the target participles of the test case samples as first keywords according to the probability of the target participles of all the test case samples appearing; counting the probability of the occurrence of each participle of the description of all the test case samples in all the participles of the description of all the test case samples, and selecting the participle of the description of the test case samples as a second keyword according to the probability of the occurrence of each participle of the description of all the test case samples; and counting the probability of all the participles of the description of all the tested test defects appearing in all the participles of the description of all the tested test defects, and selecting the participles of the description of the tested test defects as third key words according to the probability of all the participles of the description of all the tested test defects appearing.
Fig. 5 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 5: a processor (processor)510, a communication Interface (Communications Interface)520, a memory (memory)530 and a communication bus 540, wherein the processor 510, the communication Interface 520 and the memory 530 communicate with each other via the communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a method of generating a test solution, the method comprising: calculating the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library based on a similarity calculation method; and selecting a test case sample according to the similarity, and generating a test scheme according to the selected test case sample.
Furthermore, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform a method of generating a test scenario provided by the above methods, the method comprising: calculating the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library based on a similarity calculation method; and selecting a test case sample according to the similarity, and generating a test scheme according to the selected test case sample.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method of generating a test protocol provided above, the method comprising: calculating the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library based on a similarity calculation method; and selecting a test case sample according to the similarity, and generating a test scheme according to the selected test case sample.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of generating a test plan, comprising:
calculating the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library based on a similarity calculation method;
and selecting the test case sample according to the similarity, and generating a test scheme according to the selected test case sample.
2. The method of claim 1, wherein the characteristics of the target test requirement comprise items, sub-items, keywords, categories, basic attributes, and defect distributions of the target test requirement;
the characteristics of the test case samples in the test case library comprise items and sub-items to which the test case samples belong, keywords of the test case samples, classification, defect number and use times.
3. The method of generating a test scenario of claim 2, wherein the similarity-based calculation method calculates the similarity between the features of the target test requirement and the features of each test case sample in the test case library, and further comprises:
acquiring an incidence relation among the test demand sample, the test case sample and the test defect sample according to the classification of the test demand sample in the test demand library, the classification of the test case sample and the classification of the test defect sample in the test defect library;
searching the target test requirement from the test requirement library, and if the target test requirement is found, acquiring the test defect sample corresponding to the target test requirement according to the incidence relation;
counting the defect distribution condition of the test defect sample corresponding to the target test requirement, and taking the defect distribution condition as the defect distribution condition of the target test requirement;
obtaining a test defect sample corresponding to each test case sample according to the incidence relation;
and counting the number of the test defect samples corresponding to each test case sample, and taking the number as the defect number of each test case sample.
4. The method of claim 1, wherein the calculating the similarity between the features of the target test requirement and the features of each test case sample in the test case library based on the similarity calculation method comprises:
converting the characteristics of the target test requirement and the characteristics of each test case sample into vectors based on an NLP algorithm;
and respectively calculating the similarity between the vector of the features of the target test requirement and the vector of the features of each test case sample based on the similarity calculation method.
5. The method of any one of claims 1 to 4, wherein after generating the test scenario from the selected test case sample, the method further comprises:
testing the software by using each test case sample in the test scheme to obtain the detected defects of each test case sample;
counting the detected defects to obtain a statistical result;
and generating a test suggestion according to the statistical result.
6. The method of claim 5, wherein the performing statistics on the measured test defects to obtain statistical results comprises:
classifying the measured test defects based on a classification algorithm;
and counting the number and the proportion of each type of test defects.
7. The method of claim 5, wherein the performing statistics on the measured test defects to obtain statistical results comprises:
segmenting the purpose and description of each test case sample in the test scheme and the description of the tested test defects based on a segmentation algorithm;
counting the probability of the target participles of all the test case samples appearing in all the target participles of all the test case samples, and selecting the target participles of the test case samples as first keywords according to the probability of the target participles of all the test case samples appearing;
counting the probability of the occurrence of each participle of the description of all the test case samples in all the participles of the description of all the test case samples, and selecting the participle of the description of the test case samples as a second keyword according to the probability of the occurrence of each participle of the description of all the test case samples;
and counting the probability of all the participles of the description of all the tested test defects appearing in all the participles of the description of all the tested test defects, and selecting the participles of the description of the tested test defects as third key words according to the probability of all the participles of the description of all the tested test defects appearing.
8. A system for generating a test plan, comprising:
the calculation module is used for calculating the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library based on a similarity calculation method;
and the generating module is used for selecting the test case sample according to the similarity and generating a test scheme according to the selected test case sample.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of generating a test scheme according to any of claims 1 to 7 are implemented by the processor when executing the program.
10. A non-transitory computer readable storage medium, having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the method of generating a test protocol of any one of claims 1 to 7.
CN202110084287.0A 2021-01-21 Method and system for generating test scheme Active CN112685324B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110084287.0A CN112685324B (en) 2021-01-21 Method and system for generating test scheme

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110084287.0A CN112685324B (en) 2021-01-21 Method and system for generating test scheme

Publications (2)

Publication Number Publication Date
CN112685324A true CN112685324A (en) 2021-04-20
CN112685324B CN112685324B (en) 2024-06-28

Family

ID=

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434414A (en) * 2021-06-28 2021-09-24 平安银行股份有限公司 Data testing method and device, electronic equipment and storage medium
CN113672522A (en) * 2021-10-25 2021-11-19 腾讯科技(深圳)有限公司 Test resource compression method and related equipment
CN113687826A (en) * 2021-08-10 2021-11-23 中国人民解放军陆军工程大学 Test case multiplexing system and method based on requirement item extraction
CN114817004A (en) * 2022-04-07 2022-07-29 中国联合网络通信集团有限公司 Test case generation method, device and equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446076A (en) * 2018-10-15 2019-03-08 广东省科技基础条件平台中心 Software project testing method, system, storage medium and terminal device
TW202029022A (en) * 2019-01-29 2020-08-01 中華電信股份有限公司 Regression method and system based on system program infrastructure
CN111881037A (en) * 2020-07-23 2020-11-03 云账户技术(天津)有限公司 Test case management method and device and electronic equipment
CN112231224A (en) * 2020-10-30 2021-01-15 平安银行股份有限公司 Business system testing method, device, equipment and medium based on artificial intelligence

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446076A (en) * 2018-10-15 2019-03-08 广东省科技基础条件平台中心 Software project testing method, system, storage medium and terminal device
TW202029022A (en) * 2019-01-29 2020-08-01 中華電信股份有限公司 Regression method and system based on system program infrastructure
CN111881037A (en) * 2020-07-23 2020-11-03 云账户技术(天津)有限公司 Test case management method and device and electronic equipment
CN112231224A (en) * 2020-10-30 2021-01-15 平安银行股份有限公司 Business system testing method, device, equipment and medium based on artificial intelligence

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434414A (en) * 2021-06-28 2021-09-24 平安银行股份有限公司 Data testing method and device, electronic equipment and storage medium
CN113687826A (en) * 2021-08-10 2021-11-23 中国人民解放军陆军工程大学 Test case multiplexing system and method based on requirement item extraction
CN113687826B (en) * 2021-08-10 2024-02-02 中国人民解放军陆军工程大学 Test case multiplexing system and method based on demand item extraction
CN113672522A (en) * 2021-10-25 2021-11-19 腾讯科技(深圳)有限公司 Test resource compression method and related equipment
CN114817004A (en) * 2022-04-07 2022-07-29 中国联合网络通信集团有限公司 Test case generation method, device and equipment and readable storage medium
CN114817004B (en) * 2022-04-07 2024-05-17 中国联合网络通信集团有限公司 Test case generation method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN111782472B (en) System abnormality detection method, device, equipment and storage medium
Natt och Dag et al. A feasibility study of automated natural language requirements analysis in market-driven development
KR20080075501A (en) Information classification paradigm
CN113934848B (en) Data classification method and device and electronic equipment
CN108470065B (en) Method and device for determining abnormal comment text
CN111723182B (en) Key information extraction method and device for vulnerability text
CN115859128B (en) Analysis method and system based on interaction similarity of archive data
CN116578700A (en) Log classification method, log classification device, equipment and medium
CN109446322B (en) Text analysis method and device, electronic equipment and readable storage medium
CN116739605A (en) Transaction data detection method, device, equipment and storage medium
CN108021595A (en) Examine the method and device of knowledge base triple
CN114969334B (en) Abnormal log detection method and device, electronic equipment and readable storage medium
CN112685324B (en) Method and system for generating test scheme
CN115018613A (en) Report analysis method, device, equipment, storage medium and product
CN112685324A (en) Method and system for generating test scheme
CN115563268A (en) Text abstract generation method and device, electronic equipment and storage medium
CN112307086B (en) Automatic data verification method and device in fire service
US11520831B2 (en) Accuracy metric for regular expression
JP2012014684A (en) Processor, method and program for supporting integration of records
CN112632284A (en) Information extraction method and system for unlabeled text data set
CN112632229A (en) Text clustering method and device
US10120652B2 (en) System and method for representing software development requirements into standard diagrams
CN113392208A (en) Method, device and storage medium for IT operation and maintenance fault processing experience accumulation
CN115758135B (en) Track traffic signal system function demand tracing method and device and electronic equipment
CN111930545B (en) SQL script processing method, SQL script processing device and SQL script processing server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20230526

Address after: 314506 room 116, building 4, No. 288, development avenue, Tongxiang Economic Development Zone, Tongxiang City, Jiaxing City, Zhejiang Province

Applicant after: Shengjing Intelligent Technology (Jiaxing) Co.,Ltd.

Address before: 102206 5th floor, building 6, 8 Beiqing Road, Changping District, Beijing

Applicant before: SANY HEAVY INDUSTRY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant