CN112685324B - Method and system for generating test scheme - Google Patents
Method and system for generating test scheme Download PDFInfo
- Publication number
- CN112685324B CN112685324B CN202110084287.0A CN202110084287A CN112685324B CN 112685324 B CN112685324 B CN 112685324B CN 202110084287 A CN202110084287 A CN 202110084287A CN 112685324 B CN112685324 B CN 112685324B
- Authority
- CN
- China
- Prior art keywords
- test
- test case
- sample
- defect
- 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.)
- Active
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 589
- 238000000034 method Methods 0.000 title claims abstract description 68
- 238000004364 calculation method Methods 0.000 claims abstract description 34
- 230000007547 defect Effects 0.000 claims description 172
- 239000013598 vector Substances 0.000 claims description 33
- 238000009826 distribution Methods 0.000 claims description 29
- 238000004422 calculation algorithm Methods 0.000 claims description 15
- 239000012085 test solution Substances 0.000 claims description 13
- 230000011218 segmentation Effects 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 10
- 238000003860 storage Methods 0.000 claims description 8
- 238000007635 classification algorithm Methods 0.000 claims description 6
- 238000004458 analytical method Methods 0.000 claims description 3
- 238000013461 design Methods 0.000 abstract description 4
- 239000000243 solution Substances 0.000 description 9
- 238000003058 natural language processing Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 230000018109 developmental process Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000013102 re-test Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000001186 cumulative effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000008451 emotion Effects 0.000 description 1
- 238000011990 functional testing Methods 0.000 description 1
- 238000009776 industrial production Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011056 performance test Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 230000033764 rhythmic process Effects 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Tests Of Electronic Circuits (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method and a system for generating a test scheme, comprising the following steps: calculating the similarity between the characteristics of the target test requirements and the characteristics of each test case sample in the test case library based on a similarity calculation method; and selecting test case samples according to the similarity, and generating a test scheme according to the selected test case samples. The invention automatically generates a set of test schemes containing a plurality of test cases, provides test references for testers, saves the design time of the test cases in the test schemes, enhances the reusability of test case samples, reduces the working cost and improves the working efficiency.
Description
Technical Field
The present invention relates to the field of software testing technologies, and in particular, to a method and a system for generating a test scheme.
Background
In the industrial internet, interconnection is the basis. Industrial internet makes related people, things and machines in industrial production interrelated, which requires a great deal of software engineering technology to achieve.
As more and more software development technologies are applied to the industrial internet, better assurance is also increasingly required for the quality of software development. Therefore, a test management platform suitable for industrial internet software development is urgently needed to be suitable for the rhythm of industrial field software engineering development, and the problems of team cooperation, test case management, defect management, test requirement management, test scheme generation, test efficiency improvement and the like in industrial internet engineering development can be well solved.
For the existing open source test management platform or part of commercial test management platforms, the management emphasis is on the management of the test process and the problem recording, and the main line recorded after the problem is found in the test process is a defect. The process of recording or checking the defects is complicated, and the unit of circulation in the test process is the defect, so that focusing of the test requirements is inconvenient, and a test guidance scheme cannot be automatically generated according to the test requirements.
Disclosure of Invention
The invention provides a method and a system for generating a test scheme, which are used for solving the defects of complicated management and low test efficiency in the test process in the prior art and realizing automatic generation of a test guidance scheme according to test requirements.
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 requirements and the characteristics of each test case sample in the test case library based on a similarity calculation method;
and selecting test case samples according to the similarity, and generating a test scheme according to the selected test case samples.
According to the method for generating the test scheme provided by the invention, the characteristics of the target test requirement comprise items and sub-items to which the target test requirement belongs, keywords, classifications, 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, classifications, defect numbers and using times of the test case samples.
According to the method for generating the test scheme provided by the invention, before the similarity calculation method 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, the method further comprises the following steps:
Acquiring an association relationship among the test requirement sample, the test case sample and the test defect sample according to the classification of the test requirement sample in the test requirement 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 so, acquiring the test defect sample corresponding to the target test requirement according to the association relation;
Counting defect distribution conditions of the test defect sample corresponding to the target test requirement, and taking the defect distribution conditions as defect distribution conditions of the target test requirement;
obtaining a test defect sample corresponding to each test case sample according to the association relation;
Counting the number of 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 provided by the invention, 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 requirements 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 characteristic of the target test requirement and the vector of the characteristic of each test case sample based on the similarity calculation method.
According to the method for generating the test scheme provided by the invention, the test case sample is selected according to the similarity, and after the test scheme is generated according to the selected test case sample, the method further comprises the following steps:
Testing software by using each test case sample in the test scheme to obtain defects measured by each test case sample;
Counting the detected defects to obtain a counting result;
And generating a test suggestion according to the statistical result.
According to the method for generating a test scheme provided by the invention, the statistics of the measured test defects is carried out, and the statistical result is obtained, which comprises the following steps:
classifying the measured test defects based on a classification algorithm;
The number and proportion of each type of test defects measured are counted.
According to the method for generating a test scheme provided by the invention, the statistics of the measured test defects is performed to obtain a statistical result, and the method further comprises the following steps:
the method comprises the steps of performing word segmentation on the purpose and description of each test case sample and the description of the measured test defects in the test scheme based on a word segmentation algorithm;
Counting the occurrence probability of each word of the purpose of all test case samples in all words of the purpose of all test case samples, and selecting the word of the purpose of the test case sample as a first keyword according to the occurrence probability of each word of the purpose of all test case samples;
Counting the occurrence probability of each word described by all test case samples in all words described by all test case samples, and selecting the word described by all test case samples as a second keyword according to the occurrence probability of each word described by all test case samples;
Counting the occurrence probability of each word of the description of all the measured test defects in all the words of the description of all the measured test defects, and selecting the word of the description of the measured test defects as a third keyword according to the occurrence probability of each word of the description of all the measured test defects.
The invention also provides a system for generating the test scheme, which comprises:
The similarity calculation module is used for calculating the similarity between the characteristics of the target test requirements and the characteristics of each test case sample in the test case library based on a similarity calculation method;
and the test scheme generating module is used for selecting the test case samples according to the similarity and generating a test scheme according to the selected test case samples.
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, the processor implementing the steps of the method of generating a test solution as described in any one of the above when executing the computer program.
The invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of generating a test solution as described in any of the above.
According to the method and the system for generating the test scheme, provided by the invention, 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, and a set of test scheme containing a plurality of test cases is automatically generated, so that 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 invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of generating a test plan provided by the present invention;
FIG. 2 is a schematic diagram of a test requirement, test case and test defect management architecture in a method for generating a test plan according to the present invention;
FIG. 3 is a schematic diagram of the association relationship among a test requirement sample, a test case sample and a test defect sample in the method for generating a test solution according to the present invention;
FIG. 4 is a schematic diagram of a system for generating a test plan provided by the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The method of generating a test scheme 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 requirements 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, a Euclidean distance method and the like. The present embodiment does not specifically limit the similarity calculation method. The characteristics of the target test requirement include basic attribute characteristics, statistical characteristics, and the like of the target test requirement, which are not particularly limited in this embodiment. The features of the test case sample include basic attribute features, statistical features, and the like of the test case sample, which are not particularly limited in this embodiment.
It should be noted that the features of the target test requirements should correspond to the features of each test case sample in the test case library one by 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. And respectively vectorizing the characteristics of the target test requirement and the test case samples to generate corresponding characteristic vectors, and calculating the similarity between the two characteristic vectors by using a similarity method, so that the similarity between each test case sample in the target test requirement and the test case library is obtained, and a data basis is provided for the next step of selecting the test case samples.
Step 102, selecting test case samples according to the similarity, and generating a test scheme according to the selected test case samples.
Specifically, based on the similarity between the target test requirement and each test case sample, a test case sample meeting the requirement is selected, and then a test scheme is generated according to the selected test case sample, so that test references are provided for testers. The tester can adjust the test scheme according to experience and/or the last test result of the software, and retest the software by using the adjusted test scheme.
When test case samples are selected according to the similarity between the target test requirement and each test case sample, test case samples corresponding to the preset number of similarity before numerical ranking can be selected, and a test scheme is formed by the test case samples corresponding to the 20 similarity before numerical ranking. In addition, test case samples corresponding to the similarity greater than the preset threshold can be selected, and the mode and the number of the test case samples selected according to the similarity are not limited in this embodiment.
According to the embodiment, through the similarity calculation method, the similarity between the characteristics of the target test requirements and the characteristics of each test case sample in the test case library is calculated, a set of test schemes containing a plurality of test cases is automatically generated, the design time of the test cases in the test schemes 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 items, sub-items, keywords, classifications, 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, classifications, defect numbers and using times of the test case samples.
The items to which the target test requirements and the test case samples belong are items to which the software to which the test requirements and the test case samples belong, and the sub-items to which the target test requirements and the test case samples belong are sub-items under the items to which the test requirements and the test case samples belong. The keywords of the target test requirements and test case samples are used to uniquely identify the target test requirements and test case samples, such as the numbers of the target test requirements and test case samples. The classification of the target test requirements and test case samples, such as speech, video and text, represents the test requirements and test case samples for speech, video and text in the software. Basic attributes of the target test requirements are as described for the target test requirements. The defect distribution condition of the target test requirement refers to the quantity distribution condition of each type of defect in the defects corresponding to the target test requirement. The number of defects 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 item, sub-item, key word and classification of the test case sample one by one. The basic attribute of the target test requirement corresponds to the use 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.
Based on the above embodiment, in this embodiment, 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 calculating method further includes: according to the classification of the test requirement samples in the test requirement library, the classification of the test case samples and the classification of the test defect samples in the test defect library, obtaining the association relationship among the test requirement samples, the test case samples and the test defect samples;
as shown in fig. 2, the present 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 between the three by classifying the tags. And uniformly classifying the test requirement samples, the test defect samples and the test case samples, and then correlating the test requirement samples, the test case samples or the test defect samples with the same classification.
The corresponding relation of the three is that one test requirement sample corresponds to a plurality of test case samples, such as a functional 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 so, acquiring a test defect sample corresponding to the target test requirement according to the association relation; counting the defect distribution situation of a test defect sample corresponding to the target test requirement, and taking the defect distribution situation as the defect distribution situation of the target test requirement;
if the test requirement library has the same test requirement sample as the target test requirement, the target test requirement can be found out 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 association relation between the test requirement samples and the test defect samples. If the target test requirement is not found from the test requirement library, no subsequent processing is performed.
And counting the defect distribution condition of the test defect sample corresponding to the target test requirement by adopting a classification counting method. For example, the number of serious defects, the number of medium defects and the number of low defects are counted, respectively, according to the classification of the importance of the defects to the software, including serious defects, medium defects and low defects. Taking the defect distribution situation obtained through statistics as the defect distribution situation of the target test requirement, wherein the defect distribution situation of the target test requirement is used for providing basic data for the calculation of the similarity. 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 association relation; counting the number of 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 association relation between the test case samples and the test defect samples. The number of test defect samples corresponding to each test case sample is counted, and the counting can be directly performed by adopting a cumulative summation mode. The statistically obtained number is used as the number of defects for each test case sample, which is used to provide the basic data for the calculation of the similarity.
Based on the above embodiment, in this embodiment, the similarity between the feature of the target test requirement and the feature of each test case sample in the test case library is calculated based on the similarity calculation method, including: converting the characteristics of the target test requirements 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 characteristic of the target test requirement and the vector of the characteristic of each test case sample based on a similarity calculation method.
Specifically, vectorization is realized on the characteristics of the target test requirement through an NLP algorithm, and a vector A is generated, namely
A=[a1,a2,a3,a4,a5,a6];
Wherein a 1 represents a vector generated by an item to which the target test requirement belongs, a 2 represents a vector generated by a sub-item to which the target test requirement belongs, a 3 represents a vector generated by a keyword of the target test requirement, a 4 represents a vector generated by classification of the target test requirement, a 5 represents a vector generated by a basic attribute of the target test requirement, and a 6 represents a vector generated by a defect distribution case of the target test requirement.
Vectorization is realized on the characteristics of test case samples in the test case library through an NLP algorithm, and a vector B is generated:
B=[b1,b2,b3,b4,b5,b6];
wherein b 1 corresponds to a vector of an item to which the test case sample belongs, b 2 corresponds to a vector of a sub-item to which the test case sample belongs, b 3 corresponds to a vector of a keyword of the test case sample, b 4 corresponds to a vector of classification of the test case sample, b 5 corresponds to a vector of the number of times of use of the test case sample, and a 6 corresponds to a vector of the number of defects of the test case sample.
The cosine similarity method can be used for calculating the cosine similarity between the target test requirement and the vector of the characteristic of each test case sample, namely:
On the basis of the above embodiment, after generating the test scheme according to the 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 defects measured by each test case sample; counting the detected defects to obtain a counting result; and generating test suggestions according to the statistical result.
Specifically, each test case sample in the test scheme is used for testing the software, and the defect actually tested by each test case sample on the software is obtained. And counting various characteristics of the actually measured defects, such as counting the number and proportion of defects with different severity levels, counting the occurrence times or probability of each defect, and the like. The present embodiment is not limited to the statistical features. After the test, a developer maintains the software according to the test result, and retests the software after the maintenance. The test advice generated from the statistics provides a reference for retesting the software.
Based on the above embodiment, in this embodiment, statistics is performed on the measured test defects, and a statistical result is obtained, including: classifying the measured test defects based on a classification algorithm; the number and proportion of each type of test defects measured are counted.
Specifically, emotion analysis is performed using a classification algorithm to obtain the classification of the actually measured defects, such as serious defects, medium defects, and low defects. The classification algorithm in this embodiment may be a KNN (K Nearest Neighbor ) algorithm. The distribution of each type of test defects, including the number and proportion of each type of test defects, was counted as shown in table 1.
TABLE 1 distribution case example of each type of test defects
Target test requirements | Number of serious defects | Number of medium defects | Number of low-level defects | Demand state |
A | 10 | 2 | 0 | High serious defect ratio |
B | 1 | 5 | 10 | High proportion of medium defects |
C | 0 | 10 | 4 | High defect rate in general |
D | 1 | 5 | 2 | High proportion of medium defects |
When the software is retested after maintenance, the retested test requirement is used as a target test requirement, and the test scheme is automatically generated by using the method in the embodiment. And adjusting the retested scheme according to the test proposal generated by the test. For example, when the proportion of the serious defects in the test advice is highest, checking whether the test case sample of the serious defects detected at this time exists in the retested scheme, and if not, adding the test case sample to the retested scheme.
Based on the above embodiment, in this embodiment, statistics is performed on the measured test defects, and a statistical result is obtained, including: the method comprises the steps of performing word segmentation on the purpose and description of each test case sample in a test scheme and the description of the measured test defects based on a word segmentation algorithm;
The word segmentation algorithm may adopt a barker word segmentation algorithm, but is not limited to the word segmentation algorithm.
Counting the occurrence probability of each word of the purpose of all test case samples in all words of the purpose of all test case samples, and selecting the word of the purpose of the test case sample as a first keyword according to the occurrence probability of each word of the purpose of all test case samples; counting the occurrence probability of each word described by all test case samples in all words described by all test case samples, and selecting the word described by the test case samples as a second keyword according to the occurrence probability of each word described by all test case samples; counting the occurrence probability of each word of the description of all the measured test defects in all the words of the description of all the measured test defects, and selecting the word of the description of the measured test defects as a third keyword according to the occurrence probability of each word of the description of all the measured test defects.
For example, the test scheme includes 5 test case samples, and after the purpose of the 5 test case samples is segmented, all the segmented word sets of the purpose of the 5 test case samples are obtained. If any word is present in the purpose of multiple test case samples, then the word is present in multiple in the word set. And counting the occurrence frequency of each word in the word segmentation set. And taking a plurality of segmented words with highest occurrence frequency as key words, or taking segmented words with occurrence frequency larger than a preset threshold value as key words. Based on the same method, keywords in the description of the test case sample and the description of the detected defect are counted. When the software is retested, the test staff increases or decreases the test samples in the retested scheme 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 tested test defect in the test solution of the target test requirement a, the extracted keywords are the interface data consistency test, the data consistency, and the interface data inconsistency, respectively.
TABLE 2 description of test case samples, description of purposes, and description examples of measured defects
In the embodiment, the NLP algorithm is used for analyzing the defects and the test cases measured after the test is performed by adopting the automatically generated test scheme, the test advice is generated, and the test advice provides test references for testers when the software is retested.
The system for generating a test solution provided by the invention is described below, and the system for generating a test solution described below and the method for generating a test solution described above can be referred to correspondingly.
As shown in fig. 4, the present embodiment provides a system for generating a test solution, including a calculation module 401 and a generation module 402, where:
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 the 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, a Euclidean distance method and the like. The present embodiment does not specifically limit the similarity calculation method. The characteristics of the target test requirement include basic attribute characteristics, statistical characteristics, and the like of the target test requirement, which are not particularly limited in this embodiment. The features of the test case sample include basic attribute features, statistical features, and the like of the test case sample, which are not particularly limited in this embodiment.
It should be noted that the features of the target test requirements should correspond to the features of each test case sample in the test case library one by 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. And respectively vectorizing the characteristics of the target test requirement and the test case samples to generate corresponding characteristic vectors, and calculating the similarity between the two characteristic vectors by using a similarity method, so that the similarity between each test case sample in the target test requirement and the test case library is obtained, and a data basis is provided for the 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, a test case sample meeting the requirement is selected, and then a test scheme is generated according to the selected test case sample, so that test references are provided for testers. The tester can adjust the test scheme according to experience and/or the last test result of the software, and retest the software by using the adjusted test scheme.
When test case samples are selected according to the similarity between the target test requirement and each test case sample, test case samples corresponding to the preset number of similarity before numerical ranking can be selected, and a test scheme is formed by the test case samples corresponding to the 20 similarity before numerical ranking. In addition, test case samples corresponding to the similarity greater than the preset threshold can be selected, and the mode and the number of the test case samples selected according to the similarity are not limited in this embodiment.
According to the embodiment, through the similarity calculation method, the similarity between the characteristics of the target test requirements and the characteristics of each test case sample in the test case library is calculated, a set of test schemes containing a plurality of test cases is automatically generated, the design time of the test cases in the test schemes 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 items, sub-items, keywords, classifications, 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, classifications, defect numbers and using times of the test case samples.
Based on the above embodiment, the embodiment further includes an obtaining module, configured to obtain an association relationship among the test requirement sample, the test case sample, and the test defect sample according to the classification of the test requirement sample in the test requirement 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 so, acquiring a test defect sample corresponding to the target test requirement according to the association 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 acquiring test defect samples corresponding to each test case sample according to the association 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 above embodiment, the calculation module in this embodiment is configured to: converting the characteristics of the target test requirements 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 characteristic of the target test requirement and the vector of the characteristic of each test case sample based on a similarity calculation method.
On the basis of the above embodiment, the embodiment further includes a supplement module, configured to test the software using each test case sample in the test scheme, obtain the defects measured by each test case sample, count the measured defects, 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 used for: classifying the measured test defects based on a classification algorithm; the number and proportion of each type of test defects measured are counted.
On the basis of the above embodiment, the supplementary module in this embodiment is used for: the method comprises the steps of performing word segmentation on the purpose and description of each test case sample in a test scheme and the description of the measured test defects based on a word segmentation algorithm; counting the occurrence probability of each word of the purpose of all test case samples in all words of the purpose of all test case samples, and selecting the word of the purpose of the test case sample as a first keyword according to the occurrence probability of each word of the purpose of all test case samples; counting the occurrence probability of each word described by all test case samples in all words described by all test case samples, and selecting the word described by the test case samples as a second keyword according to the occurrence probability of each word described by all test case samples; counting the occurrence probability of each word of the description of all the measured test defects in all the words of the description of all the measured test defects, and selecting the word of the description of the measured test defects as a third keyword according to the occurrence probability of each word of the description of all the measured test defects.
Fig. 5 illustrates a physical schematic diagram of an electronic device, as shown in fig. 5, which may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a method of generating a test plan, the method comprising: calculating the similarity between the characteristics of the target test requirements and the characteristics of each test case sample in the test case library based on a similarity calculation method; and selecting test case samples according to the similarity, and generating a test scheme according to the selected test case samples.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method of the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or 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, are capable of performing the method of generating a test solution provided by the methods described above, the method comprising: calculating the similarity between the characteristics of the target test requirements and the characteristics of each test case sample in the test case library based on a similarity calculation method; and selecting test case samples according to the similarity, and generating a test scheme according to the selected test case samples.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the methods of generating test solutions provided above, the method comprising: calculating the similarity between the characteristics of the target test requirements and the characteristics of each test case sample in the test case library based on a similarity calculation method; and selecting test case samples according to the similarity, and generating a test scheme according to the selected test case samples.
The apparatus embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solutions may be embodied essentially or in part in the form of a software product, which may be stored in a computer-readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the various embodiments or methods of some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (9)
1. A method of generating a test plan, comprising:
calculating the similarity between the characteristics of the target test requirements and the characteristics of each test case sample in the test case library based on a similarity calculation method;
Selecting the test case sample according to the similarity, and generating a test scheme according to the selected test case sample;
The similarity calculation method calculates the similarity between the characteristics of the target test requirement and the characteristics of each test case sample in the test case library, and the method further comprises the following steps:
acquiring an association relation among the test requirement sample, the test case sample and the test defect sample according to the classification of the test requirement sample in the test requirement 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 so, acquiring the test defect sample corresponding to the target test requirement according to the association relation;
Counting defect distribution conditions of the test defect sample corresponding to the target test requirement, and taking the defect distribution conditions as defect distribution conditions of the target test requirement;
obtaining a test defect sample corresponding to each test case sample according to the association relation;
Counting the number of test defect samples corresponding to each test case sample, and taking the number as the defect number of each test case sample.
2. The method of generating a test plan according to claim 1, wherein the characteristics of the target test requirement include items, sub-items to which the target test requirement belongs, keywords, classifications, 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, classifications, defect numbers and using times of the test case samples.
3. The method for generating a test solution according to claim 1, wherein 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 includes:
converting the characteristics of the target test requirements 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 characteristic of the target test requirement and the vector of the characteristic of each test case sample based on the similarity calculation method.
4. A method of generating a test plan according to any one of claims 1 to 3, further comprising, after generating the test plan from the selected test case samples:
Testing software by using each test case sample in the test scheme to obtain defects measured by each test case sample;
Counting the detected defects to obtain a counting result;
And generating a test suggestion according to the statistical result.
5. The method of generating a test plan of claim 4, wherein the counting the measured test defects to obtain statistics comprises:
classifying the measured test defects based on a classification algorithm;
The number and proportion of each type of test defects measured are counted.
6. The method of generating a test plan of claim 4, wherein the counting the measured test defects to obtain statistics comprises:
the method comprises the steps of performing word segmentation on the purpose and description of each test case sample and the description of the measured test defects in the test scheme based on a word segmentation algorithm;
Counting the occurrence probability of each word of the purpose of all test case samples in all words of the purpose of all test case samples, and selecting the word of the purpose of the test case sample as a first keyword according to the occurrence probability of each word of the purpose of all test case samples;
Counting the occurrence probability of each word described by all test case samples in all words described by all test case samples, and selecting the word described by all test case samples as a second keyword according to the occurrence probability of each word described by all test case samples;
Counting the occurrence probability of each word of the description of all the measured test defects in all the words of the description of all the measured test defects, and selecting the word of the description of the measured test defects as a third keyword according to the occurrence probability of each word of the description of all the measured test defects.
7. A system for generating a test plan, comprising:
the computing module is used for computing the similarity between the characteristics of the target test requirements and the characteristics of each test case sample in the test case library based on the similarity computing method;
The generation module is used for selecting the test case samples according to the similarity and generating a test scheme according to the selected test case samples;
The system further comprises an acquisition module, a test case analysis module and a test defect analysis module, wherein the acquisition module is used for acquiring the incidence relation among the test requirement sample, the test case sample and the test defect sample according to the classification of the test requirement sample in the test requirement 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 so, acquiring a test defect sample corresponding to the target test requirement according to the association 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 acquiring test defect samples corresponding to each test case sample according to the association 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.
8. 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 processor implements the steps of the method of generating a test solution according to any one of claims 1 to 6 when the program is executed by the processor.
9. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the method of generating a test solution according to any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110084287.0A CN112685324B (en) | 2021-01-21 | 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 | 2021-01-21 | Method and system for generating test scheme |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112685324A CN112685324A (en) | 2021-04-20 |
CN112685324B true CN112685324B (en) | 2024-06-28 |
Family
ID=75458873
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110084287.0A Active CN112685324B (en) | 2021-01-21 | 2021-01-21 | Method and system for generating test scheme |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112685324B (en) |
Families Citing this family (7)
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 |
CN113687826B (en) * | 2021-08-10 | 2024-02-02 | 中国人民解放军陆军工程大学 | Test case multiplexing system and method based on demand item extraction |
CN113672522B (en) * | 2021-10-25 | 2022-02-08 | 腾讯科技(深圳)有限公司 | Test resource compression method and related equipment |
CN114281677B (en) * | 2021-11-29 | 2025-09-12 | 神策网络科技(北京)有限公司 | Test case management method, device, equipment and medium based on multi-label system |
CN114817004B (en) * | 2022-04-07 | 2024-05-17 | 中国联合网络通信集团有限公司 | Test case generation method, device, equipment and readable storage medium |
CN115373996A (en) * | 2022-08-26 | 2022-11-22 | 中国银行股份有限公司 | Automatic test method, device and equipment |
CN119646466B (en) * | 2024-11-27 | 2025-08-05 | 北京赛目科技股份有限公司 | Evaluation method, device, electronic device and storage medium for autonomous driving test scenario set |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW202029022A (en) * | 2019-01-29 | 2020-08-01 | 中華電信股份有限公司 | Regression method and system based on system program infrastructure |
Family Cites Families (3)
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 |
CN111881037A (en) * | 2020-07-23 | 2020-11-03 | 云账户技术(天津)有限公司 | Test case management method, device and electronic equipment |
CN112231224A (en) * | 2020-10-30 | 2021-01-15 | 平安银行股份有限公司 | AI-based business system testing method, device, equipment and medium |
-
2021
- 2021-01-21 CN CN202110084287.0A patent/CN112685324B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW202029022A (en) * | 2019-01-29 | 2020-08-01 | 中華電信股份有限公司 | Regression method and system based on system program infrastructure |
Also Published As
Publication number | Publication date |
---|---|
CN112685324A (en) | 2021-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112685324B (en) | Method and system for generating test scheme | |
CN111612041A (en) | Abnormal user identification method and device, storage medium and electronic equipment | |
CN112131322B (en) | Time sequence classification method and device | |
CN114969334B (en) | Abnormal log detection method and device, electronic equipment and readable storage medium | |
CN109902731B (en) | A method and device for detecting performance faults based on support vector machines | |
CN119557607B (en) | Data tracing method and system based on big data and blockchain multidimensional features | |
CN111160329A (en) | Root cause analysis method and device | |
CN113934848B (en) | Data classification method and device and electronic equipment | |
CN117807481B (en) | Fault identification method, training device, training equipment and training medium | |
CN113656354A (en) | Log classification method, system, computer device and readable storage medium | |
CN112562736A (en) | Voice data set quality evaluation method and device | |
CN117131449A (en) | Data management-oriented anomaly identification method and system with propagation learning capability | |
CN115758183A (en) | Training method and device for log anomaly detection model | |
CN111723182B (en) | Key information extraction method and device for vulnerability text | |
CN115859128B (en) | Analysis method and system based on interaction similarity of archive data | |
CN117874236A (en) | Error log processing method and device, electronic equipment and readable storage medium | |
CN110457207A (en) | Test method and related equipment based on machine learning model | |
US20240152818A1 (en) | Methods for mitigation of algorithmic bias discrimination, proxy discrimination and disparate impact | |
CN118228993A (en) | Method, device, computer equipment and storage medium for determining demand priority | |
CN113535549B (en) | Expansion method, device and equipment of test data and computer readable storage medium | |
CN113268419B (en) | Method, device, equipment and storage medium for generating test case optimization information | |
US11520831B2 (en) | Accuracy metric for regular expression | |
CN115295134A (en) | Medical model evaluation method and device and electronic equipment | |
CN115034580A (en) | Quality evaluation method and device for fusion data set | |
JP2012014684A (en) | Processor, method and program for supporting integration of records |
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 | ||
GR01 | Patent grant |