CN115994097A - Method and device for generating abnormal cash-out use cases based on error codes - Google Patents

Method and device for generating abnormal cash-out use cases based on error codes Download PDF

Info

Publication number
CN115994097A
CN115994097A CN202310280956.0A CN202310280956A CN115994097A CN 115994097 A CN115994097 A CN 115994097A CN 202310280956 A CN202310280956 A CN 202310280956A CN 115994097 A CN115994097 A CN 115994097A
Authority
CN
China
Prior art keywords
error code
newly added
generating
abnormal
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310280956.0A
Other languages
Chinese (zh)
Other versions
CN115994097B (en
Inventor
苑书荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Accumulus Technologies Tianjin Co Ltd
Original Assignee
Accumulus Technologies Tianjin Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Accumulus Technologies Tianjin Co Ltd filed Critical Accumulus Technologies Tianjin Co Ltd
Priority to CN202310280956.0A priority Critical patent/CN115994097B/en
Publication of CN115994097A publication Critical patent/CN115994097A/en
Application granted granted Critical
Publication of CN115994097B publication Critical patent/CN115994097B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a method and a device for generating an abnormal cash-out case based on an error code, wherein the method is applied to a test environment and comprises the following steps: monitoring an error code table; generating prompt information when an error code is newly added in the error code table; the prompt information is used for prompting a tester whether to select to automatically create a test scene; if an instruction of automatically creating the test scene is received by the tester, an abnormal simulation case and an abnormal cash-out case are generated based on the created test scene. Therefore, the change of the error code table is monitored in real time, the change of the third party abnormality of the tester can be timely notified, the corresponding abnormal use case can be automatically generated by combining an abnormality simulation tool, the newly added abnormality is timely tested, the degree of dependence on manpower is reduced, the working efficiency is improved, and the potential safety hazard caused by the fact that the test is not timely performed is reduced.

Description

Method and device for generating abnormal cash-out use cases based on error codes
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a device for generating an abnormal cash-out case based on error codes.
Background
In the payment test process, in order to meet the requirements of the cash dispensing service, a third party channel such as a bank, a payment bank, a WeChat and the like is generally needed to be docked. In the testing process, the tester not only needs to test the normal scene of payment (successful payment), but also needs to simulate various errors (payment anomalies) according to the error codes provided in the third-party channel docking document so as to verify whether the payment logic processes the various anomalies correctly. In general, the number of error codes of a payment channel is hundreds, and in order to improve the testing efficiency, only typical errors of several different processing modes are usually extracted for manual testing in the channel butt joint testing process. For example: when the third party system returns a new abnormality, after the developer maintains and processes the new abnormality, the developer informs the tester again, and the tester tests the abnormality.
The above scheme has the following disadvantages: 1. time hysteresis: the time for the tester to get the anomaly is lagging, usually later than the developer; 2. the dependence on human is large: the perception of the tester depends on the developer, and the developer is assumed to forget to inform the tester, so that the tester cannot perceive abnormal changes; 3. the efficiency is lower: after the tester knows the abnormality, the tester needs to manually test the abnormality, which results in lower efficiency; 4. there is a potential safety hazard: if the tester does not obtain the abnormality returned by the third-party channel at the first time, the abnormality is not fully tested, and missed detection is caused, on-line accidents are most likely to be caused, and loss is caused for the user.
Disclosure of Invention
The embodiment of the invention provides a method and a device for generating an abnormal cash-out case based on an error code, which are used for solving the technical problems that in the related art, when an abnormality returned by a third party channel is processed, the processing mode is low in efficiency and potential safety hazards are easy to cause.
In order to solve the technical problems, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for generating an abnormal dispensing use case based on an error code, where the method is applied to a test environment, and the method includes:
monitoring an error code table; the error code table is maintained by a developer and is used for storing a database table of error codes returned by the third-party system;
generating prompt information when the error code is newly added in the error code table; the prompt message is used for prompting a tester whether to select to automatically create a test scene;
if an instruction of automatically creating a test scene is received by the tester, generating an abnormal simulation case and an abnormal cash-out case based on the created test scene;
the anomaly simulation case is used for simulating newly added error codes according to an anomaly simulation tool; the exception pay-out case is used for performing exception test on the newly added error code so as to ensure that the processing mode of the error code is a corresponding expected exception processing mode when the third party system returns the newly added error code in a production environment; the expected exception handling mode is stored in the error code table, and the expected exception handling mode and the error code are in one-to-one correspondence.
Preferably, after generating the prompt message when detecting that the error code is newly added in the error code table, the method further includes:
if no indication is received that the tester chooses to automatically create a test scene; and creating a test scene according to the parameter configuration instruction of the tester.
Preferably, generating the abnormal simulation case and the abnormal cash out case based on the created test scenario includes:
inquiring whether a test scene exists according to the scene name;
if so, generating an abnormal simulation case and an abnormal cash-out case based on the existing test scene;
if not, automatically creating a test scene according to the instruction of the tester to select to automatically create the test scene, and generating an abnormal simulation case and an abnormal cash-out case based on the created test scene.
Preferably, the error code table further includes: error information corresponding to the error code and a channel to which the error code belongs.
Preferably, automatically creating the test scenario includes:
determining a scene name of the test scene;
automatically creating a test scene based on the scene name;
wherein determining the scene name of the test scene comprises:
calling the channel of the newly added error code from the error code table;
receiving naming information input by the tester;
and connecting the channel to which the newly added error code belongs with the naming information to serve as a scene name of the test scene.
Preferably, generating the anomaly simulation case based on the created test scenario includes:
calling the newly added error code, the channel to which the newly added error code belongs and the error information corresponding to the newly added error code from the error code table;
and transmitting the newly added error code, the channel to which the newly added error code belongs and error information corresponding to the newly added error code to the abnormality simulation tool so that the abnormality simulation tool simulates the newly added error code.
Preferably, the error code table further includes: an expected order state, wherein the expected order state and the error code are in one-to-one correspondence;
based on the created test scenario, generating the abnormal cash out case includes:
determining a parameter record in a third party system cash-out parameter table according to the channel of the newly added error code; wherein, the field of the channel to which the parameter record belongs is the same as the field of the channel to which the newly added error code belongs; the parameter record includes: use case assertion, third party system cash out initialization parameters, use case request address and use case request mode;
updating the expected order state field in the use case assertion to an expected order state field corresponding to the newly added error code in the error code table;
and generating the abnormal cash dispensing use case based on the use case request address, the use case request mode, the third party system cash dispensing initialization parameter and the use case assertion after the expected order state field is updated.
Preferably, the anomaly simulation tool is a mock tool.
In a second aspect, an embodiment of the present invention provides an apparatus for generating an abnormal dispensing case based on an error code, where the apparatus is applied to a test environment, and the apparatus includes:
the monitoring module is used for monitoring the error code table; the error code table is maintained by a developer and is used for storing a database table of error codes returned by the third-party system;
the first generation module is used for generating prompt information when the error code is newly added in the error code table; the prompt message is used for prompting a tester whether to select to automatically create a test scene;
the second generation module is used for generating an abnormal simulation case and an abnormal cash-out case based on the created test scene if the indication that the tester selects to automatically create the test scene is received;
the anomaly simulation case is used for simulating newly added error codes according to an anomaly simulation tool; the exception pay-out case is used for performing exception test on the newly added error code so as to ensure that the processing mode of the error code is a corresponding expected exception processing mode when the third party system returns the newly added error code in a production environment; the expected exception handling mode is stored in the error code table, and the expected exception handling mode and the error code are in one-to-one correspondence.
Preferably, the apparatus further comprises:
the creation module is used for generating prompt information when the error code is newly added in the error code table, and if the instruction of automatically creating the test scene selected by the tester is not received; and creating a test scene according to the parameter configuration instruction of the tester.
Preferably, the second generating module is configured to query whether a test scene already exists according to a scene name;
if so, generating an abnormal simulation case and an abnormal cash-out case based on the existing test scene;
if not, automatically creating a test scene according to the instruction of the tester to select to automatically create the test scene, and generating an abnormal simulation case and an abnormal cash-out case based on the created test scene.
Preferably, the error code table further includes: error information corresponding to the error code and a channel to which the error code belongs.
Preferably, the second generating module is further configured to determine a scene name of the test scene; automatically creating a test scene based on the scene name; wherein determining the scene name of the test scene comprises:
calling the channel of the newly added error code from the error code table;
receiving naming information input by the tester;
and connecting the channel to which the newly added error code belongs with the naming information to serve as a scene name of the test scene.
Preferably, the second generating module is further configured to call, from the error code table, the newly added error code, a channel to which the newly added error code belongs, and error information corresponding to the newly added error code;
and transmitting the newly added error code, the channel to which the newly added error code belongs and error information corresponding to the newly added error code to the abnormality simulation tool so that the abnormality simulation tool simulates the newly added error code.
Preferably, the error code table further includes: an expected order state, wherein the expected order state and the error code are in one-to-one correspondence;
the second generation module is further configured to determine a parameter record in a third party system payment parameter table according to the channel to which the newly added error code belongs; wherein, the field of the channel to which the parameter record belongs is the same as the field of the channel to which the newly added error code belongs; the parameter record includes: use case assertion, third party system cash out initialization parameters, use case request address and use case request mode;
updating the expected order state field in the use case assertion to an expected order state field corresponding to the newly added error code in the error code table;
and generating the abnormal cash dispensing use case based on the use case request address, the use case request mode, the third party system cash dispensing initialization parameter and the use case assertion after the expected order state field is updated.
Preferably, the anomaly simulation tool is a mock tool.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a program stored on the memory and executable on the processor, which when executed by the processor, performs the steps of the method of generating an abnormal dispensing use case based on an error code as described in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for generating an abnormal cash usage based on an error code according to the first aspect.
Therefore, the embodiment of the invention can ensure that when the third party system is newly added or changed abnormally, the tester is informed in time, so that the tester can sense the error newly added or changed abnormally at the first time and perform corresponding tests in time, and the problem of time lag caused by relying on manual notification in the scheme of the prior art is solved; the abnormality simulation tool can be automatically adjusted, so that a tester is assisted to automatically simulate the newly increased abnormality and generate a test case corresponding to the newly increased abnormality, manual intervention is not needed, and the working efficiency can be improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flowchart of a method for generating an abnormal dispensing case based on an error code according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for generating an abnormal dispensing case based on an error code according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for generating an abnormal dispensing case based on an error code according to an embodiment of the present invention;
FIG. 4 is a block diagram of an apparatus for generating an abnormal dispensing case based on an error code according to an embodiment of the present invention;
FIG. 5 is a block diagram of an apparatus for generating an abnormal dispensing case based on an error code according to an embodiment of the present invention;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
FIG. 1 is a flow chart of a method for generating an abnormal dispensing case based on an error code, the method being applied to a test environment, the method comprising:
step S101, monitoring an error code table;
step S102, when an error code is newly added in the error code table, generating prompt information;
step S103, if an instruction of automatically creating a test scene is received, generating an abnormal simulation case and an abnormal cash-out case based on the created test scene;
it should be noted that, the error code table is maintained by a developer, and is used for storing a database table of error codes returned by the third party system, where the error code table includes: error codes, error information corresponding to the error codes, channels to which the error codes belong, expected order states corresponding to the error codes, exception handling methods corresponding to the error codes, testers to which the error codes belong, and the like (as shown in table 1 below). The error code table can support dynamic increase and decrease, and when the third party system is abnormally increased or modified, secondary development is not needed, so that development cost can be saved.
The prompt information can be used for prompting a tester whether to select to automatically create a test scene; and can give out icons of yes and no for the testers to click. Alternatively, the prompt may be performed by generating voice information.
In an exemplary application scenario, the step of monitoring the error code table may be implemented by configuring a timing task to periodically scan the MySQL table.
The exception simulation case is used for simulating the newly added error code according to the exception simulation tool, that is, the newly added error code can be simulated based on the exception simulation tool in the execution process of the exception simulation case. The abnormal cash-out case is used for performing an abnormal test on the newly added error code so as to ensure that the processing mode of the error code is an expected abnormal processing mode when the third party system returns the newly added error code in the production environment; the expected exception handling mode is stored in an error code table, and the expected exception handling mode and the error code are in one-to-one correspondence.
In one possible implementation manner, after generating the prompt message when detecting that the error code is newly added in the error code table, the method further includes: if no indication of the tester's selection to automatically create a test scene is received; and creating a test scene according to the parameter configuration instruction of the tester. That is, when the tester does not select to automatically generate the abnormal case, the parameter manual configuration can be intuitively performed through the page to simulate various abnormalities, so that the tester can select a proper test mode according to the actual situation, and the flexibility is improved.
In one possible implementation, generating the exception simulation case and the exception payout case based on the created test scenario includes: inquiring whether a test scene exists according to the scene name; if so, generating an abnormal simulation case and an abnormal cash-out case based on the existing test scene; if not, automatically creating the test scene according to the instruction of the test personnel to select to automatically create the test scene, and generating an abnormal simulation case and an abnormal cash-out case based on the created test scene. That is, the scene name may be determined first, specifically, the specific content of the channel_name field in the error code table may be called, and the channel_name field and the err field (or other fields may be used without limitation in the embodiment of the present invention) may be combined with the user input, so as to automatically connect the two fields to generate the scene name (for example, ccb_err). Inquiring whether a scene exists according to the generated scene name, and if so, performing a subsequent use case generation step based on the existing scene; if not, automatically creating a test scene.
In one possible implementation, automatically creating the test scenario includes: and determining the scene name of the test scene, and automatically creating the test scene based on the scene name. Determining a scene name of the test scene includes: calling the channel of the newly added error code from the error code table; receiving naming information input by a tester; and connecting the channel to which the newly added error code belongs with the naming information to serve as a scene name of the test scene.
In one possible implementation, as shown in fig. 2, generating the anomaly simulation case based on the created test scenario includes:
step S201, calling a newly added error code, a channel to which the newly added error code belongs and error information corresponding to the newly added error code from an error code table;
step S202, transmitting the newly added error code, the channel to which the newly added error code belongs, and the error information corresponding to the newly added error code to an anomaly simulation tool, so that the anomaly simulation tool simulates the newly added error code.
When the abnormal simulation case is generated, the newly added error code, the channel to which the newly added error code belongs, and the error information corresponding to the newly added error code may be transmitted to the abnormal simulation tool to configure the relevant parameters, so that the abnormal simulation tool may simulate the newly added error code in the subsequent case execution process. The abnormal simulation tool in the embodiment of the invention can be a mock tool, a mockServer, wiremock simulation tool and the like.
In one possible implementation, as shown in fig. 3, generating the abnormal cash out case based on the created test scenario includes:
step S301, determining a parameter record in a third party system cash-out parameter table according to the channel to which the newly added error code belongs;
step S302, updating the expected order state field in the use case assertion into an expected order state field corresponding to the newly added error code in the error code table;
step S303, generating an abnormal cash case based on the case request address, the case request mode, the third party system cash initialization parameter and the case assertion after updating the expected order state field, thereby generating the abnormal cash case according to the parameters necessary for the abnormal cash case.
The field of the channel belonging to the parameter record is the same as the field of the channel belonging to the newly added error code; the parameter records include: use case assertion, third party system payout initialization parameters, use case request address, and use case request mode.
Therefore, when the third party system is newly added or changed abnormally, the tester can be timely notified, so that the tester can sense the erroneous new addition or change abnormally at the first time and timely perform corresponding tests, and the problem of time lag caused by relying on manual notification in the scheme in the prior art is solved; the abnormality simulation tool can be automatically adjusted, so that a tester is assisted to automatically simulate the newly increased abnormality and generate a test case corresponding to the newly increased abnormality, manual intervention is not needed, and the working efficiency can be improved.
The method for generating the abnormal cash-out use case based on the error code is specifically described: in one possible implementation manner, the method disclosed by the embodiment of the invention uses java language, mysql database, enterprise WeChat message notification and mock service exception simulation, so as to simulate an exception message returned by a third party system and test the existing program when the third party system (such as a bank) is not in butt joint, or the third party system is in butt joint and returns a newly added exception (error code).
In this implementation, 3 database tables are involved, and 3 database tables may be stored using the mysql database.
TABLE 1
Figure SMS_1
Table 1 is an error code table for storing anomaly information of all payment channels and expected order states after the anomaly. Field introduction: channel_name, err_code, err_msg, status (error status: in one exemplary manner, 0 represents unavailable (discarded error code), 1 represents available), process_mode (error handling manner: in one exemplary manner, 1 represents retry, 2 represents failure, 3 represents check list … …), order_status (expected order status of error code, expected order status corresponding to different handling manners is different), tester (belonging tester).
It should be noted that, the developer may automatically or manually maintain the third party error into the error code table.
TABLE 2
Figure SMS_2
Table 2 is a channel payout default parameter table for storing default parameters for each channel payout. Field introduction: channel_name (channel abbreviation), path_parameter (default parameter, or third party system payout initialization parameter), and asert (default assertion).
It should be noted that, table 1 and table 2 may be associated by "channel_name", each channel_name in table 1 corresponds to a plurality of records in table 2 (i.e. 1 outgoing channel may correspond to a plurality of outgoing parameters, and the channel_name values of the plurality of records are consistent with the channel_name values in table 1), and in actual use, the channel to which the channel belongs may be determined according to a certain error code in table 1, and a certain parameter in table 2 may be selected randomly. In addition, the default parameters shown in Table 2 are manually maintained by the tester into Table 2 when a new third party payment channel is docked.
TABLE 3 Table 3
Figure SMS_3
Table 3 is a mock default parameters table for storing the default parameters of the mock service, field description: channel_name, mock_name, url (mock service request address), method (mock service request mode), and param (mock service default request parameter).
It should be noted that, table 1 and table 3 are associated by the channel_name field, and the multiple error codes in table 1, such as AA001 and AA002 records, each correspond to the ccb record in table 3.
In one possible implementation, as shown in fig. 4, when the third party system adds an exception (error code), the developer maintains an error code table stored in the mysql relational database, automatically or manually, the error code table including: error code, error information, error processing mode, channel, person, etc. The data monitoring module is responsible for monitoring the change of the error code table in time or in real time, for example: the time point of timing monitoring can be configured according to actual needs, or monitoring can be performed in real time.
After the data monitoring module detects that the error code table is newly increased, the message notification module can create an enterprise WeChat message notification (the notification mode is not limited to enterprise WeChat), notify the ' affiliated person ' (related testers), inquire whether to automatically create the abnormal case ', and after the testers receive the message notification of the error code newly increased and select ' yes ', the scene generation module can automatically create a test scene.
The scene generation module may call the specific content of the channel_name field in table 1, and combine the user input err field (or other fields, which may be other fields, and the embodiment of the present invention does not limit the present invention), so as to automatically connect the two fields to generate a scene name (e.g., ccb_err). Inquiring whether a scene exists according to the generated scene name, and if so, performing a subsequent use case generation step based on the existing scene; if not, 1 test scene of the name is created, and 2 scene steps are automatically generated:
step 1: the mock setting can call the specific content of the mock_name field in the table 3 as the name of the step 1;
step 2: the channel cash-out may call the specific content of the channel_name field in table 1, and combine the channel_name field (or other fields, which may not be limited in this embodiment of the present invention) entered by the user, to automatically connect the two fields, so as to generate the name (e.g., ccb_channel) of step 2.
After the scene has been created (may be a scene just created or an existing scene that is queried according to a scene name), an anomaly simulation use case and an anomaly cash out use case may be generated based on the created scene, that is, the use case generation module generates the application cases of each step in sequence according to the step 1 and the step 2.
First, call the mock service to generate a mock use case: three field values of channel_ name, mock, setmock in table 1 can be called, and the called field values are automatically connected to generate a mock use case name (such as ccb_mock_setdock); transmitting three field values of channel_name (channel), err_code (error code) and err_msg (error information) in table 1 to a mock service as mock parameters; and combining the 2 steps, and automatically creating the mock test case.
Next, an abnormal dispensing case (payment case) is generated:
1 default parameter record is randomly queried in table 2 according to the channel_name field value in table 1, the path_parameter and the asset are obtained, and the order_status in the asset is updated to the order_status in table 1 (namely, the expected order state in the modification use case assertion);
calling url in table 2 as use case request address; invoking method in Table 2 as use case request mode; the pay_parameter in table 2 is used as a default parameter of use case (a third party system pay-out initialization parameter); and asserting the modified assent as a use case to automatically create an abnormal cash-out use case.
And can call the three field values of channel_name, err_code and err_msg in table 1, and automatically connect the three field values to generate a use case name (for example, ccb_aa001_account has insufficient available funds).
Therefore, the embodiment of the invention can ensure that when the third party system is newly added or changed abnormally, the tester is informed in time, so that the tester can sense the error newly added or changed abnormally at the first time and perform corresponding tests in time, and the problem of time lag caused by relying on manual notification in the scheme of the prior art is solved; the abnormality simulation tool can be automatically adjusted, so that a tester is assisted to automatically simulate the newly increased abnormality and generate a test case corresponding to the newly increased abnormality, manual intervention is not needed, and the working efficiency can be improved.
As shown in fig. 5, an embodiment of the present invention provides an apparatus 50 for generating an abnormal dispensing case based on an error code, where the apparatus 50 is applied to a test environment, and the apparatus 50 includes:
a monitoring module 501, configured to monitor an error code table; the error code table is maintained by a developer and is used for storing a database table of error codes returned by the third-party system;
the first generating module 502 is configured to generate a prompt message when an error code is detected to be newly added in the error code table; the prompt information is used for prompting a tester whether to select to automatically create a test scene;
a second generating module 503, configured to generate an abnormal simulation case and an abnormal cash-out case based on the created test scene if an instruction of automatically creating the test scene is received by the tester;
the anomaly simulation case is used for simulating newly added error codes according to the anomaly simulation tool; the abnormal cash-out case is used for performing an abnormal test on the newly added error code so as to ensure that the processing mode of the error code is an expected abnormal processing mode when the third party system returns the newly added error code in the production environment; the expected exception handling mode is stored in an error code table, and the expected exception handling mode and the error code are in one-to-one correspondence.
In one possible implementation, the apparatus 50 further includes:
the creation module is used for generating prompt information when the error code is newly added in the error code table, and automatically creating the test scene if no indication that a tester selects is received; and creating a test scene according to the parameter configuration instruction of the tester.
In a possible implementation manner, the second generating module 503 is configured to query whether the test scene already exists according to the scene name;
if so, generating an abnormal simulation case and an abnormal cash-out case based on the existing test scene;
if not, automatically creating the test scene according to the instruction of the test personnel to select to automatically create the test scene, and generating an abnormal simulation case and an abnormal cash-out case based on the created test scene.
In one possible implementation, the error code table further includes: error information corresponding to the error code and channel to which the error code belongs.
In a possible implementation manner, the second generating module 503 is further configured to determine a scene name of the test scene, and automatically create the test scene based on the scene name, where determining the scene name of the test scene includes: calling the channel of the newly added error code from the error code table;
receiving naming information input by a tester;
and connecting the channel to which the newly added error code belongs with the naming information to serve as a scene name of the test scene.
In a possible implementation manner, the second generating module 503 is further configured to call, from the error code table, a newly added error code, a channel to which the newly added error code belongs, and error information corresponding to the newly added error code;
and transmitting the newly added error code, the channel to which the newly added error code belongs and error information corresponding to the newly added error code to an abnormality simulation tool so that the abnormality simulation tool simulates the newly added error code.
In one possible implementation, the error code table further includes: the expected order state is in one-to-one correspondence with the error code;
the second generating module 503 is further configured to determine a parameter record in the third party system payment parameter table according to the channel to which the newly added error code belongs; the field of the channel belonging to the parameter record is the same as the field of the channel belonging to the newly added error code; the parameter records include: use case assertion, third party system cash out initialization parameters, use case request address and use case request mode;
updating the expected order state field in the use case assertion to an expected order state field corresponding to the newly added error code in the error code table;
and generating an abnormal cash-out use case based on the use case request address, the use case request mode, the third-party system cash-out initialization parameter and the use case assertion after the expected order state field is updated.
In one possible implementation, the anomaly simulation tool is a mock tool.
Therefore, the change of the error code table is monitored in real time, the change of the third party abnormality of the tester is timely notified, the corresponding abnormal use cases can be automatically generated by combining an abnormality simulation tool, the dependence on manpower is reduced, the newly added abnormality can be timely tested, and the working efficiency is improved.
The embodiment of the present invention further provides an electronic device 60, as shown in fig. 6, including: the steps of a method for generating an abnormal dispensing case based on an error code as described in the above embodiment are implemented when the program is executed by the processor 601, the memory 602, and the program stored in the memory 602 and executable on the processor 601.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the method for generating an abnormal cash-out case based on an error code shown in the above embodiment, and can achieve the same technical effects, so that repetition is avoided and redundant description is omitted here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (11)

1. A method for generating an abnormal cash out case based on an error code, the method being applied in a test environment, the method comprising:
monitoring an error code table; the error code table is maintained by a developer and is used for storing a database table of error codes returned by the third-party system;
generating prompt information when the error code is newly added in the error code table; the prompt message is used for prompting a tester whether to select to automatically create a test scene;
if an instruction of automatically creating a test scene is received by the tester, generating an abnormal simulation case and an abnormal cash-out case based on the created test scene;
the anomaly simulation case is used for simulating newly added error codes according to an anomaly simulation tool; the exception pay-out case is used for performing exception test on the newly added error code so as to ensure that when the third party system returns the newly added error code in a production environment, the processing mode of the newly added error code is a corresponding expected exception processing mode; the expected exception handling mode is stored in the error code table, and the expected exception handling mode and the error code are in one-to-one correspondence.
2. The method of claim 1, wherein upon detecting that an error code is newly added to the error code table, generating a hint message, the method further comprises:
if no indication is received that the tester chooses to automatically create a test scene; and creating a test scene according to the parameter configuration instruction of the tester.
3. The method of claim 1, wherein generating an exception simulation case and an exception payout case based on the created test scenario comprises:
inquiring whether a test scene exists according to the scene name;
if so, generating an abnormal simulation case and an abnormal cash-out case based on the existing test scene;
if not, automatically creating a test scene according to the instruction of the tester to select to automatically create the test scene, and generating an abnormal simulation case and an abnormal cash-out case based on the created test scene.
4. The method of claim 1, wherein the error code table further comprises: error information corresponding to the error code and a channel to which the error code belongs.
5. The method of claim 3, wherein automatically creating the test scenario comprises:
determining a scene name of the test scene;
automatically creating a test scene based on the scene name;
wherein determining the scene name of the test scene comprises:
calling the channel of the newly added error code from the error code table;
receiving naming information input by the tester;
and connecting the channel to which the newly added error code belongs with the naming information to serve as a scene name of the test scene.
6. The method of claim 4, wherein generating an anomaly simulation case based on the created test scenario comprises:
calling the newly added error code, the channel to which the newly added error code belongs and the error information corresponding to the newly added error code from the error code table;
and transmitting the newly added error code, the channel to which the newly added error code belongs and error information corresponding to the newly added error code to the abnormality simulation tool so that the abnormality simulation tool simulates the newly added error code.
7. The method of claim 4, wherein the error code table further comprises: an expected order state, wherein the expected order state and the error code are in one-to-one correspondence;
based on the created test scenario, generating the abnormal cash out case includes:
determining a parameter record in a third party system cash-out parameter table according to the channel of the newly added error code; wherein, the field of the channel to which the parameter record belongs is the same as the field of the channel to which the newly added error code belongs; the parameter record includes: use case assertion, third party system cash out initialization parameters, use case request address and use case request mode;
updating the expected order state field in the use case assertion to an expected order state field corresponding to the newly added error code in the error code table;
and generating the abnormal cash dispensing use case based on the use case request address, the use case request mode, the third party system cash dispensing initialization parameter and the use case assertion after the expected order state field is updated.
8. The method of any one of claims 1-7, wherein the anomaly simulation tool is a mock tool.
9. An apparatus for generating an abnormal dispensing use case based on an error code, the apparatus being for use in a test environment, the apparatus comprising:
the monitoring module is used for monitoring the error code table; the error code table is maintained by a developer and is used for storing a database table of error codes returned by the third-party system;
the first generation module is used for generating prompt information when the error code is newly added in the error code table; the prompt message is used for prompting a tester whether to select to automatically create a test scene;
the second generation module is used for generating an abnormal simulation case and an abnormal cash-out case based on the created test scene if the indication that the tester selects to automatically create the test scene is received;
the anomaly simulation case is used for simulating newly added error codes according to an anomaly simulation tool; the exception pay-out case is used for performing exception test on the newly added error code so as to ensure that the processing mode of the error code is a corresponding expected exception processing mode when the third party system returns the newly added error code in a production environment; the expected exception handling mode is stored in the error code table, and the expected exception handling mode and the error code are in one-to-one correspondence.
10. An electronic device, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor, performs the steps of the method of generating an abnormal cash-out case based on an error code as claimed in any one of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method of generating an abnormal cash-out case based on an error code as claimed in any one of claims 1 to 8.
CN202310280956.0A 2023-03-22 2023-03-22 Method and device for generating abnormal cash-out use cases based on error codes Active CN115994097B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310280956.0A CN115994097B (en) 2023-03-22 2023-03-22 Method and device for generating abnormal cash-out use cases based on error codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310280956.0A CN115994097B (en) 2023-03-22 2023-03-22 Method and device for generating abnormal cash-out use cases based on error codes

Publications (2)

Publication Number Publication Date
CN115994097A true CN115994097A (en) 2023-04-21
CN115994097B CN115994097B (en) 2023-05-16

Family

ID=85990560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310280956.0A Active CN115994097B (en) 2023-03-22 2023-03-22 Method and device for generating abnormal cash-out use cases based on error codes

Country Status (1)

Country Link
CN (1) CN115994097B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140331212A1 (en) * 2011-02-22 2014-11-06 Zensar Technologies Ltd. Computer implemented system and method for indexing and annotating use cases and generating test scenarios therefrom
WO2021013058A1 (en) * 2019-07-19 2021-01-28 深圳前海微众银行股份有限公司 Exception prompting method, apparatus, system and device for big data product, and medium
CN114020640A (en) * 2021-11-26 2022-02-08 中国银行股份有限公司 Automatic testing method and device
CN115794637A (en) * 2022-12-02 2023-03-14 中国建设银行股份有限公司 Method, device, equipment and computer readable medium for automatic test

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140331212A1 (en) * 2011-02-22 2014-11-06 Zensar Technologies Ltd. Computer implemented system and method for indexing and annotating use cases and generating test scenarios therefrom
WO2021013058A1 (en) * 2019-07-19 2021-01-28 深圳前海微众银行股份有限公司 Exception prompting method, apparatus, system and device for big data product, and medium
CN114020640A (en) * 2021-11-26 2022-02-08 中国银行股份有限公司 Automatic testing method and device
CN115794637A (en) * 2022-12-02 2023-03-14 中国建设银行股份有限公司 Method, device, equipment and computer readable medium for automatic test

Also Published As

Publication number Publication date
CN115994097B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
CN112052172B (en) Rapid test method and device for third-party channel and electronic equipment
CN109726108B (en) Front-end code testing method, device, system and medium based on analog data
CN109977012B (en) Joint debugging test method, device, equipment and computer readable storage medium of system
CN110765018A (en) Automatic interface testing method and equipment
CN110569194A (en) interface testing method and device, electronic equipment and storage medium
CN104683154A (en) Exception handling method, terminal equipment and server
CN110908702A (en) Version switching method, version switching device, computer equipment and storage medium
CN114168471A (en) Test method, test device, electronic equipment and storage medium
CN110908708B (en) Code release method, device and system
CN110737548B (en) Data request method and server
CN113533887A (en) Intelligent debugging method and system for power distribution terminal
CN112561690B (en) Method, system, equipment and storage medium for testing credit card staged service interface
KR101792864B1 (en) System and Method for verifying application
CN115994097B (en) Method and device for generating abnormal cash-out use cases based on error codes
CN113094251B (en) Method and device for testing embedded system, computer equipment and storage medium
CN111752601A (en) Data configuration method, device and system, electronic equipment and storage medium thereof
CN111427582A (en) Management method, device and equipment of RT L code and computer readable storage medium
CN110554963A (en) Application rollback method, device and storage medium
CN108845932B (en) Unit testing method and device of network library, storage medium and terminal
CN114116244A (en) Data processing method, device and system, electronic equipment and storage medium
CN107784047B (en) Method and device for realizing storage process
CN110198249A (en) A kind of electrical power distribution automatization system test method and system
CN117112435B (en) Vulnerability linkage detection result fusion method, storage medium and electronic equipment
CN117234949B (en) Test data noise reduction method and device, storage medium and computer equipment
CN115086436B (en) inter-API parameter verification method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant