Test defect recommendation method and device, electronic equipment and computer program product
By conducting short text analysis of the test defect description information entered by the user, combining the test defect database and user historical behavior data, a test defect recommendation list is generated, which solves the problem of inaccurate defect recommendations in the existing technology and improves testing efficiency and coverage.
Patent Information
- Application Number
- CN202411644343.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-02-11
AI Technical Summary
When using historical test defects, the prior art has low query efficiency, poor results accuracy, and low matching degree. It is impossible to accurately recommend the most similar historical defects through defect information entered by the user.
By obtaining the user's test defect description information, short text analysis is performed, defect keywords are extracted, and defect keywords are retrieved in the test defect database, the recommended weights of candidate test defects are generated, and the test defects are recommended to the user based on the user's historical behavior analysis data.
It improves the accuracy and pertinence of testing defect recommendations, solves the problem of fuzzy matching of keywords under traditional methods, effectively explores the value of historical testing defects, improves the efficiency of testing defect resolution, and accelerates the testing work process.
Smart Images

Figure CN119415400A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of test defect analysis, and in particular to a test defect recommendation method, device, electronic equipment, and computer program product. Background Art
[0002] Test defects are one of the most valuable test outputs. They fully record the defect phenomena, causes and solutions. Their value is mainly reflected in: First, they can be used to improve the test scope (use cases), check for deficiencies and fill in the gaps, and improve test coverage; second, they can be used to avoid defects in advance. Other projects can refer to the defect information and take measures in advance to prevent similar defects; third, they provide solutions or ideas for similar defects. After discovering defects, they can quickly locate historical similar defects and refer to the solutions or ideas for the defects.
[0003] At present, the test team has accumulated a large number of historical test defects, but there is no good solution for how to deeply explore and make good use of the value of these defect assets. The current use of defects mainly focuses on: first, classifying and counting defect information, sorting out typical problems, and publishing defect analysis reports; second, after discovering defects during the test process, use defect keywords to query whether there are similar defects in the history, in order to refer to corresponding solutions or ideas, but this method currently has problems such as low query efficiency, poor result accuracy, and low matching degree. The query results are closely related to the defect keywords entered by the user, and can only achieve the simplest fuzzy query. In addition, a lot of manual analysis work is required, and it is impossible to accurately recommend the most similar historical defects based on the defect information entered by the user. Summary of the invention
[0004] The embodiments of the present application provide a test defect recommendation method, device, electronic device, and computer program product to improve the accuracy of test defect recommendation.
[0005] The present application embodiment adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a test defect recommendation method, the test defect recommendation method comprising:
[0007] Acquire the test defect description information of the user, and perform short text analysis on the test defect description information to obtain a short text analysis result, wherein the short text analysis result includes defect keywords contained in the test defect description information;
[0008] Searching in a test defect database according to the short text analysis result to obtain a candidate test defect retrieval result;
[0009] Analyzing each candidate test defect in the candidate test defect retrieval result based on the test defect database to generate a recommendation weight for each candidate test defect;
[0010] Recommend test defects to the user according to the user historical behavior analysis data and the recommendation weight of each candidate test defect.
[0011] Optionally, the test defect database is constructed and maintained in the following manner:
[0012] Acquire historical test defect data, and perform structured processing on the historical test defect data to obtain structured historical test defect data;
[0013] Analyzing the structured historical test defect data using a defect keyword analysis strategy to obtain defect keyword data;
[0014] The test defect database is constructed according to the structured historical test defect data, the defect keyword data, and a mapping relationship between the structured historical test defect data and the defect keyword data.
[0015] Optionally, the defect keyword data includes the weight and status of the defect keyword, and the defect keyword data obtained by analyzing the structured historical test defect data using the defect keyword analysis strategy includes:
[0016] Performing short text analysis on the structured historical test defect data to obtain defect keywords contained in the structured historical test defect data;
[0017] According to the defect keywords included in the structured historical test defect data, a defect keyword weight algorithm is used to calculate the weight of each defect keyword included in the structured historical test defect data;
[0018] The status of each defect keyword is determined according to the weight of each defect keyword contained in the structured historical test defect data, and the status of the defect keyword includes a valid state and an invalid state.
[0019] Optionally, determining the status of each defect keyword according to the weight of each defect keyword included in the structured historical test defect data includes:
[0020] Displaying each defect keyword according to its weight to adjust and confirm the status of the defect keyword;
[0021] The constructing the test defect database according to the historical test defect data and the corresponding defect keyword analysis results includes:
[0022] After the status of the defect keyword is confirmed, the structured historical test defect data, the defect keyword data, and the mapping relationship between the structured historical test defect data and the defect keyword data are published to a test defect database.
[0023] Optionally, the analyzing each candidate test defect in the candidate test defect search result based on the test defect database to generate a recommendation weight for each candidate test defect includes:
[0024] Based on the test defect database, statistical analysis is performed on the defect data corresponding to each candidate test defect using the test defect analysis dimension to obtain a statistical value of each candidate test defect in the test defect analysis dimension;
[0025] According to the statistical value of each candidate test defect in the test defect analysis dimension, the test defect weight algorithm is used to calculate the recommended weight of each candidate test defect.
[0026] Optionally, the test defect analysis dimension is divided into a plurality of different categories, and the step of calculating the recommended weight of each candidate test defect by using a test defect weight algorithm according to the statistical value of each candidate test defect in the test defect analysis dimension includes:
[0027] For any candidate test defect, weight calculation is performed respectively according to the statistical values of the candidate test defect in the test defect analysis dimensions of each category to obtain the weight calculation results of each category;
[0028] The weight calculation results of each category are integrated to obtain the recommended weight of the candidate test defect.
[0029] Optionally, the recommending a test defect to the user according to the user historical behavior analysis data and the recommendation weight of each candidate test defect includes:
[0030] Determine whether there is matching historical behavior analysis data based on the user's test defect description information;
[0031] If so, the defect adoption result in the matched historical behavior analysis data is displayed to the user as the optimal recommendation result, and a first preset number of candidate test defects are displayed to the user according to the recommendation weight of each candidate test defect;
[0032] If not, a second preset number of candidate test defects are directly displayed to the user according to the recommendation weight of each candidate test defect.
[0033] Optionally, the test defect recommendation method further includes:
[0034] Determine, according to the candidate test defect retrieval result and the test defect database, all defect-related words corresponding to all candidate test defects;
[0035] Generate a guide word library according to all defect-related words corresponding to all candidate test defects and defect keywords included in the test defect description information;
[0036] Based on the guide word library, guide words are recommended to the user, so as to guide the user to supplement the test defect description information through the guide words.
[0037] In a second aspect, an embodiment of the present application further provides a test defect recommendation device, the test defect recommendation device comprising:
[0038] A short text analysis unit, used to obtain the test defect description information of the user, and perform short text analysis on the test defect description information to obtain a short text analysis result, wherein the short text analysis result includes defect keywords contained in the test defect description information;
[0039] A retrieval unit, configured to search in a test defect database according to the short text analysis result to obtain a candidate test defect retrieval result;
[0040] A defect analysis unit, configured to analyze each candidate test defect in the candidate test defect retrieval result based on the test defect database, and generate a recommended weight for each candidate test defect;
[0041] The first recommendation unit is used to recommend test defects to the user according to the user historical behavior analysis data and the recommendation weight of each candidate test defect.
[0042] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0043] Processor; and
[0044] A memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the aforementioned test defect recommendation methods.
[0045] In a fourth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements any of the aforementioned test defect recommendation methods.
[0046] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: the test defect recommendation method of the embodiment of the present application first obtains the test defect description information of the user, and performs short text analysis on the test defect description information to obtain the short text analysis result, and the short text analysis result includes the defect keywords contained in the test defect description information; then, according to the short text analysis result, a search is performed in the test defect database to obtain the candidate test defect retrieval result; then, each candidate test defect in the candidate test defect retrieval result is analyzed based on the test defect database to generate the recommendation weight of each candidate test defect; finally, the test defect is recommended to the user based on the user's historical behavior analysis data and the recommendation weight of each candidate test defect. The test defect recommendation method of the embodiment of the present application supports the interpretation of the test defect scenario information described in natural language, and combines the defect data retrieval technology to match the defects that the user may encounter, thereby improving the accuracy and pertinence of the test defect recommendation, solving the problem that only fuzzy matching of keywords is supported in the traditional method, effectively mining the value of historical test defects, opening up more application scenarios for defect reuse, improving the efficiency of test defect resolution, and accelerating the testing work process. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0048] Figure 1 A flowchart of a test defect recommendation method in an embodiment of the present application;
[0049] Figure 2 This is a schematic diagram of a batch processing flow of test defect data in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of an online transaction process recommended for testing defects in an embodiment of the present application;
[0051] Figure 4 This is a structural schematic diagram of a test defect recommendation device in an embodiment of the present application;
[0052] Figure 5 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0054] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0055] To facilitate understanding of the improvements of this application, several existing test defect analysis solutions are first introduced:
[0056] 1) Patent document 202011055410.8 proposes a test defect analysis method for classifying and counting test defects and performing correlation analysis on the statistical results, and discloses a defect analysis method for classifying and counting software structured defect lists and performing correlation analysis on the statistical results. The method can obtain defect distribution and defect status results, comprehensively analyze defects from more dimensions, discover potential correlations between defects, discover problems in software testing, improve testing efficiency, and improve the efficiency of the software development process.
[0057] 2) Patent document 202210723149.7 proposes a method for locating and analyzing system defects by tracking test data, and discloses a method and device for locating and analyzing system defects by tracking test data, which can be applied to the big data field or the financial field, and can improve the accuracy of test defect analysis. The method includes: recording each test data tested by each test case in each area of the system, determining the first data quantity of each test data, defect tracking each test data to determine each defect data, analyzing each defect data to determine multiple target defect data and the second data quantity of each target defect data, determining the proportion of each target defect data in each test data by the first data quantity and the second data quantity, and then reading the third data quantity corresponding to each previous defect data in the previous defect database, comparing the second data quantity with the third data quantity to obtain the comparison result, and based on the proportion value and the comparison result, performing test defect analysis on the system to obtain the defect analysis result of the system.
[0058] 3) Patent document 202010455310.8 proposes a method of combining test defect analysis with test defect tracking tools, and discloses a project test that calls a preset defect tracking tool to obtain defect data and perform model analysis.
[0059] None of the above methods solves the problem of how to accurately recommend historical defects and corresponding solutions based on the defect scenario information described in natural language input by the user. The above methods all focus on statistical analysis of defect information at the macro level, lack specific analysis of defect content, and do not deeply explore the value of defect utilization.
[0060] The first patent document focuses on classifying and counting defects, and performing correlation analysis on the statistical results based on target attributes, lacking a specific analysis of the defect content. The second patent document analyzes system quality by calculating the ratio of target defect data to defect data, and the ratio of target defect data to previous historical target defect data. The third patent document obtains defects encountered during the test of the project to be tested by calling the preset interface of the preset defect tracking tool, and generates alarm information based on the acquired defect indicators of the project to be tested and the set indicator threshold. The results of the defect analysis are mainly used to provide alarm functions.
[0061] Therefore, the existing solutions have at least the following problems:
[0062] 1) Currently, defect retrieval is mainly based on fuzzy matching of defect keywords, and does not support the interpretation of defect scenario information described in natural language.
[0063] 2) Historical defects retrieved only based on defect keywords lack specificity and have redundant information. It is impossible to recommend the closest defect based on semantics, and the defect matching degree is low.
[0064] 3) After fuzzy matching screens out defects, a lot of manual analysis work is still required, which is inefficient, testers are not willing to use it, and the value of defects cannot be fully reflected.
[0065] Based on this, the present application embodiment provides a test defect recommendation method, such as Figure 1 As shown, a flow chart of a test defect recommendation method in an embodiment of the present application is provided, and the test defect recommendation method at least includes the following steps S110 to S140:
[0066] Step S110 , obtaining the test defect description information of the user, and performing short text analysis on the test defect description information to obtain a short text analysis result, wherein the short text analysis result includes defect keywords contained in the test defect description information.
[0067] When recommending test defects, the user's test defect description information needs to be obtained first. The user can describe the test defect to be analyzed by inputting natural language. The test defect description information input by the user is used as the target short text, and the target short text is analyzed to obtain the short text analysis result. Specifically, the target short text can be segmented by a word segmenter loaded with keyword resources, so as to analyze the defect keywords contained in the test defect description information input by the user.
[0068] Step S120 , searching in a test defect database according to the short text analysis result to obtain a candidate test defect search result.
[0069] The embodiment of the present application constructs a test defect database based on massive historical test defect data. The test defect database mainly stores historical test defect data, defect keyword data, and mapping relationship data between test defects and defect keywords.
[0070] Based on the test defect database constructed above, the short text analysis results obtained in the above steps are searched and matched in the test defect database to match the test defect data associated with the defect keywords contained in the test defect description information input by the user as candidate test defect search results.
[0071] Step S130 , analyzing each candidate test defect in the candidate test defect search result based on the test defect database, and generating a recommendation weight for each candidate test defect.
[0072] Since the test defect database contains historical test defect data, defect keyword data, and the mapping relationship between test defects and defect keywords, the embodiment of the present application can use the test defect data resources in the test defect database to perform multi-dimensional statistical analysis on the multiple candidate test defects obtained in the above steps, and calculate the recommendation weight of each candidate test defect. The larger the recommendation weight of the test defect, the more relevant it is to the test defect information currently described by the user, and the more it will be recommended first.
[0073] Step S140 , recommending test defects to the user according to the user historical behavior analysis data and the recommendation weight of each candidate test defect.
[0074] The user's historical behavior analysis data refers to the analysis of the test defect data adopted by the user in the historical recommendation process. If the user has adopted relevant test defect data before, it will have important reference value for the current test defect recommendation. Therefore, the embodiment of the present application needs to combine the user's historical behavior analysis data and the recommendation weight of each candidate test defect to recommend test defects to the user, thereby improving the accuracy of the recommendation.
[0075] The test defect recommendation method of the embodiment of the present application supports the interpretation of test defect scenario information described in natural language, and combines defect data retrieval technology to match defects that users may encounter, thereby improving the accuracy and pertinence of test defect recommendations, solving the problem that only fuzzy matching of keywords is supported under traditional methods, effectively mining the value of historical test defects, opening up more application scenarios for defect reuse, improving the efficiency of test defect resolution, and accelerating the testing work process.
[0076] In some embodiments of the present application, the test defect database is constructed and maintained in the following manner: historical test defect data is obtained, and the historical test defect data is structured to obtain structured historical test defect data; the structured historical test defect data is analyzed using a defect keyword analysis strategy to obtain defect keyword data; the test defect database is constructed according to the structured historical test defect data, the defect keyword data, and the mapping relationship between the structured historical test defect data and the defect keyword data.
[0077] When constructing a test defect database, the embodiment of the present application can first collect historical test defect data and perform structured processing. For example, historical test defect data can be obtained by exporting from a defect management system, collecting and archiving defect files, etc., and then using a pre-defined standardized template to perform structured sorting of defects, designing a database table structure based on the standardized template, and then writing file parsing and defect storage code, and importing the structured sorted defect data into the database.
[0078] Then, the defect keyword analysis strategy is used to parse the structured historical test defect data to extract key information of the test defect, such as problem description, solution, severity level, etc. Defect analysis mainly involves word segmentation processing, which obtains defect short texts one by one from the test defect database, and decomposes the short texts into basic language units such as words, phrases, sentences, etc. through the keyword library and word segmenter, collectively referred to as keywords, and stores the keywords and their statistical information in the test defect database. Finally, it is also necessary to store the correspondence between the above structured test defect data and defect keyword data in the test defect database to provide data support for subsequent defect analysis.
[0079] In some embodiments of the present application, the defect keyword data includes the weight and status of the defect keywords, and the use of the defect keyword analysis strategy to analyze the structured historical test defect data to obtain the defect keyword data includes: performing short text analysis on the structured historical test defect data to obtain the defect keywords contained in the structured historical test defect data; calculating the weight of each defect keyword contained in the structured historical test defect data using a defect keyword weight algorithm based on the defect keywords contained in the structured historical test defect data; determining the status of each defect keyword based on the weight of each defect keyword contained in the structured historical test defect data, and the status of the defect keyword includes a valid state and an invalid state.
[0080] The embodiment of the present application can first use short text analysis technology to analyze the keywords involved in the test defect database and mark them as pending status, and collect multiple dimensional data of the keywords, and combine the weight algorithm to calculate the weight of each keyword to determine the importance of different keywords in all defects, so as to provide basic data and auxiliary decision-making data for subsequent keyword confirmation.
[0081] The steps for calculating keyword weights in this embodiment of the application are as follows:
[0082] 1) Data statistics: collect relevant data of keywords from various dimensions, including the number of times the keyword appears, the average severity level of the defect, the average resolution time of the defect, the number of views of the defect, the number of times the defect is adopted, and whether it is a historically valid keyword.
[0083] 2) Weight classification calculation: Use principal component analysis to calculate some dimensional data, and then use business weighting method to perform weighted calculation on the calculation results and other dimensional data.
[0084] 3) Comprehensive calculation: Comprehensively calculate the calculation results of the previous stage to obtain the total weight of each keyword.
[0085] The specific algorithm of keyword weight is as follows:
[0086] 1) Data statistics: Taking a certain keyword as an example, the statistical results are as follows:
[0087] Dimension A: The number of times the keyword appears in the defect description is a;
[0088] Dimension B: The average severity level of all defects in which the keyword appears in the defect description is b;
[0089] Dimension C: The average resolution time for all defects where the keyword appears in the defect description is c;
[0090] Dimension D: The cumulative value of all defect views where the keyword appears in the defect description is d;
[0091] Dimension E: The cumulative value of all defect adoption times that the keyword appears in the defect description is e;
[0092] Dimension F: If the keyword is a historically valid keyword, f=1, otherwise f=0.
[0093] 2) Weight classification calculation:
[0094] First, for a defect, use the principal component analysis method to calculate the dimensions A, B, C, and D to obtain the value PCA(a,b,c,d). Then, perform maximum normalization on PCA(a,b,c,d) and e, and finally use the maximum normalization result and f together to calculate the final weight using the business weighting method. It should be noted that when the value of f is 0, it has no effect on the weight calculation result; when the value of f is 1, the weight is increased by γ as a whole.
[0095] The weight classification calculation mainly considers whether the weight calculation result is related to the data distribution of the statistical indicator data and whether there are subjective factors. If it is related to the data distribution, the principal component analysis method can be used to calculate the impact weights of different dimensions.
[0096] 3) Comprehensive calculation: Weight the results of the classification calculation in the previous step to obtain the final weighted result.
[0097]
[0098] Among them, α1, β1, and γ1 are custom coefficients, and α1+β1=1. a, b, c, and d are the statistical values of the keyword on dimensions A, B, C, and D. PCA(a,b,c,d) is the value obtained by calculating these statistical values using principal component analysis. max[PCA(A,B,C,D)] represents the maximum value of all defects calculated using principal component analysis. max(E) represents the maximum value of all defects on dimension E.
[0099] In some embodiments of the present application, determining the status of each defect keyword according to the weight of each defect keyword contained in the structured historical test defect data includes: displaying each defect keyword according to the weight of each defect keyword to adjust and confirm the status of the defect keyword; constructing the test defect database according to the historical test defect data and the corresponding defect keyword analysis results includes: after the status of the defect keyword is confirmed, publishing the structured historical test defect data, the defect keyword data, and the mapping relationship between the structured historical test defect data and the defect keyword data into the test defect database.
[0100] The embodiment of the present application provides a keyword display and adjustment function, which can reasonably screen and classify the defect keywords to be processed, and produce resources such as effective keywords and invalid keywords, thereby realizing iterative optimization of keyword resources and providing core data for subsequent resource release and online transactions. The embodiment of the present application visualizes the keywords to be processed obtained by defect analysis and the keyword weights obtained by weight calculation, and provides ease of use capabilities such as screening and sorting, while combining the capabilities of keyword historical status tagging, keyword weight display, keyword status adjustment, etc., to finally complete the confirmation of keywords.
[0101] Specifically, the keyword display is displayed in descending order according to the keyword weight ranking calculated in the above embodiment. Here, it is necessary to first eliminate historical invalid keywords, and the keywords ranked TOP k by weight can also be highlighted. The embodiment of the present application supports two keyword adjustment methods: automatic and manual. Automatic adjustment is to mark the keywords ranked TOP k by weight as valid keywords, and manual adjustment is that the user manually adjusts the keywords on the display page based on his own experience and weight ranking. If the keywords to be processed are manually marked as valid keywords and invalid keywords, it can achieve iterative optimization of the list of keywords to be processed.
[0102] In some embodiments of the present application, the present application embodiment can publish the test defect data, the confirmed keyword data, and the mapping data of the test defect and the keyword as a whole, and trigger the reconstruction of the inverted index of the document database, the version update of the mapping data, and the hot loading of the keyword resources of the word segmentation component, thereby realizing the hot update of the online transaction data. After the resources are released, the online transaction can provide users with accurate defect recommendation services based on the latest data.
[0103] Specifically, the resource release of the embodiment of the present application mainly includes test defect resource release, valid keyword / invalid keyword release, and test defect and keyword mapping resource release.
[0104] 1) Defect resource publishing: Clear the defect resources in the document database, and then publish the structured test defect data to the document database by calling the batch interface;
[0105] 2) Release of valid keywords / invalid keywords: The embodiment of the present application provides a valid keyword / invalid keyword query interface, through which a list of defective keywords can be queried. When resources are released, the header information returned by the query interface will be updated to trigger the hot loading mechanism of the word segmentation component, thereby realizing the release of keywords.
[0106] 3) Release of defect and keyword mapping resources: Triggering the defect and keyword mapping relationship generation logic will analyze the mapping relationship based on the latest released resources and generate a new version in the database, and set the version to be valid.
[0107] In some embodiments of the present application, analyzing each candidate test defect in the candidate test defect retrieval results based on the test defect database to generate a recommended weight for each candidate test defect includes: based on the test defect database, using the test defect analysis dimension to perform a statistical analysis on the defect data corresponding to each candidate test defect to obtain the statistical value of each candidate test defect in the test defect analysis dimension; according to the statistical value of each candidate test defect in the test defect analysis dimension, using the test defect weight algorithm to calculate the recommended weight of each candidate test defect.
[0108] The above embodiment can be regarded as a process of batch processing historical test defect data and building a test defect database. Figure 2 As shown, a schematic diagram of a batch processing process for testing defect data in an embodiment of the present application is provided.
[0109] In some embodiments of the present application, the test defect analysis dimension is divided into multiple different categories, and the recommended weight of each candidate test defect is calculated using a test defect weight algorithm based on the statistical value of each candidate test defect in the test defect analysis dimension, including: for any candidate test defect, weight calculation is performed separately according to the statistical value of the candidate test defect in the test defect analysis dimension of each category to obtain the weight calculation results of each category; the weight calculation results of each category are integrated to obtain the recommended weight of the candidate test defect.
[0110] The main steps of calculating the defect weight in the embodiment of the present application are as follows:
[0111] 1) Data statistics: collect relevant data of defects from various dimensions. These data include the number of valid keywords contained in the defect, the severity level of the defect, the time it takes to resolve the defect, the number of defect views, the relevance score between the defect and the input information, and the number of defect adoptions.
[0112] 2) Weight classification calculation: Use principal component analysis to calculate some dimensional data, and then use business weighting method to perform weighted calculation on the calculation results and other dimensional data.
[0113] 3) Comprehensive calculation: Comprehensively calculate the calculation results of the previous stage to obtain the total weight of each defect.
[0114] The specific algorithm of defect weight is as follows:
[0115] 1) Data statistics: Taking a certain defect as an example, the statistical results are as follows:
[0116] Dimension A: The number of valid keywords contained in the defect is a;
[0117] Dimension B: The severity level of this defect is b;
[0118] Dimension C: The defect resolution time is c;
[0119] Dimension D: The number of views of the defect is d;
[0120] Dimension E: The relevance of the defect to the input information is scored as e;
[0121] Dimension F: The number of times the defect is adopted is f.
[0122] 2) Weight classification calculation:
[0123] First, for a certain defect, use the principal component analysis method to calculate the dimensions A, B, C, and D to obtain the value PCA (a, b, c, d). Then, based on the real-time search results, PCA (a, b, c, d) and e and f are normalized to the maximum value, and finally the result of the maximum value normalization is calculated using the business weighting method to obtain the final weight.
[0124] Similar to the calculation strategy of defect keyword weights, the embodiment of the present application also needs to calculate the defect weights from multiple statistical dimensions. Considering that the data distribution of different statistical dimensions and subjective factors may affect the results of the weight calculation, a weight classification algorithm is also used here to calculate the defect weights.
[0125] 3) Comprehensive calculation: Weight the results of the classification calculation in the previous step to obtain the final weighted result.
[0126]
[0127] Among them, α2, β2, and γ2 are custom coefficients, and α2+β2+γ2=1. a, b, c, and d are the statistical values of the defect in dimensions A, B, C, and D. PCA(a, b, c, d) is the value obtained by calculating these statistical values through principal component analysis. max[PCA(A, B, C, D)] represents the maximum value of all defects in the search results calculated by principal component analysis. And max(E) and max(F) represent the maximum values of all defects in the search results in dimensions E and F.
[0128] In some embodiments of the present application, recommending test defects to the user based on the user's historical behavior analysis data and the recommendation weights of each candidate test defect includes: determining whether there is matching historical behavior analysis data based on the user's test defect description information; if so, presenting the defect adoption result in the matching historical behavior analysis data to the user as the optimal recommendation result, and presenting a first preset number of candidate test defects to the user based on the recommendation weights of each candidate test defect; if not, directly presenting a second preset number of candidate test defects to the user based on the recommendation weights of each candidate test defect.
[0129] When recommending test defects to users based on the user's historical behavior analysis data and the recommended weights of each candidate test defect, you can first perform scene matching in the historical behavior analysis data based on the user's current test defect description information. If there is historical behavior analysis data associated with the test defect currently described by the user in the historical behavior analysis data, the defect data historically adopted by the user is determined based on the matching historical behavior analysis data, and the defect data historically adopted by the user is displayed first. At the same time, the top-ranked candidate test defects can be displayed to the user based on the recommended weights of each candidate test defect for the user's reference and selection. In the case of the same weight, the results with high adoption and the most recent update time can be displayed first. If there is no matching historical behavior analysis data, the candidate test defects are directly sorted and displayed according to the weight.
[0130] It should be noted that the specific number of test defects displayed to the user can be flexibly set by those skilled in the art according to actual needs, and is not specifically limited here.
[0131] In some embodiments of the present application, the test defect recommendation method also includes: determining the full set of defect-associated words corresponding to all candidate test defects based on the candidate test defect retrieval results and the test defect database; generating a guide word library based on the full set of defect-associated words corresponding to all candidate test defects and defect keywords contained in the test defect description information; and recommending guide words to the user based on the guide word library to guide the user to supplement the test defect description information through the guide words.
[0132] Taking into account that the test defect description information input by the user once may not accurately reflect the user's needs, the embodiment of the present application also provides a hot word guidance function, which guides the user to supplement and improve the test defect description information through keywords, thereby further improving the recommendation accuracy.
[0133] Specifically, the valid keywords covered by all candidate test defects initially retrieved can be constructed into a valid keyword list PreKeywordList, which represents the full amount of valid keywords contained in the candidate test defects, and the valid keywords covered by the test defect description information input by the user can be constructed into a valid keyword list InputKeywordList, which represents the valid keywords involved in the user's current description information. The two valid keyword lists are subtracted (PreKeywordList-InputKeywordList) to obtain a guide word library, which represents keywords that are not mentioned in the user's description information but may be related to the user's test defects. Therefore, the user can be further guided to supplement the description information based on the keywords in the guide word library.
[0134] In the embodiment of the present application, the guide words can be sorted in descending order according to the number of times they appear in the preliminary candidate test defect search results, and the top n guide words can be recommended to the user according to the sorting. It is determined whether the user accepts the guidance. If the user supplements the defect description according to the guide word, the online transaction process of the test defect recommendation is repeated. If the user does not supplement, the recommendation is terminated. Finally, the user's browsing and adoption of the displayed defects are recorded to provide data support for defect weight calculation or hot word guidance.
[0135] The above embodiment can be regarded as a real-time online transaction process, that is, recommending test defects based on the results of batch processing. Figure 3 As shown, a schematic diagram of an online transaction process for testing defect recommendation in an embodiment of the present application is provided.
[0136] In summary, the key points of the test defect recommendation method of this application mainly include:
[0137] 1) Test defect analysis model: This application constructs a test defect analysis model. This model is based on short text analysis technology, keyword weight algorithm and model self-optimization capability. It can realize automatic analysis of massive historical defects, produce high-value defect keyword data resources, and build a defect index library based on defect and keyword data resources, laying the foundation for subsequent more accurate user intent identification and test defect recommendation.
[0138] 2) User intent identification: Based on the defect analysis model, combined with hot word guidance and user behavior analysis technology, effective identification of user intent is achieved, thereby providing support for accurate defect recommendations.
[0139] 3) Accurate defect recommendation: Based on short text analysis technology, it can interpret defect scenario information described in natural language. Based on the defect index library, it uses defect weight algorithm, hot word guidance, user behavior analysis, etc. to achieve accurate recommendation of historical defects and corresponding solutions.
[0140] 4) Application in the testing field: In order to improve the efficiency of defect resolution during the testing process and make full use of the value of historical defect assets, short text analysis technology is introduced into the testing field, innovative defect analysis models are created, user intent is identified, and accurate defect recommendations are achieved. This can effectively solve the problems of low utilization of the value of historical test defects in the testing field and cumbersome use, creating more possibilities for test defect applications.
[0141] Compared with the prior art, this application has achieved at least the following technical effects:
[0142] 1) This application supports the interpretation of test defect scenario information described in natural language, and guides users to enrich the description information, so as to recommend test defects more accurately, solving the problem that only keyword fuzzy matching is supported in the traditional method;
[0143] 2) The defect retrieval efficiency under the traditional method is low and the accuracy is poor. This application combines the defect analysis model and user intent recognition to recommend defects. The recommended defects are highly accurate and targeted, which effectively improves the efficiency and accuracy of defect retrieval;
[0144] 3) Effectively tapped the value of historical test defects, opened up more application scenarios for defect reuse, improved the efficiency of test defect resolution, and accelerated the testing work process.
[0145] The present application embodiment also provides a test defect recommendation device 400, such as Figure 4 As shown, a schematic diagram of the structure of a test defect recommendation device in an embodiment of the present application is provided, wherein the test defect recommendation device 400 includes: a short text analysis unit 410, a retrieval unit 420, a defect analysis unit 430 and a first recommendation unit 440, wherein:
[0146] The short text analysis unit 410 is used to obtain the test defect description information of the user, and perform short text analysis on the test defect description information to obtain a short text analysis result, wherein the short text analysis result includes defect keywords contained in the test defect description information;
[0147] A retrieval unit 420, configured to search in a test defect database according to the short text analysis result to obtain a candidate test defect retrieval result;
[0148] A defect analysis unit 430 is used to analyze each candidate test defect in the candidate test defect search result based on the test defect database, and generate a recommended weight for each candidate test defect;
[0149] The first recommendation unit 440 is configured to recommend a test defect to the user according to the user historical behavior analysis data and the recommendation weight of each candidate test defect.
[0150] In some embodiments of the present application, the test defect database is constructed and maintained in the following manner: historical test defect data is obtained, and the historical test defect data is structured to obtain structured historical test defect data; the structured historical test defect data is analyzed using a defect keyword analysis strategy to obtain defect keyword data; the test defect database is constructed according to the structured historical test defect data, the defect keyword data, and the mapping relationship between the structured historical test defect data and the defect keyword data.
[0151] In some embodiments of the present application, the defect keyword data includes the weight and status of the defect keywords, and the test defect database is constructed and maintained in the following manner: performing short text analysis on the structured historical test defect data to obtain the defect keywords contained in the structured historical test defect data; calculating the weight of each defect keyword contained in the structured historical test defect data using a defect keyword weight algorithm based on the defect keywords contained in the structured historical test defect data; determining the status of each defect keyword based on the weight of each defect keyword contained in the structured historical test defect data, and the status of the defect keyword includes a valid state and an invalid state.
[0152] In some embodiments of the present application, the test defect database is constructed and maintained in the following manner: each defect keyword is displayed according to the weight of each defect keyword to adjust and confirm the status of the defect keyword; the construction of the test defect database based on the historical test defect data and the corresponding defect keyword analysis results includes: after the status of the defect keyword is confirmed, the structured historical test defect data, the defect keyword data, and the mapping relationship between the structured historical test defect data and the defect keyword data are published to the test defect database.
[0153] In some embodiments of the present application, the defect analysis unit 430 is specifically used to: based on the test defect database, use the test defect analysis dimension to perform statistical analysis on the defect data corresponding to each candidate test defect to obtain the statistical value of each candidate test defect in the test defect analysis dimension; according to the statistical value of each candidate test defect in the test defect analysis dimension, use the test defect weight algorithm to calculate the recommended weight of each candidate test defect.
[0154] In some embodiments of the present application, the test defect analysis dimension is divided into multiple different categories, and the defect analysis unit 430 is specifically used to: for any candidate test defect, perform weight calculations according to the statistical values of the candidate test defect in the test defect analysis dimensions of each category to obtain weight calculation results for each category; and fuse the weight calculation results for each category to obtain a recommended weight for the candidate test defect.
[0155] In some embodiments of the present application, the first recommendation unit 440 is specifically used to: determine whether there is matching historical behavior analysis data based on the user's test defect description information; if so, display the defect adoption result in the matching historical behavior analysis data as the optimal recommendation result to the user, and display a first preset number of candidate test defects to the user based on the recommendation weight of each candidate test defect; if not, directly display a second preset number of candidate test defects to the user based on the recommendation weight of each candidate test defect.
[0156] In some embodiments of the present application, the test defect recommendation device 400 also includes: a determination unit, used to determine the full amount of defect-associated words corresponding to all candidate test defects based on the candidate test defect retrieval results and the test defect database; a generation unit, used to generate a guide word library based on the full amount of defect-associated words corresponding to all candidate test defects and the defect keywords contained in the test defect description information; a second recommendation unit, used to recommend guide words to the user based on the guide word library, so as to guide the user to supplement the test defect description information through the guide words.
[0157] It can be understood that the above-mentioned test defect recommendation device can implement each step of the test defect recommendation method provided in the above-mentioned embodiment, and the relevant explanations about the test defect recommendation method are applicable to the test defect recommendation device, which will not be repeated here.
[0158] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 5At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0159] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0160] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0161] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a test defect recommendation device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0162] Acquire the test defect description information of the user, and perform short text analysis on the test defect description information to obtain a short text analysis result, wherein the short text analysis result includes defect keywords contained in the test defect description information;
[0163] Searching in a test defect database according to the short text analysis result to obtain a candidate test defect retrieval result;
[0164] Analyzing each candidate test defect in the candidate test defect retrieval result based on the test defect database to generate a recommendation weight for each candidate test defect;
[0165] Recommend test defects to the user according to the user historical behavior analysis data and the recommendation weight of each candidate test defect.
[0166] The above application Figure 1 The method performed by the test defect recommendation device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0167] The present application also provides a computer program product, including a computer program or an instruction, which, when executed by a processor, implements any of the aforementioned test defect recommendation methods, and is specifically used to execute:
[0168] Acquire the test defect description information of the user, and perform short text analysis on the test defect description information to obtain a short text analysis result, wherein the short text analysis result includes defect keywords contained in the test defect description information;
[0169] Searching in a test defect database according to the short text analysis result to obtain a candidate test defect retrieval result;
[0170] Analyzing each candidate test defect in the candidate test defect retrieval result based on the test defect database to generate a recommendation weight for each candidate test defect;
[0171] Recommend test defects to the user according to the user historical behavior analysis data and the recommendation weight of each candidate test defect.
[0172] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0173] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0174] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0175] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0176] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0177] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0178] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0179] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0180] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0181] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A test defect recommendation method, characterized in that: The test defect recommendation method comprises: Acquire the test defect description information of the user, and perform short text analysis on the test defect description information to obtain a short text analysis result, wherein the short text analysis result includes defect keywords contained in the test defect description information; Searching in a test defect database according to the short text analysis result to obtain a candidate test defect retrieval result; Analyzing each candidate test defect in the candidate test defect retrieval result based on the test defect database to generate a recommendation weight for each candidate test defect; Recommend test defects to the user according to the user historical behavior analysis data and the recommendation weight of each candidate test defect.
2. The test defect recommendation method according to claim 1, characterized in that: The test defect database is constructed and maintained in the following manner: Acquire historical test defect data, and perform structured processing on the historical test defect data to obtain structured historical test defect data; Analyzing the structured historical test defect data using a defect keyword analysis strategy to obtain defect keyword data; The test defect database is constructed according to the structured historical test defect data, the defect keyword data, and a mapping relationship between the structured historical test defect data and the defect keyword data.
3. The test defect recommendation method according to claim 2, characterized in that: The defect keyword data includes the weight and status of the defect keyword. The defect keyword analysis strategy is used to analyze the structured historical test defect data to obtain the defect keyword data including: Performing short text analysis on the structured historical test defect data to obtain defect keywords contained in the structured historical test defect data; According to the defect keywords included in the structured historical test defect data, a defect keyword weight algorithm is used to calculate the weight of each defect keyword included in the structured historical test defect data; The status of each defect keyword is determined according to the weight of each defect keyword contained in the structured historical test defect data, and the status of the defect keyword includes a valid state and an invalid state.
4. The test defect recommendation method according to claim 3, characterized in that: The determining the status of each defect keyword according to the weight of each defect keyword included in the structured historical test defect data includes: Displaying each defect keyword according to its weight to adjust and confirm the status of the defect keyword; The constructing the test defect database according to the historical test defect data and the corresponding defect keyword analysis results includes: After the status of the defect keyword is confirmed, the structured historical test defect data, the defect keyword data, and the mapping relationship between the structured historical test defect data and the defect keyword data are published to a test defect database.
5. The test defect recommendation method according to claim 1, characterized in that: The step of analyzing each candidate test defect in the candidate test defect search result based on the test defect database to generate a recommendation weight for each candidate test defect includes: Based on the test defect database, statistical analysis is performed on the defect data corresponding to each candidate test defect using the test defect analysis dimension to obtain a statistical value of each candidate test defect in the test defect analysis dimension; According to the statistical value of each candidate test defect in the test defect analysis dimension, the test defect weight algorithm is used to calculate the recommended weight of each candidate test defect.
6. The test defect recommendation method according to claim 5, characterized in that: The test defect analysis dimension is divided into a plurality of different categories, and the method of calculating the recommended weight of each candidate test defect by using a test defect weight algorithm according to the statistical value of each candidate test defect in the test defect analysis dimension includes: For any candidate test defect, weight calculation is performed respectively according to the statistical values of the candidate test defect in the test defect analysis dimensions of each category to obtain the weight calculation results of each category; The weight calculation results of each category are integrated to obtain the recommended weight of the candidate test defect.
7. The test defect recommendation method according to claim 1, characterized in that: The recommending test defects to the user according to the user historical behavior analysis data and the recommendation weights of each candidate test defect includes: Determine whether there is matching historical behavior analysis data based on the user's test defect description information; If so, the defect adoption result in the matched historical behavior analysis data is displayed to the user as the optimal recommendation result, and a first preset number of candidate test defects are displayed to the user according to the recommendation weight of each candidate test defect; If not, a second preset number of candidate test defects are directly displayed to the user according to the recommendation weight of each candidate test defect.
8. The test defect recommendation method according to claim 1, characterized in that: The test defect recommendation method further includes: Determine, according to the candidate test defect retrieval result and the test defect database, all defect-related words corresponding to all candidate test defects; Generate a guide word library according to all defect-related words corresponding to all candidate test defects and defect keywords included in the test defect description information; Based on the guide word library, guide words are recommended to the user, so as to guide the user to supplement the test defect description information through the guide words.
9. A test defect recommendation device, characterized in that: The test defect recommendation device comprises: A short text analysis unit, used to obtain the test defect description information of the user, and perform short text analysis on the test defect description information to obtain a short text analysis result, wherein the short text analysis result includes defect keywords contained in the test defect description information; A retrieval unit, configured to search in a test defect database according to the short text analysis result to obtain a candidate test defect retrieval result; A defect analysis unit, configured to analyze each candidate test defect in the candidate test defect retrieval result based on the test defect database, and generate a recommended weight for each candidate test defect; The first recommendation unit is used to recommend test defects to the user according to the user historical behavior analysis data and the recommendation weight of each candidate test defect.
10. An electronic device, comprising: processor; as well as A memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the test defect recommendation method according to any one of claims 1 to 8.
11. A computer program product, comprising a computer program or an instruction, wherein the computer program or the instruction, when executed by a processor, implements the test defect recommendation method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Project test defect analysis method, device, equipment and storage medium
CN111611172A
Software test defect analysis method and device
CN112363911A
Test defect analysis method and device
CN115203025A
Cited By
Defect knowledge circulation system
US12608542B2
Defect knowledge circulation system
US20250278561A1