A test asset recommendation method and system integrating user attributes
By analyzing users' explicit and implicit attributes, forming a preference matrix, and optimizing recommendations, the problem of inaccurate test asset recommendations in existing technologies is solved, and accurate test asset recommendations are achieved.
Patent Information
- Application Number
- CN202111484104.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2041-12-07
AI Technical Summary
Existing technologies for asset retrieval and recommendation fail to fully consider user attributes, resulting in inaccurate recommendation results that cannot meet user needs.
By analyzing users' explicit and implicit attributes, a preference matrix between users and test assets is formed. Matrix factorization and linear regression algorithms are used to optimize the preference values and recommend the most suitable test assets for users.
It enables precise recommendation of test assets based on the user's comprehensive attributes, helping users find the most suitable test assets for themselves.
Smart Images

Figure CN114218090B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer software testing technology, and in particular to a method and system for recommending test assets based on comprehensive user attributes. Background Technology
[0002] As the software testing industry continues to develop and improve, the scale of software testing assets is also growing larger. Currently, software testing assets include, but are not limited to: test case libraries, test case writing elements, functional points of the system under test, test rule points, automated test case libraries, business journeys, test data construction, test-related technologies, historical production events, etc.
[0003] For an ordinary user, it is often difficult to actively obtain all relevant test assets. Even if the test assets support the search function, users may encounter situations where the search keywords are not clear enough, resulting in inaccurate search results. Furthermore, the test assets obtained may not be what the user actually wants.
[0004] A key problem is that existing technologies for retrieving and recommending test assets cannot effectively integrate user attributes. They often only consider a specific part of the user attributes as the basis for recommendations, such as recommending test assets based solely on the user's job title or main work objects, without comprehensively considering user attributes. As a result, the test asset retrieval and recommendation results often fail to meet the user's needs. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention proposes a test asset recommendation method and system that integrates user attributes. It analyzes the explicit and implicit attributes of users and test assets, quantifies the analysis results, and forms a preference matrix between users and test assets. Different test asset recommendation results can be obtained for different users, thereby accurately recommending test assets to users and helping clients find the most suitable test assets.
[0006] To achieve the above objectives, the technical solution adopted by the present invention includes:
[0007] A test asset recommendation method that integrates user attributes, characterized by comprising:
[0008] Obtain the hidden attributes of the target user, including the number of times the target user searches for and views the test asset;
[0009] The initial preference value of the target user for the test asset is calculated based on the target user's hidden attributes:
[0010] The initial preference values of each target user for each test asset are integrated to obtain an initial preference value matrix, in which the positions of the initial preference value of 0 are left blank;
[0011] Matrix decomposition of the initial preference value matrix yields the target user hidden attribute vector and the test asset hidden attribute vector;
[0012] Obtain the explicit attributes of the target user, and quantize and convert the explicit attributes of the target user into a target user explicit attribute vector;
[0013] Obtain the explicit attributes of the test asset and quantize and convert the explicit attributes of the test asset into a test asset explicit attribute vector;
[0014] The adjusted intermediate preference matrix is obtained by minimizing the residuals between the initial preference value matrix and the target user's hidden attribute vector, the test asset's hidden attribute vector, the target user's explicit attribute vector, and the test asset's explicit attribute vector.
[0015] Matrix decomposition is performed on the intermediate preference value matrix to obtain new target user hidden attribute vectors and test asset hidden attribute vectors. The intermediate preference values, new target user hidden attribute vectors, and test asset hidden attribute vectors are used to repeatedly iterate and minimize the residual calculation until convergence, thus obtaining the output preference value matrix.
[0016] The test assets with higher preference values in the output preference value matrix are recommended to the user.
[0017] Furthermore, the calculation of the target user's initial preference value for the test asset based on the target user's hidden attributes includes:
[0018] The initial preference value of the target user for the test asset is calculated using Equation 1;
[0019] z = x + a*y Equation 1
[0020] Where x is the number of searches for the test asset, y is the number of views for the test asset, z is the initial preference value of the target user for the test asset, and a is a calculated coefficient, which is any positive number greater than or equal to 1.
[0021] Furthermore, the calculation coefficient a is taken as 2.
[0022] Furthermore, the explicit attributes of the target user include the target user's job title, department, and the system they are responsible for; the process of quantifying the target user's explicit attributes into a target user explicit attribute vector includes quantifying the target user's explicit attributes into a target user explicit attribute vector according to the order of job title, department, and the system they are responsible for.
[0023] Furthermore, the explicit attributes of the test asset include the category of the test asset and the system to which the test asset belongs; the quantification of the explicit attributes of the test asset into a test asset explicit attribute vector includes quantifying the explicit attributes of the test asset into a test asset explicit attribute vector according to the order of category and system.
[0024] Further, the step of obtaining the adjusted intermediate preference value matrix by minimizing the residuals between the initial preference value matrix and the target user's hidden attribute vector, the test asset's hidden attribute vector, the target user's explicit attribute vector, and the test asset's explicit attribute vector includes:
[0025] Use Equation 2 to calculate the minimum value of the residual;
[0026] δ=(r ij -u i ·v j -α·p i -β·q j Equation 2
[0027] Where, r ij Let u be the initial preference value matrix. i To hide the attribute vector for the target user, v j To test the hidden attribute vector of the asset, p i q is the explicit attribute vector for the target user. j To test the explicit attribute vector of the asset, α is the first coefficient vector, β is the second coefficient vector, and 6 is the residual;
[0028] Equation 2 is solved using the LR linear regression algorithm to obtain α and β;
[0029] Based on the calculated α and β, the adjusted intermediate preference value matrix is calculated using Equation 3;
[0030] r′ ij =r ij -α·p i -β·q j Formula 3
[0031] Where, r′ ij This is the matrix of intermediate preference values.
[0032] Furthermore, in the initial preference value matrix, each row corresponds to a target user and each column corresponds to a test asset.
[0033] This invention also relates to a test asset recommendation system that integrates user attributes, characterized in that it includes:
[0034] The attribute acquisition module is used to acquire the hidden attributes of the target user, the explicit attributes of the target user, and the explicit attributes of the test assets.
[0035] The preference value matrix module is used to build the preference value matrix and perform matrix decomposition on the preference value matrix to obtain the target user hidden attribute vector and the test asset hidden attribute vector;
[0036] The quantization conversion module is used to quantize and convert the explicit attributes of the target user into a target user explicit attribute vector, and to quantize and convert the explicit attributes of the test asset into a test asset explicit attribute vector.
[0037] The matrix iteration module is used to perform the minimum residual calculation and obtain the adjusted preference value matrix;
[0038] The test asset recommendation module is used to recommend test assets with higher preference values from the output preference value matrix to users.
[0039] The present invention also relates to a computer-readable storage medium, characterized in that the storage medium stores a computer program, which, when executed by a processor, implements the above-described method.
[0040] The present invention also relates to an electronic device, characterized in that it includes a processor and a memory;
[0041] The memory is used to store the hidden attributes of the target user, the explicit attributes of the target user, and the explicit attributes of the test asset;
[0042] The processor is configured to execute the above method by invoking the target user's hidden attributes, the target user's explicit attributes, and the test asset's explicit attributes.
[0043] The beneficial effects of this invention are as follows:
[0044] The test asset recommendation method and system based on comprehensive user attributes described in this invention analyzes the explicit and implicit attributes of users and test assets, quantifies the analysis results, thereby extracting the essential needs of users and forming a preference matrix between users and test assets. Different test asset recommendation results can be obtained for different users, thus accurately recommending test assets to users and helping customers find the most suitable test assets for themselves. Attached Figure Description
[0045] Figure 1 This is a schematic diagram of the test asset recommendation method based on comprehensive user attributes according to the present invention.
[0046] Figure 2 This is a schematic diagram of the test asset recommendation system structure based on integrated user attributes according to the present invention. Detailed Implementation
[0047] To better understand the content of this invention, a detailed description will be provided in conjunction with the accompanying drawings and embodiments.
[0048] User attribute analysis, or starting with the attributes of the target user, involves analyzing various attributes to extract the user's essential needs. This invention analyzes user and test asset attributes from two dimensions. The first dimension is explicit attributes, also known as observable attributes, such as the user's job title, department, and system they are responsible for, as well as the type and system of the test asset. The second dimension is implicit attributes, which are preference attributes derived from the analysis of the user's historical behavior. After analyzing both explicit and implicit attributes, the results are quantified to form a preference matrix between users and test assets, allowing for different test asset recommendations for different users.
[0049] The first aspect of this invention relates to a method for recommending test assets based on comprehensive user attributes, the process of which is as follows: Figure 1 As shown, it includes:
[0050] Obtain the hidden attributes of the target user, including the number of times the target user searches for and views the test asset;
[0051] The initial preference value of the target user for the test asset is calculated based on the target user's hidden attributes, specifically using Equation 1:
[0052] z = x + a*y Equation 1
[0053] Where x is the number of searches for the test asset, y is the number of views for the test asset, z is the initial preference value of the target user for the test asset, and a is a calculated coefficient that takes any positive number greater than or equal to 1, with a preferably being 2 for calculation;
[0054] The initial preference values of each target user for each test asset are integrated to obtain an initial preference value matrix, in which the positions of the initial preference value of 0 are left blank;
[0055] Matrix decomposition of the initial preference value matrix yields the target user hidden attribute vector and the test asset hidden attribute vector;
[0056] Obtain the explicit attributes of the target user, and quantify and convert the explicit attributes of the target user into a target user explicit attribute vector. The explicit attributes of the target user include the target user's position, department, and system. The process of quantifying and converting the explicit attributes of the target user into a target user explicit attribute vector includes quantifying and converting the explicit attributes of the target user into a target user explicit attribute vector according to the order of position, department, and system.
[0057] Obtain the explicit attributes of the test asset, and quantify and convert the explicit attributes of the test asset into a test asset explicit attribute vector. The explicit attributes of the test asset include the category of the test asset and the system to which the test asset belongs. The process of quantifying and converting the explicit attributes of the test asset into a test asset explicit attribute vector includes quantifying and converting the explicit attributes of the test asset into a test asset explicit attribute vector according to the order of category and system to which the test asset belongs.
[0058] The adjusted intermediate preference matrix is obtained by minimizing the residuals between the initial preference value matrix and the target user's hidden attribute vector, the test asset's hidden attribute vector, the target user's explicit attribute vector, and the test asset's explicit attribute vector. Specifically, Equation 2 is used to minimize the residuals.
[0059] δ=(r ij -u i ·v j -α·p i -β·q j Equation 2
[0060] Where, r ij Let u be the initial preference value matrix. i To hide the attribute vector for the target user, v j To test the hidden attribute vector of the asset, p i q is the explicit attribute vector for the target user. j To test the explicit attribute vector of the asset, α is the first coefficient vector, β is the second coefficient vector, and δ is the residual; α and β are obtained by solving Equation 2 using the LR linear regression algorithm.
[0061] By substituting the α and β obtained from the solution, the adjusted intermediate preference value matrix is calculated using Equation 3:
[0062] r′ ij =r ij -α·p i -β·q j Formula 3
[0063] Where, r′ ij This is a matrix of intermediate preference values;
[0064] The intermediate preference value matrix is decomposed to obtain new target user hidden attribute vectors and test asset hidden attribute vectors. The intermediate preference values, the new target user hidden attribute vectors, and the test asset hidden attribute vectors are used to repeatedly iterate and minimize the residual calculation until convergence, thus obtaining the output preference value matrix. Preferably, the output preference value matrix can also be found by setting a maximum number of iterations to avoid the situation where it is difficult to converge completely and there is no suitable matrix available.
[0065] The test assets with higher preference values in the output preference value matrix are recommended to the user.
[0066] The second aspect of the present invention relates to a structure as follows Figure 2 The test asset recommendation system shown, which integrates user attributes, includes:
[0067] The attribute acquisition module is used to acquire the hidden attributes of the target user, the explicit attributes of the target user, and the explicit attributes of the test assets.
[0068] The preference value matrix module is used to build the preference value matrix and perform matrix decomposition on the preference value matrix to obtain the target user hidden attribute vector and the test asset hidden attribute vector;
[0069] The quantization conversion module is used to quantize and convert the explicit attributes of the target user into a target user explicit attribute vector, and to quantize and convert the explicit attributes of the test asset into a test asset explicit attribute vector.
[0070] The matrix iteration module is used to perform the minimum residual calculation and obtain the adjusted preference value matrix;
[0071] The test asset recommendation module is used to recommend test assets with higher preference values from the output preference value matrix to users.
[0072] This system can be used to implement the methods described above, thereby automatically recommending test assets to users.
[0073] The implementation of the method of the present invention will be further illustrated by a specific embodiment below.
[0074] Assume a user has 3 job categories (job A, job B, job C), 5 departments (department A to department E), and 8 systems (system A to system H). If the user's explicit attribute is job A, department A, or system A, then the user's explicit attribute is quantized into an explicit feature matrix [1 1 1]; if the user's explicit attribute is job C, department E, or system H, then the user's explicit attribute is quantized into an explicit feature matrix [3 5 8]. The quantization of other user explicit attributes can be deduced similarly.
[0075] Assume there are 10 categories of test assets (category A to category J) and 8 systems (system A to system H). If the explicit attribute of the test asset is category A and system A, then the explicit attribute of the user is quantized into an explicit feature matrix
[11] ; if the explicit attribute of the test asset is category J and system H, then the explicit attribute of the user is quantized into an explicit feature matrix [10 8]. The quantization of the explicit attributes of the remaining test assets can be deduced in the same way.
[0076] Next, we quantify the hidden attribute features of users. We first analyze user behavior. For the test asset recommendation device, we can analyze two types of historical user behavior: the number of times a user searches for related test assets and the number of times a user views related test assets. The higher these two counts, the more interested the user is in that test asset. The hidden attribute features are quantified based on these two counts as follows:
[0077] Assuming the number of times a user searches for a relevant test asset is x, the number of times they browse a relevant test asset is y, and the user's preference value for the relevant test asset is z, the formula z = x + 2 * y is defined to obtain the user's preference value for the test asset z.
[0078] Assume there are three users, A, B, and C, and three test assets, A, B, and C. User A has a preference value of 1 for asset A, a preference value of 2 for asset B, and has not searched for or browsed asset C. User B has a preference value of 3 for asset B, a preference value of 4 for asset C, and has not searched for or browsed asset A. User C has a preference value of 5 for asset C, a preference value of 6 for asset A, and has not searched for or browsed asset B. Then, the user preference value matrix can be quantized to obtain the following initial preference value matrix:
[0079]
[0080] Each row in the matrix represents a user, and each column represents a test asset. After quantization, the user's explicit features are added to obtain the preference values for empty elements in the matrix, which are the predicted preferences of users for test assets that have not been searched or browsed. Then, test assets with high predicted preference values are recommended to the user.
[0081] Specifically, the following steps can be taken:
[0082] Step 1: Use MF matrix decomposition to obtain the target user's hidden attribute vector u. i and test asset hidden attribute vector v j ;
[0083] Step 2: Quantize the explicit features of the target user and the explicit features of the test asset into a vector p. i and q j For each preference value r ij Construct the corresponding explicit feature vector of user-test assets [p] i q j ];
[0084] Step 3: Use the u obtained in Step 1 j and v j To make the residual
[0085] δ=(rij -u i ·v j -α·p i -β·q j )^2
[0086] To minimize this problem, the first and second coefficient vectors α and β are obtained by using the LR linear regression algorithm.
[0087] Step 4: Using the α and β obtained in Step 3, adjust the preference value matrix so that r′ ij =r ij -α·p i -β·q j ;
[0088] Step 5: Use the r′ obtained in Step 4 ij A new preference value matrix R is formed, and then matrix decomposition is performed on R to solve for the new u. i and v j ;
[0089] Step Six: Repeat Steps Four and Five until the problem converges;
[0090] Step 7: After convergence, the final obtained u i and v j Multiplying them together yields the final output preference value matrix. The predicted rating values corresponding to the matrix are obtained, and test assets with high predicted preference values are recommended to users.
[0091] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for recommending test assets based on comprehensive user attributes, characterized in that, include: Obtain the hidden attributes of the target user, including the number of times the target user searches for and views the test asset; The initial preference value of the target user for the test asset is calculated based on the target user's hidden attributes; The initial preference values of each target user for each test asset are integrated to obtain an initial preference value matrix, in which the positions of the initial preference value of 0 are left blank; Matrix decomposition of the initial preference value matrix yields the target user hidden attribute vector and the test asset hidden attribute vector; Obtain the explicit attributes of the target user, and quantize and convert the explicit attributes of the target user into a target user explicit attribute vector; Obtain the explicit attributes of the test asset and quantize and convert the explicit attributes of the test asset into a test asset explicit attribute vector; The adjusted intermediate preference matrix is obtained by minimizing the residuals between the initial preference value matrix and the target user's hidden attribute vector, the test asset's hidden attribute vector, the target user's explicit attribute vector, and the test asset's explicit attribute vector. Matrix decomposition is performed on the intermediate preference value matrix to obtain new target user hidden attribute vectors and test asset hidden attribute vectors. The intermediate preference values, new target user hidden attribute vectors, and test asset hidden attribute vectors are used to repeatedly iterate and minimize the residual calculation until convergence, thus obtaining the output preference value matrix. Recommend test assets with higher preference values from the output preference value matrix to users; The process of obtaining the adjusted intermediate preference matrix by minimizing the residuals between the initial preference value matrix and the target user's hidden attribute vector, the test asset's hidden attribute vector, the target user's explicit attribute vector, and the test asset's explicit attribute vector includes: Use Equation 2 to calculate the minimum value of the residual; δ=(r ij -u i ·v j -a·p i -β·q j )^2expression2 Where, r ij Let u be the initial preference value matrix. i To hide the attribute vector for the target user, v j To test the hidden attribute vector of the asset, p i q is the explicit attribute vector for the target user. j To test the explicit attribute vector of the asset, α is the first coefficient vector, β is the second coefficient vector, and δ is the residual; Equation 2 is solved using the LR linear regression algorithm to obtain α and β; Based on the calculated α and β, the adjusted intermediate preference value matrix is calculated using Equation 3; r' ij =r ij -a·p i -β·q j formula 3 Where r'ij is the intermediate preference value matrix.
2. The method as described in claim 1, characterized in that, The initial preference value of the target user for the test asset calculated based on the target user's hidden attributes includes: The initial preference value of the target user for the test asset is calculated using Equation 1; z = x + a*y Equation 1 Where x is the number of searches for the test asset, y is the number of views for the test asset, z is the initial preference value of the target user for the test asset, and a is a calculated coefficient, which is any positive number greater than or equal to 1.
3. The method as described in claim 2, characterized in that, The calculation coefficient 'a' is set to 2.
4. The method as described in claim 1, characterized in that, The explicit attributes of the target user include the target user's job title, department, and the system they are responsible for; quantifying the target user's explicit attributes into a target user explicit attribute vector involves quantifying the target user's explicit attributes into a target user explicit attribute vector according to the order of job title, department, and the system they are responsible for.
5. The method as described in claim 1, characterized in that, The explicit attributes of the test asset include the category of the test asset and the system to which the test asset belongs; the process of quantifying the explicit attributes of the test asset into a test asset explicit attribute vector includes quantifying the explicit attributes of the test asset into a test asset explicit attribute vector according to the order of category and system to which the test asset belongs.
6. The method according to any one of claims 1 to 5, characterized in that, In the initial preference value matrix, each row corresponds to a target user and each column corresponds to a test asset.
7. A test asset recommendation system that integrates user attributes, characterized in that, Used to include: The attribute acquisition module is used to acquire the hidden attributes of the target user, the explicit attributes of the target user, and the explicit attributes of the test assets. The preference value matrix module is used to build the preference value matrix and perform matrix decomposition on the preference value matrix to obtain the target user hidden attribute vector and the test asset hidden attribute vector; The quantization conversion module is used to quantize and convert the explicit attributes of the target user into a target user explicit attribute vector, and to quantize and convert the explicit attributes of the test asset into a test asset explicit attribute vector. The matrix iteration module is used to calculate the adjusted intermediate preference value matrix by minimizing the residuals between the initial preference value matrix and the target user's hidden attribute vector, the test asset's hidden attribute vector, the target user's explicit attribute vector, and the test asset's explicit attribute vector. The test asset recommendation module is used to recommend test assets with higher preference values from the output preference value matrix to users. The process of obtaining the adjusted intermediate preference matrix by minimizing the residuals between the initial preference value matrix and the target user's hidden attribute vector, the test asset's hidden attribute vector, the target user's explicit attribute vector, and the test asset's explicit attribute vector includes: Use Equation 2 to calculate the minimum value of the residual; δ=(r ij -u i ·v j -a·p i -β·q j )^2expression2 Where, r ij Let u be the initial preference value matrix. i To hide the attribute vector for the target user, v j To test the hidden attribute vector of the asset, p i q is the explicit attribute vector for the target user. j To test the explicit attribute vector of the asset, α is the first coefficient vector, β is the second coefficient vector, and δ is the residual; Equation 2 is solved using the LR linear regression algorithm to obtain α and β; Based on the calculated α and β, the adjusted intermediate preference value matrix is calculated using Equation 3; r' ij =r ij -a·p i -β·q j formula 3 Where r'ij is the intermediate preference value matrix.
8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method of any one of claims 1 to 6.
9. An electronic device, characterized in that, Including processor and memory; The memory is used to store the hidden attributes of the target user, the explicit attributes of the target user, and the explicit attributes of the test asset; The processor is configured to execute the method of any one of claims 1 to 6 by invoking the hidden attributes of the target user, the explicit attributes of the target user, and the explicit attributes of the test asset.
Citation Information
Patent Citations
Feature extraction model processing method and device, computer equipment and storage medium
CN117216707A