A test case generation method and related apparatus
By acquiring the characteristic information of test cases, finding consistent test cases from the database and reusing their resources, the problem of high cost and low efficiency in generating test cases in existing technologies is solved, and more efficient test case generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-02-23
- Publication Date
- 2026-07-07
AI Technical Summary
In existing technologies, generating test cases is costly and inefficient, requiring a large amount of manual construction and binding of test resources.
By obtaining the feature information of the first test case, a second test case with the same feature information is searched from the feature database, and the configured test resources are directly reused.
It effectively improves the efficiency of test case generation, saves time in configuring test resources, and increases the efficiency of test case generation.
Smart Images

Figure CN116680160B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more particularly to a test case generation method and related apparatus. Background Technology
[0002] With the widespread adoption of smart devices, the types and quantities of software installed on these devices are also increasing. Before software release, it is necessary to test various functions of the software, which requires the use of test cases. A test case is a description of a testing task for a specific software product, reflecting the test plan, methods, techniques, and strategies. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and is ultimately documented.
[0003] Currently, the common approach is to generate a test case set, which includes one or more test cases, each corresponding to a test scenario. In actual execution, the corresponding test resources need to be manually constructed and bound.
[0004] As software functionality increases, the number of test cases required also grows. Consequently, the amount of test resources that need to be manually constructed and bound also increases. This leads to a rise in the cost of constructing test cases and a decrease in the efficiency of test case creation. Summary of the Invention
[0005] This application provides a test case generation method. After obtaining a first test case, feature information of the first test case is generated based on it. Then, a second test case with matching feature information is searched from a feature database based on the feature information of the first test case. Since the second test case has already been configured with corresponding first test resources, and the feature information of the first test case is consistent with that of the second test case, the first test case can directly reuse the first test resources, saving time spent configuring test resources for the first test case and effectively improving the efficiency of test case generation.
[0006] In view of this, this application provides a test case generation method, including:
[0007] Obtain the first test case;
[0008] Based on the first test case, generate the feature information of the first test case;
[0009] Based on the feature information of the first test case, the second test case is determined from the feature database. The feature database stores the feature information of one or more test cases. The feature information of the first test case is consistent with the feature information of the second test case. The test resource associated with the second test case is the first test resource.
[0010] Associate the first test case with the first test resource and reuse the first test resource.
[0011] This application also provides a test case generation apparatus, comprising:
[0012] The send / receive module is used to obtain the first test case;
[0013] The processing module is used to generate feature information of the first test case based on the first test case;
[0014] The processing module is also used to determine the second test case from the feature database based on the feature information of the first test case. The feature database stores the feature information of one or more test cases. The feature information of the first test case is consistent with the feature information of the second test case. The test resource associated with the second test case is the first test resource.
[0015] The processing module is also used to associate the first test case with the first test resource and reuse the first test resource.
[0016] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0017] The processing module is also used to extract feature information of one or more short sentences in the first test case;
[0018] The processing module is also used to determine the identification information corresponding to one or more short sentences based on the feature information of one or more short sentences;
[0019] The processing module is also configured to generate feature information of the first test case based on the first information, wherein the first information includes one or more of the following:
[0020] Identification information corresponding to one or more short phrases, identification information corresponding to the name of the first test case, or identification information corresponding to the type of the first test case.
[0021] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0022] The processing module is also used to perform concatenation processing on the first information to generate a first string, wherein the first string includes the first information;
[0023] The processing module is also used to perform hash calculations on the first string to generate feature information for the first test case.
[0024] In one possible design, in another implementation of another aspect of the embodiments of this application, the string length of the feature information of the first test case is less than the string length of the first string.
[0025] In one possible design, in another implementation of another aspect of the embodiments of this application, one or more short phrases include one or more of the following:
[0026] The operation steps of the first test case, the preconditions for the operation steps of the first test case, or the expected result of the first test case.
[0027] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0028] The processing module is also used to concatenate the first information in the following order to generate a first string, the order of which includes: the name of the first test case, the type of the first test case, the operation steps of the first test case, and the preconditions of the operation steps of the first test case, wherein the operation steps of the first test case are arranged in the order indicated in the first test case.
[0029] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0030] The first test case type includes either a validation behavior type or a validation rule type.
[0031] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0032] The sending and receiving module is also used to obtain first requirement document information, which includes one or more short sentences in natural language.
[0033] The processing module is also used to convert the first requirement document information into first requirement data, which is structured data.
[0034] The processing module is also used to generate system use cases corresponding to the first requirement data based on the first requirement data;
[0035] The processing module is also used to generate the first test case based on the system test cases corresponding to the first requirement data.
[0036] In one possible design, in another implementation of another aspect of the embodiments of this application, the system use case includes one or more of the following information: system use case executor, a set of business-related preconditions, a set of postconditions, and a business path.
[0037] The business path includes a basic path and extended paths. The basic path is the core business process, and the extended path is an extension of the core business process. Each business path includes multiple business steps, and each business step has corresponding constraints.
[0038] Constraints include one or more of the following: field list, business rules, non-functional requirements, and design constraints.
[0039] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0040] The processing module is also used to perform semantic analysis on one or more test cases to determine the test resources corresponding to one or more test cases;
[0041] The processing module is also used to construct a test case set based on one or more test cases and the test resources corresponding to one or more test cases, wherein the test case set includes one or more test cases and the association relationship between one or more test cases and the test resources corresponding to one or more test cases;
[0042] The processing module is also used to compose a feature database based on one or more test case sets.
[0043] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0044] The processing module is also used to perform semantic analysis on the first test case using a neural network model, and to extract feature information of one or more short sentences in the first test case.
[0045] This application also provides a computer device, including: a memory, a processor, and a bus system;
[0046] The memory is used to store programs;
[0047] The processor is used to execute programs in memory, and the processor is used to execute the methods mentioned above according to the instructions in the program code;
[0048] Bus systems are used to connect memory and processor to enable communication between them.
[0049] Another aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described above.
[0050] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the above aspects.
[0051] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0052] After obtaining the first test case, its feature information is generated. Then, a second test case with matching feature information is searched from the feature database. Since the second test case has already been configured with the corresponding first test resource, and the feature information of the first test case matches that of the second test case, the first test case can directly reuse the first test resource, saving time spent configuring test resources for the first test case and effectively improving the efficiency of test case generation. Attached Figure Description
[0053] Figure 1a A schematic diagram illustrating the scenario of the test case generation method provided in this application;
[0054] Figure 1b This is a schematic diagram illustrating another application scenario involved in the embodiments of this application;
[0055] Figure 2 A schematic diagram of one embodiment of the test case generation method provided in this application;
[0056] Figure 3 A schematic diagram of yet another embodiment of the test case generation method provided in this application;
[0057] Figure 4 A schematic diagram of yet another embodiment of the test case generation method provided in this application;
[0058] Figure 5 A schematic diagram of yet another embodiment of the test case generation method provided in this application;
[0059] Figure 6 This is a schematic diagram of the structure of the feature database in an embodiment of this application;
[0060] Figure 7 This is a schematic diagram of the settings interface for the requirement document information in an embodiment of this application;
[0061] Figure 8 This is a schematic diagram of another setting interface for requirement document information in an embodiment of this application;
[0062] Figure 9 This is a schematic diagram of the first requirement data in the embodiments of this application;
[0063] Figure 10 This is a schematic diagram of the editing interface for requirement document information in an embodiment of this application;
[0064] Figure 11 This is a schematic diagram of the upload entry point for required document information in the embodiments of this application;
[0065] Figure 12 This is a schematic diagram illustrating the legality check of requirement document information in an embodiment of this application;
[0066] Figure 13 This is a schematic diagram illustrating the composition of system use cases in the embodiments of this application;
[0067] Figure 14 This is a schematic diagram illustrating the composition of a test case in an embodiment of this application;
[0068] Figure 15 This is a schematic diagram illustrating the process of generating feature information for the first test case in this application embodiment;
[0069] Figure 16 This is a schematic diagram of a test case generation device in an embodiment of this application;
[0070] Figure 17 This is a schematic diagram of a server structure provided in an embodiment of this application;
[0071] Figure 18 The diagram shown is a block diagram of a portion of the structure of a mobile phone related to the terminal device provided in the embodiments of this application. Detailed Implementation
[0072] This application provides a test case generation method. After obtaining a first test case, feature information of the first test case is generated based on it. Then, a second test case with matching feature information is searched from a feature database based on the feature information of the first test case. Since the second test case has already been configured with corresponding first test resources, and the feature information of the first test case is consistent with that of the second test case, the first test case can directly reuse the first test resources, saving time in configuring test resources for the first test case and effectively improving the efficiency of test case generation.
[0073] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding to,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0074] This application provides a test case generation method and related apparatus. This application can be applied to various scenarios such as cloud technology, artificial intelligence, smart transportation, and assisted driving. The test case generation method can be used in a test case generation apparatus. The test case generation apparatus and testing apparatus can be integrated into a computer device, which can be a server or a terminal. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The server can be a node in a blockchain. The terminal can be a mobile phone, tablet computer, laptop computer, smart TV, wearable smart device, personal computer (PC), smart voice interaction device, smart home appliance, or in-vehicle terminal, etc.
[0075] Please see Figure 1a , Figure 1a A schematic diagram illustrating the scenario of the test case generation method provided in this application. For example... Figure 1a As shown, after obtaining the first test case, computer device A determines the feature information of the first test case. Then, based on the feature information of the first test case, it determines the second test case from the feature database of computer device B. The test resource corresponding to the second test case is the first test resource, and the feature information of the first test case is consistent with that of the second test case. Then, the first test resource is reused for the first test case. It can be understood that computer device B can be a single computer device, a cluster of multiple computer devices, or a cloud server; there are no restrictions here.
[0076] It should be noted that, Figure 1a The illustrated test case generation scenario is merely an example. The test case generation scenario described in this application is intended to more clearly illustrate the technical solution of this application and does not constitute a limitation on the technical solution provided in this application. Those skilled in the art will understand that, with the evolution of test case generation and the emergence of new business scenarios, the technical solution provided in this application is equally applicable to similar technical problems.
[0077] Please see Figure 1b , Figure 1b This is a schematic diagram illustrating another application scenario involved in the embodiments of this application. Figure 1bThe illustrated application scenarios include: a test case generation device, a requirements management system, and a feature database. The test case generation device utilizes the test case generation method proposed in this application. The requirements management system is a management information system that can adopt a browser-server (BS) architecture. Specifically, the requirements management system can receive various instructions or data from users, including: querying requirements document information, adding requirements document information, modifying requirements document information, and deleting requirements document information. The requirements management system can perform semantic analysis on the requirements document information or test cases and extract relevant feature information. Then, the requirements management system can save this feature information to the feature database. The feature database stores the feature information of the requirements document information and the feature information of the test cases. The test case generation device can obtain relevant data from the requirements management system and the feature database and generate new test cases.
[0078] It is understood that the test case generation device and feature database mentioned above are background services provided by computer equipment. The test case generation device, requirement management system, and feature database can be implemented by the same computer equipment or by multiple computer equipment working together; there is no restriction here.
[0079] Before introducing the embodiments of this application, we will first introduce some technical concepts involved in the embodiments of this application:
[0080] 1. Test Case:
[0081] A test case is a description of a specific software product testing task, embodying the test plan, methods, techniques, and strategies. Its content includes a document comprising test objectives, test environment, input data, test steps, expected results, and test scripts. A test case can also be understood as a set of test inputs, execution conditions, and expected results compiled for a specific objective to verify whether a particular software requirement is met.
[0082] After programmers complete the application software, they need to test its various functions to ensure the software product functions correctly. Specifically, testing the software product requires the use of test cases.
[0083] Test cases can specifically include: the test case name, the preconditions that the test case needs to meet, the specific execution steps of the test case, and the expected test results of the test case. It is understood that test cases can also be displayed and stored in various formats such as text documents.
[0084] For easier understanding, please refer to Table 1, which shows some of the test cases:
[0085] Table 1
[0086]
[0087]
[0088] 2. System use cases.
[0089] System use cases are models describing user and system interaction methods, derived from requirements data using the Unified Modeling Language (UML). This modeling process can include business modeling and conceptual modeling. UML modeling is a modeling language that uses model elements to assemble the entire system. These model elements include classes within the system, the relationships between classes, and the interactions between instances of classes to achieve the system's dynamic behavior.
[0090] Each test case provides at least one test scenario that illustrates how the system interacts with the target user or other systems to achieve a specific business objective.
[0091] The target product's requirements data can be represented either as a Product Requirements Document (PRD) or as JSON data corresponding to the PRD. JSON, or JavaScript Object Notation, is a lightweight data-interchange format. It uses a text format completely independent of programming languages to store and represent data. Its concise and clear hierarchical structure makes it an ideal data exchange language, easy for humans to read and write, as well as easy for machines to parse and generate, effectively improving network transmission efficiency.
[0092] Specifically, the product requirements document describes the product requirements, including the product's strategy and tactics. The product strategy includes: product positioning, target market, target customers, competitors, etc., while the product tactics include: product structure, core business processes, specific use case descriptions, functions, and content descriptions, etc.
[0093] The following sections provide detailed explanations based on the above implementation scenarios. Please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic diagram of one embodiment of the test case generation method provided in this application. This application provides a test case generation method, including:
[0094] 201. Obtain the first test case.
[0095] In this embodiment, the test case generation device first obtains a first test case. The first test case may be a test case newly generated by the test case generation device based on the requirement document information input by the user, or it may be a test case of the test resource to be configured obtained by the test case generation device. No limitation is made here.
[0096] 202. Based on the first test case, generate the feature information corresponding to the first test case.
[0097] In this embodiment, after the test case generation device acquires the first test case, it analyzes the first test case and generates feature information corresponding to it. This feature information identifies the characteristics of the first test case, allowing the test case generation device to search the feature database for a corresponding second test case. Specific analysis methods include semantic analysis based on neural networks or manual identification; no limitation is imposed here.
[0098] For example, the feature information corresponding to the first test case can be a portion of the text extracted from the first test case, such as: "Whether the user's payment methods are determined according to the rules of payment method availability: No / Whether the bank system has given feedback: Yes / Direct connection to the merchant system to request payment". It can also be a set of identifier information corresponding to the first test case, such as: "6673,7253,9071,9108,5740,5822,5923,5970". It can also be a set of processed strings corresponding to the first test case, such as: "60966400682272308955", which is not limited in this embodiment.
[0099] 203. Based on the feature information of the first test case, determine the second test case from the feature database. The feature information of the second test case is consistent with the feature information of the first test case, and the test resource associated with the second test case is the first test resource.
[0100] In this embodiment, after the test case generation device generates feature information corresponding to the first test case, it determines the second test case from the feature database based on the feature information of the first test case. The feature information of the second test case is consistent with the feature information of the first test case, and the test resource associated with the second test case is the first test resource. The feature database stores feature information of one or more test cases. Optionally, the feature database also stores the test resource corresponding to the test case, which is the test resource configured for the test case. For ease of understanding, please refer to Table 2, which illustrates the feature information of the test cases stored in the feature database.
[0101] Table 2
[0102] Test cases Feature information Test resources Test case a 60966400682272308955 Test resource a Test case b 60511987165161847612 Test resource b Test case c 35464843134688941557 Test resource c Test case d 19813795417897451357 Test resource d
[0103] Specifically, after the test case generation device obtains the feature information "60966400682272308955" corresponding to the first test case, it searches the feature database for matching feature information. If matching feature information exists, the test case generation device determines the test case corresponding to the matching feature information as the second test case. Taking Table 2 as an example, the test case generation device determines test case a as the second test case, and the test resource a corresponding to test case a is the first test resource.
[0104] In another implementation, after the test case generation device determines the second test case in the feature database, it can determine the first test resource based on the association between the second test case and the corresponding test resource.
[0105] The feature database involved in the embodiments of this application is described below. For ease of understanding, please refer to [link / reference needed]. Figure 6 , Figure 6 This is a schematic diagram of the structure of a feature database in an embodiment of this application. The feature database stores one or more test case sets, for example... Figure 6 The diagram illustrates test case sets A through N. Each test case set includes one or more test cases, for example... Figure 6 The illustrated test case set A includes test case a to test case n, and the test case set N includes test case aa to test case nn.
[0106] Optionally, after obtaining one or more test cases, the test case generation device performs semantic analysis on the one or more test cases to determine the test resources corresponding to the one or more test cases; then, the test case generation device constructs a test case set based on the one or more test cases and the test resources corresponding to the one or more test cases, wherein the test case set includes the association relationship between the one or more test cases and the test resources corresponding to the one or more test cases; and a feature database is formed based on the one or more test case sets.
[0107] 204. Associate the first test case with the first test resource and reuse the first test resource.
[0108] In this embodiment, after determining the second test case, the test case generation device assumes that the first test case can use the first test resource corresponding to the second test case because the feature information of the first test case is consistent with the feature information of the second test case. The test case generation device associates the first test case with the first test resource so that the first test case reuses the first test resource.
[0109] For example, let's take the first test case as "Requesting the user to change the payment method" as an example. The operation steps of this test case include: "1. Directly connect to the merchant system to request the receipt of the order voucher (ID: 1)".
[0110] [System] Verify the validity of the order request information (ID: 2)
[0111] [System] Processing order request (id: 5)
[0112] 2. Direct connection to merchant system to request payment (ID: 7)
[0113] [System] Verify the validity of the payment request information (ID: 8)
[0114] 3. [System] The system verifies that the user's feedback indicates payment confirmation, and the verification requires the user to submit their payment password for authorization (ID: 14).
[0115] 4. [System] The system verifies that the user's feedback indicates authorized payment, and verification requires requesting the bank system to deduct funds (ID: 16).
[0116] [System] Set the current payment method to unavailable and record the reason for unavailability (ID: 18a1).
[0117] The prerequisites for the operation steps of this test case include: "4.1 [System] Verify that the bank system's feedback result is a failure, and guide the user to change the payment method (ID: 18a)."
[0118] {Did the bank system report a successful deduction?: No}
[0119] {Is there any feedback from the banking system?}
[0120] 4.2 [System] Request user to change payment method (ID: 18a2)
[0121] {Has the system set up order information to disable the use of WeChat Pay for merchants specified by merchant ID?: No}
[0122] {Has the user's payment account activated for payment services: Yes}.
[0123] The expected outcome of this test case includes: "1.1 [System] Feedback on payment order voucher (ID: 6)"
[0124] 2.1 [System] Requests user confirmation of payment information (ID: 13)
[0125] 3.1 [System] Request user to submit payment password to authorize payment (id: 15)
[0126] 4.1 [System] Request the user to change the payment method (ID: 18a2).
[0127] To verify the test scenario corresponding to each test case, the test resources to be constructed for the first test case include: 1. A user account with payment function enabled; 2. A regular merchant account; 3. A testable API that, when called, constructs the condition that the digital certificate is not installed on the client; 4. A testable Application Programming Interface (API) that, when called, constructs the transaction amount exceeding the balance; 5. A testable API that, when called, constructs the balance exceeding the annual cumulative limit for the same real-name ID; 6. A testable API that, when called, constructs the error message from the bank indicating insufficient funds.
[0128] One possible implementation is to paste the resource path of the first test resource into the test resource configuration of the first test case, so that the first test case can reuse the first test resource.
[0129] In this embodiment, after obtaining a first test case, the test case generation device generates feature information for the first test case based on the first test case. Then, it searches for a second test case with matching feature information from the feature database based on the feature information of the first test case. Since the second test case has already been configured with corresponding first test resources, and the feature information of the first test case is consistent with that of the second test case, the first test case can directly reuse existing first test resources, saving time in configuring test resources for the first test case and effectively improving the efficiency of test case generation. By automatically analyzing test cases corresponding to the same test scenario, it no longer relies on the tester's experience and understanding of test cases, thus improving the accuracy of test resource configuration.
[0130] Please refer to the foregoing embodiments. Figure 3 , Figure 3 This is a schematic diagram of another embodiment of the test case generation method provided in this application. In the test case generation method proposed in this application, the feature information of the first test case is generated based on the first test case, specifically including:
[0131] 301. Extract feature information from one or more short sentences in the first test case.
[0132] In this embodiment, after the test case generation device obtains the first test case, it extracts feature information of one or more short sentences from the first test case. The extracted feature information of one or more short sentences may correspond to all the short sentences in the first test case, or it may correspond to some of the short sentences in the first test case.
[0133] For example, the feature information of one or more phrases extracted from the first test case by the test case generation device includes:
[0134] 1. Whether the user's payment methods result in one of the following outcomes according to the payment method availability rules: No
[0135] 2. Does the bank system report an insufficient balance or insufficient credit card limit (error code: 88430113)? Yes
[0136] 3. Does the bank system indicate that the deduction was successful? No
[0137] 4. Does the bank system provide feedback? Yes
[0138] 5. Order Information. Is the business category of the merchant specified by the merchant ID within the scope of business categories that are prohibited from accepting cash payments in the system settings? No.
[0139] 6. Order Information. Does the specified payment method include "no_balance": No
[0140] 7. Result of the annual limit rule for payment account balance under the same real-name ID: Is the result of the balance calculation based on the minimum pending payment amount greater than the annual cumulative payment amount of the payment account under the same real-name ID? Yes
[0141] 8. Is the result of disabling the Pocket Money rule in the current transaction one of all possible results: No
[0142] 9. Does the current device's client have the digital certificate for this user's payment account installed?: No
[0143] 10. Has the system set up order information? Does the merchant ID specify a merchant that prohibits users from using cash balance for transactions? No.
[0144] 11. Has the system been configured to prohibit users from using cash balance for transactions at the merchant specified by the application ID? No
[0145] 12. Has the user's payment account activated for Wallet Balance? Yes
[0146] 13. Is the balance in this user's payment account currently under maintenance?: No
[0147] 14. Does the result of the minimum pending payment calculation rule for the user's balance in their payment account exceed the user's balance in their payment account? Yes
[0148] 15. Request payment order voucher from the direct-connect merchant system.
[0149] 16. Direct connection to merchant system to request payment
[0150] 17. [System] Requests user confirmation of payment information. The [System] verifies that the user's feedback indicates payment confirmation, and the verification requires the user to submit their payment password for authorization.
[0151] 18. [System] Requests user to submit payment password to authorize payment. [System] Verifies user feedback confirms payment authorization and requires requesting bank system deduction.
[0152] 302. Based on the feature information of one or more short sentences, determine the identification information corresponding to one or more short sentences.
[0153] In this embodiment, after the test case generation device determines the feature information of one or more short phrases in the first test case, the test case generation device further determines the identification information corresponding to the one or more short phrases. Specifically, each short phrase has a unique identification information, and the test case generation device searches for the identification information corresponding to the feature information of the short phrase in the feature database based on the feature information of one or more short phrases in the first test case.
[0154] For example, if 18 short phrases are extracted in step 301, then in step 302, 18 corresponding identifiers are determined in the feature database based on the feature information of these 18 short phrases. For example: "6673,7253,9071,9108,5740,5822,5923,5970,6096,6400,6822,7230,8955,9717,7871,7684,7710,7860".
[0155] 303. Based on the first information, generate the feature information of the first test case.
[0156] In this embodiment, after determining the identification information of one or more phrases in the first test case, the test case generation device can generate feature information of the first test case based on the first information. Specifically, the first information includes one or more of the following: identification information corresponding to one or more phrases, identification information corresponding to the name of the first test case, or identification information corresponding to the type of the first test case. Each test case name has corresponding identification information, which can be a set of strings. Test cases have different types, and each type has unique corresponding identification information, which can also be a set of strings.
[0157] This application embodiment illustrates a method for generating feature information of a first test case. Specifically, the feature information of the first test case is determined based on various identification information related to the first test case, which can effectively improve the correlation between the feature information and the first test case, further improve the accuracy of determining the second test case based on the feature information of the first test case, and improve the accuracy and efficiency of configuring test resources for the test case.
[0158] Please refer to the foregoing embodiments. Figure 4 , Figure 4 This is a schematic diagram of another embodiment of the test case generation method provided in this application. In the test case generation method proposed in this application, feature information of a first test case is generated based on first information, including:
[0159] 401. Perform concatenation on the first piece of information to generate the first string.
[0160] In this embodiment, after obtaining the first information, the test case generation device performs concatenation processing on the first information to generate a first string. For example, the first information includes: identification information corresponding to one or more short phrases, identification information corresponding to the name of the first test case, and identification information corresponding to the type of the first test case. For instance, the identification information corresponding to one or more short phrases is: “6673,7253,9071,9108,5740,5822,5923,5970,6096,6400,6822,7230,8955,9717,7871,7684,7710,7860”; the identification information corresponding to the name of the first test case is “894781179921058”; and the identification information corresponding to the type of the first test case is “01”.
[0161] The test case generation device concatenates the aforementioned identification information in a certain order, and the resulting string is called the first string. For example, the first string is: "66737253907191085740582259235970609664006822723089559717787176847710786089478117992105801".
[0162] The order can be: 1. Identification information corresponding to one or more short phrases, 2. Identification information corresponding to the name of the first test case, 3. Identification information corresponding to the type of the first test case. Alternatively, the order can be: 1. Identification information corresponding to the name of the first test case, 2. Identification information corresponding to the type of the first test case, 3. Identification information corresponding to one or more short phrases. This application embodiment does not impose any limitations on this.
[0163] When the first test case includes multiple short sentences, the order of the identification information corresponding to one or more short sentences in the sequence is arranged according to the order in which the short sentences appear in the first test case.
[0164] 402. Perform a hash calculation on the first string to generate the feature information of the first test case.
[0165] In this embodiment, after the test case generation device generates the first string, it performs a hash calculation on the first string. The result of the hash calculation is then used as the feature information of the first test case. The string length of the feature information of the first test case is less than the string length of the first string.
[0166] The hash algorithm used in hash calculation is a common hashing algorithm, which maps a long string of information to a unique, shorter string for easier storage and comparison. This application does not limit the algorithm used for hash calculation in its embodiments.
[0167] For example, the first string is: "66737253907191085740582259235970609664006822723089559717787176847710786089478117992105801". Using the MD2 algorithm for hash calculation, the resulting hash value is "b9bc39afafdb60a1de14bddff389c384". This hash value is used as the feature information for the first test case.
[0168] For example, please refer to Figure 15 , Figure 15 This is a schematic diagram illustrating the process of generating feature information for the first test case in this embodiment. After obtaining the first test case, the test case generation device extracts features from it to obtain identification information corresponding to one or more short phrases (the identification information includes: operation steps or preconditions), identification information corresponding to the name of the first test case, and identification information corresponding to the type of the first test case. Then, the test case generation device concatenates the above identification information to obtain a first string. Next, the test case generation device performs a hash calculation on the first string, and the resulting hash value serves as the feature information of the first test case.
[0169] In this embodiment of the application, the test case generation device converts the first string with a larger string length into a unique corresponding hash value through hash calculation, and then uses the hash value as the feature information of the first test case, which facilitates subsequent storage and comparison calculation.
[0170] In conjunction with the foregoing embodiments, another embodiment of the test case generation method provided in this application includes: one or more short phrases including one or more of the following: operation steps of the first test case, preconditions for the operation steps of the first test case, or expected results of the first test case.
[0171] For example, please refer to Figure 14 , Figure 14This is a schematic diagram illustrating the composition of a test case in an embodiment of this application. Specifically, the name of this test case is "Requesting the user to change the payment method," and the identifier information corresponding to the name of this test case is "0001."
[0172] The steps for this test case include: "1. Directly connect to the merchant system to request and obtain the payment order voucher (ID: 1)."
[0173] [System] Verify the validity of the order request information (ID: 2)
[0174] [System] Processing order request (id: 5)
[0175] 2. Direct connection to merchant system to request payment (ID: 7)
[0176] [System] Verify the validity of the payment request information (ID: 8)
[0177] 3. [System] The system verifies that the user's feedback indicates payment confirmation, and the verification requires the user to submit their payment password for authorization (ID: 14).
[0178] 4. [System] The system verifies that the user's feedback indicates authorized payment, and verification requires requesting the bank system to deduct funds (ID: 16).
[0179] [System] Set the current payment method to unavailable and record the reason for unavailability (ID: 18a1).
[0180] The prerequisites for the operation steps of this test case include: "4.1 [System] Verify that the bank system's feedback result is a failure, and guide the user to change the payment method (ID: 18a)."
[0181] {Did the bank system report a successful deduction?: No}
[0182] {Is there any feedback from the banking system?}
[0183] 4.2 [System] Request user to change payment method (ID: 18a2)
[0184] {Has the system set up order information to disable the use of WeChat Pay for merchants specified by merchant ID?: No}
[0185] {Has the user's payment account activated for payment services: Yes}.
[0186] The expected outcome of this test case includes: "1.1 [System] Feedback on payment order voucher (ID: 6)"
[0187] 2.1 [System] Requests user confirmation of payment information (ID: 13)
[0188] 3.1 [System] Request user to submit payment password to authorize payment (id: 15)
[0189] 4.1 [System] Request the user to change the payment method (ID: 18a2).
[0190] Each of the above short phrases has a unique corresponding identifier. For example, the identifier for the short phrase "4.1 [System] Requests user to change payment method" is "18a2".
[0191] In conjunction with the foregoing embodiments, another embodiment of the test case generation method provided in this application includes: concatenating first information to generate a first string, including:
[0192] The first information is concatenated in the following order to generate a first string, which includes: the name of the first test case, the type of the first test case, the operation steps of the first test case, and the preconditions of the operation steps of the first test case. The operation steps of the first test case are arranged in the order indicated in the first test case.
[0193] Specifically, after determining the order of the first information, the test case generation device performs connection processing on the first information according to the order of its arrangement. Figure 14 Taking this as an example, the first piece of information includes: "000118a18a212578141618a16131518a2".
[0194] In conjunction with the foregoing embodiments, another embodiment of the test case generation method provided in this application includes: the type of the first test case includes either a verification behavior type or a verification rule type. Specifically, different types have different identification information; for example, the identification information for the verification behavior type is "01", and the identification information for the verification rule type is "02".
[0195] Please refer to the foregoing embodiments. Figure 5 , Figure 5 This is a schematic diagram of another embodiment of the test case generation method provided in this application. The test case generation method provided in this application also includes:
[0196] 501. Obtain the information from the first requirement document.
[0197] In this embodiment, the test case generation device first obtains first requirements document information from the user or other computer devices. For easier understanding, please refer to [link to relevant documentation]. Figure 11 , Figure 11 This is a schematic diagram of the upload entry point for requirement document information in the embodiments of this application. Figure 11In this example, the first requirement document uploaded by the user is "jsapi.docx". It's understandable that one first requirement document can correspond to one or more test cases.
[0198] The requirements document can be in text format, such as a .doc or .docx file. It contains one or more statements in natural language. These statements represent the requirements data written in natural language.
[0199] Optionally, after the test case generation device obtains the first requirement document information, it checks the validity of the first requirement document information. For example... Figure 12 As shown, Figure 12 This is a schematic diagram illustrating the legality check of the requirement document information in this embodiment. Once the legality check of each statement in the first requirement document information passes, the process proceeds to step 502.
[0200] 502. Convert the information in the first requirement document into first requirement data.
[0201] In this embodiment, after the test case generation device obtains the first requirement document information, it converts the first requirement document information into first requirement data. The first requirement data is structured data, such as a JSON file.
[0202] The following description is in conjunction with the accompanying drawings. For example: Please refer to... Figure 7 , Figure 7 This is a schematic diagram of the interface for setting the requirements document information in an embodiment of this application. Figure 7 This illustration shows how to set up the path steps for requirements document information. For example, the title of the first requirements document is "Simplified Payment Registration User - Payment," and the target system of this first requirements document is the "Payment System." The name of the system use case corresponding to this first requirements document is "Simplified Payment Registration User - Payment." The main executor of this system use case is "Simplified Payment Registration User." The auxiliary executor of this system use case is the "Bank System." Detailed steps for this system use case include: "1. User submits payment information and requests payment," "1a. User cancels payment," "1a.1 [System] Proceed to step 9," "1b. User selects to add bank card payment," "1b1. [System] Proceed to "Add New Card Use Case, proceed to step 2 upon completion," etc.
[0203] Please see Figure 8 , Figure 8 This is a schematic diagram of another setting interface for requirement document information in the embodiments of this application. Figure 8This illustrates the process of setting up relevant business rules in the requirements document. Specifically, regarding "Simplified Payment Registration - Payment," the supplementary constraints are set as follows: "1. User submits payment information and requests payment," "2a. [System] checks the payment information or transaction information for invalidity," "Discount rules..." etc. After setting up the first requirements document, save it in docx format.
[0204] After obtaining the first requirement document information, the test case generation device converts the first requirement document information into first requirement data, which is structured data. For easier understanding, please refer to [link to relevant documentation]. Figure 9 , Figure 9 This is a schematic diagram of the first requirement data in the embodiments of this application.
[0205] Furthermore, users can modify the information in the initial requirement document. For example... Figure 10 The interface shown in the illustration. Figure 10 This is a schematic diagram of the editing interface for requirement document information in an embodiment of this application.
[0206] Optionally, users can also edit and modify the structured primary requirement information. For details on the editing interface, please refer to [link / reference needed]. Figure 10 The interface shown in the illustration.
[0207] One possible implementation is that the aforementioned settings and editing interfaces are displayed in a web browser.
[0208] 503. Based on the first requirement data, generate the system use cases corresponding to the first requirement data.
[0209] In this embodiment, after the test case generation device generates the first requirement data, it can generate corresponding system test cases based on the first requirement data. For easier understanding, please refer to [link to relevant documentation]. Figure 13 , Figure 13 This is a schematic diagram illustrating the composition of a system use case in an embodiment of this application. A system use case includes one or more of the following: a system use case executor (including a main executor and auxiliary executors), a set of preconditions related to the business, a set of postconditions, and a business path. The business path includes a basic path and extended paths. The basic path is the core business process, and the extended paths are extensions of the core business process. Each business path includes multiple business steps, and each business step has corresponding constraints. These constraints include one or more of the following: a field list, business rules, non-functional requirements, and design constraints.
[0210] 504. Generate the first test case based on the system test cases corresponding to the first requirement data.
[0211] In this embodiment, the test case generation device analyzes the system test cases and generates corresponding test cases.
[0212] Furthermore, to enrich the number of test cases in the feature database, the test case generation device can generate multiple test cases. Finally, based on the generated multiple test cases, one or more test case sets are constructed.
[0213] In this embodiment, the test case generation device can obtain a text document format requirement document for the target product, then perform a structured transformation on the text document format requirement document to obtain structured requirement data, which can then be displayed in a web browser. The structured requirement data displayed in the web browser provides users with query, addition, and modification functions. Users can query, modify, and add requirements in the web browser displaying the structured requirement data. For added or modified requirements, a legality check can be performed. When the check is successful, the structured requirement document can be updated and stored based on the addition or modification operation. This facilitates subsequent device parsing of the requirement data and generation of system test cases. Because the computer device performs UML modeling and transformation of the target product's product requirement document and displays it on the computer device's display interface, it provides users with the functions of querying, writing, adding, and deleting adjustment operations for the product requirement document. When users need to modify or adjust the product, they do not need to rewrite the corresponding product requirement document for the adjusted product; instead, they can directly add, delete, and modify the target product's product requirement data in the display interface, greatly facilitating users' product updates and testing of the updated product.
[0214] In conjunction with the foregoing embodiments, the test case generation method provided in this application further includes: performing semantic analysis on the first test case using a neural network model to extract feature information of one or more short sentences in the first test case.
[0215] Specifically, when the test case generation device uses a neural network model (e.g., a machine learning algorithm) to analyze the corpus of test cases (e.g., one or more short sentences) and determine the feature information corresponding to the first test case, and the test case generation device finds feature information in the feature database that is similar to the feature information corresponding to the first test case, the test case generation device considers the second test case corresponding to the feature information in the feature database to be semantically similar to the first test case, and thus determines that the first test case and the second test case describe the same test scenario, and the same test resources can be reused.
[0216] The test case generation apparatus of this application is described in detail below. This apparatus is used to perform the relevant processes executed by the test case generation apparatus in the foregoing embodiments. Please refer to... Figure 16 , Figure 16 This is a schematic diagram of a test case generation device according to an embodiment of this application. A test case generation device 1600 according to an embodiment of this application includes:
[0217] The transceiver module 1601 is used to obtain the first test case;
[0218] Processing module 1602 is used to generate feature information of the first test case based on the first test case;
[0219] The processing module 1602 is further configured to determine the second test case from the feature database based on the feature information of the first test case, wherein the feature database stores feature information of one or more test cases, the feature information of the first test case is consistent with the feature information of the second test case, and the test resource associated with the second test case is the first test resource;
[0220] The processing module 1602 is also used to associate the first test case with the first test resource and reuse the first test resource.
[0221] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0222] The processing module 1602 is also used to extract feature information of one or more short sentences in the first test case;
[0223] The processing module 1602 is also used to determine the identification information corresponding to one or more short sentences based on the feature information of one or more short sentences;
[0224] Processing module 1602 is further configured to generate feature information of the first test case based on the first information, wherein the first information includes one or more of the following:
[0225] Identification information corresponding to one or more short phrases, identification information corresponding to the name of the first test case, or identification information corresponding to the type of the first test case.
[0226] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0227] The processing module 1602 is also used to perform concatenation processing on the first information to generate a first string, wherein the first string includes the first information;
[0228] The processing module 1602 is also used to perform hash calculation on the first string to generate feature information of the first test case.
[0229] In one possible design, in another implementation of another aspect of the embodiments of this application, the string length of the feature information of the first test case is less than the string length of the first string.
[0230] In one possible design, in another implementation of another aspect of the embodiments of this application, one or more short phrases include one or more of the following:
[0231] The operation steps of the first test case, the preconditions for the operation steps of the first test case, or the expected result of the first test case.
[0232] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0233] The processing module 1602 is further configured to perform concatenation processing on the first information in the following order to generate a first string, the order including: the name of the first test case, the type of the first test case, the operation steps of the first test case, and the preconditions of the operation steps of the first test case, wherein the operation steps of the first test case are arranged in the order indicated in the first test case.
[0234] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0235] The first test case type includes either a validation behavior type or a validation rule type.
[0236] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0237] The transceiver module 1601 is also used to obtain first requirement document information, which includes one or more short sentences in natural language.
[0238] Processing module 1602 is also used to convert the first requirement document information into first requirement data, wherein the first requirement data is structured data;
[0239] The processing module 1602 is also used to generate system use cases corresponding to the first requirement data based on the first requirement data;
[0240] The processing module 1602 is also used to generate the first test case based on the system test cases corresponding to the first requirement data.
[0241] In one possible design, in another implementation of another aspect of the embodiments of this application, the system use case includes one or more of the following information: system use case executor, a set of business-related preconditions, a set of postconditions, and a business path.
[0242] The business path includes a basic path and extended paths. The basic path is the core business process, and the extended path is an extension of the core business process. Each business path includes multiple business steps, and each business step has corresponding constraints.
[0243] Constraints include one or more of the following: field list, business rules, non-functional requirements, and design constraints.
[0244] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0245] The processing module 1602 is also used to perform semantic analysis on one or more test cases to determine the test resources corresponding to one or more test cases;
[0246] The processing module 1602 is also used to construct a test case set based on one or more test cases and the test resources corresponding to one or more test cases, wherein the test case set includes one or more test cases and the association relationship between one or more test cases and the test resources corresponding to one or more test cases;
[0247] The processing module 1602 is also used to compose a feature database based on one or more test case sets.
[0248] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0249] The processing module 1602 is also used to perform semantic analysis on the first test case using a neural network model, and extract feature information of one or more short sentences in the first test case.
[0250] Figure 17 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 700 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 722 (e.g., one or more processors) and memory 732, and one or more storage media 730 (e.g., one or more mass storage devices) for storing application programs 742 or data 744. The memory 732 and storage media 730 can be temporary or persistent storage. The program stored in the storage media 730 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the server. Furthermore, the CPU 722 may be configured to communicate with the storage media 730 and execute the series of instruction operations in the storage media 730 on the server 700.
[0251] Server 700 may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input / output interfaces 758, and / or one or more operating systems 741, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0252] The steps performed by the server in the above embodiments can be based on this Figure 17 The server structure shown.
[0253] Figure 18 This is a schematic diagram of a terminal device structure provided in an embodiment of this application, such as... Figure 18 As shown, for ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application. This terminal device is also called a user terminal, which can be any terminal device including mobile phones, tablets, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. User terminals include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, in-vehicle terminals, and aircraft. Taking a mobile phone as an example:
[0254] Figure 18 This diagram illustrates a partial structural representation of a mobile phone related to the terminal device provided in this embodiment. (Reference) Figure 18 The mobile phone includes components such as a radio frequency (RF) circuit 810, a memory 820, an input unit 830, a display unit 840, a sensor 850, an audio circuit 860, a wireless fidelity (WiFi) module 870, a processor 880, and a power supply 890. Those skilled in the art will understand that... Figure 18 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0255] The following is combined Figure 18 A detailed introduction to each component of a mobile phone:
[0256] RF circuit 810 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with processor 880; additionally, it transmits uplink data to the base station. Typically, RF circuit 810 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, RF circuit 810 can also communicate wirelessly with networks and other devices. The aforementioned wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0257] The memory 820 can be used to store software programs and modules. The processor 880 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 820. The memory 820 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 820 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0258] The input unit 830 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 830 may include a touch panel 831 and other input devices 832. The touch panel 831, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 831), and drive the corresponding connection devices according to a pre-set program. Optionally, the touch panel 831 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 880, and can also receive and execute commands sent by the processor 880. In addition, the touch panel 831 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 831, the input unit 830 may also include other input devices 832. Specifically, other input devices 832 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0259] The display unit 840 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 840 may include a display panel 841, which may optionally be configured as a Liquid Crystal Display (LCD), Organic Light-Emitting Diode (OLED), or similar display. Further, a touch panel 831 may cover the display panel 841. When the touch panel 831 detects a touch operation on or near it, it transmits the information to the processor 880 to determine the type of touch event. Subsequently, the processor 880 provides corresponding visual output on the display panel 841 based on the type of touch event. Although in Figure 18 In this embodiment, the touch panel 831 and the display panel 841 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 831 and the display panel 841 can be integrated to realize the input and output functions of the mobile phone.
[0260] The mobile phone may also include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 841 according to the ambient light level, and the proximity sensor can turn off the display panel 841 and / or backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, which can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0261] Audio circuit 860, speaker 861, and microphone 862 provide an audio interface between the user and the mobile phone. Audio circuit 860 converts received audio data into electrical signals and transmits them to speaker 861, where speaker 861 converts them into sound signals for output. On the other hand, microphone 862 converts collected sound signals into electrical signals, which are received by audio circuit 860, converted into audio data, and then output to processor 880 for processing. The audio data is then transmitted via RF circuit 810 to, for example, another mobile phone, or output to memory 820 for further processing.
[0262] WiFi is a short-range wireless transmission technology. Through the WiFi module 870, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 18 The WiFi module 870 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.
[0263] The processor 880 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 820, and by calling data stored in the memory 820, thereby performing an overall check of the phone. Optionally, the processor 880 may include one or more processing units; optionally, the processor 880 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may also not be integrated into the processor 880.
[0264] The phone also includes a power supply 890 (such as a battery) that supplies power to various components. Optionally, the power supply can be logically connected to the processor 880 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0265] Although not shown, mobile phones may also include a camera, Bluetooth module, etc., which will not be described in detail here.
[0266] The steps performed by the terminal device in the above embodiments can be based on this Figure 18 The terminal device structure is shown.
[0267] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the foregoing embodiments.
[0268] This application also provides a computer program product including a program, which, when run on a computer, causes the computer to perform the methods described in the foregoing embodiments.
[0269] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0270] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0271] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0272] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0273] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0274] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A test case generation method, characterized in that, include: Obtain the first test case; Based on the first test case, generate the feature information of the first test case; Based on the feature information of the first test case, a second test case is determined from the feature database, wherein the feature database stores feature information of one or more test cases, the feature information of the first test case is consistent with the feature information of the second test case, and the test resource associated with the second test case is the first test resource; Associate the first test case with the first test resource and reuse the first test resource.
2. The method according to claim 1, characterized in that, Based on the first test case, generate the feature information of the first test case, including: Extract feature information from one or more short sentences in the first test case; Based on the feature information of the one or more short sentences, determine the identification information corresponding to the one or more short sentences; Based on the first information, feature information of the first test case is generated, wherein the first information includes one or more of the following: The identification information corresponding to one or more short phrases, the identification information corresponding to the name of the first test case, or the identification information corresponding to the type of the first test case.
3. The method according to claim 2, characterized in that, Based on the first information, feature information of the first test case is generated, including: The first information is concatenated to generate a first string, which includes the first information. Perform a hash calculation on the first string to generate the feature information of the first test case.
4. The method according to claim 3, characterized in that, The string length of the feature information of the first test case is less than the string length of the first string.
5. The method according to claim 2, characterized in that, The one or more short phrases include one or more of the following: The operation steps of the first test case, the preconditions for the operation steps of the first test case, or the expected result of the first test case.
6. The method according to claim 3, characterized in that, The first information is concatenated to generate the first string, including: The first information is concatenated in the following order to generate the first string, the order including: the name of the first test case, the type of the first test case, the operation steps of the first test case, and the preconditions of the operation steps of the first test case, wherein the operation steps of the first test case are arranged in the order indicated in the first test case.
7. The method according to claim 6, characterized in that, The first test case can be of the following types: verification behavior type or verification rule type.
8. The method according to claim 1, characterized in that, Obtaining the first test case includes: Obtain first requirement document information, which includes one or more short sentences in natural language; The first requirement document information is converted into first requirement data, which is structured data. Based on the first requirement data, generate system use cases corresponding to the first requirement data; The first test case is generated based on the system test cases corresponding to the first requirement data.
9. The method according to claim 8, characterized in that, The system use case includes one or more of the following information: system use case executor, a set of business-related preconditions, a set of postconditions, and a business path. The business path includes a basic path and extended paths. The basic path is the core business process, and the extended paths are extensions of the core business process. Each business path includes multiple business steps, and each business step has corresponding constraints. The constraints include one or more of the following: field list, business rules, non-functional requirements, and design constraints.
10. The method according to claim 1, characterized in that, Before obtaining the first test case, the method further includes: Perform semantic analysis on the one or more test cases to determine the test resources corresponding to the one or more test cases; Based on the one or more test cases and the test resources corresponding to the one or more test cases, a test case set is constructed, wherein the test case set includes the one or more test cases and the association relationship between the one or more test cases and the test resources corresponding to the one or more test cases; The feature database is composed of one or more test case sets.
11. The method according to any one of claims 2-10, characterized in that, Extracting feature information from one or more short sentences in the first test case, including: A neural network model is used to perform semantic analysis on the first test case to extract feature information of one or more short sentences in the first test case.
12. A test case generation device, characterized in that, include: The send / receive module is used to obtain the first test case; The processing module is used to generate feature information of the first test case based on the first test case; The processing module is further configured to determine a second test case from a feature database based on the feature information of the first test case, wherein the feature database includes one or more test cases, the feature information of the first test case is consistent with the feature information of the second test case, and the test resource associated with the second test case is the first test resource; The processing module is further configured to associate the first test case with the first test resource and reuse the first test resource.
13. A computer device, characterized in that, include: Memory, processor, and bus system; The memory is used to store programs; The processor is configured to execute a program in the memory, and the processor is configured to execute the method of any one of claims 1 to 11 according to instructions in the program code; The bus system is used to connect the memory and the processor to enable communication between the memory and the processor.
14. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 11.
15. A computer program product, comprising a computer program and instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method as described in any one of claims 1 to 11.