Method for testing functional points, related apparatus and computer program product
Patent Information
- Application Number
- CN202610747692.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-27
- Publication Date
- 2026-09-01
AI Technical Summary
[0010]本申请实施例提供的方案中,基于针对目标应用中同一个待测试功能点的测试用例,构建针对待测试功能点的测试用例对,其中,测试用例来自于测试用例集合;响应于对应于待测试功能点的目标测试用例对的第一数量大于或者等于待测试功能点对应的第一数量阈值,将待测试功能点确定为目标功能点,其中,目标测试用例对中包括的两个测试用例各自所关联的应用条件之间存在冲突;响应于关联于测试用例集合的目标功能点的第二数量大于或者等于第二数量阈值,利用测试用例集合对目标应用进行测试,生成测试结果。
Smart Images

Figure CN122673089A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, computer-readable medium, and computer program product for testing function points. Background Technology
[0002] In the software application development lifecycle, testing the functionality of the software and application is a crucial step in ensuring development quality. This step typically involves systematically testing all functionalities to identify potential defects, ensuring the final software and application meet expectations. Consequently, to improve testing efficiency and reduce costs, automated testing techniques utilizing test case sets have become widely used in software testing and are a core means of achieving rapid and reliable test feedback.
[0003] Against this backdrop, how to effectively manage test case sets during the testing process, so as to cover more functionalities and conduct more effective and higher-quality testing, is a matter of concern and urgent need. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for testing functional points. By ensuring that the test case set has sufficient functional scenario coverage and functional coverage before being used for application testing, it avoids low-quality testing and waste of testing resources due to low quality test case set, thereby improving the testing quality of applications and functional points.
[0005] One aspect of this application provides a method for testing functional points, comprising: constructing a pair of test cases for the same functional point to be tested in a target application, wherein the test cases are derived from a set of test cases; determining the functional point to be tested as a target functional point in response to a first number of target test case pairs corresponding to the functional point to be tested being greater than or equal to a first number threshold corresponding to the functional point to be tested, wherein there is a conflict between the application conditions associated with the two test cases included in the target test case pair; and testing the target application using the set of test cases in response to a second number of target functional points associated with the set of test cases being greater than or equal to a second number threshold, thereby generating test results.
[0006] In another aspect, this application provides an apparatus for testing function points, comprising: a test case pair construction module configured to construct test case pairs for the function point to be tested based on test cases for the same function point to be tested in a target application, wherein the test cases are derived from a test case set; a first function point determination module configured to determine the function point to be tested as a target function point in response to a first number of target test case pairs corresponding to the function point to be tested being greater than or equal to a first number threshold corresponding to the function point to be tested, wherein there is a conflict between the application conditions associated with the two test cases included in the target test case pair; and a test execution module configured to test the target application using the test case set in response to a second number of target function points associated with the test case set being greater than or equal to a second number threshold, thereby generating test results.
[0007] In another aspect of this application, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of the test function points provided above.
[0008] Another aspect of this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the method for the test function points provided above.
[0009] Another aspect of this application is a computer program product that includes a computer program having computer program instructions stored thereon, which, when executed by a processor, can implement the method of the test function points provided above.
[0010] In the solution provided in this application embodiment, a pair of test cases for the same function point to be tested in the target application is constructed, wherein the test cases come from a set of test cases; in response to a first number of target test case pairs corresponding to the function point to be tested being greater than or equal to a first number threshold corresponding to the function point to be tested, the function point to be tested is determined as the target function point, wherein there is a conflict between the application conditions associated with the two test cases included in the target test case pair; in response to a second number of target function points associated with the set of test cases being greater than or equal to a second number threshold, the target application is tested using the set of test cases, and test results are generated.
[0011] Therefore, by ensuring that the test case set has sufficient functional scenario coverage and functional coverage before using it for application testing, we can avoid low-quality testing and wasted testing resources due to low quality test case sets, thereby improving the testing quality of applications and functionalities. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0014] Figure 1 A flowchart illustrating a process for testing functional points, provided as an embodiment of this application;
[0015] Figure 2 A flowchart illustrating a process for generating calibration test coverage is provided in one embodiment of this application;
[0016] Figure 3 A flowchart illustrating a process for generating a list of missing function points, provided as an embodiment of this application;
[0017] Figure 4 A flowchart illustrating the process of implementing test function points in a specific application scenario, as provided in another embodiment of this application;
[0018] Figure 5 This is a schematic diagram of the structure of an apparatus for testing function points provided in an embodiment of this application;
[0019] Figure 6 This is a schematic diagram of the structure of an electronic device suitable for implementing the solutions in the embodiments of this application.
[0020] The same or similar reference numerals in the accompanying drawings represent the same or similar parts. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] In a typical configuration of this application, the terminal and the service network devices each include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0023] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0024] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer program instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0025] As discussed above, in the process of using test case sets for testing, how to effectively manage the test case sets to cover more functional points and conduct more effective and higher-quality testing of functional points is a matter of concern and urgent need.
[0026] In some solutions, the test case set can be evaluated by statistically analyzing the percentage of functionalities in the application that the test cases in the test case set hit, i.e., the test coverage. If the test coverage meets the requirements, the test case set can be used to test the application.
[0027] However, in this approach, relying solely on the aforementioned test coverage to evaluate the quality of the test case set (i.e., whether it is usable) often fails to represent the test case set's coverage of the functional application scenarios. This can easily lead to an "overestimation" of the test case set, resulting in the incorrect use of potentially low-quality test case sets for low-quality testing and a waste of testing resources.
[0028] For example, if a feature can be applied to multiple different scenarios (especially those that conflict and cannot be implemented simultaneously), the above evaluation method cannot reflect the adaptability and testing capability of the test case set for that feature across different scenarios. It might assume that the test case set fully covers the feature if it only includes one or a few scenarios, and then contribute this to the test coverage score to evaluate the quality of the test case set. In such cases, because the test case set cannot adequately and satisfactorily cover the feature, its contribution to the test coverage score may be objectively insufficient, constituting the aforementioned "inflated evaluation." This leads to an incorrect evaluation of the test case set (i.e., incorrectly evaluating a low-quality test case set as a high-quality one).
[0029] To address this issue, this application provides a method for testing functional points. This method constructs test case pairs for the same functional point under test within a target application, with the test cases originating from a test case set. In response to a first quantity of target test case pairs corresponding to the functional point under test being greater than or equal to a first quantity threshold corresponding to the functional point under test, the functional point under test is determined as the target functional point. There is a conflict between the application conditions associated with the two test cases included in the target test case pair. In response to a second quantity of target functional points associated with the test case set being greater than or equal to a second quantity threshold, the target application is tested using the test case set, generating test results. Therefore, by ensuring that the test case set has sufficient functional scenario coverage and functional coverage before being used for application testing, low-quality testing and wasted testing resources due to a low-quality test case set are avoided, thus improving the testing quality for applications and functional points.
[0030] In practical scenarios, the execution entity of this method can be a user device, a device composed of a user device and a network device integrated through a network, or an application running on the aforementioned devices. User devices include, but are not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and wristbands. Network devices include, but are not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.
[0031] When the executing entity is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software programs or software modules, or as a single software program or software module, without specific limitations.
[0032] Figure 1 The present application illustrates a process 100 for testing functional points, which includes at least the following processing steps:
[0033] (Step) S101, Based on the test cases for the same function point to be tested in the target application, construct a pair of test cases for the function point to be tested;
[0034] In the embodiments of this application, the executing entity (e.g., the aforementioned user equipment or network device capable of testing the application and its functional points) may first obtain the target application to be tested, as well as a set of test cases for testing the target application.
[0035] Then, the executing entity can detect and determine test cases from the test case set that can test the function points to be tested in the target application, on a unit basis (i.e., each test case actually comes from this test case set). In practice, the function points to be tested can be determined based on the requirements description list, the function description list, or the results of code function identification in the application. For example, after receiving the requirements document and the requirements description list, the executing entity can clean and standardize them, and based on the processing results, use identification models (e.g., pre-trained large language models) to identify the included function points, and determine the function points to be tested based on them and from among them.
[0036] For example, after determining the testable functional points A, B, and C in the target application, the executing entity can then determine the test cases (one or more) that can test functional point A, test cases that can test functional point B, and test cases that can test functional point C in the test case set.
[0037] In some embodiments, the executing entity can determine the keywords of the test cases or the "test function points" that semantically match the functions that the test cases can test, based on the description information of the test cases, through keyword matching, semantic matching, or other methods, and establish the correspondence between them. For example, if the function of the function point A to be tested is "XX", and the description information of test case a records that the function it can test is "XX", then the executing entity can match the function point A to be tested and test case a through keyword matching of "XX" to determine the association between the two.
[0038] After determining the test cases corresponding to each functional point to be tested, in this step, the executing entity can combine the test cases for the same functional point to be tested in pairs to obtain one or at least two test case pairs. For example, the executing entity can combine all the test cases for the same functional point to be tested in pairs to generate test case pairs. For example, for functional point A, if there are test cases a, b, and c for it, the executing entity can form test case pairs "ab", "ac", and "bc".
[0039] S102, in response to the first number of target test case pairs corresponding to the function point to be tested being greater than or equal to the first number threshold corresponding to the function point to be tested, the function point to be tested is determined as the target function point;
[0040] In the embodiments of this application, based on the above S101, in this step, the executing entity can detect whether there is a conflict between the application conditions associated with the two test cases included in each test case pair.
[0041] This "conflict" can also be understood as a "co-occurrence relationship," meaning that if two application conditions conflict, it means that these two test cases will not actually co-occur. For example, if one application condition is "user's first login" and another application condition is "user's repeated logins," then they will not co-occur and there is a conflict.
[0042] Accordingly, if two application conditions conflict, the executing entity can respond by identifying the test case pair as the target test case pair. Thus, the executing entity can, based on "co-occurrence relationships" and "conflict existence," strive to uncover the scenarios involved and associated with the functional points (because of the conflict, such a target test case pair necessarily involves application scenarios of two different functional points). This allows the entity to utilize the "target test case pair" to evaluate the breadth of scenarios associated with the functional points of the test cases, thereby providing a more effective evaluation of the test case set.
[0043] For example, for cases that include test cases and The target test cases can be compared by the executing entity. constraint set and application condition set ,if and There exists at least one pair of conflicting application conditions of the same dimension (e.g.) Includes "user not logged in" If it contains "user is logged in"), then it is determined that... and There is a conflict between them; they are target test case pairs.
[0044] In some embodiments, application conditions include at least one of the following: preconditions (e.g., the preconditions that a function associated with a test case must have before it is used, such as real-name login, anonymous login, etc.), environment configuration conditions (e.g., the environment in which the function associated with the test case needs to run, such as operating system version, browser version, available runtime libraries, etc.), and timing conditions (e.g., the execution sequence between test cases). Therefore, the aforementioned "conflicts" can be accurately and efficiently identified through objectively incompatible dimensions and metrics such as preconditions, environment, and timing.
[0045] Accordingly, if the first number of target test cases corresponding to the function point to be tested is greater than or equal to the first number threshold corresponding to the function point to be tested, the executing entity can determine the function point to be tested as the target function point, so as to characterize and determine that the breadth of the "scenarios" involved and covered by the test case set at the function point to be tested can meet the requirements of the function point to be tested. That is, when the test case set tests the "target function point", its testing capability and quality meet the requirements.
[0046] Typically, this first quantity threshold can be set differently for specific functional points under test to represent the standard of "scenario breadth" required by the functional point under test. That is, if the first quantity of target test case pairs for the functional point under test is greater than or equal to the first quantity threshold corresponding to the functional point under test, it is considered that the breadth of scenarios involved and covered by the test case set at the functional point under test meets the requirements of the functional point under test.
[0047] In some embodiments, certain functionalities (functionalities to be tested) may not have requirements for the breadth of scenarios, making it impossible to construct "target test case pairs" for them. For example, functionalities that can be compatible with multiple operating environments and scenarios can be pre-classified to determine the target functional type.
[0048] Then, if the function point to be tested belongs to the target function type and is associated with at least one test case in the aforementioned test case set, the executing entity can directly identify it as the target function point to indicate that it meets the requirements. This avoids the omission of "function points" that do not require a wide range of scenarios and can be tested satisfactorily by the test case set, thus ensuring the accuracy of the "target function point".
[0049] In some embodiments, after identifying the target test case pairs, the executing entity can choose to deduplicate, filter, and clean the target test case pairs to avoid repeatedly counting target test case pairs corresponding to the same two scenarios. For example, the executing entity can further detect the target test case pairs and cluster and merge target test case pairs corresponding to the same two scenarios, organizing and retaining them as a single target test case pair. That is, if the specific conflicting application conditions between two target test case pairs are completely equivalent, the executing entity can merge these two target test case pairs, or in other words, retain only one of them, treating and retaining them as a single target test case pair. This ensures that the first quantity threshold can more accurately correspond to the differing scenarios, avoiding repeated counting of target test case pairs belonging to the same "conflict" (e.g., because duplicate target test case pairs are retained, the same two scenarios are repeatedly accumulated as multiple scenarios).
[0050] Accordingly, in some embodiments, the executing entity may first select and determine the target test case pairs to be processed in this step (for example, the results detected by the above-mentioned method of detecting whether there is a conflict between application conditions are taken as the target test case pairs to be processed). Then, as discussed above, the executing entity clusters, groups, or merges and cleans these target test case pairs to be processed to obtain the final "target test case pairs" that are retained. Accordingly, in such a case, the first quantity mentioned above can actually be understood as the "number of groups" obtained after grouping and cleaning the target test cases to be processed.
[0051] In some embodiments, during the grouping process, the executing entity may employ, for example, a greedy algorithm to group the data in order to improve the grouping quality.
[0052] S103, in response to the second number of target functional points associated with the test case set being greater than or equal to the second number threshold, test the target application using the test case set and generate test results.
[0053] In the embodiments of this application, as discussed above, in this step, the executing entity can use the number of target functional points to evaluate the "quality" of the test case set. Specifically, a second quantity threshold can be preset (for example, it can usually be determined based on the number of functional points to be tested, the number of functional points that the test case set is believed to be able to test, and the standard and proportion that the number of functional points that can be satisfied in the scenario should occupy). Then, in this step, the executing entity can compare the second number of target functional points associated with the test case set with the second quantity threshold.
[0054] If the second quantity is greater than or equal to the second quantity threshold, the executing entity can respond by assuming that the quality of the test case set meets the testing requirements for the target application, and choose to use the test case set to test the target application and generate test results.
[0055] In practice, the test results are usually a summary of the processing results of each function point after being tested by the corresponding test cases (for example, the processing results of the function point after executing the test cases), which is used to provide feedback on the operation and implementation status of each function point. This will not be explained in detail here.
[0056] Subsequently, the method for testing functional points provided in this application constructs test case pairs for the same functional point to be tested within a target application, based on test cases for the same functional point to be tested. The test cases are drawn from a test case set. In response to a first number of target test case pairs corresponding to the functional point to be tested being greater than or equal to a first number threshold corresponding to the functional point to be tested, the functional point to be tested is determined as the target functional point. The application conditions associated with the two test cases included in the target test case pair conflict. In response to a second number of target functional points associated with the test case set being greater than or equal to a second number threshold, the target application is tested using the test case set, generating test results. Thus, by ensuring that the test case set has sufficient functional scenario coverage and functional coverage before being used for application testing, low-quality testing and wasted testing resources due to a low-quality test case set are avoided, thereby improving the testing quality for applications and functional points.
[0057] In some embodiments, to improve testing efficiency and quality, the "functional points to be tested" in the target application can be pre-screened and managed to avoid testing functional points that do not need to be tested. In some embodiments, these functional points that do not need to be tested may be, for example, control groups in A / B testing, pre-embedded verification functions, compatibility testing functions, etc.
[0058] Accordingly, in some embodiments, a list of types of functional points that need to be tested can be pre-configured so that after the subsequent execution entity obtains the initial functional points of the target application, the first initial functional point that is matched by the type list in the initial functional points of the target application can be used as the aforementioned functional point to be tested, thereby achieving the screening of functional points and avoiding testing those functional points that do not need to be tested.
[0059] In some embodiments, for second initial function points that are not hit by the type list, the executing entity may also choose to read a third number of target test case pairs associated with the second initial function points that are not hit by the type list from the test case set.
[0060] If the third quantity is greater than or equal to the third quantity threshold (typically, a standard is set based on the assumption that the number of test cases is large enough to allow testing of the feature point together at a low cost of obtaining test cases), the executing entity can also respond by selecting the second initial feature point as the feature point to be tested.
[0061] This allows the implementing entity to dynamically decide which "functional points to be tested" need to be considered based on the specific circumstances of the test case set, while reducing the maintenance cost of the type list. (For example, if the test cases include a large number of test cases for the second initial functional point that was not hit, and it is possible to test the functional point together with a lower test case acquisition cost, the functional point may be proactively included in the scope of consideration to improve application stability.)
[0062] In some embodiments, for similar purposes, if the second initial function point is ultimately not included as a function point to be tested, the executing entity may also choose to read out those test cases in the test case set that are only associated with the second initial function point and remove them from the test case set in order to refine and optimize the test case set and improve the quality of the test case set.
[0063] In some embodiments, to facilitate users who test, manage, and develop the target application to understand the testing status of the test case set for the target application, the executing entity may also choose to perform statistics on the "coverage" and "test coverage" of the test case set, so that the user can better understand the testing status and make corresponding decisions.
[0064] Accordingly, the executing entity can generate the test coverage of the test case set for the target application based on the fourth number of testable functional points associated with at least one test case. For example, the executing entity can determine the test cases associated with the testable functional points based on the aforementioned keyword and semantic matching methods, and generate the test coverage of the test case set for the target application based on the fourth number of testable functional points associated with at least one test case (e.g., based on the ratio of the fourth number to the total number of testable functional points).
[0065] Then, the executing entity can provide the test coverage and test results to the target devices used by the aforementioned users to complete the feedback action to the users, so that the users can use the test coverage to more intuitively understand the test quality of the test case set for the target application.
[0066] However, as discussed above, since such "test coverage" may not intuitively reflect the coverage of the test case set for the "scenario", the implementing entity may choose to provide the user with "corrected test coverage" separately or together in such cases. By using the "corrected test coverage" that references the "scenario coverage", the user can more intuitively refer to the coverage of the test case set for the "scenario" to assist them in making better decisions (e.g., changing or adjusting the test case set).
[0067] Accordingly, in some embodiments, such as in S103 above, before testing the target application using the test case set and generating test results, the execution entity can actually complete the process of testing the target application using the test case set and generating test results by "waiting for user instructions". That is, if the second number of target functional points associated with the test case set is greater than or equal to the second number threshold, the execution entity can respond by first interacting with the user in the form of a prompt message to notify the user that the execution entity "thinks" that the test case set meets the requirements and ask the user whether to use the test case set to perform the test.
[0068] Accordingly, if the user instructs, for example, to send a test command, the execution entity can choose to respond to receiving the test command by actually using the test case set to test the target application and generate test results. Accordingly, during this process, the execution entity can also provide test coverage, corrected test coverage (and in some embodiments, the execution entity can even specifically provide the correspondence between test cases and the functional points to be tested, the target functional points, the target test case pairs corresponding to the functional points, etc., so as to facilitate the user's decision to execute the test or to adjust the test cases included in the test case set).
[0069] It should be understood that the above test instructions do not require the user to provide them immediately after receiving the prompt information. For example, the above execution entity may complete some of the actions in the above process 100 with the purpose of first evaluating the "test case set", and then, after the user actually has test requirements, use the test case set to test the target application and generate test results according to the user's instructions, as discussed above.
[0070] The following section will discuss in detail the process of generating and determining the calibration test coverage. For easier understanding, please refer to [link to relevant documentation]. Figure 2 . Figure 2 The present application illustrates a process 200 for generating corrected test coverage, which includes at least the following processing steps:
[0071] S201, Based on the target test case pair, determine the test case set from the test case set;
[0072] Specifically, the executing entity can determine the test case set from the test case set based on the conflict relationships represented and embodied by the target test case pair. Correspondingly, the application conditions associated with each test case in the test case set must be compatible. That is, the executing entity can determine the test case set from the test case set by excluding one test case from the target test case pair while retaining the other, ensuring that there are no longer any conflicts between the application conditions associated with each test case in the test case set, or that they are mutually compatible.
[0073] Correspondingly, such a set of test examples can be understood as corresponding to a specific test or application scenario.
[0074] S202, Determine the number of corrections for the functional points to be tested that can be associated with the set of test examples;
[0075] Specifically, in this step, the executing entity can determine the number of corrections for the functional points to be tested that the test case set can be associated with based on the test case set selected in S201 above. That is, in such a scenario, the coverage of functional points that the test case set can provide at one time.
[0076] S203, based on the number of corrections, generates a set of test cases to measure the correction test coverage of the target application.
[0077] Specifically, in this step, the executing entity can use the ratio of the number of corrections in S202 to the total number of functional points to be tested as the correction test coverage of the target application. That is, the executing entity can provide "test coverage" (i.e., correction test coverage) more specifically by using a "scenario" as a dimension, thereby removing the artificially high part of the test coverage caused by not considering scenario differences.
[0078] Subsequently, as discussed above, the implementing entity may choose to provide the test coverage or the test results to the target device separately or together with the aforementioned test coverage. For example, upon completion of the test, the implementing entity may further choose to provide the test coverage, calibration test coverage, and test results to the target device during the process of providing the test coverage and test results to the target device, which will not be repeated here.
[0079] It should be understood that, in practice, due to the differences in test cases within the specific target test cases to be removed, at least two different sets of test cases may actually be identified. In such cases, the executing entity can similarly generate the corrected test coverage corresponding to each set of test cases, and then, based on the differences in scenarios, select the lowest, highest, or partial or complete corrected test coverage to provide to the target device, so that users can refer to it based on different needs and dimensions.
[0080] In some embodiments, to facilitate user adjustments to the test case set to more comprehensively cover all functionalities, the executing entity can generate a list of missing functionalities based on untested functionalities that are not associated with test cases. Then, by providing this list of missing functionalities to the target device, users can efficiently and cost-effectively adjust the test case set to improve its quality.
[0081] In some embodiments, considering that the description of application function points may be provided based on a requirements list or code recognition, there may be a problem of repeatedly describing the same function point using different "textual forms" or "general concepts". For example, for the function point "pop-up notification", it may be described using both "pop-up notification" and "display toast". Therefore, to avoid the actual identical function points being mistakenly understood as two function points due to keyword or semantic recognition, leading to situations where one is considered covered while the other is considered omitted (e.g., "pop-up notification" is considered covered while "display toast" is not), the executing entity can also check for such situations during the process of generating a list of omitted function points based on untested function points without associated test cases in the function points to be tested.
[0082] To better describe how to generate a list of missing features in such a situation, you can also refer to... Figure 3 This will be explained together. Figure 3 The diagram illustrates a process 300 for generating a list of missing feature points according to an embodiment of this application. Process 300 may specifically include the following steps:
[0083] S301: Generate the semantic similarity between untested functional points that are not associated with test cases and tested functional points that have been tested by a set of test cases;
[0084] Specifically, as discussed above, for an untested feature point that is not associated with a test case, the executing entity can choose to first compare it with each tested feature point that has been tested by a set of test cases (or, in other words, tested feature points that can be tested by a set of test cases) and generate semantic similarity between them.
[0085] S302: For untested functional points, determine the highest semantic similarity among the semantic similarities associated with the untested functional points;
[0086] Specifically, based on the above S301, for a specific untested function point, the executing entity can obtain the semantic similarity between it and each tested function point, and determine the highest semantic similarity among them, that is, the semantic similarity with the highest numerical value.
[0087] S303: In response to the highest semantic similarity being less than the similarity threshold, generate a list of missing functional points based on untested functional points.
[0088] Specifically, based on S302 above, if the highest semantic similarity is less than the similarity threshold (which can usually be determined based on the standard that the two are considered to have the same semantic meaning), it means that the untested function does not correspond to or belong to other tested function points. In this case, the executing entity can determine that it is an "omitted function" and base it on its tested function points. Alternatively, if the highest semantic similarity is greater than or equal to the similarity threshold, it means that the "untested function point" has actually been tested with a high probability, and the executing entity can choose not to provide it to the user.
[0089] Similarly, in some embodiments, the execution entity can also determine whether an untested function point is a "necessary result" or "extended result" of a tested function point by judging whether the untested function point is a tested function point (e.g., based on pre-configured associations or extensions). If so, the execution entity can also choose not to treat it as an omitted function point and add or generate it to the list of omitted function points.
[0090] In some embodiments, considering that functional points associated with more target test case pairs may be more likely to have "inflated" similarity, the aforementioned "similarity threshold" can also be determined based on the fifth number of target test case pairs associated with the tested functional point corresponding to the highest value, and the value of this similarity threshold is positively correlated with the fifth number. That is, the specific value of this similarity threshold is determined based on the degree of inflated similarity of the most likely "tested functional point". This allows the retention criteria for "untested functional points" to dynamically change with the degree of inflated similarity, making it easier for "untested functional points" associated with tested functional points with higher inflated similarity, and more likely to have under-tested issues, to be provided to users as omitted functional points. This allows users to objectively understand that the functional point is more likely to have been under-tested, improving test quality.
[0091] In some embodiments, to inform users of the number of times a feature point under test has been tested, so that they can determine whether the feature point has been tested sufficiently and adequately, the executing entity may also choose to provide users with the "coverage contribution" of a specific feature point under test to the set of test cases. Accordingly, the executing entity may generate the test coverage contribution based on the sixth number of test cases associated with the feature point under test, for example, by directly using the sixth number as the test coverage contribution.
[0092] Accordingly, in order to help users determine whether the "coverage contribution level" is "artificially inflated", the implementing entity can also provide users with a specific indicator of coverage interference, so that users can use the "coverage contribution level" to understand whether there is any "artificial inflating" and the specific degree of "artificial inflating".
[0093] In some embodiments, the implementing entity may generate a coverage interference degree for the test coverage contribution based on the first and sixth quantities described above;
[0094] For example, for a specific function to be tested The executing entity can first obtain the aforementioned first quantity. In some embodiments, as discussed above, to avoid overlap between target test case pairs, the executing entity can also choose to obtain the number of deduplicated target test cases for actual use, and this obtained result can be described as... Then, the executing entity can remove it from the association. The total number of test cases The calculation result is obtained. Then, the executing entity can determine the above-mentioned "coverage interference degree" using the following formula (1), that is, the coverage interference degree. :
[0095] (1)
[0096] Accordingly, if the coverage interference A value of 0 indicates that the test cases in the test case set involve pairwise distinct scenarios, meaning that as many scenarios as possible are involved, and there is no "artificially high" value caused by duplicate calculations of the same scenario. Conversely, as... If the value gradually approaches 1, it means that more test cases can be categorized into the same scenario, or in other words, the number of test cases that can be classified into the same scenario is increasing. Therefore, we can directly utilize the number of included test cases. Using this method to measure contribution may result in an inflated figure.
[0097] Subsequently, the implementing entity can similarly provide feedback to the user by providing the test coverage contribution and coverage interference to the target device, so that the user can understand the test situation and make corresponding decisions.
[0098] To enhance understanding, this application also provides a specific implementation scheme based on a particular application scenario. Please refer to it. Figure 4 , Figure 4 This is a flowchart of a process 400 for implementing a test function in an application scenario, as provided in an embodiment of this application.
[0099] In process 400, the execution entities, such as network devices and user devices mentioned above, can also be discussed. For ease of understanding, the “execution entity” will no longer be shown in the figure.
[0100] In process 400, the application 410 execution entity can determine the "function points to be tested" by executing S401, as discussed above, using the requirements list, etc. For example, in process 400, the function points to be tested may include, for example, function point 421, function point 422, function point 423... function point 42N (where N is a positive integer).
[0101] Then, the executing entity can determine the test cases associated with each functional point to be tested in the test case set 430 by executing S402. For the purpose of brevity and clarity, executively, in Figure 4 The example provided only applies to function point 421 to be tested.
[0102] Accordingly, in Figure 4In process 400, the exemplary execution entity can determine test cases 431, 432, and 433 for the function point 421 to be tested in the test case set 430 by executing S402 (it should be understood that the number and specific details are merely exemplary illustrations for ease of understanding and are not intended to limit the number or other aspects of the determined test cases).
[0103] Then, the executing entity can continue to execute S403 to construct test case pairs based on test case 431, test case 432, and test case 433, for example, test case pair 441, test case pair 442, and test case pair 443.
[0104] Then, the executing entity can continue to execute S404 to determine whether a "target test case pair" exists among test case pairs 441, 442, and 443. For example, the executing entity can first check the application conditions of each specific test case in a test case pair, and if they conflict, determine the corresponding test case pair as the target test case pair to be processed. Then, through grouping processes such as those described above, the actual "target test case pairs" are filtered and merged. For ease of understanding, in Figure 4 For example, test case pair 441, test case pair 442 and test case pair 443 can all be exemplified as "target test case pair".
[0105] Accordingly, for illustrative purposes, the first quantity threshold mentioned above can be set to "2". In this case, since test case pair 441, test case pair 442, and test case pair 443 are all "target test case pairs", the number of target test case pairs corresponding to the function point to be tested 421, i.e., "3", is greater than 2. Therefore, the executing entity can respond to this by choosing to continue executing S405 to determine the function point to be tested 421 as a target function point. Similarly, the executing entity can determine whether the function points to be tested 422, 423, ..., 42N are "target function points" in the same way as described above.
[0106] For example, in process 400, function point 422 and function point 423 to be tested are also "target function points", and for example, the second quantity threshold mentioned above can be set to "2". In this case, since function point 421, function point 422, and function point 423 to be tested are all "target function points", the number of "target function points", i.e., "3", is greater than 2. Therefore, the execution entity can respond to this by choosing to continue executing S406 to test the application 410 using the test case set 430 and generate test result 450.
[0107] This application also provides an apparatus for testing function points, the structure of which is as follows: Figure 5 The apparatus 500 shown includes: a test case pair construction module 510, configured to construct test case pairs for a function point to be tested based on test cases for the same function point to be tested in a target application, wherein the test cases are derived from a test case set; a first function point determination module 520, configured to determine the function point to be tested as a target function point in response to a first number of target test case pairs corresponding to the function point to be tested being greater than or equal to a first number threshold corresponding to the function point to be tested, wherein there is a conflict between the application conditions associated with the two test cases included in the target test case pair; and a test execution module 530, configured to test the target application using the test case set in response to a second number of target function points associated with the test case set being greater than or equal to a second number threshold, and generate test results.
[0108] This embodiment exists as a device embodiment corresponding to the above method embodiment. The device for testing functional points provided in this embodiment will only use the test case set for application testing if the test case set has sufficient functional scenario coverage and functional coverage. This avoids low-quality testing and waste of testing resources due to low quality test case set, thereby improving the testing quality of applications and functional points.
[0109] In some embodiments, the apparatus 500 further includes a first function point determination module, configured to select the first initial function point in the initial function points of the target application that is matched by the type list as the function point to be tested.
[0110] In some embodiments, the apparatus 500 further includes: a missed function point statistics module, configured to read a third number of target test case pairs associated with a second initial function point that was not hit by the type list in the test case set; and a second function point to be tested determination module, configured to determine the second initial function point as a function point to be tested in response to the third number being greater than or equal to a third number threshold.
[0111] In some embodiments, the apparatus 500 further includes: a test coverage generation module configured to generate test coverage of a set of test cases for a target application based on a fourth number of functional points to be tested associated with at least one test case; and a result communication module configured to provide the test coverage and test results to a target device.
[0112] In some embodiments, the apparatus 500 further includes: a test case filtering module configured to determine a set of test cases from a set of test cases based on target test case pairs, wherein the application conditions associated with each test case in the set of test cases are mutually compatible; a calibration quantity determination module configured to determine the calibration quantity of the functional points to be tested that can be associated with the set of test cases; a calibration coverage generation module configured to generate a calibration test coverage of the test case set for the target application based on the calibration quantity; and a result communication module further configured to provide the test coverage, calibration test coverage, and test results to the target device.
[0113] In some embodiments, the apparatus 500 further includes: an omission list generation module, configured to generate an omission list of untested functional points based on untested functional points that are not associated with test cases in the functional points to be tested; and an omission list providing module, configured to provide the omission list of functional points to a target device.
[0114] In some embodiments, the omission list generation module includes: a similarity generation submodule, which generates the semantic similarity between untested functional points that are not associated with test cases and tested functional points that have been tested by a set of test cases; a highest similarity determination submodule, configured to determine the highest semantic similarity among the semantic similarities associated with the untested functional points; and an omission list generation submodule, configured to generate a list of omission functional points based on the untested functional points in response to the highest semantic similarity being less than a similarity threshold.
[0115] In some embodiments, the similarity threshold is determined based on the fifth number of target test case pairs associated with the tested feature point corresponding to the highest semantic similarity, and the value of the similarity threshold is positively correlated with the fifth number.
[0116] In some embodiments, the apparatus 500 further includes a second function point determination module, configured to determine the function point to be tested as a target function point in response to at least one test case associated with the function point to be tested in a test case set, and the function point to be tested belonging to a target function type.
[0117] In some embodiments, the apparatus 500 further includes: a contribution generation module configured to generate a test coverage contribution based on a sixth number of test cases associated with the test function point to be tested; an interference generation module configured to generate a coverage interference based on a first number and a sixth number; and a contribution and interference providing module configured to provide the test coverage contribution and coverage interference to a target device.
[0118] In some embodiments, the application conditions include at least one of the following: pre-state application conditions, environment configuration application conditions, and timing application conditions.
[0119] Based on the same concept, this application also provides an electronic device, a readable storage medium, and a computer program product. The method corresponding to the electronic device can be the method for testing functional points in the foregoing embodiments, and its problem-solving principle is similar to that method. The electronic device provided in this application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the methods and / or technical solutions of the foregoing embodiments of this application.
[0120] Electronic devices can be user devices, or devices composed of user devices and network devices integrated through a network, or applications running on the aforementioned devices. User devices include, but are not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and wristbands. Network devices include, but are not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, and can be used to implement some processing functions when setting an alarm clock. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.
[0121] Figure 6 The diagram illustrates the structure of an electronic device 600 suitable for implementing the methods and / or technical solutions in the embodiments of this application. The electronic device 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes based on a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage portion 608 into a Random Access Memory (RAM) 603. The RAM 603 also stores various programs and data required for system operation. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An Input / Output (I / O) interface 605 is also connected to the bus 604.
[0122] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, touchscreen, microphone, infrared sensor, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), LED display, OLED display, etc., and speakers, etc.; a storage section 608 including one or more computer-readable media such as hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet.
[0123] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by a central processing unit (CPU) 601, it performs the functions defined in the methods of this application.
[0124] Another embodiment of this application provides a computer-readable storage medium and a computer program product having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application described above.
[0125] Specifically, this embodiment may employ any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, a system, apparatus, or device that is, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0126] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0127] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0128] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0129] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0130] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0131] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules and units is only a logical functional division, and in actual implementation, there may be other division methods. Taking units as examples, multiple units or page components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0132] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0133] Furthermore, the functional modules and units in the various embodiments of this application can be integrated into one processing module or unit, or each module or unit can exist physically separately, or two or more units can be integrated into one module or unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules and units.
[0134] The integrated modules and units implemented as software functional modules and units described above can be stored in a computer-readable storage medium. These software functional modules and units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
[0136] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
Claims
1. A method for testing function points, characterized in that, include: Based on test cases targeting the same functional point to be tested in the target application, construct test case pairs for the functional point to be tested, wherein the test cases are derived from a test case set; In response to a first number of target test case pairs corresponding to the function point to be tested being greater than or equal to a first number threshold corresponding to the function point to be tested, the function point to be tested is determined as a target function point, wherein there is a conflict between the application conditions associated with the two test cases included in the target test case pair. In response to a second number of target functional points associated with the test case set being greater than or equal to a second number threshold, the target application is tested using the test case set, and test results are generated.
2. The method according to claim 1, characterized in that, The method further includes: The first initial function point that is matched by the type list in the initial function points of the target application is taken as the function point to be tested.
3. The method according to claim 2, characterized in that, The method further includes: Read the third number of the target test case pairs associated with the second initial function point that is not matched by the type list in the test case set; In response to the third quantity being greater than or equal to the third quantity threshold, the second initial function point is taken as the function point to be tested.
4. The method according to claim 1, characterized in that, The method further includes: Based on a fourth number of the functional points to be tested associated with at least one of the test cases, the test coverage of the test case set for the target application is generated. The test coverage and the test results are provided to the target device.
5. The method according to claim 4, characterized in that, The method further includes: Based on the target test case pair, a test example set is determined from the test case set, wherein the application conditions associated with each test case in the test example set are mutually compatible. Determine the number of corrections that the set of test examples can be associated with for the functional points under test; Based on the number of corrections, generate the correction test coverage of the test case set for the target application; and Providing the test coverage and the test results to the target device includes: The test coverage, the corrected test coverage, and the test results are provided to the target device.
6. The method according to claim 1, characterized in that, The method further includes: Based on the untested functional points in the functional points to be tested that are not associated with the test cases, a list of missing functional points is generated. Provide the list of missing features to the target device.
7. The method according to claim 6, characterized in that, The process of generating a list of missing functional points based on untested functional points that are not associated with the test cases in the functional points to be tested includes: Generate semantic similarity between untested functional points in the functional points to be tested that are not associated with the test cases and tested functional points in the functional points to be tested that have been tested by the set of test cases; For the untested functional points, determine the highest semantic similarity among the semantic similarities associated with the untested functional points; In response to the highest semantic similarity being less than a similarity threshold, a list of missing functional points is generated based on the untested functional points.
8. The method according to claim 7, characterized in that, The similarity threshold is determined based on the fifth number of target test case pairs associated with the tested functional point corresponding to the highest semantic similarity, and the value of the similarity threshold is positively correlated with the fifth number.
9. The method according to claim 1, characterized in that, The method further includes: In response to the test case set, at least one test case is associated with the function point to be tested, and the function point to be tested belongs to the target function type, the function point to be tested is determined as the target function point.
10. The method according to claim 1, characterized in that, The method further includes: For the function point to be tested, a test coverage contribution is generated based on the sixth number of test cases associated with the function point to be tested; Based on the first quantity and the sixth quantity, a coverage interference degree is generated for the test coverage contribution. The test coverage contribution and coverage interference are provided to the target device.
11. The method according to any one of claims 1-10, characterized in that, The application conditions include at least one of the following: pre-state application conditions, environment configuration application conditions, and timing application conditions.
12. A device for testing function points, characterized in that, include: The test case pair building module is configured to build test case pairs for the same function to be tested based on test cases for the same function to be tested in the target application, wherein the test cases come from a set of test cases; The first function point determination module is configured to determine the function point to be tested as a target function point in response to a first number of target test case pairs corresponding to the function point to be tested being greater than or equal to a first number threshold corresponding to the function point to be tested. The application conditions associated with the two test cases included in the target test case pair conflict with each other. The test execution module is configured to test the target application using the test case set and generate test results in response to a second number of target functional points associated with the test case set being greater than or equal to a second number threshold.
13. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 11.
14. A computer-readable medium, characterized in that, It stores computer program instructions that can be executed by a processor to implement the method as described in any one of claims 1 to 11.
15. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 11.