Method and device for automatically simulating mobile phone to carry out transportation card service and storage medium

By automatically simulating mobile phones to conduct traffic card business, the problems of cumbersome and high labor costs in the existing technology are solved, and automated testing is realized, which improves testing efficiency and accuracy.

CN119402582APending Publication Date: 2025-02-07SHENZHEN SNOWBALL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411423045.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, after the new functions of the mobile phone transportation card business are added, the testing process is repeated and cumbersome, the labor cost is high, and it is impossible to ensure that the new function is regressed and verified on all mobile phone manufacturers.

Method used

Provide a method to automatically simulate mobile phones for traffic card business, realize automated testing and generate test reports by clarifying test functions, determining test scope, formulating test plans, determining test scenarios, and generating test cases.

Benefits of technology

Automated testing improves testing efficiency, saves labor costs, and ensures that new features can be quickly re-returned to verification on all supported mobile phone manufacturers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402582A_ABST
    Figure CN119402582A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software, in particular to a method and device for automatically simulating a mobile phone to carry out traffic card business and a storage medium, and the method comprises the steps: determining a test function based on a traffic card newly-added function; based on the test function, a test range is determined, and the test range comprises newly added function services and existing related main line services; making a test plan based on the test range; determining a test scene based on the test plan and related test parameters; and based on the test scene, testing through a test case, and generating a test report. Therefore, related tests can be automatically realized, and the labor cost is saved while the test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software technology, and in particular to a method, a device and a storage medium for automatically simulating a mobile phone to perform a transportation card service. Background Art

[0002] With the development of data technology, the application of transportation card business through mobile phone software is becoming more and more widespread. Among them, when adding new functions, it is necessary to test the new function business as well as the existing business. During the test, it is necessary to cover all mobile phone manufacturers supported by the transportation card company, and operate the complete business process of the transportation card on the corresponding mobile phone to verify the functional integrity. However, there are differences in the way different mobile phone manufacturers implement functions, so after the new function is added, it takes multiple times of manpower to repeat the regression verification of all mobile phone manufacturers, and dirty data will be generated during the test due to unstable test environment or abnormal testing. Clearing the internal data of different devices requires synchronization with the corresponding mobile phone manufacturers.

[0003] In the prior art, the corresponding transportation card business functions are generally verified manually using mobile phones to ensure the quality of the functions. The operations are cumbersome and the function verification is completely dependent on the mobile phone device. Manual execution takes a long time and cannot guarantee regression verification on all mobile phone manufacturers after the new functions are launched. In addition, the maintenance cost of mobile phone devices is high, and the internal data of mobile phone devices needs to be cleaned up in time. The entire testing process is repetitive and cumbersome, and the labor cost is high. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a method, device and storage medium for automatically simulating a mobile phone to perform transportation card services, so as to overcome the problem that after the new functions of the current mobile phone transportation card are added, the testing process is repetitive and cumbersome, and the labor cost is high.

[0005] To achieve the above objectives, the present invention adopts the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a method for automatically simulating a mobile phone to perform a transportation card service, comprising:

[0007] Based on the new functions of the transportation card, clarify the test functions;

[0008] Based on the test function, determine the test scope, wherein the test scope includes new functional services and existing related main line services;

[0009] Develop a test plan based on the test scope;

[0010] Determine a test scenario based on the test plan and related test parameters;

[0011] Based on the test scenario, test cases are used to perform tests and a test report is generated.

[0012] Furthermore, in some embodiments of the present application, the test case includes a first test case for testing the newly added functional business, and a second test case for performing regression testing on the existing related main line business.

[0013] Furthermore, in some embodiments of the present application, it also includes:

[0014] The second test case is differentiated and saved for each city, and is corresponded to a preset city code, so that when it is necessary to test the existing relevant main line business of the target city, the corresponding second test case can be obtained through the corresponding city code.

[0015] Furthermore, in some embodiments of the present application, the relevant test parameters include test mobile phone manufacturer information and transportation card service fee information.

[0016] Furthermore, in some embodiments of the present application, it also includes:

[0017] When there is a test failure, locate the test scenario of the test failure in the test report, analyze the test failure, and determine whether the test failure is caused by the newly added function of the transportation card.

[0018] Furthermore, in some embodiments of the present application, the test case generation process includes:

[0019] Use mobile phone manufacturers' devices to operate the full functions of the transportation card;

[0020] Check and record the operation log of the mobile phone manufacturer's device based on the CPLC of the mobile phone manufacturer's device;

[0021] The real operation instruction is obtained based on the operation log, and the test case is generated based on the real operation instruction and a preset script.

[0022] In a second aspect, an embodiment of the present application provides a device for automatically simulating a mobile phone to perform a transportation card service, including a processor and a memory, wherein the processor is connected to the memory:

[0023] Wherein, the processor is used to call and execute the program stored in the memory;

[0024] The memory is used to store the program, and the program is at least used for the above-mentioned method of automatically simulating a mobile phone to perform transportation card business.

[0025] In a third aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the above-mentioned method of automatically simulating a mobile phone to perform transportation card services.

[0026] The present invention relates to the field of software technology, and in particular to a method, device and storage medium for automatically simulating a mobile phone to perform a traffic card service. The method comprises clarifying a test function based on a new function of a traffic card; determining a test scope based on the test function, wherein the test scope includes new function services and existing related main line services; formulating a test plan based on the test scope; determining a test scenario based on the test plan and related test parameters; and performing a test through a test case based on the test scenario, and generating a test report. In this way, relevant tests can be automatically implemented, which not only improves the efficiency of the test, but also saves labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 It is a flow chart of a method for automatically simulating a mobile phone to perform a transportation card service provided by an embodiment of the present invention;

[0029] Figure 2 It is a structural diagram of a device for automatically simulating a mobile phone to perform a transportation card service provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0031] Figure 1 This is a flow chart of a method for automatically simulating a mobile phone to perform a transportation card service provided by an embodiment of the present invention. Figure 1 , this embodiment may include the following steps:

[0032] S101. Based on the newly added functions of the transportation card, clarify the test functions.

[0033] S102. Determine the test scope based on the test function.

[0034] Among them, the testing scope includes new functional businesses and existing related main line businesses.

[0035] S103. Develop a test plan based on the test scope.

[0036] S104. Determine a test scenario based on the test plan and related test parameters.

[0037] S105. Based on the test scenario, test the system through test cases and generate a test report.

[0038] The method for automatically simulating a mobile phone to perform a transportation card service provided by the present application clarifies the test function based on the newly added function of the transportation card; determines the test scope based on the test function, wherein the test scope includes the newly added function service and the existing related main line service; formulates a test plan based on the test scope; determines the test scenario based on the test plan and related test parameters; performs tests through test cases based on the test scenario, and generates a test report. In this way, relevant tests can be automatically implemented, which not only improves the efficiency of the test, but also saves labor costs.

[0039] It should be noted that the method of automatically simulating mobile phones to perform transportation card services provided by the present application can solve the problem that transportation cards in different cities cannot be quickly and efficiently regressed and verified on different mobile phone manufacturers. This method can solve the problem of rapid regression verification of existing functions on all supported mobile phone manufacturers on the basis of testing new functions during the iterative testing of transportation card functions, thereby reducing duplication of work and releasing labor costs. Therefore, in some embodiments of the present application, the test case includes a first test case for testing the new function business, and a second test case for regression testing the existing related main line business.

[0040] In actual applications, you can create independent test data (such as test cases) for each city and save them separately. When you want to perform functional verification, you can directly select the corresponding city code to execute the test case, and then you can regress and verify the existing functions of the corresponding city, thereby improving test efficiency and reducing test difficulty. For example, define city app_code for all cities in the verification test, such as using city area codes to represent city app_code. If the new function is the business function scenario verification of Dalian City, you can select app_code: 0411 to select the corresponding test case for regression verification.

[0041] The method provided in this application for automatically simulating a mobile phone to perform a transportation card service first defines the test scope and establishes a test plan, then formulates a test scenario, and finally outputs a test report.

[0042] Among them, after clarifying the test function, the corresponding test scope can be clarified for the test function. And after clarifying the test scope, establish a corresponding test plan. Among them, the test regression case, that is, the second test case used for regression testing of existing services, can be clarified according to the determined test scope, and the test technology can be associated with the test case, so that it can be directly used after subsequent specified test scenarios and other operations. For the formulation of test scenarios, it includes setting relevant test parameters such as the test mobile phone manufacturer and transportation card service fees that need regression verification in the test plan, so that when the test is executed, the corresponding parameters are automatically taken to execute the test case, so as to achieve the purpose of regression verification of existing functions on different equipment manufacturers.

[0043] After the selected test case is executed, the relevant system or device can automatically output the test report of this test. The relevant personnel can locate the failure scenario by checking the test report, quickly check the cause of the failure, and clarify whether it is the bug caused by the new function (in some embodiments of the present application, the positioning analysis part can also be automatically implemented by the relevant system or device, and the relevant conclusions can be directly displayed to the relevant personnel). This solves the problem of high labor costs for repeated verification of existing functions by different mobile phone manufacturers after the new function is completed, improves test efficiency and accuracy, reduces the workload of manual adjustment through automation and standardization, and thus improves the reliability and maintainability of the test.

[0044] The following is a practical example to introduce in detail the method for automatically simulating a mobile phone to perform a transportation card service provided by this application:

[0045] When the new function is "Apple Xi'an City Card opening charges a service fee of 20 yuan":

[0046] The corresponding test function is that when you use an Apple phone to activate the Xi'an City Transportation Card in the Xi'an Transportation Card APP, you need to pay a 20 yuan card opening service fee. The amount required to verify the card opening order is the sum of the recharge balance and the 20 yuan card opening service fee. The payment amount is correct.

[0047] The corresponding test scope covers new functional businesses and existing related main business, including: Apple Xi'an City Transportation Card balance recharge, card migration, cloud recovery, transportation card return and related main business processes, as well as the new function Xi'an City Transportation Card activation order, which includes a 20 yuan activation service fee.

[0048] The corresponding test cases can be selected according to the test scope determined above, which need to include two parts. One part is for the new function-related card opening order including the 20 yuan service fee related functions, that is, the card opening order needs to pay the sum of the balance and the card fee, and the card return order needs to include the sum of the card balance and the card opening service fee; the other part needs to include some functions related to the regression verification, that is, the main line functions that may be affected by this change, including recharge orders, card migration out of the cloud, and cloud card restoration local related function verification.

[0049] It should be noted that in this application, a test plan is formulated according to the test function, and then a test scenario is developed according to the test plan, and a test case is written according to the test scenario (wherein the test case may also be a previously generated test case such as a previously generated second test case). The following is an introduction to the generation and execution process of the test case of this application:

[0050] First, the generation of test cases may include: using mobile phone manufacturer's equipment to operate the full functions of the transportation card; viewing and recording the operation log of the mobile phone manufacturer's equipment based on the CPLC of the mobile phone manufacturer's equipment; obtaining real operation instructions based on the operation log, and generating test cases based on the real operation instructions and preset scripts.

[0051] Specifically, you can use devices from different manufacturers to perform corresponding complete functional operations, and then use the device's unique identifier, CPLC, to view and record the complete log of real device operations. Then, use the log to view the real instructions issued by the real mobile phone when operating the business to generate test cases to simulate the device to perform business operations, so as to achieve the purpose of simulating device operations through script execution.

[0052] On this basis, when the test case is executed, the corresponding relevant test parameters can automatically take values ​​and execute the test case, so as to achieve the purpose of regression verification of existing functions on different equipment manufacturers.

[0053] Specifically, in actual applications, you can configure the test mobile phone manufacturer information such as device manufacturer and model through global variables, and write a set of corresponding script use cases (i.e. test cases) for different devices and models according to the instruction reading and writing methods recorded by different devices (such as obtained from the above logs). Combined with the interface called by the mobile phone business operation, the test cases for the corresponding model-related functions are spliced ​​out. By passing the target device manufacturer and model values ​​to be executed in the test case, you can select the corresponding automated script to execute. For example, if you need to simulate HONOR-AN00 to execute business, you can implement the corresponding manufacturer function execution by passing the manufacturer parameter HONOR and the model parameter AN00.

[0054] The method for automatically simulating a mobile phone to perform a transportation card service provided by this application solves the problem of repeated verification by different manufacturers and high labor costs during the testing process. Using the system or equipment corresponding to the method for automatically simulating a mobile phone to perform a transportation card service provided by this application, relevant personnel only need to manually screen the test scope, formulate test scenarios, and select test cases (in some embodiments, this can also be automatically implemented based on user input information). By automating the execution of test cases and automatically outputting corresponding test reports, it is quickly clear whether this release will affect existing functions, reducing the labor costs of repeated verification.

[0055] Among them, because there is no need to perform business operations on the mobile phone, the limitations of the mobile phone test environment are reduced, and it is no longer dependent on the mobile phone carrier. Without the assistance of the mobile phone manufacturer, it is only executed through automated test cases to fully simulate the mobile phone business scenario; at the same time, the test report can be automatically generated. After the test is completed, the relevant equipment or system can output the corresponding test report according to this test execution. The executor can use the test report to quickly locate the failure scenario and clarify whether it is a bug introduced by the newly added function (in some embodiments, it can also be automatically implemented by the relevant equipment or system). These optimization solutions make the testing process simpler and easier, and can also improve the efficiency and accuracy of the test.

[0056] Based on the same inventive concept, the present application also provides a device for automatically simulating a mobile phone to perform transportation card services, which is used to implement the above method embodiments. Figure 2 is a schematic diagram of the structure of a device for automatically simulating a mobile phone to perform a transportation card service provided by an embodiment of the present invention, such as Figure 2 As shown, the device for automatically simulating a mobile phone to perform a transportation card service in this embodiment includes a processor 21 and a memory 22, and the processor 21 is connected to the memory 22. The processor 21 is used to call and execute the program stored in the memory 22; the memory 22 is used to store the program, and the program is at least used to execute the method for automatically simulating a mobile phone to perform a transportation card service in the above embodiment.

[0057] The specific implementation scheme of the device for automatically simulating a mobile phone to perform a transportation card service provided in the embodiment of the present application can refer to the implementation scheme of the method for automatically simulating a mobile phone to perform a transportation card service in any of the above embodiments, and will not be repeated here.

[0058] Based on the same inventive concept, the present application also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the above-mentioned method of automatically simulating a mobile phone to perform transportation card services.

[0059] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0060] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0061] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0062] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0063] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0064] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0065] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0066] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0067] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for automatically simulating a mobile phone to perform a transportation card service, characterized in that: include: Based on the new functions of the transportation card, clarify the test functions; Based on the test function, determine the test scope, wherein the test scope includes new functional services and existing related main line services; Develop a test plan based on the test scope; Determine a test scenario based on the test plan and related test parameters; Based on the test scenario, test cases are used to perform tests and a test report is generated.

2. The method for automatically simulating a mobile phone to perform transportation card services according to claim 1, characterized in that: The test cases include a first test case for testing the newly added functional service, and a second test case for performing regression testing on the existing related main line service.

3. The method for automatically simulating a mobile phone to perform transportation card services according to claim 2, characterized in that: Also includes: The second test case is differentiated and saved for each city, and is corresponded to a preset city code, so that when it is necessary to test the existing relevant main line business of the target city, the corresponding second test case can be obtained through the corresponding city code.

4. The method for automatically simulating a mobile phone to perform transportation card services according to claim 2, characterized in that: The relevant test parameters include test mobile phone manufacturer information and transportation card service fee information.

5. The method for automatically simulating a mobile phone to perform transportation card services according to claim 1, characterized in that: Also includes: When there is a test failure, locate the test scenario of the test failure in the test report, analyze the test failure, and determine whether the test failure is caused by the newly added function of the transportation card.

6. The method for automatically simulating a mobile phone to perform transportation card services according to claim 1, characterized in that: The test case generation process includes: Use mobile phone manufacturers' devices to operate the full functions of the transportation card; Check and record the operation log of the mobile phone manufacturer's device based on the CPLC of the mobile phone manufacturer's device; The real operation instruction is obtained based on the operation log, and the test case is generated based on the real operation instruction and a preset script.

7. A device for automatically simulating a mobile phone to perform transportation card services, characterized in that: The invention comprises a processor and a memory, wherein the processor is connected to the memory: Wherein, the processor is used to call and execute the program stored in the memory; The memory is used to store the program, and the program is at least used to execute the method of automatically simulating a mobile phone to perform transportation card services as described in any one of claims 1-6.

8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the method of automatically simulating a mobile phone to perform transportation card services as described in any one of claims 1-6.