Test method, device, storage medium and computer equipment

By acquiring and combining the state characteristics during the order flow process, test cases are generated and simulation processing is executed, which solves the problem of missed detections in software testing and achieves full business scenario test coverage and cost reduction.

CN116244211BActive Publication Date: 2026-05-08RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2023-04-13
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing software testing methods cannot effectively cover multiple business scenarios in computer software products, resulting in some test scenarios being missed and causing online problems.

Method used

By acquiring target order information and the characteristics of the state to be tested, feature combination processing is performed to generate state feature samples. Test cases are then generated based on these samples, simulation processing is performed to determine the number of hits, and test log information is generated to ensure test coverage.

Benefits of technology

It achieves full test coverage of all business scenarios in computer software products, improves testers' understanding of business scenarios, and reduces testing costs and the risk of missed tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116244211B_ABST
    Figure CN116244211B_ABST
Patent Text Reader

Abstract

The application discloses a test method, device, storage medium and computer equipment, the method comprises the following steps: obtaining target order information and to-be-tested state characteristics; performing feature combination processing according to the to-be-tested state characteristics and the target order information, and determining state characteristic samples; generating test cases according to the state characteristic samples; performing simulation processing according to the test cases, and obtaining simulation results; and determining test log information of the state characteristic samples according to the hit times in the simulation results. Thus, all possible state characteristics generated in the order life cycle are used as the basis of sample permutation and combination, the scene measurement of non-terminal states such as intermediate states and process states is realized, the perception of the test personnel to scene omissions is improved, and online problems caused by test omissions are effectively reduced. Meanwhile, test cases are generated based on real order data, the test case generation efficiency is improved, the test cases can cover various real business scenes, and the test cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a testing method, apparatus, storage medium, and computer equipment. Background Technology

[0002] Currently, one of the common methods to ensure the stable operation of computer software is to use a software testing system to execute test cases of the computer software product through testing, so as to conduct a more comprehensive inspection of the business or business scenarios in the computer software product.

[0003] However, as the number of business processes and operations in computer software products increases, and the real-time requirements for process status changes become more stringent, online data is often collected in its final state. For example, a transaction fulfillment order might store one of the states: paid, completed, or delivered. However, for final states like paid and completed, states preceding the final state are either not stored or are overwritten. This leads to some test scenarios being missed, meaning the statistically recorded scenarios do not represent the full range of online scenarios, thus causing online issues. Summary of the Invention

[0004] In view of this, this application provides a testing method, apparatus, storage medium, and computer equipment, the main purpose of which is to solve the technical problem of reducing test misses.

[0005] According to a first aspect of this application, a testing method is provided, the method comprising:

[0006] Obtain target order information and status features to be tested. The target order information includes status features during the order flow process and the combination relationship of multiple status features.

[0007] Based on the characteristics of the state to be tested and the target order information, feature combination processing is performed to determine the state feature sample, wherein the state feature sample includes the state characteristics to be tested and / or the combination relationship of the state characteristics to be tested;

[0008] Generate test cases based on state feature samples;

[0009] The simulation process is executed according to the test cases to obtain the simulation results, which include the number of hits of the state feature samples.

[0010] Test log information for determining state feature samples based on the number of hits.

[0011] Furthermore, test cases are generated based on state feature samples, including:

[0012] Perform statistical processing on the target order information to determine the popularity information of status feature samples in the target order information;

[0013] The system displays status feature samples and popularity information in conjunction with each other.

[0014] In response to the first input, test cases are generated based on the state feature samples corresponding to the first input.

[0015] Furthermore, test cases are generated based on state feature samples, including:

[0016] A link simulation model for obtaining state feature samples;

[0017] Test cases generated based on link simulation models to produce state feature samples.

[0018] Furthermore, feature combination processing is performed based on the characteristics of the state to be tested and the target order information, including:

[0019] Based on the features of the state to be tested and their combination relationships, extract the first feature combination relationship containing the features of the state to be tested in the target order information;

[0020] By combining the features of the state to be tested and the state features in the target order information, a second feature combination relationship is obtained;

[0021] The first and second feature combination relationships are filtered to obtain the feature combination relationships to be tested.

[0022] The state features to be tested and / or the combination relationships of the features to be tested are determined as state feature samples.

[0023] Furthermore, the testing methods also include:

[0024] Aggregate the state features to be tested and the order attribute features of the target order information corresponding to the state features to be tested to obtain state feature samples; and / or,

[0025] The state feature samples are obtained by aggregating the relationship between the features to be tested and the order attribute features of the target order information corresponding to the relationship between the features to be tested.

[0026] Furthermore, the filtration process includes at least one of the following: cleaning process, deweighting process, noise reduction process, and clustering process.

[0027] Furthermore, obtain target order information, including:

[0028] Obtain historical order information and preset order attribute characteristics;

[0029] Extract the attribute features of the first order from historical order information;

[0030] The first order attribute features are filtered to determine the second order attribute features from the first order attribute features;

[0031] Obtain target order information based on the second order attribute characteristics and / or preset order attribute characteristics.

[0032] Furthermore, simulation processing is performed according to the test cases, including:

[0033] Generate test tasks based on test cases;

[0034] Execute the test task to obtain simulation data;

[0035] If the simulation data of the current test task has at least one feature in the state feature sample, and the identification information of the current test task is different from the identification information of the test task corresponding to the accumulated hit count, the accumulated hit count of the state feature sample is calculated.

[0036] Furthermore, the testing methods also include:

[0037] The simulation results are verified based on the combination relationships.

[0038] Delete simulation results that failed to be verified.

[0039] Furthermore, the test log includes test coverage; test log information for determining state feature samples based on the number of hits includes:

[0040] The first state feature sample in the state feature sample is determined based on the number of hits.

[0041] The quotient of the number of first state feature samples and the number of state feature samples is determined as the test coverage.

[0042] Furthermore, the testing methods also include:

[0043] If the test coverage is less than or equal to the coverage threshold, output a prompt message based on the first state feature sample.

[0044] According to a second aspect of this application, a testing apparatus is provided, the apparatus comprising:

[0045] The first acquisition module is used to acquire target order information and test status features. The target order information includes status features during the order flow process and the combination relationship of multiple status features.

[0046] The determination module is used to perform feature combination processing based on the features of the state to be tested and the target order information to determine the state feature samples, wherein the state feature samples include the features of the state to be tested and / or the combination relationship of the features to be tested that contains the features of the state to be tested;

[0047] The testing module is used to generate test cases based on state feature samples; and to perform simulation processing according to the test cases to obtain simulation results, wherein the simulation results include the number of hits of the state feature samples; and to determine the test log information of the state feature samples based on the number of hits.

[0048] Furthermore, the testing apparatus also includes:

[0049] The statistics module is used to perform statistical processing on the target order information and determine the popularity information of the status feature samples in the target order information;

[0050] The display module is used to associate and display status feature samples and popularity information;

[0051] The testing module is specifically used to generate test cases in response to the first input, based on the state feature samples corresponding to the first input.

[0052] Furthermore, the testing module is specifically used to obtain the link simulation model of state feature samples; and to generate test cases of state feature samples based on the link simulation model.

[0053] Further, the determination module is specifically used to extract the first feature combination relationship containing the state features to be tested in the target order information according to the state features to be tested and the combination relationship; combine the state features to be tested and the state features in the target order information to obtain the second feature combination relationship; filter the first feature combination relationship and the second feature combination relationship to obtain the feature combination relationship to be tested; and determine the state features to be tested and / or the feature combination relationship to be tested as state feature samples.

[0054] Furthermore, the determination module is also used to aggregate the features of the state to be tested and the order attribute features of the target order information corresponding to the features of the state to be tested; and / or to aggregate the features of the combination relationship of the features to be tested and the order attribute features of the target order information corresponding to the combination relationship of the features to be tested.

[0055] Furthermore, the filtration process includes at least one of the following: cleaning process, deweighting process, noise reduction process, and clustering process.

[0056] Furthermore, the testing apparatus also includes:

[0057] The second acquisition module is also used to acquire historical order information and preset order attribute features;

[0058] The feature extraction module is used to extract the first order attribute features from historical order information;

[0059] The filtering module is used to filter the first order attribute features to determine the second order attribute features among the first order attribute features;

[0060] The first acquisition module is specifically used to acquire target order information according to the second order attribute features and / or preset order attribute features.

[0061] Furthermore, the testing module is specifically used to generate test tasks based on test cases; execute test tasks to obtain simulation data; if the simulation data of the current test task has at least one feature in the state feature sample, and the identification information of the current test task is different from the identification information of the test task corresponding to the accumulated hit count, the number of hits of the state feature sample is accumulated.

[0062] Furthermore, the testing apparatus also includes:

[0063] The verification module is used to verify the simulation results based on the feature combination relationship; and to delete the simulation results that fail to be verified.

[0064] Furthermore, the test log includes test coverage; a test module, specifically used to determine the first state feature sample in the state feature sample based on the number of hits; and to determine the test coverage by the quotient of the number of the first state feature samples and the number of state feature samples.

[0065] Furthermore, the testing apparatus also includes:

[0066] The prompt module is used to output prompt information based on the first state feature sample if the test coverage is less than or equal to the coverage threshold.

[0067] According to a third aspect of this application, a storage medium is provided on which a computer program is stored, which, when executed by a processor, implements the above-described test method.

[0068] According to a fourth aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described test method.

[0069] By employing the aforementioned technical solutions, this application provides a testing method, apparatus, storage medium, and computer equipment that uses feature analysis to determine the state features of intermediate or final states in the order flow process of a target order, as well as the combination relationships of multiple state features. Based on the state features to be tested, various different state feature samples are generated by combining the state features and combination relationships in the target order information. This allows testers to obtain a more comprehensive picture of the online scenarios for each business domain through the state feature samples, improving the understanding of product development testers regarding the business within the requirement domain. Furthermore, test cases are generated using the rich state feature samples, and simulation tests are executed according to the test cases to simulate online business for different state feature samples, thereby determining the actual hit count of different state feature samples. Finally, the hit count is used to analyze the test log information of the state feature samples in this test. Thus, testers can understand whether there are any missed tests in certain scenarios through the test log information. This application's embodiments utilize all possible state features generated in the order lifecycle as the basis for sample permutations and combinations, realizing the measurement of non-final states such as intermediate and process states, improving testers' awareness of missed tests, and effectively reducing online problems caused by missed tests. Meanwhile, generating test cases based on real order data not only improves the efficiency of test case generation but also enables it to cover a variety of real business scenarios, which helps reduce testing costs.

[0070] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0071] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0072] Figure 1 This illustration shows one of the flowcharts of a testing method provided in an embodiment of this application;

[0073] Figure 2 A second schematic flowchart of a testing method provided in an embodiment of this application is shown;

[0074] Figure 3 The third schematic flowchart of a testing method provided in an embodiment of this application is shown;

[0075] Figure 4 A schematic diagram of the structure of a testing device provided in an embodiment of this application is shown. Detailed Implementation

[0076] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0077] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the word “comprising” as used in the specification of this application means the presence of features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or combinations thereof. It should be understood that the word “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0078] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art.

[0079] This embodiment provides a testing method, such as Figure 1 As shown, the method includes:

[0080] Step 101: Obtain target order information and test status features.

[0081] The target order information includes status features during the order flow and the combination relationships of multiple status features. Status features represent the current state node of the order, and the combination relationships of multiple status features form a node link arranged in chronological order. Taking a delivery order as an example, status features may include generating a waybill, assigning a delivery person, picking up the goods, delivering the goods, and delivery being completed. The corresponding combination relationship is: generating a waybill → assigning a delivery person → picking up the goods → delivering the goods → delivery being completed.

[0082] Understandably, the features to be tested can be specified by the testers based on actual business needs or reasonably set according to the frequency of occurrence of status features in historical order information. The features to be tested can be features of at least one status.

[0083] It should be noted that the solutions provided in this application can be executed by any computer device, such as a terminal device or a server. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices can be smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, etc., but are not limited to these. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication methods, and this application does not impose specific limitations on this connection.

[0084] Furthermore, the data processing involved in the embodiments of this application can be implemented using cloud technology. Optionally, the data computation involved in the optional embodiments of this application can be implemented using cloud computing.

[0085] Furthermore, after obtaining the target order information, the target order information can be persisted to save the program data to a storage device that can be permanently stored (such as a disk) for subsequent feature analysis and processing.

[0086] In specific application scenarios, such as Figure 2 As shown, step 101, which is to obtain the target order information, specifically includes the following steps:

[0087] Step 101-1: Obtain historical order information and preset order attribute features.

[0088] Historical order information can be generated from various types of orders, such as food delivery orders, e-commerce orders, delivery orders, and fulfillment orders. This application embodiment does not specifically limit this.

[0089] Step 101-2: Extract the first order attribute features from the historical order information.

[0090] Among them, the preset order attribute features or the first order attribute features include, but are not limited to, order number, order type, merchant type, product features, interface parameters and other information that can be used to distinguish different orders.

[0091] Step 101-3: Filter the first order attribute features to determine the second order attribute features among the first order attribute features.

[0092] Specifically, the screening conditions can be whether the preset order type is met, whether the preset scenario is met, etc., and can be reasonably set according to the testing requirements. This application embodiment does not make specific limitations.

[0093] Step 101-4: Obtain the target order information according to the second order attribute features and / or the preset order attribute features.

[0094] In this embodiment, after determining the first order attribute features of each historical order information, the first order attribute features of each historical order information are filtered to determine the second order attribute features of orders that meet the current business requirements. Target order information is subscribed to and collected through the second order attribute features and preset order attribute features from other pre-configured external interfaces. This embodiment performs data analysis by collecting data from each node in the collection chain, which not only fully considers real order data but also supplements the second order attribute features with preset order attribute features, making the collection of target order information more comprehensive. This provides diverse data support for the subsequent permutation and combination of status features, helps to enumerate abnormal scenarios, and thus forms a more comprehensive sample of status features. This assists testers in understanding possible business scenarios within the requirement domain, facilitating more comprehensive testing and screening.

[0095] It is worth mentioning that the target order information can be obtained by filtering the target order information in historical order information according to the second order attribute characteristics and / or preset order attribute characteristics; or by using slicing or HSF interceptors to mark the core business interface, so as to collect online real-time order information with the second order attribute characteristics and / or preset order attribute characteristics as the target order information.

[0096] Furthermore, to improve the efficiency of feature extraction and filtering, data models can be created for each business domain according to business needs. Order information can then be subscribed to and collected through these data models. Similarly, preset order attribute features can be configured by testers as needed, or external interfaces can be called to obtain custom data models from other business domains besides the existing data models, and these custom data models can be used to extract preset order attribute features.

[0097] Step 102: Perform feature combination processing based on the features of the state to be tested and the target order information to determine the state feature samples.

[0098] The number of state feature samples can be one or more. A state feature sample can be a single state feature to be tested, or it can be a combination of state features to be tested and other state features.

[0099] In this embodiment, based on the features of the state to be tested, various different state feature samples are arranged and combined with the state features and combination relationships in the target order information to form a more comprehensive full map of the online state scenarios of various business domains. This allows the combined state feature samples to cover a wide range of application scenarios, thereby achieving more comprehensive testing and screening.

[0100] In specific application scenarios, such as Figure 3As shown, step 102, which involves combining features based on the characteristics of the state to be tested and the target order information to determine the state feature samples, specifically includes the following steps:

[0101] Step 102-1: Based on the features of the state to be tested and the combination relationship, extract the first feature combination relationship containing the features of the state to be tested in the target order information.

[0102] Specifically, if a state feature to be tested appears in the combination relationship of the target order information, then that combination relationship is taken as the first feature combination relationship. For example, if the combination relationship of the state features of the target order information is Create New User → Single Point Operation → Payment Operation → Confirm Order, and the payment operation node is taken as the state feature to be tested, then the first feature combination relationship can be Single Point Operation + Payment Operation, Payment Operation + Confirm Order, Create New User + Single Point Operation + Payment Operation, Single Point Operation + Payment Operation + Confirm Order; if the single point operation node and the payment operation node are taken as the state features to be tested, then the first feature combination relationship can be Single Point Operation + Payment Operation, Create New User + Single Point Operation + Payment Operation, Single Point Operation + Payment Operation + Confirm Order.

[0103] Step 102-2: Combine the features of the state to be tested and the state features in the target order information to obtain the second feature combination relationship.

[0104] In this embodiment, the state feature to be tested is combined with at least one state feature appearing in the target order information to obtain a new second feature combination relationship. This fully takes into account the process differences of different users and different types of orders in actual operation, improves the richness of state feature samples, and can improve the link-level scenario even for orders canceled at intermediate nodes through combination operations.

[0105] For example, for an order that has not been fulfilled, the status features in the target order information are payment status, initial status, and delivery in progress. If the payment operation is taken as the status feature to be tested, the combination relationship of the second feature can be: payment operation + payment status, payment operation + initial status, payment operation + delivery in progress, payment operation + payment status + initial status + delivery in progress, payment operation + payment status + initial status + delivery in progress, and payment operation + payment status + delivery in progress.

[0106] Step 102-3: Filter the first feature combination relationship and the second feature combination relationship to obtain the feature combination relationship to be tested.

[0107] Step 102-4: Determine the state features to be tested and / or the combination relationships of the features to be tested as state feature samples.

[0108] In this embodiment, considering the possibility of duplicate first feature combination relationships and second feature combination relationships under the same state characteristics, the first and second feature combination relationships are filtered to remove identical feature combination relationships, resulting in the final feature combination relationship to be tested. This improves the sample quality of state feature samples, reduces the possibility of repeated system testing, enhances the sufficiency of software testing, reduces the time cost of software testing, effectively avoids message corruption, and optimizes testing efficiency.

[0109] Specifically, the filtration process includes, but is not limited to, at least one of the following: cleaning process, deweighting process, noise reduction process, and clustering process.

[0110] Furthermore, after determining the combination relationship of the features to be tested and the state features to be tested, the testing method also includes: aggregating the state features to be tested and the order attribute features of the target order information corresponding to the state features to be tested; and / or aggregating the combination relationship of the features to be tested and the order attribute features of the target order information corresponding to the combination relationship of the features to be tested.

[0111] In this embodiment, the features of the state to be tested are aggregated with the order attribute features of the target order information containing the features of the state to be tested, to achieve multi-dimensional data splicing and form a state feature sample with a single state feature to be tested. Similarly, the combination relationship of the features to be tested is aggregated with the order attribute features of the target order information that combine the combination relationship of the features to be tested, to form a state feature sample with multiple state feature combinations. Thus, the state feature samples are marked with order attribute features to enhance the understanding of the online scenario of the state feature samples, and to facilitate the later use of order attribute features to trace more related attributes, thereby enhancing subsequent scalability. This also facilitates the management and classification of test cases and helps improve the understanding of product development and testing personnel regarding the business within the requirement domain.

[0112] Step 103: Generate test cases based on state feature samples.

[0113] In specific application scenarios, step 103, that is, generating test cases based on state feature samples, can be implemented in the following way:

[0114] Method 1 involves statistically processing the target order information to determine the popularity of status feature samples within the target order information; displaying the status feature samples and popularity information in association; and generating test cases based on the status feature samples corresponding to the first input in response to the first input.

[0115] The popularity information includes information such as the frequency of appearance of status feature samples in historical order information, change impact coefficient, and aggregation dimension, which can reflect the popularity of status feature samples in actual business.

[0116] It should be noted that the first input includes, but is not limited to, click input, key input, fingerprint input, swipe input, and press input. Key input includes, but is not limited to, single-click input, double-click input, long-press input, or combination key input of the power button, volume button, and main menu button on the client. This application embodiment does not specifically limit the user input method and can be any feasible method.

[0117] In this embodiment, a counting algorithm is used to statistically analyze the popularity of status feature samples in the target order information, and the status feature samples and their popularity information are displayed. This allows testers to accurately determine whether the application status of actual business operations in different scenarios matches the status feature samples, and to select the required status feature samples to generate test cases according to testing needs. This satisfies the need for personalized test case customization, resulting in effective, highly universal test cases with an efficient determination process, thus improving testing efficiency.

[0118] For example, if you need to assess the online application capabilities of software, test cases based on frequently occurring state feature samples have a wider range of applications. If you need to test a less frequently used function, test cases based on less frequently occurring state feature samples are more targeted.

[0119] Method 2: Obtain the link simulation model of state feature samples; generate test cases of state feature samples based on the link simulation model.

[0120] In this embodiment, a pre-configured link simulation model is used to generate test cases for each state feature sample. This enables the automatic generation of test cases, reducing automation investment and maintenance costs. Moreover, compared to relying on testers' subjective experience to select core test cases, it is based on objective data, eliminating the uncertainty brought about by subjective experience.

[0121] Specifically, based on the state transition relationships configured by the user, multiple state transition paths can be determined using a traversal algorithm, and a link simulation model can be constructed based on these multiple state transition paths.

[0122] Step 104: Perform simulation processing according to the test cases to obtain simulation results.

[0123] The simulation results include the number of hits of state feature samples.

[0124] In this embodiment, test cases are generated using state feature samples, and simulation tests are executed according to the test cases to simulate online business for different state feature samples, thereby determining the actual hit count of different state feature samples. This facilitates the analysis of test log information of different state feature samples in this test, enabling full-scale offline scenario measurement.

[0125] In specific application scenarios, step 104, which is to perform simulation processing according to the test cases, includes the following steps:

[0126] Step 104-1: Generate test tasks based on test cases.

[0127] Step 104-2: Execute the test task to obtain simulation data.

[0128] In this embodiment, when performing the test task, the simulation parameters are processed in the order of multiple links in the link path to obtain the target rules matching the simulation parameters and the simulation parameter flow information, i.e., the simulation data, thereby realizing the simulation and investigation of actual business in multiple scenarios.

[0129] Step 104-3: If the simulation data of the current test task has at least one feature in the state feature sample, and the identification information of the current test task is different from the identification information of the test task corresponding to the accumulated hit count, the cumulative hit count of the state feature sample is calculated.

[0130] In this embodiment, test messages are pre-issued according to test cases to execute simulation tests and obtain simulation data based on different state feature samples. Since there are temporal relationships between state nodes, the hit count is usually counted at a single node dimension. If the state feature sample is a combination of multiple features, duplicate hits may occur. Therefore, if the simulation data of the current test task has at least one feature from the state feature sample (meaning the current test task may have already hit that state feature sample), the completed test tasks are further iterated, and it is determined whether the identification information of the current test task is the same as the identification information of the test task corresponding to the accumulated hit count. If they are the same, it means that a hit count has already been accumulated for that state feature sample, and there is no need to accumulate it again; therefore, this count is discarded. Conversely, if they are different, it means that the current test task is accumulating the hit count for that state feature sample for the first time, and the hit count for that state feature sample is accumulated once, and the identification information of the current test task is recorded for subsequent deduplication. This improves the accuracy of the hit count statistics, obtains accurate test log information, and thus achieves precise state scenario measurement.

[0131] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to fully illustrate the specific implementation process of this embodiment, after step 104, the testing method further includes: verifying the simulation results according to the combination relationship; and deleting the simulation results that failed the verification.

[0132] In this embodiment, to prevent test cases from deviating from the actual online business process, the reasonableness of the combination relationships in the simulation results is verified using existing combination relationships. If the verification fails, it indicates that the test task corresponding to the simulation result has a problem that does not conform to actual logic and has low reference value; therefore, the simulation result that failed the verification is deleted. This improves the test quality of simulation processing and further enhances the statistical accuracy of the hit count.

[0133] For example, in a test case targeting the refund status, the simulation results from executing the test task show the test path as "payment incomplete" → "refund status." Considering that a refund cannot be processed without payment, the simulation results from this test task are deleted as invalid data.

[0134] Step 105: Determine the test log information of the state feature sample based on the number of hits.

[0135] Specifically, the test log information includes at least one of the following: test coverage, test execution chain, sample popularity, number of sample hits, method call chain, test time, and other information related to simulation testing.

[0136] By applying the technical solution of this embodiment, feature analysis is used to determine the state features of intermediate or final states in the order flow process of the target order information and the combination relationships of multiple state features. Based on the state features to be tested, various different state feature samples are generated by arranging and combining the state features and combination relationships in the target order information. Therefore, testers can obtain a more comprehensive picture of the online scenarios of various business domains through the state feature samples, which is beneficial to improving the understanding of product development testers regarding the business within the requirement domain. Furthermore, test cases are generated using the state feature samples, and scenario simulation tests are performed according to the test cases to simulate online business for different state feature samples, thereby determining the actual hit count of different state feature samples. Finally, the test status of each state feature sample is determined using the hit count, and combined with the total number of multiple state feature samples, test log information of the state feature sample in this test can be generated. Testers can understand whether there are any missed tests in certain scenarios through the test log information. This embodiment of the application uses all possible state features generated in the order lifecycle as the basis for sample arrangement and combination, realizing the scenario measurement of non-final states such as intermediate states and process states, improving testers' perception of missed tests in scenarios, and effectively reducing online problems caused by missed tests. Meanwhile, generating test cases based on real order data not only improves the efficiency of test case generation but also enables it to cover a variety of real business scenarios, which helps reduce testing costs.

[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0138] In specific application scenarios, test log information includes test coverage. Therefore, step 105, which determines the test log information of state feature samples based on the number of hits, specifically includes the following steps:

[0139] Step 105-1: Determine the first state feature sample in the state feature sample based on the number of hits.

[0140] Specifically, state feature samples with fewer than a preset number of hits can be used as the first state feature samples. Alternatively, when there are multiple state feature samples, the proportion of the hit count corresponding to any state feature sample in the total hit count of all state feature samples can be calculated, and state feature samples with a proportion less than a preset proportion can be used as the first state feature samples. This application does not impose specific limitations on the selection method for the first state feature samples, and any implementation method is acceptable. The preset number of hits and the preset proportion can be reasonably set according to the required accuracy of the test. For example, the preset number of hits can be set to any value between 0 and 30. When the hit count is less than the preset number of hits, it indicates that the test for that state feature sample may be incomplete or even not performed, and retesting may be necessary.

[0141] Step 105-2: The quotient of the number of first state feature samples and the number of state feature samples is determined as the test coverage.

[0142] In this embodiment, a division operation is performed with the number of first state feature samples as the numerator and the total number of all state feature samples as the denominator. The resulting quotient is the test coverage of the state feature samples. Therefore, the test coverage can intuitively reflect the degree of completion of the test, allowing testers to know whether any tests have been missed.

[0143] It is worth mentioning that after step 105-2, the testing method also includes: if the test coverage is less than or equal to the coverage threshold, output a prompt message based on the first feature sample.

[0144] The coverage threshold can be set reasonably according to the test accuracy.

[0145] In this embodiment, when test coverage is less than or equal to the coverage threshold, meaning there are significant omissions in the state process evaluation, online issues are likely to occur. In this case, a prompt message is output to remind testers that state feature samples with low hit rates may have been missed. This allows testers to take timely remedial measures to improve the test, effectively ensuring that key business scenarios are not overlooked.

[0146] Understandably, the way to output the prompt message can be by displaying the prompt message, broadcasting the prompt message, or sending the prompt message to the tester's client.

[0147] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0148] Furthermore, as Figures 1 to 3 To specifically implement the method, this application provides a testing device, such as... Figure 4 As shown, the device includes: a first acquisition module 41, a determination module 42, and a test module 43.

[0149] The first acquisition module 41 is used to acquire target order information and test status features. The target order information includes status features in the order flow process and the combination relationship of multiple status features.

[0150] The determination module 42 is used to perform feature combination processing based on the features to be tested and the target order information to determine the status feature samples, wherein the status feature samples include the features to be tested and / or the combination relationship of the features to be tested that contains the features to be tested;

[0151] Test module 43 is used to generate test cases based on state feature samples; and to perform simulation processing according to the test cases to obtain simulation results, wherein the simulation results include the number of hits of the state feature samples; and to determine the test log information of the state feature samples based on the number of hits.

[0152] In specific application scenarios, the device also includes: a statistics module (not shown in the figure) and a display module (not shown in the figure).

[0153] The statistics module is used to perform statistical processing on the target order information and determine the popularity information of the status feature samples in the target order information.

[0154] The display module is used to associate and display status feature samples and popularity information;

[0155] Test module 43 is specifically used to generate test cases in response to the first input, based on the state feature samples corresponding to the first input.

[0156] In specific application scenarios, test module 43 is specifically used to obtain the link simulation model of state feature samples; and to generate test cases of state feature samples based on the link simulation model.

[0157] In a specific application scenario, module 42 is specifically used to extract the first feature combination relationship containing the state features to be tested in the target order information according to the state features to be tested and the combination relationship; combine the state features to be tested and the state features in the target order information to obtain the second feature combination relationship; filter the first feature combination relationship and the second feature combination relationship to obtain the feature combination relationship to be tested; and determine the state features to be tested and the feature combination relationship to be tested as state feature samples.

[0158] In specific application scenarios, the determination module 42 is also used to aggregate the order attribute features of the target order information corresponding to the state features to be tested and the state features to be tested; and / or to aggregate the combination relationship of the features to be tested and the order attribute features of the target order information corresponding to the combination relationship of the features to be tested.

[0159] In specific application scenarios, filtering processes include at least one of the following: cleaning, deduplication, noise reduction, and clustering.

[0160] In specific application scenarios, the device also includes: a second acquisition module (not shown in the figure), a feature extraction module (not shown in the figure), and a filtering module (not shown in the figure).

[0161] The second acquisition module is also used to acquire historical order information and preset order attribute features;

[0162] The feature extraction module is used to extract the first order attribute features from historical order information;

[0163] The filtering module is used to filter the first order attribute features to determine the second order attribute features among the first order attribute features;

[0164] The first acquisition module 41 is specifically used to acquire target order information according to the second order attribute features and / or preset order attribute features.

[0165] In specific application scenarios, the test module 43 is specifically used to generate test tasks based on test cases; execute test tasks to obtain simulation data; if the simulation data of the current test task has at least one feature in the state feature sample, and the identification information of the current test task is different from the identification information of the test task corresponding to the accumulated hit count, the number of hits of the state feature sample is accumulated.

[0166] In specific application scenarios, the device also includes: a verification module (not shown in the figure).

[0167] The verification module is used to verify the simulation results based on the feature combination relationship and to delete the simulation results that failed the verification.

[0168] In specific application scenarios, test log information includes test coverage; test module 43 is specifically used to determine the first state feature sample in the state feature sample based on the number of hits; and the quotient of the number of the first state feature sample and the number of state feature samples is determined as the test coverage.

[0169] In specific application scenarios, the device also includes a prompting module (not shown in the figure).

[0170] The prompting module is used to output prompt information based on the first state feature sample if the test coverage is less than or equal to the coverage threshold.

[0171] It should be noted that other corresponding descriptions of the functional units involved in the testing device provided in this application embodiment can be found by referring to... Figures 1 to 3 The corresponding descriptions in [the document] will not be repeated here.

[0172] Based on the above, Figures 1 to 3 Accordingly, this application embodiment also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method. Figures 1 to 3 The test method shown.

[0173] Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods described in the various implementation scenarios of this application.

[0174] Based on the above, Figures 1 to 3 The method shown, and Figure 4 To achieve the above objectives, the present application also provides a computer device, specifically a personal computer, server, network device, etc., as shown in the virtual device embodiment. This computer device includes a storage medium and a processor; the storage medium stores a computer program; the processor executes the computer program to achieve the above-described objectives. Figures 1 to 3 The test method shown.

[0175] Optionally, the computer device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Bluetooth interfaces, Wi-Fi interfaces), etc.

[0176] Those skilled in the art will understand that the computer device structure provided in this embodiment does not constitute a limitation on the computer device, and may include more or fewer components, or combine certain components, or have different component arrangements.

[0177] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and stores the hardware and software resources of a computer device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software within the physical device.

[0178] Through the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software plus necessary general-purpose hardware platforms, or it can be implemented using hardware to obtain target order information and test state features. The target order information includes state features during the order flow process and combinations of multiple state features. Based on the test state features and target order information, feature combination processing is performed to determine state feature samples. These state feature samples include test state features and / or combinations of test features containing test state features. Test cases are generated based on the state feature samples. Simulation processing is executed according to the test cases to obtain simulation results, including the number of hits for the state feature samples. Test log information for the state feature samples is determined based on the number of hits. In this embodiment, feature analysis determines the state features of intermediate or final states during the order flow process in the target order information and the combinations of multiple state features. Based on the test state features, various different state feature samples are arranged and combined using the state features and combinations in the target order information. Therefore, testers can obtain a more comprehensive picture of the online scenarios of various business domains through the state feature samples, which is beneficial to improving the understanding of product development testers regarding the business within the requirement domain. Furthermore, test cases are generated using rich state feature samples, and simulation tests are executed according to these test cases to simulate online business for different state feature samples, thereby determining the actual hit count for different state feature samples. Finally, the hit count is used to analyze the test log information of the state feature samples in this test. Thus, testers can understand whether there are any missed tests in certain scenarios through the test log information. This embodiment of the application uses all possible state features generated in the order lifecycle as the basis for sample permutations and combinations, realizing scenario measurement of non-final states such as intermediate states and process states, improving testers' awareness of scenario misses, and effectively reducing online problems caused by missed tests. At the same time, generating test cases based on real order data improves the efficiency of test case generation while enabling it to cover a variety of real business scenarios, which helps reduce testing costs.

[0179] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.

[0180] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.

Claims

1. A testing method, characterized in that, The method includes: Collect online real-time order information with second order attribute features and / or preset order attribute features that meet the current business needs as target order information, and obtain the status features to be tested. The target order information includes status features in the order flow process and the combination relationship of multiple status features. Based on the features to be tested and the target order information, feature combination processing is performed to determine the status feature sample, wherein the status feature sample includes the features to be tested and / or the combination relationship of features to be tested that includes the features to be tested; Test cases are generated based on the state feature samples; The simulation process is executed according to the test cases to obtain simulation results, wherein the simulation results include the number of hits of the state feature samples; The test log information of the state feature sample is determined based on the number of hits; The feature combination processing based on the characteristics of the state to be tested and the target order information includes: Based on the features of the state to be tested and the combination relationship, extract the first feature combination relationship containing the features of the state to be tested in the target order information; By combining the state features to be tested and the state features in the target order information, a second feature combination relationship is obtained; The first feature combination relationship and the second feature combination relationship are filtered to obtain the feature combination relationship to be tested. The state feature to be tested and / or the combination relationship of the state feature to be tested are determined as the state feature sample.

2. The method according to claim 1, characterized in that, The step of generating test cases based on the state feature samples includes: Statistical processing is performed on the target order information to determine the popularity information of the status feature samples in the target order information; The status feature samples and the popularity information are displayed together. In response to the first input, the test case is generated based on the state feature sample corresponding to the first input.

3. The method according to claim 1, characterized in that, The step of generating test cases based on the state feature samples includes: Obtain the link simulation model of the state feature samples; The test cases are generated based on the link simulation model to produce the state feature samples.

4. The method according to claim 1, characterized in that, The method further includes: Aggregate the features of the state to be tested and the order attribute features of the target order information corresponding to the features of the state to be tested; and / or, The test feature combination relationship and the order attribute features of the target order information corresponding to the test feature combination relationship are aggregated.

5. The method according to claim 1, characterized in that, The filtration process includes at least one of the following: cleaning process, deduplication process, noise reduction process, and clustering process.

6. The method according to any one of claims 1 to 5, characterized in that, The step of performing simulation processing according to the test cases includes: Generate test tasks based on the test cases; The simulation data was obtained by performing the test task. If the simulation data of the current test task has at least one feature in the state feature sample, and the identification information of the current test task is different from the identification information of the test task corresponding to the accumulated hit count, the hit count of the state feature sample is accumulated.

7. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The simulation results are verified based on the combined relationships. Delete the simulation results that failed to be verified.

8. The method according to any one of claims 1 to 5, characterized in that, The test log includes test coverage; the test log information for determining the state feature sample based on the hit count includes: The first state feature sample in the state feature sample is determined based on the number of hits; The quotient of the number of the first state feature samples and the number of the state feature samples is determined as the test coverage.

9. The method according to claim 8, characterized in that, The method further includes: If the test coverage is less than or equal to the coverage threshold, a prompt message is output based on the first state feature sample.

10. A testing apparatus, characterized in that, The device includes: The first acquisition module is used to collect online real-time order information with second order attribute features and / or preset order attribute features that meet the current business needs as target order information, and to acquire the status features to be tested. The target order information includes status features in the order flow process and the combination relationship of multiple status features. The determination module is used to perform feature combination processing based on the state features to be tested and the target order information to determine state feature samples, wherein the state feature samples include the state features to be tested and / or the combination relationship of the state features to be tested that includes the state features to be tested; The testing module is used to generate test cases based on the state feature samples; and, The simulation process is executed according to the test cases to obtain simulation results, wherein the simulation results include the number of hits of the state feature samples; and, The test log information of the state feature sample is determined based on the number of hits; The determining module is specifically configured to: extract a first feature combination relationship containing the state feature to be tested in the target order information according to the state feature to be tested and the combination relationship; combine the state feature to be tested and the state feature in the target order information to obtain a second feature combination relationship; filter the first feature combination relationship and the second feature combination relationship to obtain the feature combination relationship to be tested; and determine the state feature to be tested and / or the feature combination relationship to be tested as the state feature sample.

11. The apparatus according to claim 10, characterized in that, The device further includes: The statistics module is used to perform statistical processing on the target order information to determine the popularity information of the status feature samples in the target order information; The display module is used to associate and display the state feature samples and the heat information; The testing module is specifically used to generate the test cases in response to the first input, based on the state feature samples corresponding to the first input.

12. The apparatus according to claim 10, characterized in that, The test module is specifically used to obtain the link simulation model of the state feature samples; The test cases are generated based on the link simulation model to produce the state feature samples.

13. The apparatus according to claim 10, characterized in that, The determining module is further configured to perform aggregation processing on the features of the state to be tested and the order attribute features of the target order information corresponding to the features of the state to be tested; and / or, The test feature combination relationship and the order attribute features of the target order information corresponding to the test feature combination relationship are aggregated.

14. The apparatus according to claim 10, characterized in that, The filtration process includes at least one of the following: cleaning process, deduplication process, noise reduction process, and clustering process.

15. The apparatus according to any one of claims 10 to 14, characterized in that, The testing module is specifically used to generate test tasks based on the test cases; The simulation data was obtained by performing the test task. If the simulation data of the current test task has at least one feature in the state feature sample, and the identification information of the current test task is different from the identification information of the test task corresponding to the accumulated hit count, the hit count of the state feature sample is accumulated.

16. The apparatus according to any one of claims 10 to 14, characterized in that, The device further includes: The verification module is used to verify the simulation results according to the combination relationship; Delete the simulation results that failed to be verified.

17. The apparatus according to any one of claims 10 to 14, characterized in that, The test logs include test coverage; The testing module is specifically used to determine the first state feature sample in the state feature sample based on the number of hits. The quotient of the number of the first state feature samples and the number of the state feature samples is determined as the test coverage.

18. The apparatus according to claim 17, characterized in that, The device further includes: The prompting module is used to output prompting information based on the first state feature sample if the test coverage is less than or equal to the coverage threshold.

19. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the test method according to any one of claims 1 to 9.

20. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the program, it implements the test method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Test case generation method and device, electronic device and storage medium

    CN113434436A