Chaotic engineering case processing method and device and storage medium

By analyzing the code information to generate an association relationship table, accurately screening or generating chaos engineering cases, the problems of low case processing efficiency and low accuracy in the existing technology are solved, and efficient and accurate case design and testing are achieved.

CN119201716APending Publication Date: 2024-12-27CHINA MERCHANTS BANK
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411272333.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Chaos engineering case processing is inefficient and inaccurate enough. The existing technology mainly relies on expert case databases and manual experience, resulting in disproportionate time consumption and results.

Method used

By obtaining the code information entered by the user, analyzing the code keywords and application characteristics, generating an association relationship table, generating a target case based on the table, and conducting chaos engineering tests, and using an automated code analysis identification system to accurately filter or generate cases.

Benefits of technology

It effectively avoids imperfections and omissions of manual analysis, improves case design efficiency, reduces case redundancy problems, and improves the accuracy and efficiency of tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201716A_ABST
    Figure CN119201716A_ABST
Patent Text Reader

Abstract

The invention discloses a chaos engineering case processing method and device and a storage medium, and relates to the technical field of chaos engineering tests.The chaos engineering case processing method comprises the steps that code information input by a user is obtained, the code information is analyzed, and code keywords and application characteristics are obtained; generating an incidence relation table according to the application characteristics and the code keywords; generating a target case through the association relation table; and performing a chaos engineering test based on the target case, analyzing and identifying application characteristics and calling links and code logic of a system or an application through an automatic code, and accurately screening or generating a chaos engineering case in combination with a characteristic association relationship labeling rule. The conditions of imperfect and missing manual analysis can be effectively avoided, meanwhile, the case design efficiency is improved, and the case redundancy problem is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chaos engineering testing technology, and in particular to a chaos engineering case processing method, device and storage medium. Background Art

[0002] With the massive construction of cloud platforms, many enterprises have migrated services from the original traditional infrastructure environment to the cloud. However, the cloud infrastructure is unstable. In addition, the overall system call link under the microservice architecture is more complex, so it is more prone to various abnormal situations. In order to improve the robustness of the system, chaos engineering came into being. In the process of chaos engineering evolution, it is necessary to simulate various abnormal scenarios, so various methods are needed to improve the implementation capability and efficiency of chaos engineering.

[0003] As chaos engineering becomes more popular in the field of software engineering, the case collection and tool chain of chaos engineering are becoming larger and more complex. For the case arrangement of chaos engineering, how to arrange chaos engineering experiments more accurately and reduce the performance degradation caused by randomness and the incomplete coverage of coverage points have become urgent problems to be solved. At the same time, in order to improve the execution efficiency, it is necessary to arrange the generated cases so as to ensure that the impact of environmental changes on the experimental results is minimized.

[0004] Currently, the industry mainly screens cases through expert case libraries combined with manual experience, or directly uses expert case libraries to randomly select or conduct full-scale testing without screening. Although this testing solution is automated, the time consumption and results obtained are disproportionate. Summary of the invention

[0005] The main purpose of this application is to provide a chaos engineering case processing method, device and storage medium, aiming to solve the technical problems of low efficiency and inaccuracy in chaos engineering case processing.

[0006] To achieve the above objectives, the present application proposes a chaos engineering case processing method, which includes:

[0007] Obtaining code information input by a user, and analyzing the code information to obtain code keywords and application characteristics;

[0008] Generate an association relationship table according to the application characteristics and the code keywords;

[0009] Generate a target case through the association relationship table;

[0010] Perform chaos engineering testing based on the target case.

[0011] In one embodiment, the step of obtaining the code information input by the user and analyzing the code information to obtain the code keywords and application characteristics includes:

[0012] Obtain code information input by the user, and obtain source code language type, project construction tool, code repository address, and corresponding branch according to the code information;

[0013] Pull the source code of the application to be tested according to the code warehouse address, and switch to the corresponding branch;

[0014] Analyze the dependent objects of the application source code to be tested according to the source code language type and the engineering construction tool to obtain a first code keyword;

[0015] Determining, on the corresponding branch, a code analysis strategy for the application source code to be tested;

[0016] Extracting a second code keyword according to the code analysis strategy;

[0017] Obtaining a code keyword according to the first code keyword and the second code keyword;

[0018] The application characteristics are obtained according to the code keywords and the relationship between the code keywords and the application characteristics.

[0019] In one embodiment, the step of generating an association relationship table according to the application characteristics and the code keywords includes:

[0020] Generate an initial association relationship table according to the application characteristics and the code keywords;

[0021] Scoring the number of occurrences of the code keywords according to the initial association relationship table to obtain a scoring result;

[0022] Sorting the application characteristics in the initial association relationship table according to the scoring result to obtain a sorting result;

[0023] Traversing the application characteristics according to the sorting result to obtain the search application characteristics, and determining the required parameter configuration according to the search application characteristics;

[0024] When the demand parameter configuration is not located in the initial association relationship table, recording a parameter keyword of the demand parameter configuration;

[0025] Keywords are extracted from the preset parameter configuration file based on the parameter keywords, and the extracted keywords and corresponding application characteristics are written into the initial association relationship table to obtain an association relationship table.

[0026] In one embodiment, the step of generating a target case through the association relationship table includes:

[0027] Get a library of preset chaos engineering cases;

[0028] Extracting application characteristics according to the association relationship table;

[0029] Based on the application characteristics, basic case data matching the application characteristics are screened out from the preset chaos case library;

[0030] The base case data is used as the target case.

[0031] In one embodiment, the step of generating a target case through the association relationship table includes:

[0032] Extracting application characteristics according to the association relationship table;

[0033] Acquire the relationship between the application characteristic and the fault domain, and obtain the fault domain through the relationship between the application characteristic and the fault domain and the application characteristic;

[0034] Set fault weights and feature weights;

[0035] A target case is generated according to the application characteristics, the characteristic weights, the fault domains, and the fault weights.

[0036] In one embodiment, the step of setting the characteristic weight includes:

[0037] Get the initial case scores and the correlation between fault domains and subdomain scenarios;

[0038] Converting the association relationship between the fault domain and the subdomain scenario into a relationship coefficient;

[0039] Acquire an application characteristic ranking according to the association relationship table, and obtain an application characteristic score according to the application characteristic ranking;

[0040] The characteristic weight is set according to the case initial score, the application characteristic score and the relationship coefficient.

[0041] In one embodiment, the step of setting the fault weight includes:

[0042] Performing link analysis on the code information to obtain a link position where the code keyword is located in the call link;

[0043] Setting a link coefficient according to the link position;

[0044] Obtaining the number of occurrences of the application characteristic on the link, and setting the application characteristic coefficient according to the number of occurrences;

[0045] The fault weight is set by the link coefficient and the application characteristic coefficient.

[0046] In one embodiment, the step of performing chaos engineering testing based on the target case includes:

[0047] Performing link analysis on the code information to obtain code analysis strategy coverage in the code, and identifying strategies not covered by the code analysis;

[0048] Analyze and correct the strategies not covered by the code analysis to obtain a corrected scenario;

[0049] Supplement the correction scenario to the target case, and adjust the correlation coefficients between application characteristics, fault domains, and fault subdomains to generate basic information of the target case;

[0050] Generate a case catalog and a case arrangement call link diagram according to the basic information of the target case;

[0051] Chaos engineering testing is performed through the case catalog, the code analysis strategy coverage, and the case orchestration call link diagram.

[0052] In addition, to achieve the above purpose, the present application also proposes a chaos engineering case processing device, the chaos engineering case processing device comprising:

[0053] An acquisition module is used to acquire the code information input by the user and analyze the code information to obtain code keywords and application characteristics;

[0054] A generating module, used for generating an association relationship table according to the application characteristics and the code keywords;

[0055] The generating module is further used to generate a target case through the association relationship table;

[0056] A testing module is used to perform chaos engineering testing based on the target case.

[0057] In addition, to achieve the above-mentioned purpose, the present application also proposes a chaos engineering case processing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the chaos engineering case processing method described above.

[0058] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the chaos engineering case processing method described above are implemented.

[0059] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the chaos engineering case processing method described above.

[0060] One or more technical solutions proposed in this application obtain code information input by the user and analyze the code information to obtain code keywords and application characteristics; generate an association table based on the application characteristics and the code keywords; generate a target case through the association table; perform chaos engineering testing based on the target case, identify the application characteristics, call links, and code logic of the system or application through automated code analysis, and accurately screen or generate chaos engineering cases in combination with characteristic association annotation rules. It can effectively avoid incomplete and missed manual analysis, while improving case design efficiency and reducing case redundancy. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0062] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0063] Figure 1 A flowchart of the first embodiment of the chaos engineering case processing method of this application is provided;

[0064] Figure 2 This is a schematic diagram of the overall process in an embodiment of the chaos engineering case processing method of this application;

[0065] Figure 3 A flow chart of the second embodiment of the chaos engineering case processing method of this application;

[0066] Figure 4 A flowchart of the third embodiment of the chaos engineering case processing method of this application is provided;

[0067] Figure 5 This is a schematic diagram of the correlation between parameters in the marking system in the first embodiment of the chaos engineering case processing method of this application;

[0068] Figure 6 A flowchart diagram of the fourth embodiment of the chaos engineering case processing method of this application;

[0069] Figure 7This is a schematic diagram of the module structure of the chaos engineering case processing device according to an embodiment of the present application;

[0070] Figure 8 Schematic diagram of the device structure of the hardware operating environment involved in the chaos engineering case processing method in the embodiment of the present application.

[0071] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0072] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0073] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0074] The main solution of the embodiment of the present application is: obtain the code information input by the user, and analyze the code information to obtain code keywords and application characteristics; generate an association table according to the application characteristics and the code keywords; generate a target case through the association table; and perform chaos engineering testing based on the target case.

[0075] Since the existing technology mainly selects cases through an expert case library combined with manual experience, or directly uses the expert case library to randomly select or does not screen and directly conducts full testing, the chaos engineering test efficiency and accuracy are low.

[0076] This application provides a solution. First, the user fills in the business interface and code warehouse address of the system or application to be drilled to obtain the correlation table of the system chaos engineering characteristics. On the basis of the preset basic chaos engineering case library (the case library contains the corresponding test objectives, emergency plan presets, chaos engineering field information such as fault domains, fault scenarios, etc.), the case is filtered by using the correlation between application characteristics and fault domains and fault scenarios, and new cases are automatically added through the correlation between application characteristics and fault domains and parameter configurations. The cases are combined with the code link to arrange the cases and generate the coverage of the method of the tested system. Finally, the cases on each code link are arranged as independent fault scenarios and entered into the case library, and the test coverage of the system method is statistically analyzed by combining the proportion of the analyzed method links.

[0077] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a chaos engineering case processing device, etc. The following takes the chaos engineering case processing device as an example to illustrate this embodiment and the following embodiments.

[0078] Based on this, the present application embodiment provides a chaos engineering case processing method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the chaos engineering case processing method of this application.

[0079] In this embodiment, the chaos engineering case processing method includes steps S10 to S40:

[0080] Step S10: Obtain the code information input by the user, and analyze the code information to obtain code keywords and application characteristics.

[0081] It should be noted that the code information input by the user may include the business interface information of the drill system or application filled in by the user, the code repository address, the source code language type, the engineering construction tool and the corresponding branch, etc.

[0082] Analyzing the code information may include determining specific source code according to the code repository address, thereby analyzing the source code to obtain code keywords and application characteristics.

[0083] Code keywords are identifiers with specific meanings in source code. They are used to represent specific functions or structures in programming languages. In the context of code analysis and chaos engineering, code keywords usually refer to identifiers that can represent important features, functions, or components of an application. These keywords can help analysts or automated tools understand the structure, logic, and behavior of the code.

[0084] Application characteristics refer to identifiable and distinguishable functions, properties or behaviors in software applications, which define the capabilities, performance and user experience of the application. Application characteristics may include functional characteristics, performance characteristics, usability characteristics, reliability characteristics, security characteristics, etc. The content of application characteristics is code keywords and their optional numerical values. Code keywords include characteristics such as product names, class names, calling method characteristics, parameter names and values.

[0085] Step S20: Generate an association relationship table according to the application characteristics and the code keywords.

[0086] In a specific implementation, an association table can be generated through application characteristics and code keywords. The association table is an association table of chaos engineering characteristics. The association table includes different application characteristics and their corresponding code keywords, and may also include information such as parameter configuration of the application characteristics.

[0087] In a feasible implementation, step S20 may include steps S21 to S26:

[0088] Step S21: generating an initial association relationship table according to the application characteristics and the code keywords.

[0089] It should be understood that an initial association relationship table of application characteristics and code keywords can be generated based on application characteristics and code keywords and a rule base of the relationship between application characteristics and code keywords. The initial association relationship table represents the relationship between code keywords and application characteristics.

[0090] Step S22: scoring the number of occurrences of the code keywords according to the initial association relationship table to obtain a scoring result.

[0091] In a specific implementation, the number of occurrences of the code keywords in the initial association relationship table may be obtained, and then scoring may be performed according to the number of occurrences of the code. The more occurrences, the higher the score, thereby obtaining a scoring result.

[0092] Step S23: Sort the application characteristics in the initial association relationship table according to the scoring result to obtain a sorting result.

[0093] In a specific implementation, the application characteristics may be ranked according to the scoring results. The higher the score is in the scoring results, the higher the application characteristics are ranked, thereby obtaining a ranking result of the application characteristics.

[0094] Step S24: traverse the application characteristics according to the sorting result to obtain the search application characteristics, and determine the required parameter configuration according to the search application characteristics.

[0095] In a specific implementation, the application characteristics can be searched according to the sorting results, and all application characteristics can be traversed to obtain the currently retrieved application characteristics, and determine the parameter configuration that should exist in the currently retrieved application characteristics, that is, the required parameter configuration.

[0096] After obtaining the requirement parameter configuration, it can be determined whether the requirement parameter configuration is located in the initial association relationship table. If the requirement parameter configuration is located in the initial association relationship table, the parameter value is recorded.

[0097] Step S25: When the demand parameter configuration is not located in the initial association relationship table, a parameter keyword of the demand parameter configuration is recorded.

[0098] It is understandable that when the requirement parameter configuration is not located in the initial association relationship table, the parameter keyword of the requirement parameter configuration may be recorded first.

[0099] Step S26: extracting keywords from the preset parameter configuration file based on the parameter keywords, and writing the extracted keywords and corresponding application characteristics into the initial association relationship table to obtain an association relationship table.

[0100] In a specific implementation, an unanalyzed parameter configuration file, that is, a preset parameter configuration file, can be determined based on the parameter keywords, and keywords can be extracted from the unanalyzed parameter configuration file to obtain the extracted keywords, and then it can be determined whether the extracted keywords are entered into the initial association table. If the initial association table has been entered, the value and version are updated; if the initial association table has not been entered, it is entered and the initial association table is completed according to its corresponding application characteristics.

[0101] Taking the Springboot project as an example, first write the corresponding parameter configuration into the association table according to the Springboot application characteristics, then analyze whether the Spring configuration file exists, analyze whether the configuration class exists, and finally find its configuration based on the similarity of the class, interface or parameter name. When a match is found, update the generated association table (application characteristics-parameter configuration) and update its version.

[0102] After updating the initial association table, the external keywords such as parameters (a virtual operating environment), deployment environment type, and environment variables can be analyzed according to the deployment configuration file. If there is no deployment configuration file, the user can fill it in and complete the association table with the result. The application characteristics entered in the subsequent relationship table are sorted according to the average score obtained in the second step.

[0103] Step S30: Generate a target case through the association relationship table.

[0104] After obtaining the association table, you can extract application characteristics and filter or create new scenario cases according to the corresponding association relationships to obtain the target case.

[0105] Step S40: Perform chaos engineering testing based on the target case.

[0106] It should be noted that after obtaining the target case, the basic information of the case can be determined based on the target case and the method coverage in the tested link can be obtained, so as to perform analysis and correction, and add the corrected scenario to the fault case library to perform chaos engineering testing.

[0107] In a feasible implementation, step S40 may include steps S41 to S45:

[0108] Step S41: performing link analysis on the code information to obtain the coverage of code analysis strategies in the code, and identifying strategies not covered by code analysis.

[0109] It should be noted that after obtaining the code information, link analysis can be performed based on the static code in the code information. First, the entry method of the project operation is found based on the method characteristics. The project type is marked by the content characteristics involved in the entry method and the code keywords generated by the artifact to determine the method of subsequent code analysis. The code analysis method is the code analysis strategy. Taking the Springboot (an open source system building framework) project as an example, the grammatical features are used to find the externally exposed method entrances of the controller layer (control layer). According to the method call link combined with the code keywords extracted from the artifact, the call path of the business link is recorded at the method level. After completion, the code keywords are extracted for each method, and the methods are annotated with keywords. Finally, the method analysis coverage in the code is counted, and the methods that are not covered by the analysis are identified, that is, the strategy not covered by the code analysis.

[0110] Methods annotated with keywords have the following features: Keywords can be repeated in different methods, and the number of repeated keywords is recorded using a suffix. The same method is analyzed only once, and the number of analysis layers for sub-call methods in a method can be selected to determine the analysis depth. Code keywords are extracted from a single method based on the features such as the class and interface that appear.

[0111] Step S42: Analyze and correct the policies not covered by the code analysis to obtain a corrected scenario.

[0112] In a specific implementation, the reasons why the policies not covered by the code analysis are not covered can be manually analyzed, and manual correction options can be provided to obtain correction scenarios.

[0113] Step S43: Supplement the correction scenario to the target case, and adjust the correlation coefficients between application characteristics, fault domains, and fault subdomains to generate basic information of the target case.

[0114] It should be understood that the correction scenario can be added to the target case, which is the fault case library, and the correlation coefficients between the application characteristics, fault domains, and fault subdomains can be adjusted accordingly. The correlation coefficients include the correlation coefficients between the application characteristics and the fault domains and the correlation coefficients between the fault domains and the fault subdomains. The full name of the fault domain is the chaos engineering fault domain, which refers to the specific fault characteristics of the chaos engineering field that are unified through abstraction of possible faults in the real environment. They define fault events in the chaos engineering field and have a certain correlation with application characteristics. The chaos engineering fault domain includes network faults, computing resource faults, configuration faults, storage faults, etc., and the content includes sub-scenarios, fault parameters, etc.

[0115] In the specific implementation, the basic information of the target case finally generated includes the following key contents: Chaos Engineering case injection interface (fault entry), the traffic injected into the API (default time before triggering the fault), the specific point of injected fault (fault point and application characteristics and importance score), injected fault and fault phenomenon: (fault domain and subdomain information and impact score), content that needs to be paid attention to after injection (fault subdomain information), case priority (importance score ranking), etc.

[0116] Step S44: Generate a case catalog and a case arrangement call chain diagram according to the basic information of the target case.

[0117] It should be noted that the case catalog and case orchestration call chain diagram can be generated according to the basic information of the target case. The case catalog can be obtained by sorting the content in the basic information of the target case. By analyzing the code chain, the key methods and call paths are identified. These paths represent the normal and abnormal execution processes of the system. The generated cases are combined with the code chain to ensure that each key path has corresponding test case coverage, so as to obtain the case orchestration call chain diagram.

[0118] Step S45: Perform chaos engineering testing through the case catalog, the code analysis strategy coverage, and the case orchestration call link diagram.

[0119] In specific implementation, call chain diagrams can be used to visualize how cases flow and interact in the entire system architecture. Based on the case catalog and code analysis strategy coverage, a detailed test plan is developed, including the execution order of test cases and the configuration of the test environment, and then the test objectives are determined to conduct chaos engineering testing.

[0120] like Figure 2 As shown, Figure 2 This is an overall flow chart of the chaos engineering case processing method. It obtains the interface information and code repository address information input by the user through the system or application, pulls the code from the code repository for semantic analysis to obtain application characteristics and code keywords, and performs link analysis and method annotation keywords to obtain method coverage. An association table is generated through application characteristics and code keywords, and then a target case is generated according to the association table or the target case is screened from the chaos engineering case library according to the association table. The basic information of the target case is manually corrected (optional), and importance and impact scores are performed at the same time. The code link is integrated, and a case directory, method coverage, and a case orchestration call link diagram are generated.

[0121] This embodiment provides a chaos engineering case processing method, including: obtaining code information input by the user, and analyzing the code information to obtain code keywords and application characteristics; generating an association table according to the application characteristics and the code keywords; generating a target case through the association table; performing chaos engineering testing based on the target case, identifying the application characteristics and call links and code logic of the system or application through automated code analysis, and accurately screening or generating chaos engineering cases in combination with characteristic association annotation rules. It can effectively avoid the situation of incomplete and missed manual analysis, while improving the efficiency of case design and reducing case redundancy.

[0122] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S10 includes steps S101 to S107:

[0123] Step S101: Obtain code information input by a user, and obtain source code language type, project construction tool, code repository address and corresponding branch according to the code information.

[0124] It should be understood that the code information input by the user can be obtained, and the code information includes the source code language type, engineering construction tool, code warehouse address and corresponding branch. Therefore, the source code language type, engineering construction tool, code warehouse address and corresponding branch can be obtained through the code information.

[0125] Step S102: Pull the source code of the application to be tested according to the code repository address, and switch to the corresponding branch.

[0126] It should be noted that you can pull the source code of the application to be tested through the code repository address and switch to the corresponding branch.

[0127] Step S103: Analyze the dependent objects of the application source code to be tested according to the source code language type and the engineering construction tool to obtain a first code keyword.

[0128] In a specific implementation, the corresponding dependency tree, that is, the dependent objects of the application source code to be tested, is analyzed according to the source code language type and the engineering construction tool. Taking Java as an example, in the Maven construction method, the dependencies in the Pom.xml (a product build description language file) file are analyzed, and the first code keyword is determined according to the product name corresponding to the dependency or other corresponding product features.

[0129] Step S104: determining a code analysis strategy for the application source code to be tested on the corresponding branch.

[0130] In the specific implementation, link analysis can be performed on the source code of the application to be tested, and then the code analysis strategy of the source code of the application to be tested is determined on the corresponding branch, specifically, the entry method (code analysis strategy) of the project operation is found according to the method characteristics, and the subsequent code analysis method is determined by marking the project type through the content characteristics of the entry method design and the code keyword generated by the product.

[0131] Step S105: extracting second code keywords according to the code analysis strategy.

[0132] In the specific implementation, after determining the code analysis method, the second code keyword can be extracted according to the code analysis strategy. Taking the Springboot (an open source system building framework) project as an example, the grammatical features are used to find the externally exposed method entries of the controller layer (control layer). The code keywords extracted from the method call link and the product are combined, and the call path of the business link is recorded at the method level. After completion, the code keywords are extracted for each method.

[0133] After obtaining the second code keyword, the method can be keyword-annotated. The keyword-annotated methods have the following characteristics: Keywords in different methods can be repeated, and the number of repeated keywords is recorded using a suffix. The same method is analyzed only once, and the sub-call method in the method can be configured with an optional analysis layer to determine the analysis depth. Code keywords are extracted from a single method based on the features such as the class and interface that appear.

[0134] Step S106: Obtain a code keyword according to the first code keyword and the second code keyword.

[0135] It can be understood that the first code keyword and the second code keyword can be used as code keywords.

[0136] Step S107: obtaining application characteristics according to the code keywords and the relationship between the code keywords and the application characteristics.

[0137] The content of application characteristics is code keywords and their optional numerical values. Code keywords include characteristics such as product name, class name, calling method characteristics, parameter name and value. Therefore, there is a certain inclusion relationship between code keywords and application characteristics. The inclusion relationship is formed into a set of rule bases through pre-analysis statistics, which is used to parse the semantic analysis results to form the input of the subsequent annotation system. Therefore, after obtaining the code keywords, the application characteristics can be obtained based on the code keywords and the relationship between the code keywords and the application characteristics. The relationship between the code keywords and the application characteristics is expressed as follows:

[0138]

[0139] The association between application features and code keywords can be as follows:

[0140] Application features: external features (Kafka (an open source messaging middleware) dependency) ---- code keyword [kafka].

[0141] The association between application characteristics and code parameter class keywords can be as follows:

[0142] Application characteristics: internal characteristics (HTTPClient (an application layer protocol communication client)) ---- code parameters [{HTTP.Timeout: [30, network delay]}].

[0143] This embodiment obtains the code information input by the user, obtains the source code language type, engineering construction tool, code repository address and corresponding branch according to the code information; pulls the source code of the application to be tested according to the code repository address, and switches to the corresponding branch; analyzes the dependent objects of the source code of the application to be tested according to the source code language type and the engineering construction tool to obtain a first code keyword; determines the code analysis strategy of the source code of the application to be tested on the corresponding branch; extracts the second code keyword according to the code analysis strategy; obtains the code keyword according to the first code keyword and the second code keyword; obtains the application characteristics according to the code keyword and the relationship between the code keyword and the application characteristics. By obtaining the code information input by the user and performing code analysis according to the code repository address in the code information, key information can be automatically extracted from the source code and converted into application characteristics useful for chaos engineering, thereby providing support for the stability and reliability testing of the system.

[0144] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , step S30 includes steps S301 to S304:

[0145] Step S301: Obtain a preset chaos engineering case library.

[0146] It should be noted that the preset chaos engineering case library is a collection that includes a series of chaos engineering test cases. These cases are designed to simulate various failures and abnormal situations in a controlled experimental environment to verify the robustness and reliability of the system.

[0147] Step S302: extracting application characteristics according to the association relationship table.

[0148] In a specific implementation, the corresponding application characteristics can be extracted through the association relationship table.

[0149] Step S303: based on the application characteristics, basic case data matching the application characteristics are screened out from the preset chaos case library.

[0150] It should be noted that scenario cases can be screened out from the preset chaos case library by annotating system association relationships to obtain basic case data that matches the application characteristics.

[0151] The annotation system association relationship is as follows Figure 5 As shown, Figure 5 This is a diagram of the relationship between the parameters in the annotation system, including the relationship between code keywords and application characteristics, the relationship between application characteristics and application chaos engineering fault domains (hereinafter referred to as fault domains), the annotated relationship between chaos engineering fault cases (hereinafter referred to as cases) and application characteristics, the annotated relationship between cases and application fault domains, the relationship between fault domains and subdomain scenarios, and the special relationship between subdomain scenario parameters.

[0152] Therefore, the case, as the final product, is the annotation object of the fault domain and application characteristics. In addition, there is a certain correlation between application characteristics and fault domain. The combination of fault domain and application characteristics can screen the basic case information in the preset chaos case library to obtain basic case data. Its characteristics, for example, fault domain is divided into types based on computing basis or cloud computing, and application characteristics are divided according to language characteristics or component characteristics inside and outside the application. The two can be combined in the following ways: the potential correlation between application characteristics and fault domain uses a deep neural network to form an invisible correlation after training according to user data, or uses a rule-based association method for subsequent scoring.

[0153] An association rule between application characteristics and fault domains can be expressed as follows:

[0154] Application characteristics: External characteristics (Kafka dependency) - Fault domain: [Network failure: high priority, computing resource failure: medium priority, configuration failure: low priority].

[0155] Application characteristics: Internal characteristics (JVM virtual machine)--Fault domain: [Storage failure: high priority, Computing resource failure: medium priority, Configuration failure: low priority].

[0156] Application characteristics: External characteristics (operating environment)--Fault domain: [Storage failure: high priority, Computing resource failure: high priority, Network failure: high priority].

[0157] A deep neural network representation of application characteristics and fault domains can be as follows (90% is a possible probability, which can also be a score):

[0158] Application characteristics: [external characteristics (Kafka dependency), internal characteristics (JVM virtual machine)] -- Fault domains: [network failure (50%), computing resource failure (40%), configuration failure (20%), storage failure (30%), JVM kafka method delay (90%)].

[0159] The neural network training method can use the transformer framework (Transformer is a deep learning model used for natural language processing (NLP) and other sequence-to-sequence tasks), and build the following corpus at the same time: Aggregate corpus for application characteristics to train the neural network's definition of input parameters. Aggregate corpus for fault domains to train the neural network's definition of output parameters. Analyze and aggregate corpus for case selection in the screening or construction process to optimize the neural network's selection structure, namely the encoder and decoder structure.

[0160] The association between fault domains and fault sub-scenario can be as follows:

[0161] Network failures – (network latency <90%>, packet loss 70%, network packet size limit 10%, etc.);

[0162] Memory failure----(memory overflow 10%, memory leak 50%, insufficient memory 90%, etc.).

[0163] The parameter association for the application subdomain scenario can be as follows:

[0164] (Network delay fault parameters<T+1S> )--Application characteristics (Kafka dependency) parameters (connection timeout: TS);

[0165] (CPU fault parameters <t>)--fixed parameters (T);

[0166] For case annotation information, it can be as follows:

[0167] Microservice application A JVM Full GC (garbage collection)----[{fault domain: [computing resource failure: insufficient computing resources (sub-scenario)], application characteristics: [JVM virtual machine]}]. For the preset chaos engineering case library of the annotation system, the basic case information is first filled in manually, and the application characteristics and fault domains are supplemented according to the filled-in cases. After the application characteristics and fault domains are determined, the basic case data can be filtered according to the application characteristics and fault domains.

[0168] Step S304: taking the basic case data as the target case.

[0169] In specific implementation, the screened basic case data can be used as the final target case.

[0170] This embodiment obtains a preset chaos engineering case library; extracts application characteristics according to the association table; based on the application characteristics, basic case data matching the application characteristics are screened out from the preset chaos case library; and the basic case data is used as the target case. By using the association table, the key application characteristics are identified by analyzing the code and application behavior, and matching cases are screened out from the preset chaos engineering case library according to the extracted application characteristics, and the screened basic case data is marked as the target case. The subsequent target cases will be used in chaos engineering experiments, thereby improving the accuracy of case generation.

[0171] Based on the first and third embodiments of the present application, in the fourth embodiment of the present application, the same or similar contents as those of the first and third embodiments can be referred to the above description, and will not be described in detail later. Figure 6 , step S30 includes steps S301' to S304':

[0172] Step S301 ′: extracting application characteristics according to the association relationship table.

[0173] In a specific implementation, the corresponding application characteristics can be extracted through the association relationship table.

[0174] Step S302': Acquire the relationship between the application characteristic and the fault domain, and obtain the fault domain through the relationship between the application characteristic and the fault domain and the application characteristic.

[0175] Understandably, continuing as above Figure 5 As shown, there is a corresponding relationship between the application characteristics and the fault domain, so the fault domain can be obtained through the relationship between the application characteristics and the fault domain and the application characteristics.

[0176] In a specific implementation, cases can be generated based on application characteristics and fault domains.

[0177] Step S303 ′: setting fault weights and characteristic weights.

[0178] It should be noted that the fault weight is the impact score, and the feature weight is the importance score. By setting the fault weight and feature weight, a case score can be generated through a two-factor weighted calculation.

[0179] In a feasible implementation, the step of setting the feature weight includes:

[0180] Get the initial case scores and the correlation between fault domains and subdomain scenarios;

[0181] Converting the association relationship between the fault domain and the subdomain scenario into a relationship coefficient;

[0182] Acquire an application characteristic ranking according to the association relationship table, and obtain an application characteristic score according to the application characteristic ranking;

[0183] The characteristic weight is set according to the case initial score, the application characteristic score and the relationship coefficient.

[0184] It should be noted that the initial score of the case can be set according to the initial score of the basic case of 12 points and the initial score of the fault case of 10 points, and the correlation between the fault domain and the subdomain scenario can be directly obtained.

[0185] According to the conversion percentage of the correlation coefficient of the application characteristic correlation, fault domain and sub-scenario, the correlation coefficient is obtained. In the specific implementation, the application characteristic ranking can be obtained according to the correlation table, and then points are added from the last place upwards according to the application characteristic ranking. One point is added for each order ranking to obtain the application characteristic score.

[0186] In the specific implementation, the feature weight is set by the case initial score, application feature score and relationship coefficient as shown in Formula 2:

[0187]

[0188] The characteristic weight can be calculated by the above formula 2.

[0189] In a feasible implementation manner, the step of setting the fault weight includes:

[0190] Performing link analysis on the code information to obtain a link position where the code keyword is located in the call link;

[0191] Setting a link coefficient according to the link position;

[0192] Obtaining the number of occurrences of the application characteristic on the link, and setting the application characteristic coefficient according to the number of occurrences;

[0193] The fault weight is set by the link coefficient and the application characteristic coefficient.

[0194] It should be noted that when analyzing the code information in the early stage, the static code can be subjected to link analysis, so as to obtain the link position of the code keyword in the call link. According to the position of the code keyword in the call link obtained by the code analysis, the fault case corresponding to the application characteristic is inserted into the method call link drawn previously, and a test link scenario is constructed, and the impact score of the case is calculated according to the rules.

[0195] The link coefficient is set according to the link position: the main link is calculated according to the *1.2 coefficient, and the main link is the link that must be run; the secondary link is calculated according to the *0.8 coefficient, and the secondary link is the link that does not necessarily pass through the operation.

[0196] In a specific implementation, the application characteristic coefficient can also be set according to the number of times the application characteristic appears on the link, as follows: the application characteristic only at the abnormal method is calculated by a coefficient of 0.8, and the application characteristic that appears multiple times on the same link is calculated by a coefficient of 1.2.

[0197] It should be noted that the fault weight can be calculated by the link coefficient and the application characteristic coefficient, as shown in the following formula 3:

[0198]

[0199] Step S304': Generate a target case through the application characteristics, the characteristic weights, the fault domains and the fault weights.

[0200] The final score is calculated according to the coefficients, thereby generating specific cases for the test scenarios on the link and obtaining the target cases.

[0201] In specific implementations, case scores can be calculated using application characteristics, characteristic weights, fault domains, and fault weights, and combined with code link orchestration cases to generate target cases.

[0202] The dependent formula for generating target cases is as follows:

[0203]

[0204] This embodiment extracts application characteristics according to the association table; obtains the relationship between application characteristics and fault domains, and obtains the fault domain through the relationship between the application characteristics and the fault domain and the application characteristics; sets fault weights and characteristic weights; generates target cases through the application characteristics, the characteristic weights, the fault domains, and the fault weights, determines which characteristics may affect which fault domains by analyzing the association between application characteristics and potential fault domains, and determines the fault domains that may be affected through the relationship between application characteristics and fault domains. Weights are set for each fault domain and application characteristic, and these weights reflect their importance and potential impact on system stability. Fault weights may be based on the severity of the impact of the fault on the system, and characteristic weights may be based on the criticality of the characteristic in the business logic, thereby combining application characteristics, characteristic weights, fault domains, and fault weights to generate target cases.

[0205] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the chaos engineering case processing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0206] This application also provides a chaos engineering case processing device, please refer to Figure 7 , the chaos engineering case processing device comprises:

[0207] The acquisition module 10 is used to acquire the code information input by the user and analyze the code information to obtain code keywords and application characteristics.

[0208] The generating module 20 is used to generate an association relationship table according to the application characteristics and the code keywords.

[0209] The generating module 20 is further configured to generate a target case through the association relationship table.

[0210] The testing module 30 is used to perform chaos engineering testing based on the target case.

[0211] The chaos engineering case processing device provided by the present application adopts the chaos engineering case processing method in the above embodiment, which can solve the technical problems of low efficiency and inaccuracy in chaos engineering case processing. Compared with the prior art, the beneficial effects of the chaos engineering case processing device provided by the present application are the same as the beneficial effects of the chaos engineering case processing method provided by the above embodiment, and the other technical features in the chaos engineering case processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0212] In one embodiment, the acquisition module 10 is also used to obtain code information input by a user, obtain a source code language type, an engineering construction tool, a code repository address, and a corresponding branch based on the code information; pull the source code of the application to be tested according to the code repository address, and switch to the corresponding branch; analyze the dependent objects of the application source code to be tested according to the source code language type and the engineering construction tool to obtain a first code keyword; determine a code analysis strategy for the application source code to be tested on the corresponding branch; extract a second code keyword based on the code analysis strategy; obtain a code keyword based on the first code keyword and the second code keyword; and obtain application characteristics based on the code keywords and the relationship between the code keywords and the application characteristics.

[0213] In one embodiment, the generation module 20 is further used to generate an initial association relationship table based on the application characteristics and the code keywords; score the number of code keyword occurrences according to the initial association relationship table to obtain a scoring result; sort the application characteristics in the initial association relationship table according to the scoring result to obtain a sorting result; traverse the application characteristics according to the sorting result to obtain a retrieval application characteristic, and determine the demand parameter configuration according to the retrieval application characteristic; when the demand parameter configuration is not located in the initial association relationship table, record the parameter keyword of the demand parameter configuration; extract keywords from the preset parameter configuration file based on the parameter keyword, and write the extracted keywords and corresponding application characteristics into the initial association relationship table to obtain an association relationship table.

[0214] In one embodiment, the generation module 20 is also used to obtain a preset chaos engineering case library; extract application characteristics according to the association relationship table; based on the application characteristics, filter out basic case data matching the application characteristics from the preset chaos case library; and use the basic case data as the target case.

[0215] In one embodiment, the generation module 20 is also used to extract application characteristics according to the association table; obtain the relationship between the application characteristics and the fault domain, and obtain the fault domain through the relationship between the application characteristics and the fault domain and the application characteristics; set the fault weight and characteristic weight; generate the target case through the application characteristics, the characteristic weight, the fault domain and the fault weight.

[0216] In one embodiment, the generation module 20 is also used to obtain the initial score of the case and the correlation relationship between the fault domain and the subdomain scenario; convert the correlation relationship between the fault domain and the subdomain scenario into a relationship coefficient; obtain the application characteristic ranking according to the correlation relationship table, and obtain the application characteristic score according to the application characteristic ranking; set the characteristic weight according to the initial score of the case, the application characteristic score and the relationship coefficient.

[0217] In one embodiment, the generation module 20 is also used to perform link analysis on the code information to obtain the link position of the code keyword at the calling link; set the link coefficient according to the link position; obtain the number of occurrences of the application characteristic on the link, and set the application characteristic coefficient according to the number of occurrences; set the fault weight through the link coefficient and the application characteristic coefficient.

[0218] In one embodiment, the test module 30 is also used to perform link analysis on the code information, obtain the code analysis strategy coverage in the code, and identify the strategies not covered by the code analysis; analyze and correct the strategies not covered by the code analysis to obtain the corrected scenarios; add the corrected scenarios to the target cases, and adjust the correlation coefficients between application characteristics, fault domains, and fault subdomains to generate basic information of the target case; generate a case directory and a case orchestration call link diagram based on the basic information of the target case; perform chaos engineering testing through the case directory, the code analysis strategy coverage, and the case orchestration call link diagram.

[0219] The present application provides a chaos engineering case processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the chaos engineering case processing method in the above-mentioned embodiment one.

[0220] Reference below Figure 8 , which shows a schematic diagram of the structure of a chaos engineering case processing device suitable for implementing the embodiments of the present application. The chaos engineering case processing device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The chaos engineering case processing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0221] like Figure 8 As shown, the chaos engineering case processing device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the chaos engineering case processing device are also stored in RAM1004. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the chaos engineering case processing device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a chaos engineering case processing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0222] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0223] The chaos engineering case processing device provided by the present application adopts the chaos engineering case processing method in the above embodiment, which can solve the technical problems of low efficiency and inaccuracy in chaos engineering case processing. Compared with the prior art, the beneficial effects of the chaos engineering case processing device provided by the present application are the same as the beneficial effects of the chaos engineering case processing method provided by the above embodiment, and the other technical features in the chaos engineering case processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0224] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0225] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0226] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the chaos engineering case processing method in the above-mentioned embodiment.

[0227] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0228] The above-mentioned computer-readable storage medium may be included in the chaos engineering case processing device; or it may exist independently without being assembled into the chaos engineering case processing device.

[0229] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the chaos engineering case processing device, the chaos engineering case processing device: obtains the code information input by the user, and analyzes the code information to obtain code keywords and application characteristics; generates an association table according to the application characteristics and the code keywords; generates a target case through the association table; and performs chaos engineering testing based on the target case.

[0230] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0231] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0232] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0233] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned chaos engineering case processing method, and can solve the technical problems of low efficiency and inaccuracy in chaos engineering case processing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the chaos engineering case processing method provided in the above-mentioned embodiment, and will not be repeated here.

[0234] The present application also provides a computer program product, including a computer program, which implements the steps of the chaos engineering case processing method as described above when executed by a processor.

[0235] The computer program product provided by this application can solve the technical problems of low efficiency and inaccuracy in chaos engineering case processing. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the chaos engineering case processing method provided by the above embodiment, which will not be repeated here.

[0236] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.< / t>

Claims

1. A chaos engineering case processing method, characterized in that: The chaos engineering case processing method includes: Obtaining code information input by a user, and analyzing the code information to obtain code keywords and application characteristics; Generate an association relationship table according to the application characteristics and the code keywords; Generate a target case through the association relationship table; Perform chaos engineering testing based on the target case.

2. The method according to claim 1, characterized in that The step of obtaining the code information input by the user and analyzing the code information to obtain the code keywords and application characteristics includes: Obtain code information input by the user, and obtain source code language type, project construction tool, code repository address, and corresponding branch according to the code information; Pull the source code of the application to be tested according to the code warehouse address, and switch to the corresponding branch; Analyze the dependent objects of the application source code to be tested according to the source code language type and the engineering construction tool to obtain a first code keyword; Determining, on the corresponding branch, a code analysis strategy for the application source code to be tested; Extracting a second code keyword according to the code analysis strategy; Obtaining a code keyword according to the first code keyword and the second code keyword; The application characteristics are obtained according to the code keywords and the relationship between the code keywords and the application characteristics.

3. The method according to claim 1, characterized in that The step of generating an association relationship table according to the application characteristics and the code keywords comprises: Generate an initial association relationship table according to the application characteristics and the code keywords; Scoring the number of occurrences of the code keywords according to the initial association relationship table to obtain a scoring result; Sorting the application characteristics in the initial association relationship table according to the scoring result to obtain a sorting result; Traversing the application characteristics according to the sorting result to obtain the search application characteristics, and determining the required parameter configuration according to the search application characteristics; When the demand parameter configuration is not located in the initial association relationship table, recording a parameter keyword of the demand parameter configuration; Keywords are extracted from the preset parameter configuration file based on the parameter keywords, and the extracted keywords and corresponding application characteristics are written into the initial association relationship table to obtain an association relationship table.

4. The method according to claim 1, characterized in that The step of generating a target case through the association relationship table includes: Get a library of preset chaos engineering cases; Extracting application characteristics according to the association relationship table; Based on the application characteristics, basic case data matching the application characteristics are screened out from the preset chaos case library; The base case data is used as the target case.

5. The method according to claim 1, characterized in that The step of generating a target case through the association relationship table includes: Extracting application characteristics according to the association relationship table; Acquire the relationship between the application characteristic and the fault domain, and obtain the fault domain through the relationship between the application characteristic and the fault domain and the application characteristic; Set fault weights and feature weights; A target case is generated according to the application characteristics, the characteristic weights, the fault domains, and the fault weights.

6. The method according to claim 5, characterized in that The steps to set feature weights include: Get the initial case scores and the correlation between fault domains and subdomain scenarios; Converting the association relationship between the fault domain and the subdomain scenario into a relationship coefficient; Acquire an application characteristic ranking according to the association relationship table, and obtain an application characteristic score according to the application characteristic ranking; The characteristic weight is set according to the case initial score, the application characteristic score and the relationship coefficient.

7. The method according to claim 5, characterized in that The steps to set fault weights include: Performing link analysis on the code information to obtain a link position where the code keyword is located in the call link; Setting a link coefficient according to the link position; Obtaining the number of occurrences of the application characteristic on the link, and setting the application characteristic coefficient according to the number of occurrences; The fault weight is set by the link coefficient and the application characteristic coefficient.

8. The method according to any one of claims 1 to 7, characterized in that The step of performing chaos engineering testing based on the target case includes: Performing link analysis on the code information to obtain code analysis strategy coverage in the code, and identifying strategies not covered by the code analysis; Analyze and correct the strategies not covered by the code analysis to obtain a corrected scenario; Supplement the correction scenario to the target case, and adjust the correlation coefficients between application characteristics, fault domains, and fault subdomains to generate basic information of the target case; Generate a case catalog and a case arrangement call link diagram according to the basic information of the target case; Chaos engineering testing is performed through the case catalog, the code analysis strategy coverage, and the case orchestration call link diagram.

9. A chaos engineering case processing device, characterized in that: The device comprises: An acquisition module is used to acquire the code information input by the user and analyze the code information to obtain code keywords and application characteristics; A generating module, used for generating an association relationship table according to the application characteristics and the code keywords; The generating module is further used to generate a target case through the association relationship table; A testing module is used to perform chaos engineering testing based on the target case.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the chaos engineering case processing method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Computing hardware system testing method based on chaos engineering

    CN120929346A