Fuzz testing method and platform based on upper competition

Through the fuzz testing method and platform based on superior competition, the problem of inefficiency of traditional testing methods is solved, more efficient software critical path coverage and defect identification are achieved, and software quality assurance is improved.

CN118626381BActive Publication Date: 2024-11-12KAIYUAN HUACHUANG TECH (GRP) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410800245.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-11-12
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

Traditional fuzz testing methods are inefficient in testing, making it difficult to effectively cover all critical paths of the software, making it difficult to detect potential vulnerabilities and security risks.

Method used

Using the fuzz testing method and platform based on superior competition, by obtaining the historical test records of the target components, introducing the use case effectiveness evaluation function, global use case optimization, generating fuzz testing cases, analyzing test records, identifying defects, and building a system defect set To formulate a repair plan.

Benefits of technology

Improve test coverage and efficiency, effectively explore the software status space, identify and repair potential defects, and improve software quality assurance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626381B_ABST
    Figure CN118626381B_ABST
Patent Text Reader

Abstract

The present invention discloses a fuzzy testing method and platform based on upper competition, which relates to the field of data processing technology, including: obtaining a target component; screening the test records of the target component to obtain a target historical test exception record; introducing a use case effectiveness evaluation function as a use case evaluation strategy, and establishing a use case optimization space; performing a fuzzy test on the target use case obtained by global optimization in a predetermined test environment to obtain a target test record; comparing the target prediction anomaly with the target test anomaly obtained by analyzing the target test record to obtain a target comparison deviation; when the target comparison deviation is at a deviation limit, the target defect obtained by analyzing the target test anomaly is used as the defect of the target component; forming a system defect set of the target system, and establishing a defect repair plan for the target system. The present invention solves the technical problems of low test efficiency in the prior art and difficulty in effectively covering all critical paths of the software, and achieves the technical effect of improving test coverage and test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a fuzzy testing method and platform based on upper competition. Background Art

[0002] With the rapid development of information technology, software testing plays a vital role in ensuring software quality. However, traditional testing methods are unable to cope with increasingly complex software systems and changing user needs. In particular, traditional methods often have difficulty detecting potential vulnerabilities and security risks in software, which are not easily triggered under normal circumstances.

[0003] In the field of software testing, fuzz testing has become an important technical means, which triggers potential errors and vulnerabilities by inputting random or semi-random data into the system. However, traditional fuzz testing methods are often inefficient and difficult to effectively cover all critical paths of the software. Summary of the invention

[0004] The present application provides a fuzzy testing method and platform based on upper competition, which is used to solve the technical problems that the existing testing technology is inefficient and difficult to effectively cover all critical paths of the software.

[0005] In view of the above problems, the present application provides a fuzzy testing method and platform based on upper competition.

[0006] In a first aspect of the present application, a fuzzy testing method based on upper competition is provided, the method comprising:

[0007] Acquire a target component, wherein the target component refers to any system component in the target system that meets the processing and execution constraints; screen the target historical test records of the target component to obtain target historical test exception records; introduce a use case effectiveness evaluation function as a use case evaluation strategy, and use the target historical test exception records as a use case optimization space; perform fuzzy testing on the target use case obtained by global optimization in the use case optimization space based on the use case evaluation strategy in a predetermined test environment to obtain a target test record, wherein the target use case has an identifier of a target prediction exception; compare the target prediction exception with the target test exception obtained by analyzing the target test record to obtain a target comparison deviation; when the target comparison deviation is within the deviation limit, use the target defect obtained by analyzing the target test exception as the defect of the target component; assemble a system defect set of the target system based on the target defect, and analyze the system defect set to establish a defect repair plan for the target system.

[0008] The second aspect of the present application provides a fuzzy testing platform based on upper competition, the platform comprising:

[0009] A target component acquisition module, wherein the target component acquisition module acquires a target component, wherein the target component refers to any system component in the target system that meets the processing execution constraint; a target historical test exception record acquisition module, wherein the target historical test exception record acquisition module screens the target historical test records of the target component to obtain target historical test exception records; a use case optimization space establishment module, wherein the use case optimization space establishment module introduces a use case effectiveness evaluation function as a use case evaluation strategy, and uses the target historical test exception records as a use case optimization space; a target test record acquisition module, wherein the target test record acquisition module performs global optimization in the use case optimization space based on the use case evaluation strategy in a predetermined test environment. The obtained target use case is fuzzily tested to obtain a target test record, wherein the target use case has an identifier of a target prediction anomaly; a target comparison deviation acquisition module, wherein the target comparison deviation acquisition module compares the target prediction anomaly with the target test anomaly obtained by analyzing the target test record to obtain a target comparison deviation; a target component defect determination module, wherein the target component defect determination module is used to, when the target comparison deviation is within the deviation limit, use the target defect obtained by analyzing the target test anomaly as the defect of the target component; a defect repair plan establishment module, wherein the defect repair plan establishment module assembles a system defect set of the target system based on the target defect, and analyzes the system defect set to establish a defect repair plan for the target system.

[0010] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0011] The present application obtains a target component, wherein the target component refers to any system component in the target system that meets the processing execution restriction constraint; the target historical test record of the target component is screened to obtain a target historical test exception record; a use case validity evaluation function is introduced as a use case evaluation strategy, and the target historical test exception record is used as a use case optimization space; a fuzzy test is performed on the target use case obtained by global optimization in the use case optimization space based on the use case evaluation strategy in a predetermined test environment, and a target test record is obtained, wherein the target use case has a target prediction exception identification; the target prediction exception is compared with the target test exception obtained by analyzing the target test record, and a target comparison deviation is obtained; when the target comparison deviation is at a deviation limit, the target defect obtained by analyzing the target test exception is used as a defect of the target component; a system defect set of the target system is formed based on the target defect, and a defect repair plan for the target system is established by analyzing the system defect set. The present invention solves the technical problems that the prior art test efficiency is low and it is difficult to effectively cover all critical paths of the software. By introducing a superordinate competition mechanism, the state space of the software is effectively explored, and the technical effect of improving the test coverage and test efficiency is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] 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.

[0013] Figure 1 A schematic diagram of a fuzzy testing method based on upper competition provided in an embodiment of the present application;

[0014] Figure 2 A schematic diagram of the structure of a fuzzy testing platform based on upper competition provided in an embodiment of the present application.

[0015] Explanation of the accompanying drawings: target component acquisition module 11, target historical test exception record acquisition module 12, use case optimization space establishment module 13, target test record acquisition module 14, target comparison deviation acquisition module 15, target component defect determination module 16, defect repair plan establishment module 17. DETAILED DESCRIPTION

[0016] This application provides a fuzzy testing method and platform based on upper competition, aiming to solve the technical problems of low testing efficiency in existing technologies and difficulty in effectively covering all critical paths of the software. By introducing an upper competition mechanism, the state space of the software is effectively explored, thereby achieving the technical effect of improving test coverage and test efficiency.

[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0018] It should be noted that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, platform, product or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or modules that are not explicitly listed or inherent to these processes, methods, products or devices.

[0019] Embodiment 1

[0020] like Figure 1 As shown, the present application provides a fuzzy testing method based on upper competition, the method comprising:

[0021] Step S100: Acquire a target component, wherein the target component refers to any system component in the target system that meets the processing execution restriction constraint;

[0022] In the embodiments of the present application, the target system refers to the overall software system to be tested. This system is a large application, a service platform, a website or any other type of software product. In the software architecture, the target system is decomposed into multiple independent and reusable parts, which are system components. System components are divided into modules, libraries, services or any other independent units that constitute the system.

[0023] A system component that satisfies a processing execution constraint is arbitrarily selected from the target system as a target component, wherein the processing execution constraint is multi-thread processing and there is upper-level competition.

[0024] Step S200: screening the target historical test records of the target component to obtain target historical test exception records;

[0025] In an embodiment of the present application, firstly, all target historical test records of the target component are exported from the test management system.

[0026] Determine the criteria for filtering abnormal records based on the test purpose and requirements. These criteria include records with a test result status of failure or abnormality, or specific error codes and messages. In a multi-threaded and upper-level competition environment, the criteria also include exceptions related to concurrent performance, data consistency, and other issues.

[0027] Next, use tools such as Excel, Tableau, and Power BI to filter the target historical test records and obtain the target historical test exception records.

[0028] Step S300: introducing a use case effectiveness evaluation function as a use case evaluation strategy, and using the target historical test exception record as a use case optimization space;

[0029] In the embodiment of the present application, a use case effectiveness evaluation function is first introduced as a use case evaluation strategy. When the use case effectiveness evaluation function is introduced, indicators for evaluating the effectiveness of test cases are determined, including the coverage rate and diversity index of the test cases.

[0030] At the same time, the target historical test exception records are sorted to form a use case optimization space. The use case optimization space contains all the exceptions that occurred in the past tests. When constructing the use case optimization space, each exception record is annotated, including the exception type, frequency of occurrence, etc.

[0031] Step S400: performing fuzzy testing on a target use case obtained by global optimization in the use case optimization space based on the use case evaluation strategy in a predetermined test environment to obtain a target test record, wherein the target use case has an identification of target prediction anomaly;

[0032] In an embodiment of the present application, in a predetermined test environment, a use case evaluation strategy is used to perform global optimization on the use case optimization space, and the test case with the highest score or the most representative is selected as the target use case, and the target use case has an identification of a target prediction anomaly.

[0033] Next, perform fuzz testing on the target use case. According to the characteristics of the test environment and the target use case, select the appropriate fuzz testing tool or framework. Based on the target use case, use the fuzz testing tool to generate a large amount of random and mutated input data. In the predetermined test environment, use the generated fuzz testing input to test the target use case and obtain the target test record. The target test record contains various information about the execution of the test case, such as input data, output results, exception information, system logs, etc.

[0034] Step S500: Compare the target predicted anomaly with the target test anomaly obtained by analyzing the target test record to obtain a target comparison deviation;

[0035] In an embodiment of the present application, the target test record is analyzed to obtain information such as anomalies and errors appearing in the target test record, and such information is used as target test anomalies.

[0036] When comparing the target predicted anomaly with the target test anomaly obtained by analyzing the target test record, automatic matching is performed through existing text matching and pattern recognition technologies to compare the anomaly type, description, triggering conditions, etc. For complex anomalies or situations that are difficult to match directly, natural language processing technology is used to extract key information about the anomaly.

[0037] Based on the matching results, the target comparison deviation is calculated. Deviations include quantity deviation, type deviation, trigger condition deviation, behavior deviation, etc. Statistical methods such as difference percentage and confidence interval are used to quantify these deviations and obtain the target comparison deviation.

[0038] Step S600: when the target comparison deviation is within the deviation limit, a target defect obtained by analyzing the target test anomaly is taken as a defect of the target component;

[0039] In the embodiment of the present application, the deviation limit is a threshold value set according to the test requirements and expert experience, and is used to determine whether the deviation between the predicted result of the test case and the actual test result is within an acceptable range.

[0040] The calculated target comparison deviation is compared with the deviation limit. When the target comparison deviation is within the deviation limit, the target defect obtained by analyzing the target test anomaly is taken as the defect of the target component.

[0041] Step S700: constructing a system defect set of the target system based on the target defect, and analyzing the system defect set to establish a defect repair plan for the target system.

[0042] In the embodiment of the present application, the collected defects are classified and sorted, for example, according to the severity of the defects, the system modules or functions affected, the causes of the defects, etc. The classified defects are combined into a system defect set of the target system. This system defect set contains all known major defects in the target system.

[0043] Next, defects are prioritized based on factors such as the severity of the defects, the scope of impact, and the cost of repair using existing technologies, such as risk assessment frameworks and multi-attribute decision analysis methods.

[0044] Obtain the defect repair plan for the target system by querying the defect repair plan library. The defect repair plan library is a pre-built database containing common defect repair strategies. By querying the defect repair plan library, you can quickly find the defect repair plan for a specific defect.

[0045] Furthermore, the method provided in the application embodiment also includes:

[0046] Using virtualization technology to create an initial execution environment;

[0047] Generate target software and hardware conditions in combination with target test requirements of the target use case;

[0048] The target software and hardware conditions are rendered to the initial execution environment to obtain the predetermined test environment.

[0049] In the embodiment of the present application, firstly, a suitable virtualization technology is selected, such as VMware, Microsoft Hyper-V, VirtualBox, etc. After selecting the virtualization technology, the corresponding virtualization software is installed on the physical server. For example, if VMware is selected, VMware ESXi or VMware Workstation software is installed. The initial execution environment is created through the virtualization software.

[0050] Before starting the test, analyze the test requirements of the target use case. This includes the purpose of the test, the scope of the test, the expected test results, etc. According to the test requirements, determine the required hardware and software conditions. The hardware and software conditions include specific operating systems, software versions, hardware configurations, etc.

[0051] In the established initial execution environment, configuration is performed according to the determined hardware and software conditions. Configuration includes installing the operating system, setting up network connections, installing necessary software, etc. After the configuration is completed, the initial execution environment is verified by running some basic test scripts or commands to ensure that all configurations meet the test requirements.

[0052] After configuration and verification are correct, start the initial execution environment to obtain the predetermined test environment.

[0053] Furthermore, the method provided in the application embodiment also includes:

[0054] Step a: the use case optimization space includes multiple historical use cases in the target historical test exception record;

[0055] Step b: Recording the first historical use case among the extracted multiple historical use cases as the target use case;

[0056] Step c: evaluating and analyzing the first historical test record of the first historical use case according to the use case evaluation strategy to obtain a first validity;

[0057] Step d: extracting a second historical use case from the multiple historical use cases, where the second historical use case is any one of the multiple historical use cases that is different from the first historical use case;

[0058] Step e: obtaining a second validity of the second historical use case according to the use case evaluation strategy;

[0059] Step f: when the second effectiveness is greater than the first effectiveness, replacing the first historical use case with the second historical use case to become the target use case;

[0060] Step g: Repeat steps d to f until a predetermined repetition limit is reached, and output the target use case obtained at that time.

[0061] In the embodiment of the present application, the use case optimization space includes multiple historical use cases in the target historical test exception record, and these historical use cases are use cases in which problems were found in the past test process. From the multiple historical use cases, one is randomly selected as the first historical use case, and the first historical use case is recorded as the target use case.

[0062] Next, the first historical test record of the first historical case is evaluated and analyzed using the use case evaluation strategy to obtain the first validity. From the multiple historical case, a case different from the first historical case is selected, which is called the second historical case. The second historical case is used for comparison with the first historical case. The historical test record of the second historical case is evaluated and analyzed using the use case evaluation strategy to obtain the second validity.

[0063] The second validity is compared with the first validity. When the second validity is greater than the first validity, the second historical case replaces the first historical case as the target case. The above process is repeated, and a new second historical case is selected for evaluation and comparison in each iteration until the predetermined repetition limit is reached, and the current target case is output.

[0064] Furthermore, the method provided in the application embodiment also includes:

[0065] The use case evaluation strategy obtains the utility dimension characteristics of the predetermined use case;

[0066] Evaluate and analyze the first historical test record based on the utility dimension feature of the predetermined use case to obtain the first effectiveness;

[0067] Among them, the predetermined use case utility dimension characteristics include at least coverage measurement dimension, diversity indicator dimension and performance impact dimension, the coverage measurement dimension includes code coverage, data flow coverage and path coverage, the diversity indicator dimension includes input type diversity index, boundary condition diversity index and exception type diversity index, and the performance impact dimension includes CPU performance impact index and memory performance impact index.

[0068] In an embodiment of the present application, a use case utility dimension feature is obtained through a use case evaluation strategy, and the use case utility dimension feature is a predefined indicator for measuring the utility of a test case.

[0069] The first historical test record is evaluated and analyzed through the predetermined use case utility dimension feature to obtain the first effectiveness. The predetermined use case utility dimension feature includes a coverage measurement dimension, a diversity indicator dimension, and a performance impact dimension.

[0070] Coverage measurement dimensions include code coverage, data flow coverage, and path coverage. Code coverage measures how much source code is executed by the test case. Data flow coverage checks whether the variables in the program are properly covered and modified by the test case. Path coverage ensures that different execution paths in the program are walked by the test case.

[0071] The diversity index dimensions include input type diversity index, boundary condition diversity index and exception type diversity index. The input type diversity index tests whether the test cases cover different types of inputs, such as numbers, strings, files, etc. The boundary condition diversity index tests whether the test cases test the boundary conditions of the input values, such as the minimum value, maximum value and values ​​near the boundary. The exception type diversity index tests whether the test cases trigger different types of exceptions.

[0072] The performance impact dimension includes the CPU performance impact index and the memory performance impact index. The CPU performance impact index evaluates the use of CPU resources during the execution of the test case and whether it causes unnecessary CPU load. The memory performance impact index measures the memory usage during the execution of the test case, including memory occupancy and possible memory leaks.

[0073] Through comprehensive evaluation of the above-mentioned dimensional features, the first validity of the first historical test case is obtained.

[0074] Furthermore, the expression of the use case evaluation strategy provided in the application embodiment is as follows:

[0075]

[0076] Wherein, f(x) refers to the first validity of the first historical test record x, C′ i (x) and C″ i (x) and C″′ i (x) are parameter values ​​of the code coverage, the data flow coverage and the path coverage corresponding to the i-th test in the first historical test record x, respectively. The first historical test record x includes a total of I tests of coverage measurement dimensions. 1 and α 2 and α 3 are the first coverage coefficient, the second coverage coefficient and the third coverage coefficient respectively, and α 1 +α 2 +α 3 =1, D′ j (x) and D″ j (x) and D″′ j (x) are parameter values ​​of the input type diversity index, the boundary condition diversity index and the abnormal type diversity index corresponding to the j-th test in the first historical test record x, and the first historical test record x includes J tests of diversity indicator dimensions, β 1 and β 2 and β 3 are the first diversity coefficient, the second diversity coefficient and the third diversity coefficient, respectively, and β 1 +β 2 +β 3 =1, P′ j (x) and P″ j (x) are parameter values ​​of the CPU performance impact index and the memory performance impact index corresponding to the kth test in the first historical test record x, and the first historical test record x includes K performance impact dimension tests in total, γ 1 and γ 2are the first performance impact coefficient and the second performance impact coefficient respectively, and γ 1 +γ 2 =1, α, β and γ refer to the adjustment coefficient of the coverage measurement dimension, the adjustment coefficient of the diversity indicator dimension and the adjustment coefficient of the performance impact dimension respectively, and α+β+γ=1.

[0077] In the embodiment of the present application, the expression of the use case evaluation strategy combines the results of different dimensions by weighted summation to obtain an overall effectiveness score of the test case.

[0078] α, β, and γ are the adjustment coefficients of the coverage measurement dimension, the diversity indicator dimension, and the performance impact dimension, respectively, and their sum is 1. The adjustment coefficients are adjusted by technical experts based on actual needs to adjust the weights of different dimensions in the final effectiveness evaluation.

[0079] By combining the adjustment coefficient with coverage metrics, diversity indicators and performance impact parameters, the function f(x) provides a comprehensive method to calculate the effectiveness of the test record. The obtained effectiveness takes into account different aspects of the test, such as code coverage, test data diversity and impact on system performance.

[0080] Furthermore, the method provided in the application embodiment also includes:

[0081] Reading predetermined use case features, and performing multi-dimensional feature collection on the first historical use case based on the predetermined use case features to obtain first historical use case feature information;

[0082] Performing weighted calculation on the first historical use case feature information after standardization to obtain a first data characteristic value;

[0083] Feedback adjustment is performed on the first effectiveness based on the first data characteristic value.

[0084] In an embodiment of the present application, an automated testing framework and a continuous integration system are used to predefine a set of test case features, and these features are used as key indicators for evaluating the effectiveness of the test cases.

[0085] For the first historical use case, multi-dimensional feature collection is performed based on predetermined use case features, and relevant information is extracted from various data sources to obtain first historical use case feature information.

[0086] Afterwards, the feature information of the first historical use case is standardized, and the feature value is converted into a distribution with a mean of 0 and a standard deviation of 1 through Z-score standardization.

[0087] After the features are normalized, a weighted calculation is used to obtain the first data characteristic value. In the calculation process, the normalized value of each feature is multiplied by its corresponding weight, and the results are added to obtain the first data characteristic value, wherein the feature weight is determined by a domain expert.

[0088] Compare the first data characteristic value with the preset threshold, for example, code coverage is usually expected to reach more than 80%, response time is not more than 2 seconds, etc. Through comparison, identify the characteristics that are below the threshold or perform poorly relative to other dimensions. For example, if the code coverage is found to be only 60%, then code coverage is a shortcoming. Prioritize the shortcomings according to their impact on system quality and the difficulty of repair. For example, if low code coverage may lead to serious functional defects, then it is given priority.

[0089] Next, formulate an adjustment strategy. When optimizing the code structure, use code refactoring techniques, such as extracting methods and moving methods, to simplify complex code structures. Introduce code quality inspection tools, such as SonarQube, to detect and improve code structures in an automated way. When enhancing execution paths, use code coverage tools, such as JaCoCo, to find code paths that are not covered by tests, and write new test cases to cover these paths. When enriching data attributes, introduce more test data, especially boundary values ​​and outliers, to ensure the robustness of the system. Use data generation tools, such as Mockaroo, to create diverse test data sets. When optimizing system response, perform performance analysis on the system, identify performance bottlenecks and optimize them. Use performance testing tools, such as Apache JMeter, to stress test the optimized system to ensure that response time and resource consumption are within an acceptable range.

[0090] Finally, feedback and adjustments are made to the first effectiveness based on the formulated strategy.

[0091] Furthermore, the method provided in the application embodiment also includes:

[0092] The predetermined use case features include use case code structure, use case execution path, use case data attributes and use case system response.

[0093] In the embodiment of the present application, the predetermined use case features include use case code structure, use case execution path, use case data attributes and use case system response.

[0094] The use case code structure includes the complexity of the function, the number of lines of code, the use of loops and conditional statements, etc.

[0095] The use case execution path includes the main logic flow, branch path and exception handling path.

[0096] Use case data attributes include data type, data range, data validity and boundary conditions, etc.

[0097] The use case system response records the system's response to the test case, such as response time, resource consumption, exception or error information, etc.

[0098] Furthermore, the method provided in the application embodiment also includes:

[0099] Reading predetermined local use case limits, wherein the predetermined local use case limits include predetermined use case validity limits and predetermined use case characteristic limits;

[0100] Determine whether the first validity meets the predetermined use case validity limit, and obtain a first determination result;

[0101] Determine whether the first data characteristic value meets the predetermined use case characteristic limit, and obtain a second determination result;

[0102] Building a target local use case set based on the first judgment result and the second judgment result;

[0103] The defects of each local use case in the target local use case set are analyzed to form a system local defect set, and a local defect repair plan for the system local defect set is established.

[0104] In an embodiment of the present application, a configuration file or a database stores predetermined local use case limits, which include predetermined use case validity limits and predetermined use case characteristic limits. The predetermined local use case limits are read from the configuration file or the database through an automated script or an API call.

[0105] The first validity is compared with the read predetermined use case validity limit, and a first judgment result is obtained according to the comparison result, and the judgment result is divided into compliance or non-compliance.

[0106] The first data characteristic value is compared with the read predetermined use case characteristic limit value. The characteristic value includes multiple dimensions, such as code complexity, path coverage, etc., which need to be compared separately. According to the comparison result, the second judgment result is set, and the judgment result is divided into compliance or non-compliance.

[0107] According to the first judgment result and the second judgment result, test cases that meet both the validity limit and the characteristic limit are screened out, and these screened out test cases are assembled into a target local case set.

[0108] Perform detailed defect analysis on each test case in the target local test case set. Use static code analysis, dynamic testing and other technical means to discover defects.

[0109] When performing static code analysis, the code in the target local use case set is statically analyzed by using SonarQube, Pylint, Checkstyle, etc. Potential problems in the code are detected, such as unused variables, complex code blocks, possible null pointer exceptions, etc.

[0110] When performing dynamic testing, use automated testing frameworks such as Selenium, Appium, and JUnit to execute test cases in the target local test case set. Identify runtime defects by monitoring exceptions, failures, and performance bottlenecks during test execution.

[0111] The analyzed defects are classified and sorted to form a local defect set of the system.

[0112] When establishing a local defect repair plan for a local defect set of the system, use defect management tools such as JIRA, Bugzilla, etc. to track and record the detailed information of each local defect. Classify the defects according to factors such as the severity, scope of impact, and urgency of repair, and determine the repair priority.

[0113] Apply root cause analysis methods such as 5Why and Fishbone Diagram to explore the root cause of each defect. Use code review, log analysis, user feedback and other methods to assist in the analysis.

[0114] Develop specific repair plans based on the nature and root causes of the defects. For simple code errors, modify the code directly to fix them; for complex logic or design issues, refactor part of the code or adjust the system architecture. Introduce automated testing tools such as JUnit and Selenium to ensure the effectiveness of the repair and prevent similar problems from happening again.

[0115] In the embodiments of the present application, in summary, the embodiments of the present application have at least the following technical effects:

[0116] The present application obtains a target component, wherein the target component refers to any system component in the target system that meets the processing execution restriction constraint; the target historical test record of the target component is screened to obtain a target historical test exception record; a use case validity evaluation function is introduced as a use case evaluation strategy, and the target historical test exception record is used as a use case optimization space; a fuzzy test is performed on the target use case obtained by global optimization in the use case optimization space based on the use case evaluation strategy in a predetermined test environment, and a target test record is obtained, wherein the target use case has a target prediction exception identification; the target prediction exception is compared with the target test exception obtained by analyzing the target test record, and a target comparison deviation is obtained; when the target comparison deviation is at a deviation limit, the target defect obtained by analyzing the target test exception is used as a defect of the target component; a system defect set of the target system is formed based on the target defect, and a defect repair plan for the target system is established by analyzing the system defect set. The present invention solves the technical problems that the prior art test efficiency is low and it is difficult to effectively cover all critical paths of the software. By introducing a superordinate competition mechanism, the state space of the software is effectively explored, and the technical effect of improving the test coverage and test efficiency is achieved.

[0117] Embodiment 2

[0118] Based on the same inventive concept as the fuzzy testing method based on upper competition in the above-mentioned embodiment, Figure 2 As shown, the present application provides a fuzzy testing platform based on upper competition, and the platform and method embodiments in the embodiments of the present application are based on the same inventive concept. Among them, the platform includes:

[0119] A target component acquisition module 11, wherein the target component acquisition module 11 acquires a target component, wherein the target component refers to any system component in the target system that meets the processing execution restriction constraint;

[0120] A target historical test exception record acquisition module 12, wherein the target historical test exception record acquisition module 12 screens the target historical test records of the target component to obtain the target historical test exception records;

[0121] A use case optimization space establishment module 13, wherein the use case optimization space establishment module 13 introduces a use case effectiveness evaluation function as a use case evaluation strategy and uses the target historical test exception record as a use case optimization space;

[0122] A target test record acquisition module 14, wherein the target test record acquisition module 14 performs fuzzy testing on a target use case obtained by global optimization in the use case optimization space based on the use case evaluation strategy in a predetermined test environment to obtain a target test record, wherein the target use case has an identification of a target prediction anomaly;

[0123] A target comparison deviation acquisition module 15, wherein the target comparison deviation acquisition module 15 compares the target prediction anomaly with the target test anomaly obtained by analyzing the target test record to obtain a target comparison deviation;

[0124] A target component defect determination module 16, wherein the target component defect determination module 16 is configured to, when the target comparison deviation is within a deviation limit, use a target defect obtained by analyzing the target test anomaly as a defect of the target component;

[0125] The defect repair plan establishing module 17 composes a system defect set of the target system based on the target defect, and analyzes the system defect set to establish a defect repair plan for the target system.

[0126] Furthermore, the platform is also used to implement the following functions:

[0127] Using virtualization technology to create an initial execution environment;

[0128] Generate target software and hardware conditions in combination with target test requirements of the target use case;

[0129] The target software and hardware conditions are rendered to the initial execution environment to obtain the predetermined test environment.

[0130] Furthermore, the platform is also used to implement the following functions:

[0131] Step a: the use case optimization space includes multiple historical use cases in the target historical test exception record;

[0132] Step b: Recording the first historical use case among the extracted multiple historical use cases as the target use case;

[0133] Step c: evaluating and analyzing the first historical test record of the first historical use case according to the use case evaluation strategy to obtain a first validity;

[0134] Step d: extracting a second historical use case from the multiple historical use cases, where the second historical use case is any one of the multiple historical use cases that is different from the first historical use case;

[0135] Step e: obtaining a second validity of the second historical use case according to the use case evaluation strategy;

[0136] Step f: when the second effectiveness is greater than the first effectiveness, replacing the first historical use case with the second historical use case to become the target use case;

[0137] Step g: Repeat steps d to f until a predetermined repetition limit is reached, and output the target use case obtained at that time.

[0138] Furthermore, the platform is also used to implement the following functions:

[0139] The use case evaluation strategy obtains the utility dimension characteristics of the predetermined use case;

[0140] Evaluate and analyze the first historical test record based on the utility dimension feature of the predetermined use case to obtain the first effectiveness;

[0141] Among them, the predetermined use case utility dimension characteristics include at least coverage measurement dimension, diversity indicator dimension and performance impact dimension, the coverage measurement dimension includes code coverage, data flow coverage and path coverage, the diversity indicator dimension includes input type diversity index, boundary condition diversity index and exception type diversity index, and the performance impact dimension includes CPU performance impact index and memory performance impact index.

[0142] Furthermore, the platform is also used to implement the following functions:

[0143]

[0144] Wherein, f(x) refers to the first validity of the first historical test record x, C′ i (x) and C″ i (x) and C″′ i (x) are parameter values ​​of the code coverage, the data flow coverage and the path coverage corresponding to the i-th test in the first historical test record x, respectively. The first historical test record x includes a total of I tests of coverage measurement dimensions. 1 and α 2 and α 3 are the first coverage coefficient, the second coverage coefficient and the third coverage coefficient respectively, and α 1 +α 2 +α 3 =1, D′ j (x) and D″ j (x) and D″′ j (x) are parameter values ​​of the input type diversity index, the boundary condition diversity index and the abnormal type diversity index corresponding to the j-th test in the first historical test record x, and the first historical test record x includes J tests of diversity indicator dimensions, β 1 and β 2 and β 3 are the first diversity coefficient, the second diversity coefficient and the third diversity coefficient, respectively, and β 1 +β 2 +β 3 =1, P′ j(x) and P″ j (x) are parameter values ​​of the CPU performance impact index and the memory performance impact index corresponding to the kth test in the first historical test record x, and the first historical test record x includes K performance impact dimension tests in total, γ 1 and γ 2 are the first performance impact coefficient and the second performance impact coefficient respectively, and γ 1 +γ 2 =1, α, β and γ refer to the adjustment coefficient of the coverage measurement dimension, the adjustment coefficient of the diversity indicator dimension and the adjustment coefficient of the performance impact dimension respectively, and α+β+γ=1.

[0145] Furthermore, the platform is also used to implement the following functions:

[0146] Reading predetermined use case features, and performing multi-dimensional feature collection on the first historical use case based on the predetermined use case features to obtain first historical use case feature information;

[0147] Performing weighted calculation on the first historical use case feature information after standardization to obtain a first data characteristic value;

[0148] Feedback adjustment is performed on the first effectiveness based on the first data characteristic value.

[0149] Furthermore, the platform is also used to implement the following functions:

[0150] The predetermined use case features include use case code structure, use case execution path, use case data attributes and use case system response.

[0151] Furthermore, the platform is also used to implement the following functions:

[0152] Reading predetermined local use case limits, wherein the predetermined local use case limits include predetermined use case validity limits and predetermined use case characteristic limits;

[0153] Determine whether the first validity meets the predetermined use case validity limit, and obtain a first determination result;

[0154] Determine whether the first data characteristic value meets the predetermined use case characteristic limit, and obtain a second determination result;

[0155] Building a target local use case set based on the first judgment result and the second judgment result;

[0156] The defects of each local use case in the target local use case set are analyzed to form a system local defect set, and a local defect repair plan for the system local defect set is established.

[0157] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of this specification are described. The processes depicted in the accompanying drawings do not necessarily require the specific order and continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0158] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

[0159] This specification and drawings are merely exemplary illustrations of the present application and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, a person skilled in the art may make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalents, the present application intends to include these modifications and variations.

Claims

1. A fuzzy testing method based on upper competition, characterized in that: include: Acquire a target component, wherein the target component refers to any system component in the target system that meets the processing execution restriction constraint; Screening the target historical test records of the target component to obtain target historical test exception records; A use case effectiveness evaluation function is introduced as a use case evaluation strategy, and the target historical test exception record is used as a use case optimization space; Performing fuzzy testing on a target use case obtained by global optimization in the use case optimization space based on the use case evaluation strategy in a predetermined test environment to obtain a target test record, wherein the target use case has an identification of target prediction anomaly; Comparing the target prediction anomaly with the target test anomaly obtained by analyzing the target test record to obtain a target comparison deviation; When the target comparison deviation is within the deviation limit, a target defect obtained by analyzing the target test anomaly is used as a defect of the target component; Building a system defect set of the target system based on the target defect, and analyzing the system defect set to establish a defect repair plan for the target system; Performing global optimization in the use case optimization space based on the use case evaluation strategy in a predetermined test environment includes: Step a: the use case optimization space includes multiple historical use cases in the target historical test exception record; Step b: Recording the first historical use case among the extracted multiple historical use cases as the target use case; Step c: evaluating and analyzing the first historical test record of the first historical use case according to the use case evaluation strategy to obtain a first validity; Step d: extracting a second historical use case from the multiple historical use cases, where the second historical use case is any one of the multiple historical use cases that is different from the first historical use case; Step e: obtaining a second validity of the second historical use case according to the use case evaluation strategy; Step f: when the second effectiveness is greater than the first effectiveness, replacing the first historical use case with the second historical use case to become the target use case; Step g: Repeat steps d to f until a predetermined repetition limit is reached, and output the target use case obtained at that time.

2. According to the fuzzy testing method based on upper competition in claim 1, it is characterized in that the method include: Using virtualization technology to create an initial execution environment; Generate target software and hardware conditions in combination with target test requirements of the target use case; The target software and hardware conditions are rendered to the initial execution environment to obtain the predetermined test environment.

3. The fuzzy testing method based on upper competition according to claim 1 is characterized in that: Methods include: The use case evaluation strategy obtains the utility dimension characteristics of the predetermined use case; Evaluate and analyze the first historical test record based on the utility dimension feature of the predetermined use case to obtain the first effectiveness; Among them, the predetermined use case utility dimension characteristics include at least coverage measurement dimension, diversity indicator dimension and performance impact dimension, the coverage measurement dimension includes code coverage, data flow coverage and path coverage, the diversity indicator dimension includes input type diversity index, boundary condition diversity index and exception type diversity index, and the performance impact dimension includes CPU performance impact index and memory performance impact index.

4. The fuzzy testing method based on upper competition according to claim 3 is characterized in that: The expression of the use case evaluation strategy is as follows: Wherein, f(x) refers to the first validity of the first historical test record x, C′ i (x) and C″ i (x) and C″′ i (x) are parameter values ​​of the code coverage, the data flow coverage and the path coverage corresponding to the i-th test in the first historical test record x, the first historical test record x includes a total of I tests of coverage measurement dimensions, α1, α2 and α3 are the first coverage coefficient, the second coverage coefficient and the third coverage coefficient, and α1+α2+α3=1, D′ j (x) and D″ j (x) and D″′ j (x) are parameter values ​​of the input type diversity index, the boundary condition diversity index and the abnormal type diversity index corresponding to the jth test in the first historical test record x, the first historical test record x includes a total of J tests of diversity indicator dimensions, β1, β2 and β3 are the first diversity coefficient, the second diversity coefficient and the third diversity coefficient, and β1+β2+β3=1, P′ j (x) and P″ j (x) are the parameter values ​​of the CPU performance impact index and the memory performance impact index corresponding to the kth test in the first historical test record x, the first historical test record x includes K tests of performance impact dimensions, γ1 and γ2 are the first performance impact coefficient and the second performance impact coefficient, and γ1+γ2=1, α, β and γ are the adjustment coefficients of the coverage measurement dimension, the adjustment coefficients of the diversity indicator dimension and the adjustment coefficients of the performance impact dimension, and α+β+γ=1.

5. The fuzzy testing method based on upper competition according to claim 1 is characterized in that: The method also includes: Reading predetermined use case features, and performing multi-dimensional feature collection on the first historical use case based on the predetermined use case features to obtain first historical use case feature information; Performing weighted calculation on the first historical use case feature information after standardization to obtain a first data characteristic value; Feedback adjustment is performed on the first effectiveness based on the first data characteristic value.

6. The fuzzy testing method based on upper competition according to claim 5 is characterized in that: The predetermined use case features include use case code structure, use case execution path, use case data attributes and use case system response.

7. The fuzzy testing method based on upper competition according to claim 6 is characterized in that: The method also includes: Reading predetermined local use case limits, wherein the predetermined local use case limits include predetermined use case validity limits and predetermined use case characteristic limits; Determine whether the first validity meets the predetermined use case validity limit, and obtain a first determination result; Determine whether the first data characteristic value meets the predetermined use case characteristic limit, and obtain a second determination result; Building a target local use case set based on the first judgment result and the second judgment result; The defects of each local use case in the target local use case set are analyzed to form a system local defect set, and a local defect repair plan for the system local defect set is established.

8. The fuzzy testing platform based on upper competition is characterized by: The platform includes: A target component acquisition module, wherein the target component acquisition module acquires a target component, wherein the target component refers to any system component in the target system that meets the processing execution restriction constraint; A target historical test exception record acquisition module, wherein the target historical test exception record acquisition module screens the target historical test records of the target component to obtain the target historical test exception records; A use case optimization space establishment module, wherein the use case optimization space establishment module introduces a use case effectiveness evaluation function as a use case evaluation strategy and uses the target historical test exception record as a use case optimization space; A target test record acquisition module, wherein the target test record acquisition module performs fuzzy testing on a target use case obtained by global optimization in the use case optimization space based on the use case evaluation strategy in a predetermined test environment to obtain a target test record, wherein the target use case has an identification of target prediction anomaly; A target comparison deviation acquisition module, wherein the target comparison deviation acquisition module compares the target prediction anomaly with the target test anomaly obtained by analyzing the target test record to obtain a target comparison deviation; a target component defect determination module, the target component defect determination module being used to, when the target comparison deviation is within the deviation limit, use a target defect obtained by analyzing the target test anomaly as a defect of the target component; A defect repair plan establishment module, wherein the defect repair plan establishment module assembles a system defect set of the target system based on the target defect, and analyzes the system defect set to establish a defect repair plan for the target system; The platform is also used to implement the following functions: Step a: the use case optimization space includes multiple historical use cases in the target historical test exception record; Step b: Recording the first historical use case among the extracted multiple historical use cases as the target use case; Step c: evaluating and analyzing the first historical test record of the first historical use case according to the use case evaluation strategy to obtain a first validity; Step d: extracting a second historical use case from the multiple historical use cases, where the second historical use case is any one of the multiple historical use cases that is different from the first historical use case; Step e: obtaining a second validity of the second historical use case according to the use case evaluation strategy; Step f: when the second effectiveness is greater than the first effectiveness, replacing the first historical use case with the second historical use case to become the target use case; Step g: Repeat steps d to f until a predetermined repetition limit is reached, and output the target use case obtained at that time.