Test case construction method and device
By obtaining the business parameter combination of business types in different scenarios, generating test cases, and determining the business parameters of the next business scenario at the end of the execution of the data stay node, the problems of complex test case management and high maintenance costs in the existing technology are solved, and the efficiency of test case construction and unified system management are improved.
Patent Information
- Application Number
- CN202411963062.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-18
AI Technical Summary
The existing technology lacks global design and unified orchestration when designing test cases, resulting in complex management of test cases and test components, low reuse and high maintenance costs.
By obtaining the business parameter combination of the business type in different scenarios, the corresponding test cases are generated, and when the execution of the data stay node is completed, the business parameters of the next business scenario are determined, and the corresponding components are called to generate the second test case.
It realizes the efficiency improvement of test case construction and the maintenance cost reduction, while improving the reusability of the bid issuing components and achieving unified management of the test system.
Smart Images

Figure CN119847929A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of software testing, and in particular to a test case construction method and device. Background Art
[0002] Trading platforms often involve business processes in multiple scenarios, such as borrowing, lending, deducting, and repaying. In order to ensure the reliability, security, and correctness of the trading platform, it is usually necessary to conduct comprehensive testing of the trading platform.
[0003] Under related technologies, test cases are usually designed according to the demand dimension, and there is a lack of global design and unified orchestration for the management of test cases and test components, resulting in a mesh structure of existing test cases and test components, low reuse and high maintenance costs. Summary of the invention
[0004] The embodiment of the present invention provides a test case construction method and device, which are used to improve the efficiency of test case construction and reduce the maintenance cost of the test case.
[0005] On the one hand, an embodiment of the present application provides a test case construction method, the method comprising:
[0006] For multiple business types, perform the following operations respectively:
[0007] Obtain a first business parameter combination associated with a business type in a first business scenario;
[0008] Obtaining a service application form based on the first service parameter combination and a data retention node set for the test process;
[0009] Calling the bidding component under the first business scenario, and generating a first test case corresponding to the one business type based on the business application form;
[0010] When the first test case is executed at the data retention node, determining a second business parameter corresponding to the one business type in a second business scenario;
[0011] Call the repayment component and generate a second test case corresponding to the one business type based on the second business parameter.
[0012] Optionally, the first business parameter combination includes: a primary category, a secondary category, a business model and basic data;
[0013] The obtaining of a first business parameter combination associated with a business type in a first business scenario includes:
[0014] Obtaining a primary category, a secondary category, and a business model associated with the one business type in the first business scenario;
[0015] Importing corresponding basic data for the primary category, the secondary category and the business model;
[0016] The first-level category, the second-level category, the business model, and the obtained basic data are used to construct the first business parameter combination.
[0017] Optionally, calling the corresponding tender issuing component in the first business scenario and generating a first test case corresponding to the one business type based on the business application form includes:
[0018] Calculate the fee details corresponding to the service application form according to the preset rate of the service type to obtain a final service application form;
[0019] Based on the final business application form, a first test case corresponding to the one business type is generated.
[0020] Optionally, the second service parameter includes: a control parameter;
[0021] The determining of the second service parameter corresponding to the one service type in the second service scenario includes:
[0022] Using the business application form as a basic parameter corresponding to the one business type in the second business scenario;
[0023] Based on the basic parameters, control parameters corresponding to the one service type in the second service scenario are set.
[0024] Optionally, the setting, based on the basic parameter, a control parameter corresponding to the one service type in the second service scenario includes:
[0025] If the basic parameters and control parameters meet the test requirements of the one service type in the second service scenario, the basic parameters and control parameters are used as the second service parameters;
[0026] If the basic parameters and control parameters do not meet the test requirements, optional parameters are introduced according to the test requirements to achieve simulation of a custom repayment scenario.
[0027] Optionally, it also includes:
[0028] If, during the execution of the first test case, the time taken for the first test case to execute to the data retention node exceeds a preset time, it is determined that the test result of the first test case is abnormal.
[0029] On the one hand, an embodiment of the present application provides a test case construction device, the device comprising:
[0030] The acquisition module is used to perform the following operations for multiple business types:
[0031] Obtain a first business parameter combination associated with a business type in a first business scenario;
[0032] A first building module, configured to obtain a service application form based on the first service parameter combination and a data retention node set for a test process;
[0033] Calling the bidding component under the first business scenario, and generating a first test case corresponding to the one business type based on the business application form;
[0034] A second building module is used to determine a second business parameter corresponding to the one business type in a second business scenario when the first test case is executed at the data retention node;
[0035] Call the repayment component and generate a second test case corresponding to the one business type based on the second business parameter.
[0036] Optionally, the acquisition module is specifically used for:
[0037] Obtaining a primary category, a secondary category, and a business model associated with the one business type in the first business scenario;
[0038] Acquire basic data corresponding to the primary category, the secondary category and the business model from a database;
[0039] The first-level category, the second-level category, the business model, and the obtained basic data are used to construct the first business parameter combination.
[0040] Optionally, the first building module is specifically used to:
[0041] Calculate the fee details corresponding to the service application form according to the preset rate of the service type to obtain a final service application form;
[0042] Based on the final business application form, a first test case corresponding to the one business type is generated.
[0043] Optionally, the second building module is specifically used to:
[0044] Using the business application form as a basic parameter corresponding to the one business type in the second business scenario;
[0045] Based on the basic parameters, control parameters corresponding to the one service type in the second service scenario are set.
[0046] Optionally, the second building module is specifically used to:
[0047] If the basic parameters meet the test requirements of the one service type in the second service scenario, the basic parameters are used as the control parameters;
[0048] If the basic parameters do not meet the test requirements, the basic parameters are adjusted according to the test requirements to obtain the control parameters.
[0049] Optionally, the first building block is further used for:
[0050] If, during the execution of the first test case, the time taken for the first test case to execute to the data retention node exceeds a preset time, it is determined that the test result of the first test case is abnormal.
[0051] In one aspect, an embodiment of the present application provides a computer device, including:
[0052] A memory for storing program instructions;
[0053] The processor is used to call the program instructions stored in the memory and execute the steps of the above test case construction method according to the obtained program.
[0054] On the one hand, an embodiment of the present application provides a computer-readable storage medium storing a computer program executable by a computer device, and when the program is run on the computer device, the computer executes the steps of the above-mentioned test case construction method.
[0055] On the one hand, an embodiment of the present application provides a computer program product, including a computer program stored on a computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a computer device, the computer device executes the steps of the above-mentioned test case construction method.
[0056] In an embodiment of the present application, the bidding component in the first business scenario is called, and a corresponding first test case is generated based on the first business parameter combination and the set data retention node; the repayment component in the second business scenario is called, and a second test case corresponding to the business type is generated based on the second business parameter, so that different business types share a common loan and repayment component (bidding component / repayment component), and test cases are generated based on business parameters / business parameter combinations, thereby achieving unified management of the test system, improving the efficiency of test case construction, reducing the maintenance cost of test cases, and improving the reusability of the bidding component. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0058] Figure 1 A schematic diagram of a system architecture provided in an embodiment of the present application;
[0059] Figure 2 A flowchart of a test case construction method provided in an embodiment of the present application;
[0060] Figure 3 A schematic diagram of the structure of a test case construction method provided in an embodiment of the present application;
[0061] Figure 4 A schematic diagram of the structure of a test case construction device provided in an embodiment of the present application;
[0062] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical scheme and beneficial effects of the present invention more clear, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0064] The following is a brief introduction to the system architecture diagram applicable to the technical solution of the embodiment of the present application. It should be noted that the process introduced below is only used to illustrate the embodiment of the present application and is not a limitation.
[0065] refer to Figure 1 , which is a system architecture diagram applicable to an embodiment of the present application. The system architecture includes at least a terminal device 101 and a server 102. The number of terminal devices 101 can be one or more, and the number of servers 102 can also be one or more. The present application does not specifically limit the number of terminal devices 101 and servers 102.
[0066] The terminal device 101 is pre-installed with the application under test, which is a client application, a web application, a small program application, etc. The terminal device 101 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart home appliance, a smart voice interaction device, a smart car device, etc., but is not limited thereto.
[0067] Server 102 is a test platform. Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms, but is not limited to these.
[0068] It should be noted that the method in the embodiment of the present application can be executed by the terminal device 101 or the server 102 alone, or can be executed by the terminal device 101 and the server 102 together.
[0069] In the embodiment of the present application, the terminal device 101 and the server 102 may be directly or indirectly connected to each other through one or more networks. The network may be a wired network or a wireless network, for example, a mobile cellular network, or a wireless fidelity (Wireless-Fidelity, WIFI) network, or other possible networks, which are not limited in the embodiment of the present application.
[0070] The following is based on Figure 1 The system architecture diagram shown in FIG. 1 shows a flow chart of a test case construction method provided in the embodiment of the present application. The flow chart of the method can be Figure 1 The terminal device 101 shown in the figure may also be executed by the server 102, or the terminal device 101 and the server 102 may interact to execute the Figure 2 As shown, the following steps are included:
[0071] For multiple business types, the following steps 201 to 205 are performed respectively:
[0072] Step 201: Obtain a first business parameter combination associated with a business type in a first business scenario.
[0073] In some embodiments, a primary category, a secondary category, and a business model associated with a business type in a first business scenario are obtained; corresponding basic data are input for the primary category, the secondary category, and the business model; and a first business parameter combination is constructed using the primary category, the secondary category, the business model, and the obtained basic data.
[0074] Specifically, the first business parameter combination includes: a primary category, a secondary category, a business model and target basic data.
[0075] Among them, the first-level categories include: main business, large amount, specific assets, diversion, channel and KOO. The second-level categories include: main business cash loan, main business second-category account, small and micro, auction turnover, interest first and principal later, flexible repayment, institutional diversion, channel API, KOO cash label, KOO borrow and repay at any time, and KOO safe use.
[0076] The business modes include: single-bid mode, multi-bid mode and routing-bid mode. A business type corresponds to the first-level category, second-level category and business mode in the first business parameter combination. Different business types use a common bid issuing component, which is controlled by different modes and business parameter combinations to generate different bids.
[0077] The basic parameters of the bid are the data supported by the first business scenario, including: bid amount, bid period, user information, product line, and specific tags, etc. The basic data is constructed based on the obtained primary category, secondary category, and business model.
[0078] Step 202: Obtain a service application form based on the first service parameter combination and the data dwelling node set for the test process.
[0079] Specifically, the data stay nodes include: bid pre-processing, bid generation, bid review, and bid completion. The data stay node is used to determine the state or stage of the first test case during execution. By setting different data stay nodes, the progress of the first test case construction and execution is controlled. For example, the data stay node is set as the bid pre-processing. When the application under test finishes executing at the data stay node, it will notify that the bid pre-processing has been successful, indicating that the performance of the bid issuance component is normal and the bid issuance preparation work can be completed normally, that is, the preparation work before the generation of the first test case is successfully completed.
[0080] In some embodiments, if during the execution of the first test case, the time taken for the first test case to execute to the data retention node exceeds a preset time, the test result of the first test case is determined to be abnormal.
[0081] Specifically, if, when executing the first test case, no notification of successful execution of the data retention node is received within the preset time, such as successful execution of data target generation, successful execution of data target completion, etc., then the test result of the first test case is determined to be abnormal, that is, the application under test has an abnormality at the data retention node. The preset time is set according to the actual business, and this application does not make specific restrictions.
[0082] In an embodiment of the present application, different data retention nodes are set for the test process, and possible problems in the process of test case construction and execution are checked node by node, so as to perform a detailed and comprehensive test on the application under test; by setting data retention nodes, the business configuration can be modified through the effective retention of the first test case to ensure the stability of the test process.
[0083] Step 203, calling the bidding component in the first business scenario, and generating a first test case corresponding to the business type based on the business application form.
[0084] Specifically, the bidding component is an interface for generating bids, allowing users to generate bids through specific operations, such as investment bids, loan bids, etc. In this application, the bidding component is used to generate and publish test bids (i.e., test cases) with different parameter combinations. For example, for a business type, the bidding component in the first business scenario is called to generate a first test case corresponding to the business application form. A test case is a bid corresponding to a business type. There can be multiple test cases in the first business scenario, and different business types share the same bidding component.
[0085] The business application form also includes: decision parameters and organization parameters. Among them, the decision parameters are used to simulate whether the control test case executes the loan decision; the organization parameters are used to set the organization that simulates the execution of the loan decision. When the data stop node set for the test process of the first test case is completed as the target data, the decision parameters and organization parameters need to be set, otherwise, the decision parameters and organization parameters do not need to be set.
[0086] In some embodiments, according to a preset rate for a service type, detailed fee information corresponding to the service application form is calculated, and based on the final service application form, a first test case corresponding to the service type is generated.
[0087] Specifically, the bidding component calculates the corresponding fee details based on the preset rate of the corresponding business type and the bidding amount, bidding period, etc. of the basic data in the business application form. The bidding component generates a first test case corresponding to the business type based on the bidding amount, bidding period and corresponding fee items.
[0088] Step 204: When the first test case is executed at the data retention node, a business type and a second business parameter corresponding to the second business scenario are determined.
[0089] Specifically, when the data stop node set for the test process of the first test case is completed as the data target, and the first test case is successfully executed at the data target node, the second business parameter corresponding to the business type corresponding to the first test case in the second business scenario is determined. When the first test case is executed at the set data stop node, it means that the first test case is executed, and the target ID of the first test case is generated.
[0090] The second business parameters include user ID, target ID of the first test case, repayment period, repayment amount, whether to change the repayment plan, repayment date, repayment method, repayment type, debt type and source of funds.
[0091] Among them, user ID, target ID of the first test case, repayment method and repayment type are required options, and the remaining second business parameters are optional. All parameters except the above required parameters are set to default mode; user ID and target ID of the first test case are obtained based on the target ID generated after the first test case is executed and the business application form.
[0092] In some embodiments, the business application form is used as a basic parameter corresponding to a business type in the second business scenario; based on the basic parameter, a control parameter corresponding to the business type in the second business scenario is set.
[0093] Specifically, the basic parameters include: user ID, target ID of the first test case; optional parameters include: number of repayment periods, repayment amount, whether to change the repayment plan, and source of funds; control parameters include: repayment method, repayment type, and debt type. Among them, repayment methods include: online repayment and offline repayment; repayment types include: overdue partial repayment, overdue full repayment, early current repayment, early settlement repayment, and repayment on the due date; debt types include: initial debt, repayment of debt, and repurchase debt; sources of funds include: bank cards, credit cards, electronic wallets, etc.
[0094] The user information of the basic information in the business application form is used as the user ID of the second business parameter, and the target ID of the first test case corresponding to the business application form is obtained. The repayment amount and repayment period in the second business parameter can be automatically calculated based on the repayment method and repayment type in the control parameter. It is hereby noted that when the optional parameters repayment amount and repayment period specify values, they will be processed according to the incoming business parameters, and the remaining second business parameters are set to the default mode. When the repayment type is determined to be a one-time repayment for multiple periods (that is, the number of repayment periods is multiple periods), the repayment amount is the total amount of all periods to be repaid, and the number of repayment periods is the first period to be repaid corresponding to the target ID.
[0095] In the embodiment of the present application, the construction of the second test case for various repayment scenarios of different business types is controlled by the second business parameter, which can flexibly and accurately control the repayment mode in the second business, solves the tester's demand for the construction of different forms of second test cases under complex business scenarios, and also solves the demand for simulating the initiation of complex repayment scenarios in a simple way.
[0096] In some embodiments, if the basic parameters and control parameters meet the test requirements of the one business type in the second business scenario, the basic parameters and control parameters are used as the second business parameters; if the basic parameters and control parameters do not meet the test requirements, optional parameters are introduced according to the test requirements to realize the simulation of the custom repayment scenario.
[0097] Specifically, if the above-mentioned complete basic parameters and control parameters meet the test requirements in the second business scenario, the repayment method and repayment type can be set according to the test requirements, and the repayment amount and repayment period in the second business scenario can be automatically calculated based on the above-mentioned control parameters. If the basic parameters and control parameters do not meet the test requirements, the optional parameters such as repayment amount, repayment period, and whether to change the repayment plan are set according to the test requirements to complete the simulation of the custom repayment scenario. The above parameter settings are determined according to the actual situation and are not specifically limited in this application.
[0098] For example, the target ID corresponds to a repayment plan with 3 periods, each period is not overdue, and each expected repayment amount is 10,000 yuan. In the second business scenario, the repayment method is selected as online repayment, and the repayment type is selected as overdue full-period repayment. Based on the two control parameters of repayment method and repayment type, the first period to be repaid of the target ID will be automatically changed to overdue status first, and then the repayment period and repayment amount will be automatically calculated according to the control parameters. If the repayment amount or repayment period needs to be specified, the specific value can be passed in to simulate the initiation of online overdue repayment.
[0099] In an embodiment of the present application, second business data is obtained based on the business application form and the target ID of the first test case, and the second business data is adjusted according to the test requirements of the second business scenario, thereby improving the flexibility of test case construction and making the test of the application under test more comprehensive.
[0100] Step 205: Call the second repayment component to generate a second test case corresponding to the business type based on the second business parameter.
[0101] In an embodiment of the present application, the bidding component in the first business scenario is called, and a corresponding first test case is generated based on the first business parameter combination and the set data retention node; the repayment component in the second business scenario is called, and a second test case corresponding to the business type is generated based on the second business parameter, so that different business types share a common borrowing and repayment component, and test cases are generated based on business parameters / business parameter combinations, thereby achieving unified management of the test system, improving the efficiency of test case construction, reducing the maintenance cost of test cases, and improving the reusability of borrowing and repayment components.
[0102] In order to better explain the embodiment of the present application, a test case construction method provided by the embodiment of the present application is introduced below in combination with the actual scenario of the credit test platform. Figure 3 As shown in the figure, the first business scenario is a borrowing scenario, and the second business scenario is a repayment scenario. The entire process includes: use case writing, control system, use case execution, and result verification. The credit test platform includes: core controller, domain controller, and branch path control. The core controller includes borrowing, lending, repayment, and deduction; the domain controller includes borrowing controller, lending controller, repayment controller, and deduction controller; branch path control refers to the management of four different business scenarios: borrowing, lending, repayment, and deduction.
[0103] Specifically, the core controller provides interface services for external systems / platforms in the credit test platform. In this application, the core controller provides two input parameter interface services, namely the loan input parameter interface service and the repayment input parameter interface service, so that the loan business and the repayment business can uniformly maintain a set of basic loan and repayment components. Based on the business parameters provided by the loan interface service, the corresponding test cases are generated; the core controller achieves faster data processing speed and stronger operation stability in the business scenarios of borrowing, lending, repaying and deducting, and has a powerful switching function, which can flexibly achieve seamless docking and efficient interaction with other business scenarios.
[0104] There are 4 data retention nodes under the loan controller, including: pre-bid issuance, bid data generation, bid data review and bid data completion. These data retention nodes are used to control the data construction and execution direction of the loan test case (i.e. the first test case). According to different data retention nodes, the data generation in the loan test case will stay in a specified state to meet diverse business needs.
[0105] Specifically, the loan controller is combined with the LiteFlow framework to implement process orchestration of multiple data retention nodes, and implement different business logics by flexibly orchestrating these data retention nodes. The LiteFlow framework is a lightweight workflow engine framework based on a microservice architecture that can help developers quickly build, manage, and execute complex business processes in distributed systems, especially for microservices and asynchronous tasks. The core function of LiteFlow is to support process orchestration, task scheduling, and business flow, and is suitable for large-scale, high-concurrency, and complex business process management.
[0106] For example, in the loan controller, the generation process of the first test case can be decomposed into multiple steps such as bid pre-issuance, bid data generation, bid data review and bid data completion. Each step is used as a stop node, and LiteFlow is used to arrange the execution order and conditions of the stop data retention nodes.
[0107] There are 8 data retention nodes under the loan controller, including: before loan routing processing, before loan information pulling, after loan information pulling, credit application, credit inquiry, loan application, loan inquiry and loan completion. These nodes are used to finely control the execution status of the loan business for the borrowing test case (i.e. the first test case) so that it accurately stays in a specific state of the loan process to ensure the accuracy and stability of the loan process. However, in reality, the loan business is executed by a specific lending institution. Therefore, during the test process, when building a business application form for the borrowing business, the relevant operations of the actual lending institution are simulated by setting decision parameters and institution parameters.
[0108] The repayment controller has a data retention node, including: repayment completion; the repayment controller is used to execute data repayment plan changes, repayment business parameters (i.e., second business parameters) construction, and real-time account entry notification process. The credit test platform can accurately identify important information such as repayment period and repayment amount according to test requirements to ensure timely transmission and processing of repayment information.
[0109] There are three data retention nodes under the deduction controller, including: deduction reception, deduction initiation and deduction completion, which are used to monitor and manage the status of the deduction retention nodes in the deduction business to ensure a smooth and accurate deduction process. In practice, the deduction business is also executed by specific lending institutions.
[0110] Branch path control provides a wealth of regional nodes to meet diverse local needs and provide customized precision services. By passing the stop nodes in the corresponding field controller, it can ensure that the overall process goes to the stop node of a specific business.
[0111] Taking the loan business as an example, when it is necessary to test the business type corresponding to the primary category of main business, the secondary category of main cash loan, and the business model of single bid, the tester only needs to pass in the specified first business parameter combination according to the loan input interface service, where the basic data in the first business parameter combination can be directly constructed manually or obtained from the database, such as setting the bid amount to 1000, the number of bid periods to 6, and the basic data such as user information and product lines are not limited; set the stop node to the target data completion to ensure that the target data of the loan test case for this test requirement reaches the specified state; set the decision parameter to true, and the institution parameter to 930 to simulate the 930 lending institution to perform real operations. Based on the complete first business parameter combination, the business application form is obtained, and the loan input interface service controls the bid issuance component corresponding to the business type, and generates the corresponding first test case based on the business application form. When the first test case is executed and successfully executed at the data stop node of the target data completion, the core controller controls the loan controller to make the 930 institution simulate the loan operation for the business type of main business-main cash loan-single bid of the first test case.
[0112] Specifically, decision parameters are defined by Drools, which is an open source business rule management system (BRMS) used to define and execute decision logic. Drools mainly implements complex decision logic through the rule engine, uses rules to describe business decisions, and automatically makes inferences and decisions based on input data, making business processes more flexible, easy to maintain and expand. It is suitable for scenarios that require complex decisions.
[0113] Taking the repayment business corresponding to the first test case generated above as an example, the second business parameter settings are as follows: the user ID is '710006537', the label ID of the first test case is '804324199', the repayment method is offline repayment, the repayment type is overdue full-term repayment, the source of funds is bank card (i.e. using bank card for repayment), and confirm the change of repayment plan; if other second business parameters are not filled in, the default mode is used, for example, the repayment date will default to starting from the first pending repayment period according to the repayment type and the setting of confirming the change of repayment plan. Since the repayment period and repayment amount are not filled in, the repayment will be confirmed as scheduled repayment or full repayment according to the repayment type, and the repayment amount and the first pending repayment period of the corresponding data will be automatically calculated. After the second business parameters are completely set, the core controller will perform basic verification on the second business parameters based on the first test case. After the verification is correct, the second repayment component corresponding to the repayment input interface service control business type generates the corresponding second test case based on the above-mentioned complete second business parameters, until the second test case is executed and successfully executed at the data stop node where the repayment is completed.
[0114] Among them, since the repayment method in the above second business parameter is offline repayment, the deduction institution (i.e. the lending institution) will first perform the deduction operation based on the first test case that has already been loaned, and then generate the second test case to execute the second test case to complete the repayment process. At this point, the test process of borrowing, lending, deduction, and repayment in the credit test platform has been successfully completed.
[0115] If the repayment method is online repayment, after the corresponding second test case is generated, when the second test case is executed and successfully executed at the stop node where the repayment is completed, the core controller controls the deduction controller to make the 930 institution simulate the deduction operation for the second test case. At this point, the test process of borrowing, lending, repayment, and deduction in the credit test platform is successfully completed. If no abnormality occurs during the execution of multiple first test cases and the second test case, it is considered that there is no abnormality in the credit application tested by the credit test platform, that is, the credit application passes the result verification.
[0116] Specifically, when the logic of the underlying borrowing and repayment input parameter interface services changes, it is only necessary to modify the business parameters provided by the borrowing and repayment input parameter interface services respectively. There is no need to maintain multiple bidding or repayment components, which improves the maintainability of the system and the uniformity of the business entrance.
[0117] In the embodiment of the present application, when the tester needs to construct test cases of different combination types, he only needs to uniformly reference the borrowing and repayment input parameter interface services, and can go to different logical branches through different business parameter controls, thereby reducing the work of the tester to re-arrange the automated use cases for the same function, making the orchestration process simpler and reducing the difficulty of constructing test cases in diversified testing scenarios; the control system calls a unified public borrowing and repayment component through different business types in borrowing and repayment scenarios, and can sort out and integrate test cases in a clear and hierarchical manner, reducing the high maintenance costs caused by disorderly and chaotic management, and improving the efficiency of test case construction.
[0118] Based on the same technical concept, the present application embodiment provides a structural diagram of a test case construction device, such as Figure 4 As shown, the test case construction device 400 includes:
[0119] The acquisition module 401 is used to perform the following operations respectively for multiple business types:
[0120] Obtain a first business parameter combination associated with a business type in a first business scenario;
[0121] A first construction module 402 is used to obtain a service application form based on the first service parameter combination and a data stop node set for the test process;
[0122] Calling the corresponding tender issuing component under the first business scenario, and generating a first test case corresponding to the one business type based on the business application form;
[0123] The second construction module 403 is used to determine the second business parameter corresponding to the one business type in the second business scenario when the first test case is executed at the data retention node;
[0124] The second repayment component is called to generate a second test case corresponding to the one business type based on the second business parameter.
[0125] Optionally, the acquisition module 401 is specifically used for:
[0126] Obtaining a primary category, a secondary category, and a business model associated with the one business type in the first business scenario;
[0127] Setting corresponding basic data for the primary category, the secondary category and the business model;
[0128] The first-level category, the second-level category, the business model, and the obtained basic data are used to construct the first business parameter combination.
[0129] Optionally, the first building module 402 is specifically used to:
[0130] Calculate the rate details corresponding to the service application form according to the preset rate of the service type to obtain a final service application form;
[0131] Based on the final business application form, a first test case corresponding to the one business type is generated.
[0132] Optionally, the second building module 403 is specifically used to:
[0133] Using the business application form as a basic parameter corresponding to the one business type in the second business scenario;
[0134] Based on the basic parameters, control parameters corresponding to the one service type in the second service scenario are set.
[0135] Optionally, the second building module 403 is specifically used to:
[0136] If the basic parameters and control parameters meet the test requirements of the one service type in the second service scenario, the basic parameters and control parameters are used as the second service parameters;
[0137] If the basic parameters and control parameters do not meet the test requirements, optional parameters are introduced according to the test requirements to achieve simulation of different repayment scenarios.
[0138] Optionally, the first building module 402 is further used for:
[0139] If, during the execution of the first test case, the time taken for the first test case to execute to the data retention node exceeds a preset time, it is determined that the test result of the first test case is abnormal.
[0140] In an embodiment of the present application, a bidding component in a first business scenario is called, and a corresponding first test case is generated based on a first business parameter combination and a set dwell node; a second repayment component in a second business scenario is called, and a second test case corresponding to the business type is generated based on a second business parameter, so that different business types share a common borrowing and repayment component, and test cases are generated based on business parameters / business parameter combinations, thereby achieving unified management of the test system, improving the efficiency of test case construction, reducing the maintenance cost of test cases, and improving the reusability of the bidding component.
[0141] Based on the same technical concept, the embodiment of the present application provides a computer device, which can be Figure 1 The server shown, such as Figure 5 As shown, it includes at least one processor 501 and a memory 502 connected to the at least one processor. The specific link medium between the processor 501 and the memory 502 is not limited in the embodiment of the present application. Figure 5 For example, the processor 501 and the memory 502 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0142] In an embodiment of the present application, the memory 502 stores instructions executed by at least one processor 501, and the at least one processor 501 can execute the steps of the above-mentioned test case construction method by executing the instructions stored in the memory 502.
[0143] Among them, the processor 501 is the control center of the computer device, and can use various interfaces and lines to connect various parts of the computer device, and realize the construction of test cases by running or executing instructions stored in the memory 502 and calling data stored in the memory 502. Optionally, the processor 501 may include one or more processing modules, and the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0144] The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0145] The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 502 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer device, but is not limited thereto. The memory 502 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0146] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned test case construction method.
[0147] Based on the same inventive concept, an embodiment of the present application provides a computer program product, including a computer program stored on a computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a computer device, the computer device executes the steps of the above-mentioned test case construction method.
[0148] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0149] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0150] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0151] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0152] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A test case construction method, characterized in that: include: For multiple business types, perform the following operations respectively: Obtain a first business parameter combination associated with a business type in a first business scenario; Obtaining a service application form based on the first service parameter combination and a data retention node set for the test process; Calling the bidding component under the first business scenario, and generating a first test case corresponding to the one business type based on the business application form; When the first test case is executed at the data retention node, determining a second business parameter corresponding to the one business type in a second business scenario; Call the repayment component and generate a second test case corresponding to the one business type based on the second business parameter.
2. The method according to claim 1, characterized in that The first business parameter combination includes: primary category, secondary category, business model and basic data; The obtaining of a first business parameter combination associated with a business type in a first business scenario includes: Obtaining a primary category, a secondary category, and a business model associated with the one business type in the first business scenario; Importing corresponding basic data for the primary category, the secondary category and the business model; The first-level category, the second-level category, the business model, and the obtained basic data are used to construct the first business parameter combination.
3. The method according to claim 1, characterized in that The calling of the bidding component in the first business scenario to generate a first test case corresponding to the one business type based on the business application form includes: Calculate the fee details corresponding to the service application form according to the preset rate of the service type to obtain a final service application form; Based on the final business application form, a first test case corresponding to the one business type is generated.
4. The method according to claim 1, characterized in that The second service parameters include: control parameters; The determining of the second service parameter corresponding to the one service type in the second service scenario includes: Using the business application form as a basic parameter corresponding to the one business type in the second business scenario; Based on the basic parameters, control parameters corresponding to the one service type in the second service scenario are set.
5. The method according to claim 4, characterized in that The setting, based on the basic parameters, a control parameter corresponding to the one service type in the second service scenario includes: If the basic parameters and control parameters meet the test requirements of the one service type in the second service scenario, the basic parameters and control parameters are used as the second service parameters; If the basic parameters and control parameters do not meet the test requirements, optional parameters are introduced according to the test requirements to achieve simulation of a custom repayment scenario.
6. The method according to claim 1, characterized in that Also includes: If, during the execution of the first test case, the time taken for the first test case to execute to the data retention node exceeds a preset time, it is determined that the test result of the first test case is abnormal.
7. A test case construction device, characterized in that: include: The acquisition module is used to perform the following operations for multiple business types: Obtain a first business parameter combination associated with a business type in a first business scenario; A first building module, configured to obtain a service application form based on the first service parameter combination and a data retention node set for a test process; Calling the bidding component under the first business scenario, and generating a first test case corresponding to the one business type based on the business application form; A second building module is used to determine a second business parameter corresponding to the one business type in a second business scenario when the first test case is executed at the data retention node; Call the repayment component and generate a second test case corresponding to the one business type based on the second business parameter.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of any one of the methods of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of any method described in claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises a computer program stored on a computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer device, the computer device is caused to execute the steps of the method according to any one of claims 1 to 6.