Demand test integrated generation method and device
By relying on the business architecture, the outputs in the demand stage are structured and analyzed, and as inputs in the test stage, the test cases are intelligently generated, which solves the problem that traditional test design methods are time-consuming and the requirements are not combined with test design, and efficient and intelligent test case design is achieved, which improves R&D efficiency.
Patent Information
- Application Number
- CN202111237359.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-10-22
AI Technical Summary
Traditional test design methods require a lot of time to design the test content, and the requirements and test design have not been effectively combined, resulting in the inability to guarantee the test coverage. How to improve the design efficiency and quality of requirements and tests, and intelligently connect demand and tests, has become a technical problem that needs to be solved urgently.
By relying on the business architecture, the outputs in the demand stage are structured and analyzed and used as inputs in the test stage, the demand content is used to generate test cases efficiently and intelligently, saving labor costs and improving business R&D efficiency. Specific methods include building a process model, identifying the preconditions, business rules and error handling of demand use cases, and generating the data structure of the test case.
Through intelligent output of test cases, the coverage effect and design efficiency of test case design are improved, the time and labor cost of test design are compressed, thereby improving the overall efficiency of product research and development process.
Smart Images

Figure CN114003492B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of cloud computing technology, specifically to the field of software testing, and more specifically to a method and device for generating integrated requirements and testing. Background Art
[0002] As market competition becomes increasingly fierce, the efficiency requirements for new product development are also getting higher and higher. Rapidly designing test cases that cover test content is a key step in improving R&D efficiency. Traditional test design methods require a lot of time to design test content. Demand and test design have not been effectively combined. The design structures on the demand side and the test side are asynchronous, and the test coverage cannot be guaranteed. How to improve the design efficiency and quality of demand and test, and intelligently connect demand and test, is a technical problem that needs to be solved urgently. Summary of the invention
[0003] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method and device for generating integrated requirements and tests, which structure and analyze the output of the requirements phase based on the business architecture and use it as the input of the testing phase, thereby utilizing the requirements content to efficiently and intelligently generate test cases, saving labor costs and improving business R&D efficiency.
[0004] According to a first aspect of the present disclosure, a method for generating an integrated requirement test is provided, comprising: in response to a data structure of a requirement use case input in advance, identifying a precondition, business rules and error handling of a requirement use case, assigning the category of the precondition, the abbreviation of the business rule and the category of the error handling to the case name of each test case, and assigning the content of the precondition, the rule description of the business rule and the content of the error handling to the rule element data corresponding to each case name; identifying the input and output information of a requirement use case, judging whether the input and output information is in the form of a dictionary value, if so, automatically assigning the case name to a preset case name, and assigning the output result of the dictionary value form after element combination to the rule element data corresponding to the preset case name; judging whether each case name after assignment is derived from the precondition, if so, identifying the process description of a requirement use case, and assigning the first step of the process description to the check item corresponding to the case name; otherwise, identifying the postcondition of a requirement use case, and assigning the postcondition to the check item corresponding to the case name; assigning the process description to the step description corresponding to each case name, and generating the data structure of each test case.
[0005] According to an embodiment of the present disclosure, before the step of responding to a pre-input data structure of a demand use case, it also includes: building a process model including business areas, value streams, activities and tasks; at the task level in the process model, setting business processes including preconditions, process descriptions, error handling, and postconditions, setting business rules, input and output information, and building a demand use case data structure; building a test case data structure including a case name, rule element data, check items and step descriptions.
[0006] According to an embodiment of the present disclosure, in response to a pre-input data structure of a requirement use case, it also includes: inputting the requirement item content at the business domain level in the process model; inputting the requirement use case name at the activity level in the process model; and identifying the business scenarios of each test case corresponding to a requirement use case based on the requirement use case name.
[0007] According to an embodiment of the present disclosure, judging whether the input-output information is in a dictionary value format further includes: if not, generating a counter-example from the input-output information to form a dictionary value format.
[0008] According to an embodiment of the present disclosure, generating a counterexample from input and output information to form a dictionary value format includes: using an equivalence class partitioning method to automatically generate a counterexample from the input and output information to form a dictionary value format.
[0009] According to an embodiment of the present disclosure, the preset case name is an automatically generated case, and the element combination adopts a full permutation combination algorithm or a pairwise two-state combination algorithm, and the full permutation combination algorithm includes a Cartesian product full-state combination algorithm.
[0010] According to an embodiment of the present disclosure, before the step of generating the data structure of each test case, the step further includes: presetting different degrees of risk coefficients for each test case.
[0011] According to an embodiment of the present disclosure, each test case is arranged in sequence according to the case name originating from the precondition, business rule, error handling, and input and output information.
[0012] The second aspect of the present disclosure provides a demand test integrated generation device, including: a case name assignment module, which is used to respond to a data structure of a demand use case input in advance, identify the preconditions, business rules and error handling of a demand use case, assign the category of the preconditions, the abbreviation of the business rules and the category of the error handling to the case name of each test case, and assign the content of the preconditions, the rule description of the business rules and the content of the error handling to the rule element data corresponding to each case name; an input and output assignment module, which is used to identify the input and output information of a demand use case, judge whether the input and output information is in the form of dictionary values, and if If yes, the case name is automatically assigned to the preset case name, and the output result after the element combination in the dictionary value form is assigned to the rule element data corresponding to the preset case name; the check item assignment module is used to determine whether each case name after assignment is derived from the precondition. If so, the process description of a requirement use case is identified, and the first step of the process description is assigned to the check item corresponding to the case name; otherwise, the postcondition of a requirement use case is identified, and the postcondition is assigned to the check item corresponding to the case name; and the case generation module is used to assign the process description to the step description corresponding to each case name to generate the data structure of each test case.
[0013] According to an embodiment of the present disclosure, before the case name assignment module, it also includes: a process model building module, which is used to build a process model including business areas, value streams, activities and tasks; a requirement use case building module, which is used to set up business processes including preconditions, process descriptions, error handling, and postconditions at the task level in the process model, set business rules, input and output information, and build a requirement use case data structure; and a test case building module, which is used to build a test case data structure including a case name, rule element data, check items and step descriptions.
[0014] The third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned requirement test integrated generation method.
[0015] The fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned requirement test integrated generation method.
[0016] The fifth aspect of the present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned requirement test integrated generation method when executed by a processor.
[0017] Compared with the prior art, the method and device for integrated generation of demand tests provided by the present disclosure have at least the following beneficial effects:
[0018] Relying on the business architecture methodology, the present invention completes structured analysis of the input in the demand phase, thereby outputting effective test case design in the test phase. In the test phase, there is no need to repeatedly input the content that needs to be tested in the demand document, and the system intelligently completes test identification and design, greatly improving the coverage effect and design efficiency of the test case design, reducing the time and labor cost of test design, and thus improving the overall efficiency of the product development process. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0020] Figure 1 The system architecture of the method and device for integrated generation of demand tests according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 2 A flowchart of a method for generating integrated requirements and tests according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 3 A flowchart schematically shows a model building process according to an embodiment of the present disclosure;
[0023] Figure 4 A flowchart schematically shows a process of inputting a demand use case according to an embodiment of the present disclosure;
[0024] Figure 5 A tree structure diagram of a model built according to an embodiment of the present disclosure is schematically shown;
[0025] Figure 6 A flowchart schematically shows a process of determining input and output information according to an embodiment of the present disclosure;
[0026] Figure 7 The operation flow chart of the method for generating integrated requirements and tests according to an embodiment of the present disclosure is schematically shown;
[0027] Figure 8 The test case generation process in the field of fund transaction business according to a specific embodiment of the present disclosure is schematically shown;
[0028] Fig. 9 A block diagram of a device for generating integrated requirements and tests according to an embodiment of the present disclosure is schematically shown;
[0029] Fig.10 A block diagram schematically illustrates a model building process according to an embodiment of the present disclosure; and
[0030] Fig.11 A block diagram of an electronic device suitable for implementing a requirement test integrated generation method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0031] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0032] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0033] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0034] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0035] In the technical solution disclosed in the present invention, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations, necessary confidentiality measures are taken, and do not violate public order and good morals.
[0036] Embodiments of the present disclosure provide a method, device, equipment, storage medium, and program product for generating integrated demand tests, and relate to the technical fields of cloud computing and software testing. The method includes: in response to a data structure of a demand use case input in advance, identifying the precondition, business rules and error handling of a demand use case, assigning the category of the precondition, the abbreviation of the business rule and the category of the error handling to the case name of each test case, and assigning the content of the precondition, the rule description of the business rule and the content of the error handling to the rule element data corresponding to each case name; identifying the input and output information of a demand use case, judging whether the input and output information is in the form of a dictionary value, if so, automatically assigning the case name to a preset case name, and assigning the output result of the dictionary value form after element combination to the rule element data corresponding to the preset case name; judging whether each case name after assignment is derived from the precondition, if so, identifying the process description of a demand use case, and assigning the first step of the process description to the check item corresponding to the case name; otherwise, identifying the postcondition of a demand use case, and assigning the postcondition to the check item corresponding to the case name; assigning the process description to the step description corresponding to each case name, and generating the data structure of each test case.
[0037] Figure 1 The system architecture 100 for the method and device for generating integrated demand test according to an embodiment of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0038] like Figure 1 As shown, according to the embodiment, the system architecture 100 may be a process model 101, which specifically includes four levels: business domain 102, value stream 103, activity 104 and task 105. The four levels are gradually deepened from shallow to deep.
[0039] This method mainly relies on the process model 101, and uses the business domain, value stream, activities and tasks in the process model 101 as the basic standard framework to perform structured design, editing and storage of requirements and tests.
[0040] Among them, process model 101 describes the process of executing banking business through a standardized and structured model language, reflecting the process of the bank handling and processing resources and delivering value in accordance with certain processes and rules in order to meet internal and external needs.
[0041] Business domain 102 is the first level of process model 101, reflecting the overall value creation process of the enterprise and the performance of the bank's service capabilities. It is divided into two categories: product domain and management domain. Value stream 103 is the second level of process model 101. It is a relatively high-level description of how business domain 102 creates value, which is convenient for quickly understanding the operation process of the business domain. Activity 104 is the third level of process model 101. It is triggered by events and is an interactive process with stakeholders to meet stakeholder needs or specific business purposes. It describes the end-to-end complete business process. Task 105 is the fourth level of process model 101. It is the main component unit of the third-level activity. It is a set of steps performed by a role within a certain period of time with a clear business purpose.
[0042] The following will be based on Figure 1 The system architecture described by Figure 2 to Figure 8 The requirement test integrated generation method of the disclosed embodiment is described in detail.
[0043] Figure 2 The flowchart of the method for generating integrated requirements and tests according to an embodiment of the present disclosure is schematically shown.
[0044] like Figure 2 As shown, the requirement test integrated generation method of this embodiment includes operations S210 to S240.
[0045] In operation S210, in response to the data structure of a requirement use case input in advance, the preconditions, business rules and error handling of a requirement use case are identified, the category of the preconditions, the abbreviation of the business rules and the category of the error handling are respectively assigned to the case name of each test case, and the content of the preconditions, the rule description of the business rules and the content of the error handling are respectively assigned to the rule element data corresponding to each case name.
[0046] In operation S220, the input and output information of a requirement use case is identified, and it is determined whether the input and output information is in the form of a dictionary value. If so, the case name is automatically assigned to a preset case name, and the output result after the dictionary value form is combined with the elements is assigned to the rule element data corresponding to the preset case name.
[0047] In operation S230, determine whether the assigned case names are derived from the preconditions. If so, identify the process description of a requirement use case and assign the first step of the process description to the check item corresponding to the case name; otherwise, identify the postconditions of a requirement use case and assign the postconditions to the check items corresponding to the case name.
[0048] In operation S240, the process description is assigned to the step description corresponding to each case name to generate a data structure for each test case.
[0049] Through the embodiments of the present disclosure, the outputs of the demand phase and the test phase are structured and analyzed, and the structured analysis results are used to intelligently generate test cases that can guide execution, thereby efficiently and intelligently forming test cases, saving labor costs, and improving business R&D efficiency.
[0050] Figure 3 The flowchart of the model building process according to the embodiment of the present disclosure is schematically shown.
[0051] like Figure 3 As shown, before the step of responding to a data structure of a demand use case input in advance in the above operation S10, operations S310 to S330 may also be included.
[0052] In operation S310, a process model including business domains, value streams, activities, and tasks is constructed.
[0053] The process model can be Figure 1 The process model 101 shown is constructed to form a four-level structure.
[0054] In operation S320, at the task level in the process model, a business process including preconditions, process descriptions, error handling, and postconditions is set, business rules, input and output information are set, and a demand use case data structure is built.
[0055] This operation is the process of building the demand use case data structure. The demand use case is used to specifically describe the basic information, complete process and business rules of a use case. The demand use case is the input information of this method, mainly including business processes, business rules and input and output information.
[0056] Among them, the business process is used to describe the workflow of the use case content, which can specifically include preconditions, process descriptions, error handling, and postconditions. Preconditions refer to the prerequisites that must be met before starting to execute the requirement use case. The process description is usually expressed in the form of human-computer interaction steps, which shows the interaction sequence between the role and the system, and is a dialogue that flows from preconditions to postconditions. Error handling is used to describe the "error flow", also known as exceptions, which mainly refers to potential conditions that prevent the successful execution of the use case. Postconditions are used to describe one or more system states after the requirement use case is executed.
[0057] Business rules are used to describe the business logic and constraints of the use case, and are used to maintain the business structure or control and influence the business behavior. Input and output information is used to summarize the information carried by the current field. If a dictionary value is involved, it should be marked in this information.
[0058] In operation S330, a test case data structure including a case name, rule element data, check items, and step descriptions is constructed.
[0059] This operation is the process of building the test case data structure. The test case is the deliverable output in the test analysis and design process that designs reasonable steps and data for test points to verify and validate the IT system.
[0060] The data structure of the test case mainly includes the case name, rule element data, check items and step descriptions. The test case is automatically generated according to the aforementioned input requirement use case data structure.
[0061] Among them, rule element data includes rule information, element information and data design information. Rule information analyzes the business rules of security, usability, performance and compatibility that business functions need to follow. Element information is the elements and values that may affect the results of business function execution. Data design information includes the selection algorithm to generate element combinations.
[0062] Check items are used to clarify the check and verification content of each business function execution result, and the expected results can be checked and confirmed after the case is executed. Step description refers to the step design of test cases that need to supplement step content, which is used to assist executors to better test according to the interface content.
[0063] Based on the requirement use case data structure that has been created above, the user can enter a complete structured requirement use case.
[0064] Figure 4 The flowchart of the requirement use case input process according to the embodiment of the present disclosure is schematically shown.
[0065] like Figure 4 As shown, the data structure in response to a pre-input requirement use case in the above operation S10 may further include operations S410 to S430.
[0066] In operation S410 , at the business domain level in the process model, the content of the requirement item is input.
[0067] In operation S420 , at the activity level in the process model, a requirement use case name is input.
[0068] In operation S430, business scenarios of each test case corresponding to a requirement case are identified according to the requirement case name.
[0069] Therefore, based on the input information of the requirement use case at the activity level, the business scenario applicable to the requirement use case that needs to be tested can be directly confirmed.
[0070] Figure 5The tree structure diagram of the model built according to the embodiment of the present disclosure is schematically shown.
[0071] like Figure 5 As shown, it can be seen that the structure and intuitive correspondence between the demand use case and the test case. The embodiment of the present disclosure combines the four-level process model in the business architecture to establish a design tool with the same granularity between the demand use case and the test case, thereby solving the problem of identifying the correlation between demand and test.
[0072] Taking the demand phase as an example, the system tools are used to establish the tree structure relationship of benchmarking tasks such as the demand use case benchmarking activities and the detailed rules and processes of the demand use case. Taking the test phase as an example, the business scenario benchmarking activities are established, and the tree structure relationship of benchmarking tasks such as the detailed rules and processes of the test case is established. In this way, a unified description based on the business architecture is established to provide a basis for intelligent output of test cases.
[0073] In the embodiment of the present disclosure, judging whether the input and output information is in the form of a dictionary value further includes: if not, generating a counter-example from the input and output information to form a dictionary value form. Figure 6 The input and output information determination process will be described.
[0074] Figure 6 The flowchart of the input and output information judgment process according to the embodiment of the present disclosure is schematically shown.
[0075] like Figure 6 As shown, the input and output information determination process of the above operation S220 may include operations S2201 to S2205.
[0076] In operation S2201, input and output information of a requirement use case is identified.
[0077] In operation S2202, it is determined whether the input and output information is in the form of dictionary values. If so, the process proceeds to operation S2204; otherwise, the process proceeds to operation S2203.
[0078] In operation S2203, the input and output information is generated into a counterexample dictionary value form, and then enters operation S2204.
[0079] In operation S2204, the case name is automatically assigned to a preset case name, and the output result after the dictionary value form is combined with the elements is assigned to the rule element data corresponding to the preset case name.
[0080] Therefore, the embodiment of the present disclosure uniformly converts the input and output information into a dictionary value form, and forms a permutation and combination result through element combination, so as to generate more comprehensive and complete rule element data.
[0081] Furthermore, in the embodiment of the present disclosure, the input and output information is generated into a counter-example dictionary value form, including: using an equivalence class partitioning method to automatically generate a counter-example dictionary value form from the input and output information. The equivalence class partitioning method divides the input domain of the program into several parts, and then selects a small amount of representative data from each part as test cases. The role of each class of representative data in the test is equivalent to other values in this class.
[0082] In the disclosed embodiment, the preset case name is the automatically generated case, and the element combination adopts the full permutation combination algorithm or the pairwise two-state combination algorithm, and the full permutation combination algorithm includes the Cartesian product full-state combination algorithm. In order to facilitate the distinction, the full permutation combination algorithm can be generally adopted. If there are many forms of elements and their dictionary values, the pairwise two-state combination algorithm can be adopted to improve the combination efficiency.
[0083] The preset case name is set here as an automatically generated case, mainly to distinguish the preset case name from the case name after being assigned by the category of the precondition, the abbreviation of the business rule and the category of the error handling.
[0084] In the embodiment of the present disclosure, before the step of generating the data structure of each test case, it also includes: presetting different degrees of risk coefficients for each test case. The setting of the risk coefficient predefines the risk level for each test case to facilitate guiding the test execution.
[0085] Figure 7 The operational flow chart of the requirement test integration generation method according to an embodiment of the present disclosure is schematically shown.
[0086] like Figure 7 As shown, the automatic generation process of the test cases of the embodiment of the present disclosure is more intuitively described. After inputting a complete structured requirement use case, the preconditions, business rules and error handling of the requirement use case can be identified in parallel, and the category of the preconditions, the abbreviation of the business rules and the category of the error handling are respectively assigned to the case name of each test case, and accordingly, corresponding to the case name of each test case, the content of the preconditions, the rule description of the business rules and the content of the error handling are respectively assigned to the rule element data corresponding to each case name.
[0087] For the input and output information of the identified demand use case, it is judged whether the input and output information is in the form of dictionary values. If it is not in the form of dictionary values, a counter-example is generated to convert it into a dictionary value. Then, the case name is automatically assigned to the preset case name, and the output result of the dictionary value form after element combination is assigned to the rule element data corresponding to the preset case name.
[0088] For the check items of each test case, two different forms of assignment are performed by judging whether each test case is derived from the precondition. If it is derived from the precondition, the check items of the test case are set as the first step of the process description of the requirement case. Otherwise, the check items of the test case are uniformly set as the postconditions of the requirement case.
[0089] Finally, based on the process description of the required use case, the step description of each case name is supplemented, and the preset risk factor of each test case is added to generate the data structure of each test case.
[0090] Through the embodiments of the present disclosure, under a given business architecture, inputting a complete demand use case will directly guide the design of the test case, and a set of test cases that can be directly used for execution can be intelligently output, thereby integrating the demand use case with the test case and improving R&D efficiency.
[0091] Figure 8 The present invention schematically illustrates a test case generation process in the field of fund transaction business according to a specific embodiment of the present disclosure.
[0092] like Figure 8 As shown, in a specific embodiment, taking the business field of capital transaction as an example, the user is first required to input the demand use case information according to the data structure of the demand use case. To expand on this, for the demand use case, at the business field level, the corresponding demand item content is input; at the activity level, the demand use case name is input; at the task level, the business process, business rules and input and output information are input. Among them, the business process includes preconditions, process descriptions, error handling and postconditions. Since this specific embodiment does not involve error handling, the error handling content is omitted. Thus, a complete and structured demand use case is input in advance.
[0093] According to the mapping relationship between the demand use case and the test case, such as Figure 8 As shown, a set of test cases are intelligently output. Among them, the first five test cases are generated through preconditions and business rules, and the case name, rule element data, etc. are output. At the same time, the first step of the step description or the postcondition of the requirement case is intelligently identified and output to the check item of the test case. The last six test cases are generated through the input information of the requirement case, combining the input information of the requirement case and its dictionary value and postcondition. The rule element data is a combined calculation structure. At the same time, all test cases correspond to step descriptions, which are used to guide test execution, and their content is generated through the process description of the requirement case.
[0094] Specifically, when the elements are combined, this specific embodiment can adopt the Cartesian product full-state combination algorithm. For example, the value set of element A is {a1, a2}, and the value set of element B is {b1, b2, b3}, then 6 test cases are intelligently output, and the set can be displayed as {(a1, b1)(a1, b2)(a1, b3)(a2, b1)(a2, b2)(a2, b3)}, that is, in the test execution stage, the above 6 combinations need to be covered to cover comprehensive test risks. For example Figure 8 In the requirement use case, the value of "currency pair" is "1-EUR / USD, 2-USD / JPY, 3-GBP / USD", and the value of "counterparty" is "whitelist". The system automatically identifies the element with only one value and generates a counterexample, that is, the value of "counterparty" is "1-whitelist, 2-non-whitelist", and performs the Cartesian product full-state combination algorithm on the two, that is, outputs six test cases, whose combinations are {(currency pair = EUR / USD, counterparty = whitelist), (currency pair = USD / JPY, counterparty = whitelist), (currency pair = GBP / USD, counterparty = whitelist), (currency pair = EUR / USD, counterparty = non-whitelist), (currency pair = USD / JPY, counterparty = non-whitelist), (currency pair = GBP / USD, counterparty = non-whitelist)}.
[0095] If there are many elements and their dictionary values, the pairwise two-state combination algorithm is adopted. The orthogonal analysis test technology is used to combine the elements in pairs and remove repeated pairwise combinations. The number of result combinations of elements is greatly reduced through filtering, thereby meeting the test scenarios of non-traversable function points and improving design efficiency. The permutation and combination results are output as the regular element data fields of the test case.
[0096] Through the above system processing, a series of test cases that can be directly used for execution are intelligently output, namely Figure 4 Testing phase part.
[0097] The above is only an exemplary description, and the present embodiment is not limited thereto. For example, in some embodiments, each test case can be arranged in sequence according to the case name derived from the precondition, business rule, error handling, input and output information. Arranging each test case in sequence facilitates guiding the test execution and compresses the time and labor cost of test design.
[0098] Based on the above-mentioned requirement test integrated generation method, the present disclosure also provides a requirement test integrated generation device. Figure 9-10 The device is described in detail.
[0099] Fig. 9 A block diagram of a requirement-test integration generation device according to an embodiment of the present disclosure is schematically shown.
[0100] like Fig. 9 As shown, the requirement test integrated generation device 900 of this embodiment includes a case name assignment module 910 , an input and output assignment module 920 , a check item assignment module 930 and a case generation module 940 .
[0101] The case name assignment module 910 is used to respond to the data structure of a requirement case input in advance, identify the preconditions, business rules and error handling of a requirement case, assign the category of the preconditions, the abbreviation of the business rules and the category of the error handling to the case name of each test case, and assign the content of the preconditions, the rule description of the business rules and the content of the error handling to the rule element data corresponding to each case name. In one embodiment, the case name assignment module 910 can be used to perform the operation S210 described above, which will not be repeated here.
[0102] The input-output assignment module 920 is used to identify the input-output information of a demand case, determine whether the input-output information is in the form of a dictionary value, and if so, automatically assign the case name to a preset case name, and assign the output result of the dictionary value form after element combination to the rule element data corresponding to the preset case name. In one embodiment, the input-output assignment module 920 can be used to perform the operation S220 described above, which will not be repeated here.
[0103] The check item assignment module 930 is used to determine whether each case name after the assignment is derived from the precondition. If so, a process description of a requirement use case is identified, and the first step of the process description is assigned to the check item corresponding to the case name; otherwise, a postcondition of a requirement use case is identified, and the postcondition is assigned to the check item corresponding to the case name. In one embodiment, the check item assignment module 930 can be used to perform the operation S220 described above, which will not be repeated here.
[0104] The case generation module 940 is used to assign the process description to the step description corresponding to each case name to generate the data structure of each test case. In one embodiment, the case generation module 940 can be used to perform the operation S220 described above, which will not be repeated here.
[0105] Through the embodiments of the present disclosure, the outputs of the demand phase and the test phase are structured and analyzed, and the structured analysis results are used to intelligently generate test cases that can guide execution, thereby efficiently and intelligently forming test cases, saving labor costs, and improving business R&D efficiency.
[0106] Fig.10 A block diagram schematically shows a model building process according to an embodiment of the present disclosure.
[0107] like Fig.10 As described above, before the case name assignment module 910 , a model building module 1000 may be included. The model building module 1000 may include a process model building module 1010 , a process model building module 1010 , and a test case building module 1030 .
[0108] The process model building module 1010 is used to build a process model including business domains, value streams, activities and tasks. In one embodiment, the process model building module 1010 can be used to perform the operation S310 described above, which will not be described in detail here.
[0109] The demand use case building module 1020 is used to set the business process including preconditions, process descriptions, error handling, and postconditions at the task level in the process model, set business rules, input and output information, and build the demand use case data structure. In one embodiment, the demand use case building module 1020 can be used to perform the operation S320 described above, which will not be repeated here.
[0110] The test case building module 1030 is used to build a test case data structure including a case name, rule element data, check items and step descriptions. In one embodiment, the test case building module 1030 can be used to perform the operation S330 described above, which will not be described in detail here.
[0111] Through the embodiments of the present disclosure, combined with the four-level process model in the business architecture, a design tool with the same granularity is established between the demand use cases and the test cases, thereby solving the problem of identifying the correlation between the demand and the test.
[0112] According to an embodiment of the present disclosure, any multiple modules among the case name assignment module 910, the input and output assignment module 920, the check item assignment module 930, the case generation module 940, the process model building module 1010, the process model building module 1010, and the test case building module 1030 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the case name assignment module 910, the input and output assignment module 920, the check item assignment module 930 and the case generation module 940, the process model building module 1010, the process model building module 1010 and the test case building module 1030 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by an appropriate combination of any of them. Alternatively, at least one of the case name assignment module 910, the input and output assignment module 920, the check item assignment module 930 and the case generation module 940, the process model building module 1010, the process model building module 1010 and the test case building module 1030 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0113] Fig.11 A block diagram of an electronic device suitable for implementing a requirement test integrated generation method according to an embodiment of the present disclosure is schematically shown.
[0114] like Fig.11 As shown, the electronic device 1100 according to an embodiment of the present disclosure includes a processor 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage part 1108 to a random access memory (RAM) 1103. The processor 1101 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1101 may also include an onboard memory for caching purposes. The processor 1101 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0115] In RAM 1103, various programs and data required for the operation of electronic device 1100 are stored. Processor 1101, ROM 1102 and RAM 1103 are connected to each other through bus 1104. Processor 1101 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1102 and / or RAM 1103. It should be noted that the program can also be stored in one or more memories other than ROM 1102 and RAM 1103. Processor 1101 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0116] According to an embodiment of the present disclosure, the electronic device 1100 may further include an input / output (I / O) interface 1105, which is also connected to the bus 1104. The electronic device 1100 may further include one or more of the following components connected to the I / O interface 1105: an input portion 1106 including a keyboard, a mouse, etc.; an output portion 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1108 including a hard disk, etc.; and a communication portion 1109 including a network interface card such as a LAN card, a modem, etc. The communication portion 11011 performs communication processing via a network such as the Internet. The drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that the computer program read therefrom is installed into the storage portion 1108 as needed.
[0117] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the requirement test integrated generation method according to the embodiment of the present disclosure is implemented.
[0118] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus, or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1102 and / or RAM 1103 described above and / or one or more memories other than ROM 1102 and RAM 1103.
[0119] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the requirement test integrated generation method provided by the embodiment of the present disclosure.
[0120] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 1101. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0121] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1109, and / or installed from a removable medium 1111. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0122] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the processor 1101, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0123] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0124] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0125] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0126] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for generating integrated requirements and tests, comprising: In response to a data structure of a demand use case input in advance, identify the precondition, business rules and error handling of the demand use case, assign the category of the precondition, the abbreviation of the business rule and the category of the error handling to the case name of each test case, and assign the content of the precondition, the rule description of the business rule and the content of the error handling to the rule element data corresponding to the case name, wherein the rule element data includes rule information, element information and data design information, the rule information is an analysis of the business rules that the business function needs to follow, the element information is the elements and values that may affect the execution results of the business function, and the data design information includes the selection algorithm to generate element combinations; Identify the input and output information of the one requirement use case, determine whether the input and output information is in a dictionary value format, and if so, automatically assign the case name of the test case corresponding to the input and output information to a preset case name, and assign the output result of the dictionary value format after element combination to the rule element data corresponding to the preset case name; Determine whether each case name after the assignment is derived from the precondition. If so, identify the process description of the one demand use case, and assign the first step of the process description to the check item corresponding to the case name; otherwise, identify the postcondition of the one demand use case, and assign the postcondition to the check item corresponding to the case name; The process description is assigned to the step description corresponding to each case name to generate the data structure of each test case.
2. The method according to claim 1, wherein: Before the step of responding to the data structure of a pre-input requirement use case, the method further includes: Build a process model including business domains, value streams, activities and tasks; At the task level in the process model, set up business processes including preconditions, process descriptions, error handling, and postconditions, set up business rules, input and output information, and build a demand use case data structure; Build a test case data structure including case name, rule element data, check items and step descriptions.
3. The method according to claim 2, wherein: The data structure in response to a pre-input requirement use case further includes: At the business domain level in the process model, enter the requirements; At the activity level in the process model, enter the name of the requirement use case; According to the name of the requirement use case, the business scenarios of each test case corresponding to the requirement use case are identified.
4. The method according to claim 1, wherein: The determining whether the input and output information is in the form of a dictionary value further includes: If not, the input and output information is converted into a counterexample dictionary value format.
5. The method according to claim 4, wherein: The step of generating a counter-example dictionary value form from the input and output information includes: By adopting the equivalence class division method, the input and output information is automatically generated into a counterexample to form a dictionary value form.
6. The method according to claim 1, wherein: The preset case name is the automatically generated case, and the element combination adopts a full permutation combination algorithm or a pairwise two-state combination algorithm, and the full permutation combination algorithm includes a Cartesian product full-state combination algorithm.
7. The method according to claim 1, wherein: Before the step of generating the data structure of each test case, the method further includes: Different levels of risk factors are preset for each test case.
8. The method according to claim 1, wherein: The test cases are arranged in order according to the case names, namely, preconditions, business rules, error handling, and input and output information.
9. A demand test integrated generation device, comprising: A case name assignment module, for responding to a data structure of a demand use case input in advance, identifying the precondition, business rules and error handling of the demand use case, assigning the category of the precondition, the abbreviation of the business rule and the category of the error handling to the case name of each test case, respectively, and assigning the content of the precondition, the rule description of the business rule and the content of the error handling to the rule element data corresponding to each case name, respectively, wherein the rule element data includes rule information, element information and data design information, the rule information is an analysis of the business rules that the business function needs to follow, the element information is the elements and values that may affect the execution results of the business function, and the data design information includes the selection algorithm to generate the element combination; An input-output assignment module, used to identify the input-output information of the one requirement use case, determine whether the input-output information is in the form of a dictionary value, and if so, automatically assign the case name of the test case corresponding to the input-output information to a preset case name, and assign the output result of the dictionary value form after element combination to the rule element data corresponding to the preset case name; A check item assignment module, used to determine whether each case name after assignment is derived from the precondition, and if so, identify the process description of the one demand use case, and assign the first step of the process description to the check item corresponding to the case name; otherwise, identify the postcondition of the one demand use case, and assign the postcondition to the check item corresponding to the case name; and The test case generation module is used to assign the process description to the step description corresponding to each case name to generate the data structure of each test case.
10. The device according to claim 9, wherein: Before the case name assignment module, it also includes: Process model building module, used to build process models including business domains, value streams, activities and tasks; A demand use case building module is used to set the business process including preconditions, process descriptions, error handling, and postconditions at the task level in the process model, set business rules, input and output information, and build a demand use case data structure; and The test case building module is used to build a test case data structure including case name, rule element data, check items and step descriptions.
11. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 8.
12. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 8.
13. A computer 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 8 is implemented.
Citation Information
Patent Citations
Testing method and device and computer readable storage medium
CN110162468A
Step-by-step solving system test case generation method based on component contract
CN112463578A