Chaotic test case acquisition method and device and storage medium
Through the factor extraction and intent identification model, the test scenario elements and capability objectives are obtained, and the chaos test cases are sorted and updated, which solves the problems of low efficiency in the use case acquisition and complex construction in the existing technology, and achieves efficient and accurate test cases acquisition.
Patent Information
- Application Number
- CN202411831074.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, the acquisition efficiency of chaos test cases is low, the construction process is complex, and the requirements for testers are high, making it difficult to ensure the accuracy of the use cases.
The test scenario elements are obtained through the feature extraction model, and the test capability targets are obtained through the intent identification model. According to these elements, the matching chaotic test cases in the use case database are sorted and updated, and the sorted results and updated use cases are displayed.
It reduces the labor and time cost of chaos test case development, improves the efficiency of use case acquisition, simplifies construction complexity, and improves the test accuracy of use cases.
Smart Images

Figure CN119597674A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to a method, device and storage medium for acquiring chaos test cases. Background Art
[0002] With the continuous development of software technology, the stability and reliability of business systems have become the focus of people's attention, and chaos testing has become one of the most commonly used testing methods.
[0003] Chaos testing is to test the resilience of software systems by introducing random failures. It requires a specific and detailed test plan as a test basis. In the existing technology, testers need to define test objectives, clarify test points, estimate expected results, and then design failure scenarios based on experience to complete the construction of chaos test cases.
[0004] However, this method of obtaining test cases not only requires high manpower and time costs, but also has low test case acquisition efficiency. It also places high demands on testers, who need to understand the principles of fault setting and have sufficient understanding of device performance and software systems. It is difficult to ensure the accuracy of chaos test cases. Summary of the invention
[0005] The present invention provides a method, device, electronic device and storage medium for acquiring chaos test cases, so as to solve the problems of low efficiency in acquiring chaos test cases and complex construction process.
[0006] According to one aspect of the present invention, a method for obtaining a chaos test case is provided, comprising:
[0007] In response to obtaining a use case presentation request, obtaining test scenario elements through an element extraction model, and obtaining a test capability target through an intent recognition model;
[0008] According to the test scenario elements and the test capability objectives, the chaotic test cases matched in the use case database are sorted, and the sorting results are displayed through a display interface;
[0009] According to the test scenario elements and the test capability target, the target chaos test case selected in the display interface is updated to display the updated target chaos test case.
[0010] The method of sorting the chaotic test cases matched in the use case database according to the test scenario elements and the test capability goals includes: sorting the chaotic test cases matched under different scenario categories respectively according to the test scenario elements and the test capability goals; wherein the scenario categories include atomic scenarios, link scenarios and aggregate scenarios.
[0011] After displaying the updated target chaos test case, it also includes: obtaining a constructed link scenario case based on multiple target chaos test cases under the atomic scenario; and / or obtaining a constructed aggregate scenario case based on multiple target chaos test cases under the link scenario.
[0012] The feature extraction model includes a recurrent neural network model; the intent recognition model includes a neural network model based on an attention mechanism.
[0013] The method of obtaining test scenario elements through an element extraction model and obtaining test capability targets through an intent recognition model specifically includes: obtaining the start probability of each character in the use case display request as an extraction start point and the end probability of each character as an extraction end point; obtaining a target start character according to the start probability of each character and obtaining a target end character according to the end probability of each character; extracting valid paragraph information in the use case display request according to the target start character and the target end character; obtaining test scenario elements through an element extraction model according to the valid paragraph information and obtaining test capability targets through an intent recognition model.
[0014] The obtaining of the starting probability of each character in the use case display request as the extraction starting point, and the ending probability of each character as the extraction ending point, comprises: obtaining the starting probability of each character in the use case display request as the extraction starting point, and the ending probability of each character as the extraction ending point through a trained paragraph extraction model; wherein the paragraph extraction model is constructed based on a neural network with a self-attention mechanism.
[0015] According to another aspect of the present invention, a chaotic test case acquisition device is provided, comprising:
[0016] An information extraction execution module, configured to obtain test scenario elements through an element extraction model and obtain test capability targets through an intent recognition model in response to obtaining a use case display request;
[0017] A use case sorting execution module is used to sort the chaotic test cases matched in the use case database according to the test scenario elements and the test capability objectives, and display the sorting results through a display interface;
[0018] The use case update execution module is used to update the target chaos test case selected in the display interface according to the test scenario elements and the test capability target, so as to display the updated target chaos test case.
[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0020] at least one processor; and
[0021] a memory communicatively connected to the at least one processor; wherein,
[0022] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the chaotic test case acquisition method described in any embodiment of the present invention.
[0023] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the chaotic test case acquisition method described in any embodiment of the present invention when executed.
[0024] According to another aspect of the present invention, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method for acquiring chaotic test cases according to any embodiment of the present invention is implemented.
[0025] The technical solution of the embodiment of the present invention, after obtaining the use case display request, first obtains the test scenario elements through the element extraction model, and obtains the test capability target through the intention recognition model; then sorts the chaotic test cases matched in the use case database according to the test scenario elements and the test capability target; finally, updates the target chaotic test cases selected in the display interface according to the test scenario elements and the test capability target. It not only reduces the manpower cost and time cost required for the development of chaotic test cases, improves the efficiency of obtaining chaotic test cases, but also the acquisition method has a low degree of dependence on testers, simplifies the complexity of building chaotic test cases, and improves the test accuracy of chaotic test cases.
[0026] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 This is a flowchart of a method for obtaining a chaos test case provided in accordance with the first embodiment of the present invention;
[0029] Figure 2 is a flowchart of another method for obtaining chaos test cases provided in Embodiment 2 of the present invention;
[0030] Figure 3 is a flowchart of another method for obtaining chaos test cases provided in Embodiment 3 of the present invention;
[0031] Figure 4 This is a structural schematic diagram of a chaotic test case acquisition device provided according to a fourth embodiment of the present invention;
[0032] Figure 5 It is a structural schematic diagram of an electronic device for implementing the chaotic test case acquisition method of an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] Embodiment 1
[0036] Figure 1 This is a flowchart of a method for obtaining a chaotic test case provided in the first embodiment of the present invention. This embodiment can be applied to obtain a chaotic test case according to the test scenario elements and test capability targets in the case display request. This method can be executed by a chaotic test case acquisition device in any embodiment of the present invention. The chaotic test case acquisition device can be implemented in the form of hardware and / or software. The chaotic test case acquisition device can be configured in an electronic device such as a server. Figure 1 As shown, the method includes:
[0037] S101. In response to obtaining a use case presentation request, obtaining test scenario elements through an element extraction model, and obtaining a test capability target through an intent recognition model.
[0038] The user can send text information of the use case display request through the input box displayed in the upper computer interface; after obtaining the use case display request, the server extracts the test scenario elements therein according to the element extraction model, and extracts the test capability goals therein through the intent recognition model; the test scenario elements are the element information in the use case display request that describes the test scenario to which the chaos test case is applicable. For example, the test scenario elements may include the object of action, the fault type and the system parameters.
[0039] The action object indicates the test object of the chaos test case, which may include the device name (for example, the service provider device) and the container name; the fault type indicates the fault name that occurs in the chaos test case, such as network failure, high CPU usage, high memory usage, I / O busy, and disk full; the system parameters indicate the test items involved in the test object, such as the mount directory, port, class method, and process number; the test capability target reflects the test intention of the chaos test case user, such as self-isolation capability, active-active capability, graceful startup capability, graceful shutdown capability, and current limiting capability.
[0040] The keyword types and keyword composition structures of test scenario elements and test capability targets are different, and when users issue use case display requests, there is often a certain degree of randomness and habit in their language expressions. Test capability targets sometimes do not appear in use case display requests, that is, test capability targets cannot be extracted through use case display requests; and test scenario elements, as test scenario elements that describe the applicability of chaos test cases, need to include at least one test scenario element in the use case display request. For example, the fault type may be missing in the user display request, but the object of action must be included, otherwise the chaos test case obtained this time will lose its specific test significance.
[0041] Accordingly, in a valid use case display request, the extraction result of the test capability target may be a null value, but the extraction result of the test scenario element cannot be a null value. After the test scenario elements and the test capability target are extracted respectively through the pre-trained feature extraction model and intent recognition model, once the feature extraction model does not mention any test scenario elements, the current use case display request can be identified as an invalid request, that is, the request will not be responded to; at the same time, when the intent recognition model does not extract the test capability target, the current use case display request will not be mistakenly identified as an invalid request, thereby ensuring the response to the current use case display request.
[0042] This can avoid the timely detection of invalid requests with empty values for test scenario elements, and can also avoid mistaking use case display requests with empty values for test capability targets for invalid requests. In particular, the element extraction model and the intent recognition model require different training samples to be trained separately. At the same time, the two can also be constructed separately based on different neural network structures to obtain matching keyword extraction models according to the different keyword types, structures and positions.
[0043] Optionally, in an embodiment of the present invention, the feature extraction model includes a recurrent neural network model; the intent recognition model includes a neural network model based on an attention mechanism. Specifically, a recurrent neural network (RNN) is a recursive neural network that takes sequence data as input, performs recursion in the direction of sequence evolution, and all nodes are connected in a chain. It is characterized in that adjacent input information is used as associated information to ensure the coherence between words.
[0044] For the test scenario elements in the chaos test case, it not only includes a large number of keywords, but also each keyword often has a certain continuity. Taking the above-mentioned technical solution as an example, the action object and system parameters often appear in one sentence. For example, the use case display request is "perform a network fault (fault type) test on the first process (i.e., system parameters) opened by the service provider (i.e., the action object)", in which the action object, system parameters and fault type appear continuously. Therefore, the element extraction model can be constructed and trained based on the recurrent neural network to ensure the complete extraction of the test scenario elements and avoid losing keywords, for example, avoid losing the "system parameters" that have an associated relationship with the "action object".
[0045] The neural network model based on the attention mechanism is composed of multiple stacked encoder layers and multiple stacked decoder layers. The output result is output through the output layer connected to the terminal decoder layer. Its characteristic is that it regards each word as an equidistant word, without paying attention to the distance between words, that is, it does not regard adjacent words as related words, so as to ensure the independence of each word.
[0046] For the test capability target in the chaos test case, it not only includes only a small number of keywords, but also the keywords often appear in the form of independent words. Even if they are close to the test scenario elements, they will not be affected by the test scenario elements. Taking the above technical solution as an example, for example, the use case display request is "to perform a network fault (i.e., fault type) test on the first process (i.e., system parameters) opened by the service provider (i.e., the object of action) to test its current limiting capability (i.e., test capability target)". Although the test capability target is close to some test scenario elements and far away from some test scenario elements, it actually has no correlation with each test scenario element. Therefore, the intent extraction model can be constructed and trained based on the neural network of the attention mechanism to ensure the accurate extraction of the test capability target and avoid identifying it as a test scenario element or non-keyword.
[0047] S102. Sort the chaotic test cases matched in the test case database according to the test scenario elements and the test capability objectives, and display the sorting results through a display interface.
[0048] The test scenario elements and test capability goals can be used together as retrieval basis, and the similarity can be compared with the label information of each chaos test case in the use case database; wherein the label information describes the scenario information adapted by the current chaos test case and the test capability it possesses; then, a specified number of chaos test cases are obtained according to the similarity comparison results, and they are sorted in descending order according to the similarity comparison results, so that the sorting results can be displayed through a display interface.
[0049] In particular, the above-mentioned specified number can be determined based on the similarity comparison result. For example, all chaos test cases whose similarity comparison results are greater than or equal to a preset similarity threshold are regarded as chaos test cases that match the current use case display request, and are then displayed through the display interface, while other chaos test cases are not displayed; the above-mentioned specified number can also be a fixed value, that is, a specified number of chaos test cases with the highest similarity are obtained as chaos test cases that match the current use case display request.
[0050] In addition, the test scenario elements and test capability goals can be used as retrieval basis respectively, and the similarity is compared with the label information of each chaotic test case in the use case database respectively, so as to obtain the chaotic test cases that match each other respectively; wherein, the test scenario elements and the test capability goals correspond to different preset similarity thresholds respectively; the number of keywords of the test scenario elements is usually large, and the preset similarity threshold can be configured as a lower value, while the number of keywords of the test capability goals is usually small, and the preset similarity threshold can be configured as a higher value; then, the chaotic test cases that hit both the test scenario elements and the test capability goals are put in front, and then the chaotic test cases that only hit the test scenario elements and the chaotic test cases that only hit the test capability goals are sorted in turn according to the similarity comparison results.
[0051] In particular, when sorting multiple chaotic test cases that hit both the test scenario elements and the test capability targets, different weight coefficients can be configured for the test scenario elements and the test capability targets respectively, and the similarity comparison results of the test scenario elements are multiplied by the corresponding weight coefficients, and the similarity comparison results of the test capability targets are also multiplied by the corresponding weight coefficients. The product calculation results are then summed, and the multiple chaotic test cases that hit both the test scenario elements and the test capability targets are sorted according to the summation results.
[0052] Similarly, when sorting the chaotic test cases that only hit the test scenario elements and the chaotic test cases that only hit the test capability targets, different weight coefficients can be configured for the test scenario elements and the test capability targets respectively, and the similarity comparison results of the test scenario elements are multiplied by the corresponding weight coefficients, and the similarity comparison results of the test capability targets are also multiplied by the corresponding weight coefficients, and the product calculation results of each product are sorted.
[0053] S103. According to the test scenario elements and the test capability target, the target chaos test case selected in the display interface is updated to display the updated target chaos test case.
[0054] According to the user's selection results in the display interface, determine the chaos test case selected by the user, that is, the target chaos test case. If the test scenario elements and test capability targets in the use case display request are the same as the corresponding keywords in the label information of the target chaos test case, there is no need to update the target chaos test case; if the test scenario elements and test capability targets are different from the corresponding keywords, it is necessary to use the test scenario elements and test capability targets to replace the corresponding keywords; if a parameter of the test scenario elements and the test capability targets is a null value, the keyword corresponding to the null value item in the label information of the target chaos test case is also retained.
[0055] At the same time, each keyword in the label information can have one or more matching tracking locations in the code file of the chaos test case, so as to guide the tester to customize the update of the tracking location of the replacement keyword to achieve the generation of personalized chaos test cases; in addition, according to the user's selection result this time, the mapping relationship between the test scenario elements and test capability goals extracted from the current use case display request and the label information of the target chaos test case can be used as training samples to continue training the feature extraction model and the intent recognition model to ensure the real-time update of the feature extraction model and the intent recognition model, and improve the extraction effect of the feature extraction model and the intent recognition model.
[0056] The technical solution of the embodiment of the present invention, after obtaining the use case display request, first obtains the test scenario elements through the element extraction model, and obtains the test capability target through the intention recognition model; then sorts the chaotic test cases matched in the use case database according to the test scenario elements and the test capability target; finally, updates the target chaotic test cases selected in the display interface according to the test scenario elements and the test capability target. It not only reduces the manpower cost and time cost required for the development of chaotic test cases, improves the efficiency of obtaining chaotic test cases, but also the acquisition method has a low degree of dependence on testers, simplifies the complexity of building chaotic test cases, and improves the test accuracy of chaotic test cases.
[0057] Embodiment 2
[0058] Figure 2 This is a flow chart of a method for obtaining a chaos test case provided by the second embodiment of the present invention. The relationship between this embodiment and the above embodiment is that, according to different scene categories, target chaos test cases under different scene categories are displayed respectively. Figure 2 As shown, the method includes:
[0059] S201. In response to obtaining a use case presentation request, obtaining test scenario elements through an element extraction model, and obtaining a test capability target through an intent recognition model.
[0060] S202. Sort the chaotic test cases matching different scenario categories according to the test scenario elements and the test capability objectives, and display the sorting results through a display interface; wherein the scenario categories include atomic scenarios, link scenarios, and aggregate scenarios.
[0061] An atomic scenario use case is a use case for performing chaos testing on an electronic device in a business node or a functional component in the electronic device. It describes the minimum test scenario for chaos testing, for example, a use case for performing chaos testing on device B of business node A or interface B of device B. A link scenario use case is a test on a specific business execution link, which consists of at least two business nodes. For example, a use case for performing chaos testing on an encrypted business link consisting of node A, node B, and node C. An aggregation scenario use case is a use case for performing chaos testing on a node network composed of at least two business links. It includes chaos test cases that have been developed by individual testers based on actual needs.
[0062] When retrieving matching chaos test cases, you can search separately under different scenario categories to display the matching chaos test cases under different scenario categories to the user. This is convenient for users to browse by category and also convenient for users to splice and combine chaos test cases under the current scenario category or different scenario categories to obtain customized chaos test cases, thereby simplifying the process of building chaos test cases.
[0063] S203. Update the target chaos test case selected in the display interface according to the test scenario elements and the test capability target to display the updated target chaos test case.
[0064] Optionally, in an embodiment of the present invention, after displaying the updated target chaos test case, it also includes: obtaining a constructed link scenario case based on multiple target chaos test cases under the atomic scenario; and / or obtaining a constructed aggregate scenario case based on multiple target chaos test cases under the link scenario.
[0065] Specifically, each target chaos test case in the atomic scenario can be constructed into a link scenario case according to a preset connection method (for example, sequential connection, reverse connection and random connection); each target chaos test case in the link scenario can also be used to complete the construction of an aggregate scenario case based on a common business node. For example, link scenario case A includes nodes A, B and C connected in sequence; link scenario case B includes nodes D, B and E connected in sequence. Thus, an aggregate scenario case consisting of nodes A, B, C, D and E can be generated, and node B is respectively connected to nodes A, C, D and E. This realizes the automatic generation of personalized test cases required by users and further simplifies the complexity of building chaos test cases.
[0066] The technical solution of the embodiment of the present invention sorts the chaotic test cases matching different scenario categories according to the test scenario elements and the test capability objectives, thereby facilitating the user's classified browsing and combining the chaotic test cases under the current case category or different case category to obtain customized chaotic test cases. At the same time, based on multiple target chaotic test cases under the atomic scenario, a constructed link scenario case is obtained, and based on multiple target chaotic test cases under the link scenario, a constructed aggregate scenario case is obtained, thereby realizing the automatic generation of personalized test cases required by users and further simplifying the complexity of constructing chaotic test cases.
[0067] Embodiment 3
[0068] Figure 3 This is a flowchart of a method for obtaining a chaotic test case provided by the third embodiment of the present invention. The relationship between this embodiment and the above embodiment is that before extracting the test scenario elements and the test capability objectives, the valid paragraph information in the use case display request is first extracted. Figure 3 As shown, the method includes:
[0069] S301: In response to obtaining a use case display request, obtaining a start probability of each character in the use case display request being used as an extraction start point, and an end probability of each character being used as an extraction end point.
[0070] Due to the different expression habits of different users, invalid text content sometimes exists in the obtained use case display request, such as modal particles, conjunctions or polite expressions, and their appearance positions are usually at the front end or the back end. Therefore, after obtaining the use case display request, the start probability of each character in the use case display request as the extraction starting point and the end probability as the extraction end point can be obtained according to the label information of each chaotic test case stored in the use case database.
[0071] For example, the starting characters of each keyword in the label information of all chaotic test cases in the use case database are obtained, and the occurrence probability of each starting character is calculated, and then the probability is assigned to the same character in the use case display request, while the probability of other characters in the use case display request is zero, thereby obtaining the probability of each character in the use case display request as the starting character; similarly, the ending characters of each keyword in the label information of all chaotic test cases in the use case database are obtained, and the occurrence probability of each ending character is calculated, and then the probability is assigned to the same character in the use case display request, while the probability of other characters in the use case display request is zero, thereby obtaining the probability of each character in the use case display request as the ending character.
[0072] S302: acquiring a target start character according to the start probability of each character, and acquiring a target end character according to the end probability of each character.
[0073] After obtaining the start probability of each character, the character with the most forward position among the characters whose probability value is greater than the first probability threshold can be used as the target start character to ensure the complete acquisition of all keywords and avoid keyword loss. At the same time, after obtaining the end probability of each character, the character with the most backward position among the characters whose probability value is greater than the second probability threshold can be used as the target end character to also ensure the complete acquisition of all keywords and avoid keyword loss.
[0074] S303: Extract valid paragraph information in the use case display request according to the target starting character and the target ending character.
[0075] According to the target starting character and the target ending character, the valid paragraph information in the use case display request is extracted, and the information other than the valid paragraph information is deleted as invalid information, thereby reducing the number of characters in the use case display request, avoiding the situation where invalid characters are mistaken for test scenario elements and test capability targets, and improving the extraction accuracy of test scenario elements and test capability targets.
[0076] S304. According to the valid paragraph information, the test scenario elements are obtained through the element extraction model, and the test capability target is obtained through the intent recognition model.
[0077] S305. Sort the chaotic test cases matched in the test case database according to the test scenario elements and the test capability objectives, and display the sorting results through a display interface.
[0078] S306. According to the test scenario elements and the test capability target, the target chaos test case selected in the display interface is updated to display the updated target chaos test case.
[0079] Optionally, in an embodiment of the present invention, the step of obtaining the starting probability of each character in the use case display request as the starting point of extraction, and the ending probability of each character as the ending point of extraction, includes: obtaining the starting probability of each character in the use case display request as the starting point of extraction, and the ending probability of each character as the ending point of extraction through a trained paragraph extraction model; wherein, the paragraph extraction model is constructed based on a neural network with a self-attention mechanism.
[0080] Specifically, the paragraph extraction model is a pre-trained sorting model, which is used to extract text features for the use case display request and obtain a feature vector; wherein the text feature is the basic unit for representing text content, and the characters, words or phrases in the use case display request can be used as the text features of the use case display request, and the feature vector is the result of the quantitative representation of the text features, which is a multi-dimensional feature vector; after obtaining the feature vector of the use case display request, the feature vector is recognized to output the start probability of each character in the text information as the extraction starting point, and the end probability of each character as the extraction end point.
[0081] The self-attention mechanism has the characteristic of quickly extracting sparse data, while reducing the dependence on external information, and is more conducive to capturing the internal correlation of data or features; in an embodiment of the present invention, the paragraph extraction model constructed based on the neural network of the self-attention mechanism reduces the model's dependence on the number of training samples, while ensuring the accurate acquisition of test scenario elements and test capability objectives, it simplifies the steps of obtaining use case display requests. In addition, the paragraph extraction method based on the paragraph extraction model improves the extraction accuracy and efficiency of effective paragraph information.
[0082] The technical solution of the embodiment of the present invention obtains the predicted start probability of each character in the text information as the extraction starting point, and the predicted end probability of each character as the extraction end point, through the trained paragraph extraction model, thereby reducing the number of characters requested for use case display, avoiding the situation where invalid characters are mistaken for test scenario elements and test capability targets, and improving the extraction accuracy of test scenario elements and test capability targets.
[0083] Embodiment 4
[0084] Figure 4 : is a structural block diagram of a chaotic test case acquisition device provided by Embodiment 4 of the present invention, and the device specifically comprises:
[0085] The information extraction execution module 401 is used to obtain the test scenario elements through the element extraction model and the test capability target through the intention recognition model in response to obtaining the use case display request;
[0086] A use case sorting execution module 402 is used to sort the chaotic test cases matched in the use case database according to the test scenario elements and the test capability objectives, and to display the sorting results through a display interface;
[0087] The use case update execution module 403 is used to update the target chaos test case selected in the display interface according to the test scenario elements and the test capability target, so as to display the updated target chaos test case.
[0088] The technical solution of the embodiment of the present invention, after obtaining the use case display request, first obtains the test scenario elements through the element extraction model, and obtains the test capability target through the intention recognition model; then sorts the chaotic test cases matched in the use case database according to the test scenario elements and the test capability target; finally, updates the target chaotic test cases selected in the display interface according to the test scenario elements and the test capability target. It not only reduces the manpower cost and time cost required for the development of chaotic test cases, improves the efficiency of obtaining chaotic test cases, but also the acquisition method has a low degree of dependence on testers, simplifies the complexity of building chaotic test cases, and improves the test accuracy of chaotic test cases.
[0089] Optionally, the use case sorting execution module 402 is specifically used to sort the chaotic test cases matching different scenario categories according to the test scenario elements and the test capability goals; wherein the scenario categories include atomic scenarios, link scenarios and aggregate scenarios.
[0090] Optionally, the chaos test case acquisition device is also used to obtain a constructed link scenario case based on multiple target chaos test cases under the atomic scenario; and / or to obtain a constructed aggregate scenario case based on multiple target chaos test cases under the link scenario.
[0091] Optionally, the factor extraction model includes a recurrent neural network model; and the intent recognition model includes a neural network model based on an attention mechanism.
[0092] Optionally, the information extraction execution module 401 is specifically used to obtain the starting probability of each character in the use case display request as the extraction starting point, and the ending probability of each character as the extraction ending point; obtain the target starting character according to the starting probability of each character, and obtain the target ending character according to the ending probability of each character; extract the valid paragraph information in the use case display request according to the target starting character and the target ending character; obtain the test scenario elements through the element extraction model according to the valid paragraph information, and obtain the test capability target through the intent recognition model.
[0093] Optionally, the information extraction execution module 401 is further specifically used to obtain the starting probability of each character in the use case display request as the extraction starting point, and the ending probability of each character as the extraction end point through the trained paragraph extraction model; wherein the paragraph extraction model is constructed based on a neural network with a self-attention mechanism.
[0094] The above device can execute the chaotic test case acquisition method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the chaotic test case acquisition method provided by any embodiment of the present invention.
[0095] Embodiment 5
[0096] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, electronic devices, blade electronic devices, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0097] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0098] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0099] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the chaotic test case acquisition method.
[0100] In some embodiments, the chaos test case acquisition method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on a heterogeneous hardware accelerator via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by a processor, one or more steps of the chaos test case acquisition method described above can be performed. Alternatively, in other embodiments, the processor can be configured to execute the chaos test case acquisition method by any other appropriate means (e.g., by means of firmware).
[0101] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0102] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or electronic device.
[0103] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0104] To provide interaction with a user, the systems and techniques described herein may be implemented on a heterogeneous hardware accelerator having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) through which a user can provide input to the heterogeneous hardware accelerator. Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0105] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data electronic device), or a computing system that includes middleware components (e.g., an application electronic device), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0106] The computing system may include a client and an electronic device. The client and the electronic device are generally remote from each other and usually interact through a communication network. The relationship between the client and the electronic device is generated by computer programs running on corresponding computers and having a client-electronic device relationship with each other. The electronic device may be a cloud electronic device, also known as a cloud computing electronic device or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0107] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0108] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for obtaining a chaos test case, characterized in that: include: In response to obtaining a use case presentation request, obtaining test scenario elements through an element extraction model, and obtaining a test capability target through an intent recognition model; According to the test scenario elements and the test capability objectives, the chaotic test cases matched in the test case database are sorted, and the sorting results are displayed through a display interface; According to the test scenario elements and the test capability target, the target chaos test case selected in the display interface is updated to display the updated target chaos test case.
2. The method according to claim 1, characterized in that: The step of sorting the chaotic test cases matched in the test case database according to the test scenario elements and the test capability objectives includes: According to the test scenario elements and the test capability objectives, the chaos test cases matching different scenario categories are sorted respectively; wherein the scenario categories include atomic scenarios, link scenarios and aggregate scenarios.
3. The method according to claim 2, characterized in that After showing the updated target chaos test case, it also includes: According to the multiple target chaos test cases under the atomic scenario, a constructed link scenario case is obtained; And / or obtain a constructed aggregate scenario use case based on multiple target chaos test cases under the link scenario.
4. The method according to claim 1, characterized in that The feature extraction model includes a recurrent neural network model; the intent recognition model includes a neural network model based on an attention mechanism.
5. The method according to claim 1, characterized in that The acquisition of test scenario elements through the element extraction model and the acquisition of test capability objectives through the intent recognition model specifically include: Obtaining the starting probability of each character in the use case display request being used as the extraction starting point, and the ending probability of each character being used as the extraction ending point; Acquire a target starting character according to the start probability of each of the characters, and acquire a target ending character according to the end probability of each of the characters; Extracting valid paragraph information in the use case display request according to the target starting character and the target ending character; According to the valid paragraph information, the test scenario elements are obtained through the element extraction model, and the test capability target is obtained through the intent recognition model.
6. The method according to claim 5, characterized in that The obtaining of the starting probability of each character in the use case display request being used as the extraction starting point, and the ending probability of each character being used as the extraction ending point, includes: The paragraph extraction model is trained to obtain the starting probability of each character in the use case display request as the extraction starting point and the ending probability of each character as the extraction end point; wherein the paragraph extraction model is constructed based on a neural network with a self-attention mechanism.
7. A chaos test case acquisition device, characterized in that: include: An information extraction execution module, configured to obtain test scenario elements through an element extraction model and obtain test capability targets through an intent recognition model in response to obtaining a use case display request; A use case sorting execution module is used to sort the chaotic test cases matched in the use case database according to the test scenario elements and the test capability objectives, and display the sorting results through a display interface; The use case update execution module is used to update the target chaos test case selected in the display interface according to the test scenario elements and the test capability target, so as to display the updated target chaos test case.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the chaotic test case acquisition method described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the chaotic test case acquisition method according to any one of claims 1 to 6 when executed.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the chaotic test case acquisition method according to any one of claims 1 to 6 is implemented.