Test case generation method and device
By reading the requirement description document and the project scale estimation document to generate a business rule list table, and combining the MATCBEPS algorithm to generate test case entries, the problem of inaccurate test cases in the existing technology is solved, and the matching and accuracy of the test cases and software products are achieved. sex.
Patent Information
- Application Number
- CN202110742720.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-06-30
AI Technical Summary
Existing test cases are inaccurate, resulting in a mismatch between software product testing and requirements, making complete testing impossible.
By reading requirement description documents and project scale estimation documents, a business rules list table is generated, and test case entries are generated based on MATCBEPS algorithm mapping to form a test case list table to ensure the accuracy and matching of test cases.
It improves the accuracy and efficiency of test cases, ensures the matching between test cases and software products, and eliminates the impact of deviations in the understanding of requirements specifications by testers and developers.
Smart Images

Figure CN113360405B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to software testing technology, and more particularly to a method and device for generating test cases. Background Art
[0002] Before a specific software product goes online, it must undergo functional testing to ensure that the software product's functions are implemented and its operation is stable. A test case is a description of the test tasks used to test the software product, and is the basis for testing the software product.
[0003] In the prior art, test cases are generated by testers who analyze business scenarios and business rules based on the requirements specification provided by the software demander. During specific testing, testers can test the software products developed by developers based on the test cases they have generated. If the test results meet the requirements of the requirements specification, the software product is qualified and can be delivered; if the test results are unqualified, the testers need to feedback the test results to the developers for software development corrections.
[0004] The test cases in the prior art often have the problem of inaccuracy, which leads to the fact that the test of the software product based on the test case does not match the software product. Therefore, it is urgent to propose a test case generation method that can solve the above problem. Summary of the invention
[0005] The present application provides a test case generation method and device to solve the problem that existing test cases are inaccurate and cannot perform complete tests on software products.
[0006] In a first aspect, the present application provides a method for generating a test case, comprising:
[0007] Reading a requirement specification document and a project scale estimation document of the software to be tested, wherein the requirement specification document is used to describe the business requirements of the software, and the project scale estimation document is used to describe at least one business function required to implement the business requirements;
[0008] According to the requirement specification document, input conditions, output content and business change rules are set for each business function in the project scale estimation document to form a business rule list table, wherein the business rule list table contains business rules corresponding to each business function;
[0009] A test case list table for the software is generated according to the business rule list table.
[0010] In a second aspect, the present application provides a test case generation device, comprising:
[0011] Processor and memory;
[0012] The memory stores instructions executable by the processor;
[0013] The processor executes the executable instructions stored in the memory, so that the processor executes the test case generation method as described above.
[0014] In a third aspect, the present application provides a storage medium, wherein the storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the test case generation method as described above.
[0015] In a fourth aspect, the present application provides a program product, including a computer program, which implements the method described above when executed by a processor.
[0016] The test case generation method and device provided by the present application generate a project scale estimation document by reading the business function information of the requirement description document of the software to be tested; then, according to the business function information of the requirement description document, business rules including input conditions, output content, and change rules are set for each business function in the project scale estimation document to form a business rule list table at the function level; then, according to the business rules in the business rule list table, each test case entry is generated through mapping and filling, and a test case list table is generated by combining each test case entry, that is, a test case of the software product. The test case is generated based on the project scale estimation document in combination with the requirement description document, avoiding the adverse effects of the deviation in the understanding of the requirement description between the tester and the developer on the case test, improving the accuracy of the test case, ensuring the matching between the test case and the software product developed based on the project scale estimation book, and solving the problem that the existing test case is inaccurate and the software product cannot be fully tested. At the same time, the test case entries constituting the test case list table are stored in the test case database in the form of entries, providing reusable test cases for the generation of subsequent software product test cases, greatly improving the efficiency and accuracy of the test case generation of the software product. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] Figure 1 A schematic diagram of a system for automatically generating test cases provided in an embodiment of the present application;
[0019] Figure 2 A flow chart of a method for generating a test case provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of the test case generation method architecture provided in an embodiment of the present application;
[0021] Figure 4 A schematic diagram of a test case storage architecture in a test case generation method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] Figure 1 A schematic diagram of a test case generation system provided in an embodiment of the present application, such as Figure 1 As shown, the test case generation system provided in this embodiment includes: a requirement providing device 11, a product development device 12, a test case generation device 13 and a test device 14. The requirement providing device 11 outputs the software requirement description document to the software development device 12 and the test case generation device 13.
[0024] Among them, the requirement description document is a technical agreement document between the software demander and the software developer, which contains the functions that need to be developed for each business requirement of the software product. The software development device 12 extracts the functional information, i.e., the function points, from the received and read requirement description document to generate a project scale estimation document. Among them, the project scale estimation document is a normative document for function point estimation statistics of software system modules. Then the test case generation device 13 extracts the functional information from the requirement description document as a reference sample according to the function points. At the same time, the test case generation device 13 reads the functional information corresponding to the business requirements in the project scale estimation document from the software development device 12 according to the function points. The test case generation device 13 maps the functional information in the project scale estimation document it reads in combination with the reference sample to form the test case required for software testing. Finally, the test device 14 can use the test case to test whether the software function is qualified. The test case generation device 13 includes a processor 132 that reads the project scale estimation document from the software development device 12 and processes and generates test cases, and a memory 131 that stores information identified and generated by the processor 132, wherein the memory 131 includes a functional-level test case database that stores the test cases generated by the processor 132.
[0025] Optionally, the test device 14 may be an automated test platform ATP, or may be other test equipment required for testing, which is not specifically limited in this embodiment.
[0026] In the prior art, test cases are directly formed by testers based on their understanding of the requirements document. The accuracy of the test cases is directly affected by the testers' understanding of the requirements document and their own experience. At the same time, testers neglect to understand the project scale estimation document based on which developers develop software products, that is, they neglect to understand the developed software products. When there is a deviation or a gap in the understanding of the requirements document between testers and developers, the software product testing under the guidance of the test cases will be inaccurate, and even the testing of the software product will not match the requirements of the software product itself. Therefore, the prior art urgently needs to provide a method that can eliminate or fill this problem of incomplete understanding or understanding gap and generate accurate test cases.
[0027] The main improvement of this embodiment is that the existing test cases are directly generated by testers based on the requirement description document, and are improved to test cases that are directly generated in combination with the requirement description document and based on the project scale estimation document. The case generation device generates accurate test cases that match the software product, thereby eliminating the testers' incomplete understanding of the requirement description document and the developed software, and the problem of the understanding gap between testers and developers regarding the requirement description document.
[0028] Figure 2 A flow chart of a method for generating a test case provided in an embodiment of the present application. Figure 1 The test case generation method flow is described in detail based on the example. The execution subject of this embodiment can be Figure 1 The test case generating device 13 in the illustrated embodiment, the method comprises:
[0029] S201. Read the requirement specification document and the project scale estimation document of the software to be tested, wherein the requirement specification document is used to describe the business requirements of the software, and the project scale estimation document is used to describe at least one business function required to implement the business requirements.
[0030] Specifically, the software demander sends a demand description document to the demand providing device 11, and the demand description document is used to describe the business requirements of the demand software product. The demand description document contains the basic information of the software product and the functional information to be developed corresponding to the business requirements, namely the business function information. The business function information includes functional requirements, performance requirements, attributes, data requirements, etc. The demand providing device 11 outputs the received demand description document to the software development device 12 and the test case generating device 13. The software development device 12 reads the business function information in the demand description document. The developer understands all the business demand information in the demand description document, and generates a project scale estimation document required for software development in the software development device 12 according to the business function information read by the software development device 12. The project scale estimation document contains the specific content information of each business function of the software product. The test case generating device 13 reads the content information of each business function in the project scale estimation document and the business function information in the demand description document from the software development device 12 according to the function point. Specifically, the reading and executing subject of the test case generating device 13 is the processor 132 in the test case generating device 13. The processor 132 reads the above information and stores it in the memory 131, wherein the business function information in the requirement specification document is used as an information reference sample. The processor 132 then identifies and self-checks the content information of each business function in the read project size estimation document with reference to this sample. Next, the processor 132 arranges these business functions into items according to the function level and stores them in the memory 131.
[0031] S202. According to the requirement specification document, input conditions, output content and change rules are set for each business function in the project scale estimation document to form a business rule list table, which contains business rules corresponding to each business function.
[0032] Specifically, the processor 132 sets input conditions, output content, change rules, and other business rules for each business function arranged at the functional level in S201 in combination with the reference sample stored in S201. The business rules corresponding to each business function are listed in a table form. The input conditions, output content, and change rules are set directly. Other business rules such as system, system English name, function module, function classification, risk level, transaction type, etc. are read from the content information of each business function stored in S201 and filled into each corresponding business function table. Among them, the input conditions include input parameters and input parameter values, and the output content includes output parameters and output parameter values. Then, the reference sample is used to check the business rule parameters such as the set input conditions, output content, and change rules to ensure that each business function corresponds to the corresponding business rules. For each business function, the input conditions, output content, and change rules are necessary business rules. Finally, each business function that completes the business rule setting and filling is a business function entry. Each business function entry is combined to form a functional-level business rule list and is stored in the memory 131.
[0033] S203: Generate a software test case list table based on the business rule list table.
[0034] Specifically, the processor 132 reads and identifies the business rules corresponding to each business function in the business rule list table formed in S202. Then, the processor 132 maps and generates test case entries corresponding to each parameter of the input conditions, output content and change rules by automatically generating test case algorithms (English: Method of Auto-generated Test Case Based on Estimation of Project Size, referred to as: MATCBEPS) based on the project scale estimation book, and maps the input conditions, output content, change rules and other business rules in the business rules, such as the English name of the system, risk level, transaction type, etc. Specifically, the test case entry includes information such as use case description, test case entry number, and use case priority, wherein the use case description in the test case entry corresponds to each parameter of the input conditions, output content and change rules in the business rule list table, the test case entry number in the test case entry is related to the English name of the system in the business rule list table, the use case priority in the test case entry corresponds to the risk level in the business rule list table, and other corresponding relationships are not listed one by one in this embodiment. Finally, each test case entry constitutes a test case list table, and the test case list table is the test case required for software testing. In the above process, the memory 131 stores the information read and generated by the processor 132 .
[0035] In this embodiment, the software development device 12 reads and identifies the business function information in the requirement specification document to generate a project scale estimation document. The test case generation device 13 reads the content information of each business function in the project scale estimation document and combines the business function information in the requirement specification document to arrange the business functions in items according to the functional level. Then the test case generation device 13 sets and fills the business rules for each business function in the item arrangement, and then combines to form a functional-level business rule list table. The test case generation device 13 maps the business rules corresponding to each business function in the business rule list table through the MATCBEPS algorithm to generate test case entries. The test case entries are combined to generate a test case list table for the software product, and the test case list table is the test case of the software product. The test case generation method provided in this embodiment eliminates the adverse effects of human factors on the accuracy and integrity of case testing, and at the same time improves the matching of test cases and software products developed based on project scale estimation documents.
[0036] Figure 3 A schematic diagram of the test case generation method architecture provided in an embodiment of the present application, Figure 3 is Figure 2 Based on the above, the specific implementation process of this embodiment is described in detail. Figure 3 The method shown includes:
[0037] The software development device 12 reads the business function information of the requirements specification document of the software to be tested and generates a project size estimation document. Then the test case generation device 13 reads the content information of each business function in the project size estimation document. At the same time, the test case generation device 13 reads the business function information of the requirements specification document as an information reference sample. Then the test case generation device 13 identifies and self-checks the content information of each business function in the project size estimation document in combination with the reference sample, and arranges and stores the business functions according to the function level. This specific process is similar to Figure 2 The method in S201 is similar and will not be repeated in this embodiment.
[0038] Furthermore, the test case generating device 13 classifies each business function of the functional level of the item arrangement in the project size estimation document according to the external input EI type, the external output EO type and the external query EQ type.
[0039] like Figure 3As shown, the test case generation device 13 classifies each business function in the project size estimation document according to the external input EI type, external output EO type, and external query EQ type. After classification, external input EI type business functions, external output EO type business functions, and external query EQ type business functions are formed. This facilitates the corresponding verification of function points when it is necessary to check the test case and the size estimation document.
[0040] Furthermore, the business requirement description in the requirement specification document is used to set input conditions, output content and change rules for each classified business function to form a business rule list table.
[0041] Specifically, the classified external input EI business functions, external output EO business functions, and external query EQ business functions all contain at least one business function. Figure 3 As shown, it is necessary to set input conditions, output content, change rules and other rules for each business function included in the external input EI business function, the external output EO business function and the external query EQ business function. Among them, the input conditions include input parameters and input parameter values, and the output content includes output parameters and output parameter values. The business rules corresponding to each business function are listed in a table form. The table form refers to Table 1, which is a business rule list table provided in this embodiment.
[0042] Table 1 Business rules list
[0043]
[0044] As shown in the header of Table 1, the business rules corresponding to each business function must include input parameters, input parameter values, output parameters, output parameter values and business rules. Business rules also include but are not limited to other business rules such as system, system English name, function module, function classification, risk level, transaction type, etc. In the process of setting business rules for each business function, input conditions, output content and change rules need to be set directly, and other business rules can be read from the content information of each business function in the project scale estimation document and filled into each corresponding business function table. Then, the test case generation device 13 uses information reference samples to check the set input conditions, output content and change rules and other business rule parameters to ensure that each business function corresponds to the corresponding business rules. For each business function, input conditions, output content and change rules are necessary business rules. Each business function that completes the business rule setting and filling is combined to form the function-level business rule list table shown in Table 1.
[0045] Furthermore, the test case generating device 13 generates a test case entry for the software according to the business rules corresponding to each business function respectively included in the formed function-level business rule list table, and then the test case entries are combined to form a test case list table.
[0046] Specifically, the test case generation device 13 reads and identifies the business rules corresponding to each business function in the formed business rule list table. Then the test case generation device 13 maps the input conditions, output content, change rules and other business rules in the business rules, such as the English name of the system, risk level, transaction type, etc., through the automatic generation of test case algorithms based on the project scale estimation book (English: Method of Auto-generated Test Case Based on Estimation of Project Size, referred to as: MATCBEPS), to generate test case entries. Each test case entry corresponds to each parameter of the input condition, output content and change rule. A test case list table is formed by combining each test case entry. The test case list table refers to Table 2, which is a test case list table provided in this embodiment, wherein the test case entry expression form refers to the test case entry form of each row shown in Table 2.
[0047] Table 2 Test case list
[0048]
[0049] Specifically, the test case generation device 13 maps the business rules through the MATCBEPS algorithm to generate test case entries corresponding to each parameter of the input conditions, output content and change rules. The business rules include necessary business rules such as input conditions, output content, change rules and other optional business rules such as the English name of the system, risk level, transaction type, etc. The algorithm process includes:
[0050] Set the header of the test case list table required for business function testing according to the business function. The header includes the test case item number, use case description, test step description, and expected results.
[0051] Use the mapping algorithm to fill the function name and input conditions corresponding to each business function into the use case description in the header of the test case list table, obtain the corresponding test step description and expected results, and generate the corresponding test case;
[0052] Use the mapping algorithm to fill the function name and output content corresponding to each business function into the use case description in the header of the test case list table, obtain the corresponding test step description and expected results, and generate the corresponding test case;
[0053] The function name and change rules corresponding to each business function are filled into the use case description in the header of the test case list table through a mapping algorithm, the corresponding test step description and expected results are obtained, and the corresponding test case is generated.
[0054] Combined with Table 1 and Table 2, the MATCBEPS algorithm is explained. The algorithm process is as follows:
[0055]
[0056]
[0057] Through the above algorithm, each business function in the business rule list table is mapped and split to form each test case entry corresponding to the input conditions, output content and each parameter of the change rule in the business rule list table. Then, each generated test case entry is combined to form a test case list table, which is the test case required for software product testing. Taking the business function entry with the function name "G function" and the function number "XMTS011" in Table 1 as an example, the above MATCBEPS algorithm process is described in detail. The execution subject of the MATCBEPS algorithm is the test case generation device 13, and the algorithm is as follows:
[0058] Specifically, the business rules corresponding to the business function entry with the function number "XMTS011" shown in Table 1 are mapped and filled into the table items such as type, test case entry number, use case description, use case priority, transaction type, and test type in the header shown in Table 2 through the MATCBEPS algorithm. The specific business rules include the function name "G function" and input conditions (where the input conditions include input parameters "AAA", "BBB", "CCC", "DDD" and input parameter values "a1", "a2", "a3", "b1", "b2", "CCC", "DDD"), as well as the English name of the system, risk level, transaction type, etc. Thus, test case entries corresponding to the minimum input condition components, namely the input parameter values "a1", "a2", "a3", "b1", "b2", "CCC", and "DDD" are generated. A total of 7 test case entries. They correspond to the test case entries in Table 2 whose test case entry numbers are “XMTS-001”, “XMTS-002”, “XMTS-003”, “XMTS-004”, “XMTS-005”, “XMTS-006” and “XMTS-007” respectively. Specifically, the business rule mapping in Table 1 fills in the table item information corresponding to the header of Table 2. For example, the input conditions "AAA" and "a1" are mapped through the MATCBEPS algorithm to fill in the use case description in the "XMTS-001" test case entry, the input conditions "AAA" and "a2" are mapped through the MATCBEPS algorithm to fill in the use case description of the test case entry "XMTS-002", the input conditions "AAA" and "a3" are mapped through the MATCBEPS algorithm to fill in the use case description of the test case entry "XMTS-003", the input conditions "BBB" and "b1" are mapped through the MATCBEPS algorithm to fill in the use case description of the test case entry "XMTS-004", ...; the risk level is mapped through the MATCBEPS algorithm to fill in the use case priority in the test case entry, ..., and similar mapping and filling relationships are not listed one by one in this embodiment. When the business rule information in Table 1 is limited, for example, as shown in Table 1 of this embodiment, the test case entry in Table 2 filled by mapping Table 1 is a partially filled test case entry, and some items in Table 2, such as the designer, the ATP number of the automated test equipment, and the ATP execution mode, are not filled. Optionally, when the business rule information in the business rule list table input to the test case generation device 13 is very complete, the test case entry in the test case list table filled by the business rule mapping in the business rule list table can be a fully filled test case entry.
[0059] Similarly, the function name "G function" and output content corresponding to the business function entry with the function number "XMTS011" shown in Table 1 (in Table 1 illustrated in this embodiment, the output content of the business function entry "XMTS011" is minimally grouped into output parameters "LLL", "MMM", "NNN") are mapped and filled in the test case entries with the test case entry numbers "XMTS-008", "XMTS-009", and "XMTS-010" in Table 2 through the above-mentioned MATCBEPS algorithm. Similarly, incomplete test case entries that only fill in the type, test case entry number, use case description, use case priority, transaction type, and test type are generated.
[0060] Similarly, the function name "G function" and the change rule corresponding to the business function entry with the function number "XMTS011" as shown in Table 1 (in Table 1 illustrated in this embodiment, the minimum grouping of the business function entry change rules of "XMTS011" is "OOO", "PPP", "QQQ") are mapped and filled in through the above-mentioned MATCBEPS algorithm to generate use case descriptions with test case entry numbers "XMTS-011", "XMTS-012", and "XMTS-013" as shown in Table 2. Similarly, incomplete test case entries that only fill in the type, test case entry number, use case description, use case priority, transaction type, and test type are generated.
[0061] Thus, through the business rules corresponding to the business function entry with the function name "G function" and the function number "XMTS011" as shown in Table 1, the corresponding test case entries with the test case entry numbers XMTS-001 to 013 as shown in Table 2 are generated;
[0062] Similarly, the business rules corresponding to the business function items with function numbers XMTS012, XMTS013, XMTS014, etc. and corresponding function names H function, I function, J function, etc. shown in Table 1 are mapped to generate corresponding test case items shown in Table 2. This is done until the business rules corresponding to all business function items in the function-level business rule list table generate corresponding test case items. The generated test case items are combined into a test case list table.
[0063] For each test case, the use case description, test step description, and expected result are the necessary elements of the test case. For items in the test case list table that cannot be filled in through the business rule mapping in the business rule list table, such as test step description, expected result, etc., the corresponding test step description and expected result are obtained from the test case database for filling; and / or, the information input by the tester, such as test step description and expected result, is received for filling.
[0064] Specifically, as shown in Table 2, the table items corresponding to the table header "Use Case Description" in the generated test case list table are filled by the input conditions, output content and change rules in the function-level business rule list shown in Table 1 through the MATCBEPS algorithm mapping. As shown in Table 2, the table items corresponding to the table headers "Test Step Description" and "Expected Results" in the test case list table are filled by obtaining the corresponding test step description and expected results from the test case database, and / or receiving the test step description and expected results input by the tester.
[0065] Specifically, combined Figure 3 , Table 1 and Table 2, respectively, for each unfilled table item in the generated test case entry, obtain the test step description and expected result of the corresponding test case from the test case database, and / or, receive the test step description and expected result input by the tester to fill in. The unfilled table items include test step description, expected result, and also include but are not limited to, for example, associated requirement number, ATP number, ATP execution method, designer, etc. Specifically, as Figure 3 As shown, according to the corresponding filled use case description, it is searched whether there is a matching test case from the ATP database built by the automated test platform ATP and / or the functional test case database stored in the memory of this embodiment. If there is a matching test case, the corresponding test step description, expected results and other corresponding information are obtained from the matching test case. The information of the obtained matching test case, such as "(obtain filling)" in Table 2, is used to fill the unfilled table items in the test case entry, thereby generating a complete test case entry. Further, for the information that cannot be filled in from the ATP database and / or the functional test case database, the test step description, expected results and other corresponding information entered by the tester are received, such as "(input filling)" in Table 2, to fill the unfilled table items in the generated test case entry. As shown in Table 2, after the unfilled table items such as test step description, expected results, associated requirement number, ATP number, ATP execution mode, designer, etc. are filled in, a complete test case entry is generated. Each complete test case entry is combined to generate a test case list table, which is the test case of the software product.
[0066] Furthermore, for certain extreme business scenarios and business processes that exist in software products, developers form special requirement description documents for the functions required of software products in extreme business scenarios based on the requirement description documents, and read special requirement description documents for the functions required of the software products to be tested in extreme business scenarios. The special requirement description documents contain special business function information of the software products in extreme business scenarios and business process scenarios, including special function requirements, performance requirements, attributes, data requirements, etc.
[0067] Specifically, combined Figure 1 , Figure 2 , Table 2 is described in detail, the test case generation device 13 adopts a special requirement description document, and forms a special function-level business rule list table with the same structure as shown in Table 2 with the above-mentioned methods of S201, S202 and S203. Similarly, for the business rules corresponding to each business function contained in the generated special function-level business rule list table, corresponding complete special test case entries are generated. The generation process includes MATCBEPS algorithm mapping filling, obtaining matching information from the ATP database and / or the function-level test case database, and / or obtaining supplementary filling of table items of input information. The generated special test case entries further supplement the generated test case list table with test cases, and further generate a comprehensive test case list table. Finally, the test case list table is used to test the software product on the test device 14.
[0068] This embodiment provides a method for generating a test case. Business function information in a requirement description document and a project scale estimation document is identified. With reference to the business function information in the requirement description document, business rules are set for each business function in the project scale estimation document generated based on the requirement description document to form a business function entry. Each business function entry forms a business rule list table. The business rules corresponding to each business function entry in the business rule list table are then mapped by the MATCBEPS algorithm to generate a corresponding test case entry with partial table items filled. By obtaining the matching test case information in the automated testing platform ATP database and / or the functional level test case database, or receiving the input information of the tester, the unfilled table items in the test case entry with partial table items filled are filled. After the table items are filled, a complete test case entry is formed. These complete test case entries form a test case list table of the software, i.e., a test case of the software. Further, for some extreme business scenarios and business process situations of the software, the special requirement description document of the required functions of the software to be tested in the extreme business scenario is read. Then, the corresponding special test case entry is generated by the same method. The special test case entry further supplements the test case list table that has been generated.
[0069] Through the test case generation method provided by the embodiment of the present application. The test case in the prior art is directly generated based on the requirement description document, and is improved to be generated based on the project scale estimation document of system development and combined with the requirement description document. The adverse effects of the understanding deviation and understanding gap of the original input requirement description document by testers and developers on the accuracy and completeness of case testing are eliminated. The accuracy of the test case is improved, and the matching of the test case with the developed software product is improved.
[0070] Figure 4 A schematic diagram of a test case storage architecture in a test case generation method provided in an embodiment of the present application, Figure 4 The method for generating the test cases provided in this application is further described in detail.
[0071] like Figure 4 As shown, the method includes:
[0072] After the test cases in the test case list table are tested, the test cases in the test case list table that are not stored in the automated testing platform ATP database and / or the functional level test case database are stored in the automated testing platform ATP database and / or the functional level test case database.
[0073] Specifically, when a test case entry in the test case list table is tested on the automated testing platform ATP, the test case entry is recorded by the automated testing platform ATP and stored in the following manner: Figure 3 and Figure 4 The test case entries in the test case list table are stored in real time in the form of one entry at a time when they are generated or after the test is updated. Figure 1 In the functional test case database in the memory 131 shown in the figure, when a new software product needs to generate a test case list table, the matching test case entries can be directly called from the ATP database and / or the functional test case database for reuse to generate a new test case list table. The new software product includes but is not limited to an update of an existing software product or a similar software product.
[0074] The test case generation method provided in this embodiment stores the test case entries in the test case list table in the ATP database of the automated test platform after the ATP test of the automated test platform is completed. The test case entries in the test case list table are stored in real time in the function-level test case database when generated and after the test is updated. The storage of test cases in the corresponding database enriches the ATP database and the function-level test case database. The test cases are stored in the corresponding database in the form of entries, which is convenient for the construction of test case entries. It provides great convenience for the subsequent reuse of test cases in the form of standard entries. It greatly improves the test case generation efficiency of the software, and is conducive to forming a functional asset library of software products under comprehensive business scenarios.
[0075] The embodiment of the present application also provides a test case generation device, which includes a processor and a memory, and the memory stores processor executable instructions, so that the processor can be used to execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, and this embodiment is not repeated here. It should be understood that the above processor can be a central processing unit (English: Central Processing Unit, referred to as: CPU), or other general-purpose processors, digital signal processors (English: Digital Signal Processor, referred to as: DSP), application-specific integrated circuits (English: Application Specific Integrated Circuit, referred to as: ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the invention can be directly embodied as a hardware processor execution, or a combination of hardware and software modules in the processor. The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and can also be a U disk, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.
[0076] The embodiment of the present application also provides a storage medium, in which computer executable instructions are stored, and when these computer executable instructions are executed by a processor, the above test case generation method is implemented. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0077] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0078] An embodiment of the present application also provides a program product, such as a computer program, which, when executed by a processor, implements the test case generation method covered by the present application.
[0079] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0080] Finally, it should be noted that the above implementation modes are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned implementation modes, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned implementation modes, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the implementation modes of the present invention.
Claims
1. A method for generating a test case, characterized in that: include: Reading a requirement specification document and a project scale estimation document of the software to be tested, wherein the requirement specification document is used to describe the business requirements of the software, and the project scale estimation document is used to describe at least one business function required to implement the business requirements; According to the requirement specification document, input conditions, output content and business change rules are set for each business function in the project scale estimation document to form a business rule list table, wherein the business rule list table contains business rules corresponding to each business function; Generate a test case list table for the software according to the business rule list table; Generating a test case list table for the software according to the business rule list table includes: For each business function included in the business rule list table, a test case entry of the software is generated to form a test case list table; the business rule includes: function name, input condition, output content, and change rule; wherein the input condition includes input parameter and input parameter value, and the output content includes output parameter and output parameter value; For each business function included in the business rule list table, a test case entry for the software is generated to form a test case list table, including: The header of the test case list table required for setting the business function test according to the business function, the header includes the test case item number, use case description, test step description, and expected results; The function name and input conditions corresponding to each business function are filled into the use case description in the header of the test case list table through a mapping algorithm, the corresponding test step description and expected results are obtained, and the corresponding test case is generated; The function name and output content corresponding to each business function are filled into the use case description in the header of the test case list table through a mapping algorithm, the corresponding test step description and expected results are obtained, and the corresponding test case is generated; The function name and change rule corresponding to each business function are filled into the use case description in the header of the test case list table through a mapping algorithm, the corresponding test step description and expected result are obtained, and the corresponding test case is generated; The step of setting input conditions, output content and business change rules for each business function in the project scale estimation document according to the requirement specification document to form a business rule list table includes: Classify each business function in the project size estimation document according to external input EI type, external output EO type and external query EQ type; Using the business requirement description in the requirement specification document, set input conditions, output content and change rules for each classified business function to form a business rule list table; After generating the test case list table of the software according to the business rule list table, the method further includes: Read the special requirements document for the functions required by the software to be tested in extreme business scenarios; Using the special requirements description document, supplement the generated test case list with test cases; The reading of the requirements document and project size estimation document of the software to be tested includes: The requirement specification document is a technical agreement document between the software demander and the software developer. The business function information in the requirement specification document is read and identified by the software development equipment to generate a project scale estimation document; the content information of each business function in the project scale estimation document is read by the test case generation equipment and combined with the business function information in the requirement specification document, and the business functions are arranged as items according to the function level.
2. The method according to claim 1, characterized in that The obtaining of the corresponding test step description and expected results includes: Get the corresponding test step description and expected results from the test case database; and / or, Receive tester input on test step descriptions and expected results.
3. The method according to claim 2, characterized in that The obtaining of the corresponding test step description and expected result from the test case database includes: According to the use case description, check whether there is a matching test case from the automated testing platform ATP database and / or the functional level test case database. If there is a matching test case, use the information of the matching test case to fill in the test step description and expected results.
4. The method according to claim 2, characterized in that: Also includes: After the test cases in the test case list table are tested, the test cases in the test case list table that are not stored in the automated testing platform ATP database and / or the functional level test case database are stored in the automated testing platform ATP database and / or the functional level test case database.
5. A test case generation device, characterized in that: include: Processor and memory; The memory stores instructions executable by the processor; The processor executes the executable instructions stored in the memory, so that the processor executes the method according to any one of claims 1 to 4.
6. A storage medium, characterized in that: The storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 4 when executed by a processor.
7. A program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
