A test case running method, system, medium and program product
Patent Information
- Application Number
- CN202511242364.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2045-09-02
AI Technical Summary
[0005]但是,现有的测试方案难以应用于CAD软件测试
[0017]Beneficial technical effects: This invention provides an automated operation method that can generate corresponding test case combinations according to user needs. By filtering the test case combinations, the practicality/usability of the test results can be improved to a certain extent (such as improving test functionality or the completeness of test data).
Smart Images

Figure CN120973687B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CAD (Computer Aided Design) testing technology, specifically to a method, system, medium, and program product for running test cases. Background Technology
[0002] CAD software has complex functions and involves a lot of repetitive testing, so testing is time-consuming and costly during the software development process.
[0003] Currently, white-box analysis is commonly used for testing ordinary software. For example, patent application 201711450712.3 discloses a white-box testing method for Java projects. This method includes: determining whether the Java project under test needs to execute the test items corresponding to each test tool according to the preset execution order of each test tool, and executing the corresponding test tool when it is determined that the test items need to be executed; and generating a unit test report after the execution of each test item corresponding to multiple test tools is completed.
[0004] Patent application 201911012761.8 discloses a method for automatic test case generation and test process management based on white-box analysis, including: configuring the test environment, analyzing and displaying the user code structure; performing white-box static analysis on the user code to obtain the white-box analysis results; managing the test process based on the white-box analysis results, including: obtaining the user's test requirements, designing test processes and corresponding test cases according to the test requirements, and managing automatically generated and customer-defined test cases; performing dynamic testing based on the white-box analysis results, including: sufficiency testing, coverage testing, functional testing, time performance testing, variable dynamic analysis, and dynamic memory analysis, and then generating a dynamic test report; executing the test cases based on the white-box analysis results to obtain the test results and the coverage of each node in the function call relationship graph.
[0005] However, existing testing methods are difficult to apply to CAD software testing. Summary of the Invention
[0006] The purpose of this invention is to provide a method for running test cases in order to improve the stability and smoothness of the automated testing process.
[0007] Specifically, the present invention provides a method for running test cases, including: S400 provides a test case library, the test case library including: at least one language node, one language node corresponds to multiple function nodes, and one function node records at least one test case; S402, Obtain the test requirements input by the test user, wherein the test requirements include: at least one operation function to be tested; S404, Obtain at least one associated functional node related to the operation function; S406, Identify at least one test case under the associated functional node; S408, Generate a combination of test cases based on at least one of the test cases; S410, Run the test case combination in the test combination, the test combination including: test objective and standard objective, the test objective including: at least one version of software.
[0008] In some embodiments, S410 includes the step of: A first test case is run on the test target, the first test case including a first test element; Identify the first test parameter of the first test element, wherein the first test parameter includes one or more of the following: size, coordinates, and state; Before running the second test case on the test target, identify whether there is a second test element in the second test case that corresponds to the first test element, and whether the second test element has initial second test parameters; if so, perform the following steps: The current test environment is updated based on the first test parameter and the second test parameter.
[0009] In some embodiments, the step of updating the current test environment based on the first test parameter and the second test parameter includes: When the first test parameter and the second test parameter are different, the first test parameter of the first test element is modified to the second test parameter.
[0010] In some embodiments, the second test element includes: the same test element as the first test element, and / or, a test element associated with the first test element.
[0011] In some embodiments, S410 includes the step of: Run the first test case on the test target; Before running the second test case on the test target, determine whether to restore the current test environment. If so, the current test environment will be restored, and then the second test case will be executed.
[0012] In some embodiments, the test cases include: a first type of test case and a second type of test case; wherein, the first type of test case is stored in a first resource area, and the second type of test case is stored in a second resource area; the second type of test case is stored in the second resource area, and the index of the second type of test case is stored in a dictionary; S410 includes the step: Multiple Class I test cases are called from the first resource area, and these multiple Class I test cases are copied into the main test program during the linking phase. Start the main test program in the test target; When it is necessary to identify the second type of use case, the second type of use case is found through the corresponding index path, and a dynamic calling interface is generated for the second type of use case; The main test program runs the two types of test cases through the dynamic call interface.
[0013] In some embodiments, the indexer is the file name of the second type of use case.
[0014] The present invention also provides an operating system, comprising: The test case library module is used to provide a test case library, which includes: at least one language node, one language node corresponding to multiple function nodes, and one function node recording at least one test case; The input module is used to obtain the test requirements input by the test user, and the test requirements include: at least one operation function to be tested; An association module is used to obtain at least one associated functional node associated with the operation function; The identification module is used to identify at least one test case under the associated functional node; A combination module is used to generate a combination of test cases based on at least one of the test cases; A runtime module is used to run the test case combination in a test combination, the test combination including: a test objective and a standard objective, the test objective including: at least one version of the software.
[0015] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in any of the embodiments.
[0016] The present invention also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method as described in any of the embodiments.
[0017] Beneficial technical effects: This invention provides an automated operation method that can generate corresponding test case combinations according to user needs. By filtering the test case combinations, the practicality / usability of the test results can be improved to a certain extent (such as improving test functionality or the completeness of test data).
[0018] Furthermore, by updating the test environment through the first and second test elements, conflicts that may arise during automated testing can be reduced or mitigated.
[0019] Alternatively, this invention can reduce potential conflicts during the automated execution of batch test cases by updating the test parameters of test elements locally (i.e. focusing on related elements), while also reducing the data pressure on automated verification. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. The elements or parts in the drawings are not necessarily drawn to scale. Obviously, the drawings described below are some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0021] Figure 1 This is a flowchart illustrating a software testing method in an exemplary embodiment of the present invention; Figure 2 This is a flowchart illustrating the process of determining a data output scheme in an exemplary embodiment of the present invention; Figure 3 This is a schematic diagram of the application process of test cases in an exemplary embodiment of the present invention; Figure 4 This is a schematic diagram of the application process of test cases in another exemplary embodiment of the present invention; Figure 5 This is a partial schematic diagram of the test case selection interface in an exemplary embodiment of the present invention, showing the selected area. Figure 6 This is a schematic diagram of a computer device structure in an exemplary embodiment of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0023] In this document, suffixes such as "module," "part," or "unit" used to denote elements are used only for the purpose of illustrative purposes and have no specific meaning in themselves. Therefore, "module," "part," or "unit" may be used interchangeably.
[0024] In this document, the terms "upper," "lower," "inner," "outer," "front," "rear," "one end," and "the other end," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the present invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the present invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0025] In this document, unless otherwise explicitly specified and limited, the terms "installed," "equipped with," "connected," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, a direct connection, or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0026] In this document, "and / or" includes any and all combinations of one or more of the listed related items.
[0027] In this article, "multiple" means two or more, that is, it includes two, three, four, five, etc.
[0028] As used in this specification, the term "about" typically means + / -5% of the value, more typically + / -4% of the value, more typically + / -3% of the value, more typically + / -2% of the value, even more typically + / -1% of the value, and even more typically + / -0.5% of the value.
[0029] In this specification, certain embodiments may be disclosed in a range-bound format. It should be understood that this "range-bound" description is merely for convenience and brevity and should not be construed as a rigid limitation on the disclosed range. Therefore, the description of a range should be considered as having specifically disclosed all possible subranges and the individual numerical values within those ranges. For example, a description of the range 1-6 should be considered as having specifically disclosed subranges such as from 1 to 3, from 1 to 4, from 1 to 5, from 2 to 4, from 2 to 6, from 3 to 6, etc., and the individual numbers within those ranges, such as 1, 2, 3, 4, 5, and 6. This rule applies regardless of the breadth of the range.
[0030] Definition of the noun: “Entity”: In this document, an entity refers to graphic data on a drawing, such as a CAD file, displayed on the CAD drawing interface. An entity has attributes, which are data values that control specific visual characteristics of the entity or element (such as visibility, color, and line style). In different implementations, an entity may also be referred to as a “graphic element” or “graphic primitive.”
[0031] "Object": In this article, an object refers to information in a CAD file that is not displayed on the CAD drawing interface (the specific values of this information can also be called attributes), such as layers, text styles, and annotation styles. In this article, "style" refers to a set of named attributes used to classify and define specific geometric and text elements (such as line styles or text styles).
[0032] “Element”: In this article, an element refers to all possible information in a CAD file, including “entities” and “objects,” and can also be block, group, and cell definitions based on “entities” and / or “objects.” Correspondingly, the attributes of these elements are also referred to as simulation data (or drawing data).
[0033] "Drawings": In this article, "drawings" can refer to various files that can run in a CAD system and are used for drawing, editing, modifying, storing, and viewing CAD drawings. Common CAD drawing formats include, but are not limited to, DWG, DXF, DWT, DWF, DWL, DWS, DWX, MNU, MNC, MNL, MNS, CUI, CUIX, SHX, PAT, LIN, CTB, STB, PLT, PC3, etc.
[0034] "Software": In this article, it refers to a collection of computer data and instructions organized in a specific order. Software can include both computer programs that can run on a computer and the documentation associated with those programs. In other words, software can be a combination of programs and documentation.
[0035] "Test Environment": In this article, the software test environment refers to the combination of hardware and software specifically configured to verify the functionality, performance, and stability of the software. This includes one or more necessary components such as the operating system, database, network configuration, and testing tools (e.g., test cases). Its core objective is to simulate the performance under real-world operating scenarios (e.g., drawing, displaying diagrams).
[0036] "Operation point": In this document, "operation point" refers to the position of an operation controlled by a user in a digital interface (such as a display interface) through an input device (such as a mouse, touchpad, touchscreen, etc.). It is the direct point of interaction between the user and the system or software. It can be clearly identified by visual symbols such as a cursor or text insertion point, allowing the user to intuitively perceive the object being operated on (such as an entity or object) and complete the transmission of instructions through actions such as clicking, inputting, and dragging. For example, in some embodiments, when a user needs to draw a line segment in the current interface, they can select a first operation point and a second operation point in the display interface as the two endpoints of the line segment.
[0037] Testing a feature (or simply a function): A feature is an independent unit that can complete a specific task or provide a specific service. For example, a feature can be an operation command or an interactive module. Typically, a feature is the core carrier of software interaction with the user, and usually has clearly defined input, processing, and output logic.
[0038] Example 1: See Figures 1-2 As shown, the present invention provides a software testing method.
[0039] like Figure 1 As shown, software testing methods include: S300, Obtain a test set, the test set including: a test target and a standard target, the test target including: at least one version of the software under test, the standard target including: at least one version of the comparison software; For example, in some embodiments, the test target can be a software to be tested selected by the user, and the standard target can be a software selected by the user from the existing market as a benchmark for comparison.
[0040] S302, Select a test case combination according to the test combination, the test case combination includes: at least one test case, the test case consists of at least one simulated operation instruction, and at least one test case corresponds to a test function; In some embodiments, the test suite includes at least one test function.
[0041] For example, in some embodiments, users can select one or more test functions to form a test combination according to test requirements, and select the corresponding test case combination from the test case database according to the test combination.
[0042] For example, in some embodiments, the test case database pre-stores multiple test cases, and each test case is tagged with a label that records test function information (such as test function name) so as to automatically select and call test cases according to the test combination.
[0043] S304, run the test case combination in the test combination to generate at least one set of first test data, the first test data including: first data and second data obtained by running the test cases on the test target and the standard target respectively.
[0044] Furthermore, in some embodiments, the method further includes the step of: S306, a filtering operation is performed on the first test data to generate an output scheme; wherein, S306 includes: S3060, Calculate the difference between the first data and the second data; S3062, when the difference is less than or equal to a preset first difference threshold, and the data content of the corresponding data belongs to a preset first type of record content, the corresponding first test data is identified as first type of data, and the other first test data is identified as second type of data. S3064, Generate a data output scheme based on data attributes, wherein the data attributes include the following attributes: data category.
[0045] In some embodiments, data attributes can be obtained from a preset attribute range. This attribute range may include at least one attribute category (or attribute type) pre-defined by the user, such as data category, test function, etc.
[0046] In some embodiments, the attribute range can be selected based on the testing scenario. For example, users can select the attribute range based on the testing requirements or key considerations in the current testing scenario.
[0047] For example, in some embodiments, the output priority of type II data is higher than that of type I data.
[0048] For example, in some embodiments, the data output scheme may be: outputting the first test data in a document format, and the second type of data output is ordered before the first type of data.
[0049] For example, in some embodiments, the test data includes test data for multiple test cases, and the test data for one test case may include multiple records (each record may be marked with a different output priority). Specifically, for the multiple records corresponding to one test case, the records marked as Class II data may be placed before the records marked as Class I data.
[0050] For example, in some embodiments, data tags can be generated for the output test data (or first data, second data) respectively. These data tags are used to record the function category (such as function name, etc.) and the data category (such as belonging to a type I data or a type II data).
[0051] For example, in some embodiments, the output order of test data can also be sorted according to one or more data attributes, such as data category.
[0052] For example, the output priority of Category II data is higher than that of Category I data. For example, different functional categories are pre-set with varying degrees of importance; the greater the importance, the higher the output priority.
[0053] For example, output priority (also known as focus priority) can be determined based on a combination of data category and function category, and the weighting of data category and function category in determining output priority can be set by the software test engineer according to their needs.
[0054] In some embodiments, the type of recorded content includes one or more of the following: Grip point position, text position, annotation position, coordinate precision.
[0055] In this embodiment, by filtering a type of recorded content, the interference of subtle differences in software design on the overall performance evaluation can be reduced to a certain extent.
[0056] For example, if two software programs have slight differences in the precision of grip operation (i.e., the accuracy of grip coordinates), it may be due to differences in the design versions of the software itself. Therefore, when outputting the solution, users can be guided not to focus on this.
[0057] Alternatively, in some embodiments, when the difference is greater than a first difference threshold, or when the data content belongs to Class II record content, the corresponding test data (such as the first data and / or the second data) is identified as Class II data. Conversely, the remaining test data can also be identified as Class I data.
[0058] In other words, for a massive amount of test content and test results, this embodiment provides a data output scheme that filters core differences, so that users can quickly focus on the test results.
[0059] In some embodiments, the second type of record content can refer to multiple types of data content other than the first type of record content, such as one or more of the following: (1) Core performance indicators: such as execution time (such as startup time, file loading time, save time, rendering time, etc.) and throughput (such as the number of operations that can be completed per unit time, for example, the number of features that can be processed per second or the number of buffers that can be generated per second).
[0060] (2) Accuracy indicators: geometric operation accuracy (e.g., buffer analysis accuracy, overlay analysis accuracy, etc.), topological accuracy (e.g., the correctness of the software in maintaining and processing topological relationships (such as adjacency, connectivity, containment. For example, check whether it can correctly identify and repair topological errors such as dangling lines, overlapping surfaces, gaps, etc.), and mapping output accuracy.
[0061] (3) Resource consumption indicators: memory usage (for example, it can be free memory usage: the amount of memory used when the software starts without performing any operations; peak memory usage: the maximum amount of memory used during the execution of large and complex tasks. Memory leaks are usually manifested as peak memory continuously increasing and not being released; working set memory: the amount of memory required for the software to run normally); CPU utilization; GPU utilization; network bandwidth usage.
[0062] (4) Stability metrics: crash / error rate, big data processing capability (which is used to evaluate whether the software can open, render, and operate datasets that are far larger than normal (such as GB-level raster data or vector data containing millions of features) without crashing or experiencing a sharp drop in performance).
[0063] For example, in some embodiments, data that does not belong to the first type of recorded content (such as first data or second data) is identified as second type of data.
[0064] In some embodiments, the testing function may be a text function (such as testing the accuracy of text display), a drawing performance function (such as testing the accuracy of drawing data, drawing efficiency, rendering efficiency, etc.), an ecosystem function (such as stability, compatibility, etc.), etc.
[0065] In some embodiments, a test function may correspond to one or more recorded contents.
[0066] In some embodiments, simulated operation instructions can be pre-written operation codes by the user to perform at least one functional task. For example, simulated operation instructions can instruct CAD software to perform specific graphic or data operations, such as drawing elements, modifying objects, managing views, or controlling file attributes.
[0067] For example, in some embodiments, a simulated operation instruction is composed of a combination of multiple operation functions.
[0068] Taking the circle drawing operation command as an example, a circle drawing operation command includes: operation function 1, which adds a circle drawing data to the display interface; operation function 2, which stores the circle drawing data (such as coordinate position, diameter, etc.) into the drawing database; and operation function 3, which refreshes the display interface based on the drawing data to display the newly added circle. Typically, the multiple operation functions have a set execution order to simulate the usual operation sequence of a drawing engineer.
[0069] In some embodiments, step S3064 includes: (1) When the difference is greater than a preset second difference threshold, the first test data is marked as erroneous data; (2) Prioritize the collection of multiple erroneous data based on data attributes; For example, in some embodiments, the data attribute is the data category (such as category one or category two) corresponding to the test data. The attention priority is preferably used to define the order of data output; for example, the higher the attention priority, the earlier the output data is ranked.
[0070] (3) Sort the multiple erroneous data according to the attention priority to form a corresponding data output scheme.
[0071] In this embodiment, the priority of attention for the two types of data is preferably ranked according to the identification results of the data categories. The priority of attention for the first type of data can be directly adopted using the default output priority.
[0072] In some embodiments, the data attributes further include the following attributes: the test level of the test case, and the error severity of the erroneous data; correspondingly, step (2) includes: The attention priority is generated based on the test level and the error severity to produce the error data.
[0073] For example, test levels can have pre-defined priorities. Software test engineers can set test levels for test cases based on different testing needs.
[0074] In some embodiments, the data attribute further includes the following attribute: association function; correspondingly, step (2) includes: 1. Obtain the test functions corresponding to error data with the highest priority. 2. Obtain the associated functions related to the test function, and identify at least one associated test case corresponding to the associated function; 3. Obtain the second priority of attention for the first test data corresponding to the associated test cases; For example, in some embodiments, the second concern priority can be a pre-set priority for the associated test cases.
[0075] For example, in some embodiments, the second concern priority can be a priority generated based on the data attributes of the first test data of the associated test case.
[0076] 4. Verify or update the second priority of attention based on the first priority of attention.
[0077] For example, in some embodiments, when the difference between the first priority and the second priority is greater than a set first priority threshold, it is recommended to update the second priority based on the first priority in order to reduce the difference between the first priority and the second priority.
[0078] For example, in some embodiments, when the first priority of concern is greater than the second priority of concern, it is recommended to increase the second priority of concern, such as updating the second priority of concern to the same priority as the first priority of concern.
[0079] For example, in some embodiments, the current priority can be maintained when the first priority and the second priority are the same.
[0080] For example, in some embodiments, when both the first attention priority and the second attention priority are greater than a preset second priority threshold, it is recommended to increase the first attention priority and the second attention priority simultaneously.
[0081] For example, in some embodiments, functional relationships can be pre-defined between different testing functions. For instance, when a user wants to test the text annotation function, the size recognition function may be used in conjunction with it.
[0082] For example, in some embodiments, the test function is pre-set with associated tags, which record information (such as names) about the test function associated with the test function.
[0083] In this embodiment, based on error priority and functional relevance, errors that are important and occur in batches are preferably output first, so as to guide users to prioritize the handling of some errors with a large impact.
[0084] It is important to note that the software testing method provided in this invention primarily targets the software development phase. In actual software development, software engineers may update the code daily. Furthermore, the updated code needs to be run and verified promptly. Typically, testing requires comprehensive testing of the software's main or all functionalities, resulting in a massive amount of test data.
[0085] To address this issue, this invention proposes an automated testing and output scheme for such high-frequency testing scenarios, capable of sorting and outputting data based on priority. This automated scheme comprehensively sets priority based on different dimensions such as function category, data category, and function relevance, thereby guiding users to quickly focus on errors with a relatively large impact.
[0086] In other words, in actual software development, especially during software function upgrades or adjustments, repeated adjustments and verifications are often required to determine the final complete solution. During a single test, the amount of test data output is often very large, and the types of errors that may occur can also be numerous. To address this, this invention categorizes and sorts the error data, allowing users to quickly focus on errors that may have a relatively large impact, thereby improving the efficiency of software optimization / improvement to a certain extent.
[0087] In some embodiments, before step (2), the following step is also included: Obtain the number of the error data; When the quantity is greater than or equal to the preset quantity threshold, the attribute within the first attribute range is selected as the data attribute in step (2); When the quantity is less than the quantity threshold, the attribute within the second attribute range is selected as the data attribute in step (2); wherein the first attribute range is greater than the second attribute range.
[0088] Furthermore, this embodiment also provides a scheme for sorting erroneous data based on a range of restrictive attributes.
[0089] Specifically, in this embodiment, error data is sorted by relatively priority attribute factors in order to reduce the difficulty of priority generation while highlighting the errors in the test documents.
[0090] From another perspective, this embodiment can select the scope of consideration (i.e., the attribute range) of priority generation factors based on the overall test situation (such as the number of error data). This can reduce the difficulty of priority generation by limiting the scope of consideration (avoiding the priority sorting process from affecting the output efficiency of test data, or the overly complex sorting scheme from becoming blurred or affecting the prominence of important issues). On the other hand, it can also highlight key data in a timely manner so that users can quickly focus on key issues. Furthermore, prioritization can also differentiate the display schemes for different test data.
[0091] For example, in some embodiments, the test results can pinpoint the code location of the test case that outputs the result. If this test result is not needed in subsequent tests, the level of this output result can be modified in the test case code. When comparing results, the result level recorded at the time of output is used compared with the comparison level configured in the current comparison tool to determine how the results are displayed. Thus, only the important results are seen on the comparison display interface.
[0092] In some embodiments, the data output scheme is further used to generate scoring results, and further includes: Obtain the first rating result for the first version of the software in the first cycle; The first data attribute is used to generate the attention priority of the error data, and the test function corresponding to the first attention priority is selected as the target function; The target functionality was modified to obtain a second version of the software; Obtain the second rating result of the second version of the software in the second cycle; Calculate the score difference between the first score result and the second score result; When the score difference is less than a preset score threshold, an attribute adjustment signal is generated. The attribute adjustment signal is used to update the attribute type of the data attribute in step (2), or to suggest that the user update the attribute type.
[0093] In some embodiments, the specific update scheme can be set or selected by the user.
[0094] In other words, in this embodiment, the attribute type (or attribute range) can be adjusted by the software optimization to improve the adaptability between the priority generation scheme and the current test requirements.
[0095] For example, in some embodiments, the scoring result refers to the score given to at least one test function using preset scoring rules. Furthermore, the scoring benchmark can be determined based on the test data from the testing software.
[0096] For example, in some embodiments, different scoring tables can be set for different test functions. For example, taking resource utilization efficiency as an example, different scores can be given depending on the degree of utilization efficiency.
[0097] For example, in some embodiments, taking the test target as version A professional CAD (the first version of the software refers to version A professional CAD V1.0-0715, and the second version of the software refers to version A professional CAD V1.0-0716), and the standard target as version B professional CAD, the process of adjusting the attribute range according to the software optimization cycle / efficiency is illustrated by way of example: The professional version A, CADFAV1.0-0715 (where 0715 represents the software's generation time or batch), was tested to obtain the first set of test data. Based on this first test result, a first score was given. The first and second scores represent the overall score after the software test. That is, the score is a composite value of the scores from multiple test functions (e.g., the weighted sum of multiple scores).
[0098] Error data in the first test data is sorted and output according to the priority of attention. Software engineers first focus on one or more test data with the highest priority (the corresponding test function is called the target function), and update the code of Professional CADV1.0-0715 in version A according to the test data to obtain Professional CADV1.0-0716 in version A. Furthermore, the A version of professional CADF1.0-0716 was tested to obtain second test data, and a second score result was generated based on the second test data.
[0099] Calculate the difference between the first and second rating results (e.g., the difference between the two). If the difference is less than the rating threshold, it is recommended to update the attribute type (or attribute range) of the data attribute.
[0100] Of course, the specific update plan can be manually adjusted by the user.
[0101] In some embodiments, software versions A and B can be the software under test and a competitor's software, respectively. Alternatively, software versions A and B can be different software released by the testing vendor itself.
[0102] It is understood that the sorting results of erroneous data can be tracked in this embodiment. That is, when the user selects the test function corresponding to the higher priority according to the current priority sorting result for local optimization, the priority generation scheme can be adjusted according to its optimization efficiency to enhance the adaptability of the priority generation scheme to the test scenario.
[0103] Furthermore, in some embodiments, different data structures can be used to output the test documents.
[0104] For example, in some embodiments, the output test document is log content organized in XML markup language, which is encrypted and stored as a binary byte file.
[0105] For example, in some embodiments, the method further includes storing test documents; for instance, in some embodiments, test results marked / identified as important results may be recorded and stored.
[0106] In some embodiments, log files (i.e. test results) output by test cases can be loaded, parsed, and displayed.
[0107] Furthermore, in some embodiments, multiple log files can be loaded at once and compared to identify differences.
[0108] In some embodiments, test cases may include different categories. Furthermore, test cases may be tagged with test case labels, and these labels may indicate the test case category, such as perspective information, execution information (e.g., manual or automated execution), phase information (e.g., different phases such as unit, integration, system, acceptance, etc.), or type information (e.g., different test types such as functional, performance, security, compatibility, etc.).
[0109] For example, from a testing perspective, test cases can include one or more of the following: Black-box test cases, also known as functional or behavioral testing, involve treating the system under test as a completely opaque "black box" by the tester (such as a software engineer). The tester does not need to understand the system's internal code structure, implementation logic, or operating state; they only need to be concerned with the system's inputs and outputs. White-box test cases, also known as structural testing, transparent-box testing, or glass-box testing, allow testers to fully view the system's internal structure, such as source code, architecture, and logical flow. Test cases are designed based on this internal knowledge to verify whether the internal operations are performed as expected.
[0110] Gray-box testing is a hybrid of black-box and white-box testing. Testers have limited knowledge of the system's internal structure (e.g., database schema, API definitions, algorithm selection, system architecture diagrams, etc.). However, they don't delve into every single line of code as deeply as white-box testing.
[0111] For example, in some embodiments, test cases may also include: manual test cases, and / or automated test cases.
[0112] As an exemplary embodiment, the present invention provides a white-box automated test development method with self-verification, that is, users can perform more intuitive data analysis on the testing process through test results.
[0113] Example 2 The present invention also provides a software testing system, comprising: A test suite acquisition module is used to acquire test suites, wherein the test suites include: test objectives and standard objectives, and the test objectives include: at least one version of software; The test case combination acquisition module is used to select a test case combination according to the test combination, wherein the test case combination includes: at least one test case, and the test case consists of at least one simulated operation instruction; The testing module is used to run the test case combination in the test combination and generate at least one set of first test data, the first test data including: first data and second data obtained by running the test cases on the test target and the standard target respectively; The output module is used to filter the first test data using a filtering operation to generate an output scheme; wherein, the output module is further used to perform the following steps: Calculate the difference between the first data and the second data; When the difference is less than or equal to a preset first difference threshold, and the corresponding test case belongs to a preset type of test case, the first test data is identified as type one data, and the other first test data is identified as type two data. A data output scheme is generated based on data attributes, wherein the data attributes include: data category.
[0114] It is understood that the system in this embodiment can be used to implement the methods and / or steps in any of the above embodiments, and will not be described again here.
[0115] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the software testing method as described in any of the embodiments.
[0116] Furthermore, the present invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the software testing method steps as described in any of the embodiments.
[0117] Example 3: See Figures 3-4 As shown, the present invention provides a method for running test cases, including: S400 provides a test case library, which includes multiple pre-stored test cases.
[0118] Preferably, the test case library includes: at least one language node, one language node corresponds to multiple function nodes, and one function node records at least one test case; For example, see Figure 5 As shown, this illustrates an exemplary test case library selection interface, which provides test cases for different languages (such as C++, .NET, and Lisp). The test case library also provides a tree-like node selection interface.
[0119] For example, the node selection interface includes: language nodes (such as C++ nodes), and each language node expands into multiple function nodes (such as text nodes, mtext nodes). Furthermore, after selecting one of the function nodes, multiple test case nodes can be expanded, and users can manually select the required test cases through node selection.
[0120] S402, Obtain the test requirements input by the test user, wherein the test requirements include: at least one operation function to be tested; S404, Obtain at least one associated functional node related to the operation function; S406, Identify at least one test case under the associated functional node; S408, Generate a combination of test cases based on at least one of the test cases; S410, Run the test case combination in the test combination, the test combination including: test objective and standard objective, the test objective including: at least one version of software.
[0121] In some embodiments, S410 includes the step of: (1) Run a first test case on the test target, wherein the first test case includes a first test element; For example, in some embodiments, a test element may refer to the object or entity to be tested.
[0122] (2) Identify the first test parameter of the first test element, wherein the first test parameter includes one or more of the following: size, coordinates, and state; (3) Before running the second test case on the test target, identify whether there is a second test element in the second test case that corresponds to the first test element (where the first test element and the second test element are also referred to as related elements), and the second test element has initial second test parameters; if so, perform the following steps: (4) Update the current test environment according to the first test parameter and the second test parameter.
[0123] For example, in some embodiments, the first test element is a block A. If the block A needs to be edited during the second test case, it is assumed that there is a second test element in the second test case that corresponds to the first test element.
[0124] In some embodiments, the step of updating the current test environment based on the first test parameter and the second test parameter includes: When the first test parameter and the second test parameter are different, the first test parameter of the first test element is modified to the second test parameter.
[0125] For example, in some embodiments, the first test element is an entity, such as a rectangle, whose corresponding first test parameters include: a first size (e.g., the length and width of the rectangle each have a first value). Correspondingly, in the initial stage of the second test case execution, the second test parameters include a second size (e.g., the length and width of the rectangle each have a second value). Correspondingly, before executing the second test case, the first test parameters are modified to the second test parameters, that is, the length and width of the rectangle are modified from the first values to the second values.
[0126] For example, in some embodiments, the test parameter can also be a state, such as an entity having a frozen state or an editable state.
[0127] In this embodiment, by updating the test parameters of the test elements locally (i.e. focusing on related elements), the potential conflicts that may occur during the automated execution of batch test cases can be reduced, and the data pressure of automated verification can also be reduced.
[0128] In some embodiments, the second test element includes: the same test element as the first test element, and / or, a test element associated with the first test element. Therefore, the second test element and the first test element are referred to as associated elements.
[0129] For example, in some embodiments, the associated test element refers to a test element that is nested, referenced, or connected to the first test element.
[0130] For example, in some embodiments, if the first test element is a water pipe installed on the wall, then the second test element can be the wall itself.
[0131] In some embodiments, S410 includes the step of: Run the first test case on the test target; Before running the second test case on the test target, determine whether to restore the current test environment. If so, the current test environment will be restored, and then the second test case will be executed.
[0132] In some embodiments, the step of determining whether to restore the current test environment includes: The process of identifying whether the execution of the first test case can initiate a simulated switching operation is determined. The simulated switching operation includes one or more of the following: resolution switching, viewpoint switching (such as switching between different viewpoints such as spatial viewpoint and planar viewpoint), and zoom ratio switching. If so, it is recommended to restore the test environment.
[0133] For example, in some embodiments, scene restoration can refer to undoing a simulated switching operation. For instance, adjusting the scaling ratio from the one modified by the first test case to the initial scaling ratio before the first test case started.
[0134] For example, in some embodiments, scene restoration can be performed by updating the coordinates of the operation point in the scene (such as a display interface).
[0135] In this embodiment, scene restoration can further reduce the potential conflicts that may arise during automated operation.
[0136] In some embodiments, the test cases include: a first type of test case and a second type of test case; wherein, the first type of test case is stored in a first resource area, and the second type of test case is stored in a second resource area; the second type of test case is stored in the second resource area, and the index of the second type of test case is stored in a dictionary; S410 includes the step: Multiple Class I test cases are called from the first resource area, and these multiple Class I test cases are copied into the main test program during the linking phase. The main test program is started within the test objective; that is, one type of test case is executed one by one. When it is necessary to identify the second type of use case, the second type of use case is found through the corresponding index path (for example, it refers to the storage address of the use case), and the second type of use case is activated to generate a dynamic call interface for at least one first type of use case; The main test program runs the class of test cases through the dynamic call interface.
[0137] In this embodiment, the second type of use case is associated with at least one first type of use case.
[0138] For example, in some embodiments, the first resource area and the second resource area can be different resource areas.
[0139] For example, in some embodiments, the first resource area may be stored in the memory area, and the second resource area may be stored in the external memory area.
[0140] In some embodiments, the indexer is the filename of the second type of use case, which can be stored in a dictionary. In CAD, a dictionary is a core database container object used to store and manage a set of key-value pairs.
[0141] In some embodiments, the frequency of invocation of type I test cases is greater than the frequency of invocation of type II test cases. In this embodiment, type I test cases refer to test cases that are frequently used during the testing process, while type II test cases are test cases that are less frequently invoked.
[0142] For example, in some embodiments, a Class I use case refers to a test case used to run a certain software function. A Class II use case refers to a test case used to initiate at least one function. Specifically, a Class II use case can be associated with multiple Class I use cases, that is, the Class II use case generates calling interfaces for multiple Class I use cases.
[0143] Furthermore, type II test cases are often those that are less likely to be enabled (or have a relatively short activation time), or in some cases, type II test cases may be test cases that are ignored or cannot be paid attention to during test execution. For example, these test cases can be one or more of the following types: mtext.grx, kernel.grx.
[0144] In this embodiment, by partitioning and storing different test cases and using different methods for invocation (such as enabling them in different ways), the stability of the automated test process can be improved, while also alleviating or reducing the computer's operating pressure during the test process to a certain extent.
[0145] It is understood that the software testing method provided by this invention can improve the integrity of test data to a certain extent, and can improve the stability of the testing process to a certain extent by updating / modifying test parameters or restoring the scene (avoiding or reducing conflicts that may occur during automation).
[0146] Example 5: The present invention also provides a software testing system, which includes the following steps: Obtain a test suite, the test suite including: a test target and a standard target, the test target including: at least one version of the software under test, the standard target including: at least one version of the comparison software; Select a test case combination based on the test combination, wherein the test case combination includes: at least one test case, the test case consists of at least one simulated operation instruction, and the at least one test case corresponds to a test function; Running the test case combination in the test combination generates at least one set of first test data, which includes: first data and second data obtained by running the test cases on the test target and the standard target, respectively. Running the test case combination in the test combination includes the following steps: A first test case is run on the test target, the first test case including a first test element; Identify the first test parameter of the first test element, wherein the first test parameter includes one or more of the following: size, coordinates, and state; Before running the second test case on the test target, identify whether there is a second test element in the second test case that corresponds to the first test element, and whether the second test element has initial second test parameters; if so, perform the following steps: The current test environment is updated based on the first test parameter and the second test parameter.
[0147] It is understood that the method in this embodiment may employ the same or similar steps as any of the above embodiments, and will not be repeated here.
[0148] Example 6: In another aspect, the present invention provides a method for running test cases, comprising: It provides a test case library, which stores multiple test cases; Obtain the test requirements input by the test user, wherein the test requirements include: at least one operation function to be tested; Obtain at least one associated functional node related to the operation function; Identify at least one test case under the associated functional node; Generate a combination of test cases based on at least one of the test cases described; The test case combination is run in a test combination that includes a test objective and a standard objective, wherein the test objective includes at least one version of the software. Record the first test data, which includes the first data generated after the test target runs the combination of test cases, and the second data generated after the standard target runs the combination of test cases.
[0149] Furthermore, in some embodiments, the method further includes: The first test data is filtered using a filtering operation to generate an output scheme; this includes: Calculate the difference between the first data and the second data; When the difference is less than or equal to a preset first difference threshold, and the data content of the corresponding data belongs to a preset first type of record content, the corresponding first test data is identified as first type of data, and the other first test data is identified as second type of data. A data output scheme is generated based on data attributes, wherein the data attributes include the following: data category.
[0150] In some embodiments, after selecting a combination of test cases, the test can be run synchronously in both the test objective and the standard objective to record the test data (i.e., first data and second data).
[0151] In some embodiments, the second data may also be historical data recorded since the last run.
[0152] It is understood that the method in this embodiment may employ the same or similar steps as any of the above embodiments, and will not be repeated here.
[0153] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the embodiments.
[0154] The present invention also provides a computer program product containing instructions that, when the computer program product is run on an electronic device, enable the electronic device to perform the method described in any of the embodiments.
[0155] Please see Figure 6 , Figure 6 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application. The computer program can run as follows: Figure 6 It runs on the computer device shown. Figure 6 As shown, the computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0156] The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform the methods described in any of the embodiments.
[0157] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0158] Internal memory provides an environment for the execution of computer programs in non-volatile storage media, which, when executed by a processor, enable the processor to perform the methods in any of the embodiments.
[0159] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0160] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0161] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a computer terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0162] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A method for running test cases, characterized in that, include: S400 provides a test case library, the test case library including: at least one language node, one language node corresponds to multiple function nodes, and one function node records at least one test case; S402, Obtain the test requirements input by the test user, wherein the test requirements include: at least one operation function to be tested; S404, Obtain at least one associated functional node related to the operation function; S406, Identify at least one test case under the associated functional node; S408, Generate a combination of test cases based on at least one of the test cases; S410, Run the test case combination in the test combination, the test combination including: test objective and standard objective, the test objective including: at least one version of software; The test cases include: a first type of test case and a second type of test case; wherein, the first type of test case is stored in a first resource area, and the second type of test case is stored in a second resource area; the second type of test case is stored in the second resource area, and the index of the second type of test case is stored in a dictionary; step S410 includes the following steps: A first test case is run on the test target, the first test case including a first test element; Identify the first test parameter of the first test element, wherein the first test parameter includes one or more of the following: size, coordinates, and state; Before running the second test case on the test target, identify whether there is a second test element in the second test case that corresponds to the first test element, and whether the second test element has initial second test parameters; if so, perform the following steps: Update the current test environment based on the first test parameter and the second test parameter; Multiple Class I test cases are invoked from the first resource area, and these multiple Class I test cases are copied into the main test program during the linking phase. Start the main test program in the test target; When it is necessary to identify the second type of use case, the second type of use case is found through the corresponding index path, and a dynamic calling interface is generated for the second type of use case; The main test program runs the two types of test cases through the dynamic call interface.
2. The method according to claim 1, characterized in that, The steps for updating the current test environment based on the first test parameter and the second test parameter include: When the first test parameter and the second test parameter are different, the first test parameter of the first test element is modified to the second test parameter.
3. The method according to claim 1, characterized in that, The second test element includes: the same test element as the first test element, and / or, a test element associated with the first test element.
4. The method according to claim 1, characterized in that, S410 includes the following steps: Run the first test case on the test target; Before running the second test case on the test target, determine whether to restore the current test environment. If so, the current test environment will be restored, and then the second test case will be executed.
5. The method according to claim 1, characterized in that, The index symbol is the file name of the second type of use case.
6. A test case execution system, characterized in that, include: The test case library module is used to provide a test case library, which includes: at least one language node, one language node corresponding to multiple function nodes, and one function node recording at least one test case; The input module is used to obtain the test requirements input by the test user, and the test requirements include: at least one operation function to be tested; An association module is used to obtain at least one associated functional node associated with the operation function; The identification module is used to identify at least one test case under the associated functional node; A combination module is used to generate a combination of test cases based on at least one of the test cases; A runtime module is configured to run the test case combination within a test combination, the test combination comprising: a test objective and a standard objective, the test objective comprising: at least one version of the software; The test cases include: a first type of test case and a second type of test case; wherein, the first type of test cases are stored in a first resource area, and the second type of test cases are stored in a second resource area; the indexes of the second type of test cases are stored in a dictionary; when the running module runs the test case combination, it is specifically used to perform the following operations: A first test case is run on the test target, the first test case including a first test element; Identify the first test parameter of the first test element, wherein the first test parameter includes one or more of the following: size, coordinates, and state; Before running the second test case on the test target, identify whether there is a second test element in the second test case that corresponds to the first test element, and whether the second test element has initial second test parameters; if so, perform the following steps: Update the current test environment based on the first test parameter and the second test parameter; Multiple Class I test cases are invoked from the first resource area, and these multiple Class I test cases are copied into the main test program during the linking phase. Start the main test program in the test target; When it is necessary to identify the second type of use case, the second type of use case is found through the corresponding index path, and a dynamic calling interface is generated for the second type of use case; The main test program runs the two types of test cases through the dynamic call interface.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 5.
8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
White box testing method and device for Java project and computer equipment
CN109976994A
Methods for Automatic Test Case Generation and Test Process Management Based on White-Box Analysis
CN110750459B
Test case generating method and device, computer equipment and storage medium
CN107992409A
Software testing method and device and electronic equipment
CN115185809A