Object-oriented test case design method
Through the object-oriented test case design method, using functional categories, test case templates and public use case libraries, the problem of lack of comprehensiveness and consistency in test case design in the existing technology is solved, and the comprehensiveness of use case design and maintenance cost is achieved.
Patent Information
- Application Number
- CN202411858270.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
The existing test case design methods lack comprehensiveness, making it difficult to ensure the integrity and consistency of test cases, resulting in difficulty in review and high maintenance costs.
Adopt an object-oriented test case design method to ensure the comprehensiveness and consistency of use case design by dividing functional categories, preparing test case templates, tagging public test cases, designing instantiated use cases and citing public use case libraries.
Achieve comprehensiveness and consistency of test cases, reduce maintenance costs, and improve the efficiency and maintainability of use case design.
Smart Images

Figure CN119807044A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to an object-oriented test case design method. Background Art
[0002] The usual practice of ordinary test case design is to design test cases for each test point covering the requirements or functions one by one, and each test case has steps, expected values, etc. However, due to the lack of overall presentation of the use case, the comprehensiveness of the use case design cannot be guaranteed. Since the use case is not presented in a structured manner, the review of the test case is very difficult, which further affects the review effect that is intended to ensure comprehensiveness through the review. Since the test point of each requirement or function is designed separately, if some common points are not extracted, the same or similar test points must be redesigned and maintained every time, which is a large workload.
[0003] There is currently no effective solution to the above problems. Summary of the invention
[0004] In view of the above technical problems in the related art, the present invention proposes an object-oriented test case design method, which can overcome the above shortcomings of the prior art.
[0005] To achieve the above technical objectives, the technical solution of the present invention is implemented as follows: An object-oriented test case design method comprises the following steps: S1 divides the software under test into different functional categories according to its common functions, and prepares different test case templates according to the functional categories; S2 marks test cases that have the same function reused and defines these test cases as public test cases; S3 Design test cases for the functions of the software under test based on test case templates and public test cases; The specific steps of S3 are as follows: S31 determines the category of the function to be tested, selects a corresponding use case template according to the category, and creates an instantiated use case based on the use case template; S32 determines whether the instantiated use case has any test points that are not suitable for the tested function, and if so, deletes the unsuitable test points; S33 determines whether the tested function includes the test points of the combed public test case library, and if so, directly references the relevant test cases; S4 sorts out the unique characteristics of the tested function and adds them to the public test case library to be called as new public test cases.
[0006] Furthermore, a function belongs to at least one function category.
[0007] Furthermore, in step S33, the relevant test cases are retrieved from the public test cases.
[0008] Furthermore, the test case template is selected from a test case template library.
[0009] The beneficial effects of the present invention are as follows: Since the present invention uses the use case template and the common use case as the template for use case design, the comprehensiveness of the test case is guaranteed in terms of content; at the same time, the template and the common use case are a common extraction, and some common modifications can directly modify the common use case, and the changes in the template or the common use case are also reflected in the functional use case, so the maintenance cost is lower. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0011] Figure 1 It is a flowchart of the object-oriented test case design method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0012] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0013] like Figure 1 As shown, an object-oriented test case design method according to an embodiment of the present invention includes the following steps: S1 divides the software under test into different functional categories according to its common functions, and prepares different test case templates according to the functional categories; S2 marks test cases that have the same function reused and defines these test cases as public test cases; S3 Design test cases for the functions of the software under test based on test case templates and public test cases; The specific steps of S3 are as follows: S31 determines the category of the function to be tested, selects a corresponding use case template according to the category, and creates an instantiated use case based on the use case template; S32 determines whether the instantiated use case has any test points that are not suitable for the tested function, and if so, deletes the unsuitable test points; S33 determines whether the tested function includes the test points of the combed public test case library, and if so, directly references the relevant test cases; S4 sorts out the unique characteristics of the tested function and adds them to the public test case library to be called as new public test cases.
[0014] A function belongs to at least one function category. In step S33, the relevant test cases are retrieved from the public test cases. The test case template is selected from the test case template library.
[0015] In order to facilitate understanding of the above technical solutions of the present invention, the above technical solutions of the present invention are described in detail below through specific usage methods.
[0016] In specific use, according to the object-oriented test case design method of the present invention, the technical task of the present invention is achieved in the following manner, and the steps of the method are as follows: 1. Different test case templates need to be prepared according to the software to be tested. This template is divided into different functional categories according to the common functions in the software; 2. Focus on marking the test cases that are reused by multiple functions and call them public test cases; 3. Design use cases for software functions based on test case templates and test cases for public test cases; First, determine the category of the function to be tested; select the corresponding use case template according to the category, and create an executable use case based on the use case template; Analyze the use cases of software functions to see if there are any test cases that do not match the functions, and delete these test cases; Analyze whether this function contains test cases from the public use case library that has been sorted out. If so, directly reference these public use cases.
[0017] 4. Then sort out the unique features of this function; 5. Add the feature points to the public test cases according to their conditions; The steps of this object-oriented test case design method are as follows: 1. Use case templates divided into categories according to the common and inheritable functions of the software under test; 2. Sort out common test cases that are reused by multiple functions; 3. Start the use case design of a function. A function belongs to at least one functional category. Here are the steps: First, determine the category of the function to be tested; select the corresponding use case template according to the category, and create an instantiation of the use case based on the use case template; Analyze whether there are test points in the instantiated use case that are not suitable for this function, and delete these test points; Analyze whether this function contains the test points of the public use case library that has been sorted out. If so, directly reference these public use cases.
[0018] 4. Then sort out the unique features of this function and add them to the public use case library; 5. The newly added public use cases can be directly called the next time the relevant functions are tested Implementation example: Take the user list test case design and implementation method as an example: Test scenario description: In a certain system, there is a user list management function. You need to design a test case for this function. This function has basic add, delete, modify, query and page turning functions, as well as multi-condition filtering and data sorting functions; The steps to achieve this using the present invention are as follows: 1. It is necessary to design some use case templates according to the system, including list class, query class, etc.; 2. Design some common functions such as page turning, filtering, sorting, etc.; 3. Start designing use cases for this function: First, we found that this function use case belongs to the list function, and the list function already has test points including basic addition, deletion, modification and query, which also applies to this function; Create a test case for "User List", the category belongs to the List class; It is found that the filtering function of this function has been included in the public use case in this use case design system, so it is directly referenced.
[0019] 4. When continuing to design test cases, it is found that this function also has a "data sorting" function that is not included in the public test case. Design and add this test case to the public test case library; 5. When testing other functions in the software again, you can directly call the newly added public test cases.
[0020] Through the above specific implementations, those skilled in the art can easily implement the present invention. However, it should be understood that the present invention is not limited to the above-mentioned specific implementations. On the basis of the disclosed implementations, those skilled in the art can arbitrarily combine different technical features to achieve different technical solutions.
[0021] To sum up, with the help of the above-mentioned technical scheme of the present invention, since the use case template and the common use case are used as the template for use case design, the comprehensiveness of the test case is guaranteed in terms of content; at the same time, the template and the common use case are a common extraction, and some common modifications can directly modify the common use case. The changes in the template or the common use case are also reflected in the functional use case, so the maintenance cost is lower.
[0022] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An object-oriented test case design method, characterized in that: The steps include: S1 divides the software under test into different functional categories according to its common functions, and prepares different test case templates according to the functional categories; S2 marks test cases that have the same function reused and defines these test cases as public test cases; S3 Design test cases for the functions of the software under test based on test case templates and public test cases; The specific steps of S3 are as follows: S31 determines the category of the function to be tested, selects a corresponding use case template according to the category, and creates an instantiated use case based on the use case template; S32 determines whether the instantiated use case has any test points that are not suitable for the tested function, and if so, deletes the unsuitable test points; S33 determines whether the tested function includes the test points of the combed public test case library, and if so, directly references the relevant test cases; S4 sorts out the unique characteristics of the tested function and adds them to the public test case library to be called as new public test cases.
2. The object-oriented test case design method according to claim 1, characterized in that: A function belongs to at least one function category.
3. The object-oriented test case design method according to claim 1, characterized in that: In step S33, the relevant test cases are retrieved from the public test cases.
4. The object-oriented test case design method according to claim 1, characterized in that: Test case templates are selected from the test case template library.