Web application system automatized test method and apparatus

A technology for automated testing and web applications, applied in software testing/debugging, etc., can solve the problems of inflexible automated testing tools, low reuse rate, and heavy testing workload, so as to improve the efficiency and flexibility of development and maintenance, and facilitate portability , the effect of improving test efficiency

Active Publication Date: 2009-01-07
CHINA UNIONPAY
2 Cites 40 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0009] The technical problem to be solved by the present invention is to provide an automated testing method and device for a Web application system ...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Method used

In actual application, Web application system is usually aimed at certain kind of special business, and there are many identical basic operations in dealing with the same kind of business, so the atomic process decomposed into the smallest unit is not only applicable to a business process, but also applicable to this type of business process other business processes. Based on the above principles, when designing automated test components, reusable test components are created for the same type of business modules, and different component combinations can test various possible business processes of the business. The design of test components is very important to the testing process, because components that can be reused many times can improve the development and maintenance efficiency and flexibility of automated test tools.
[0089] Referring to FIG. 4, it is a structural diagram of the automated test component, which includes an interface 401, a component implementation 402 and a component specification 403. The interface 401 provides...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Abstract

The invention discloses an automated testing method of a Web application system and a device thereof, which aims at solving the problems of the inflexibility, the low reutilization ratio, the heavy testing workload and the low efficiency of the existing automated testing tool of the Web application system. The method comprises the following steps: operation flows of the Web application system are broken down into the combination of atomic flows; an automated testing component is established correspondingly to each atomic flow; a preset testing case that records atomic flow sequences are read; the corresponding testing component is invoked to test the Web application system correspondingly to each atomic flow in the sequences. As the automated testing method of the components can be flexibly suitable for the automated testing of a plurality of complex and multivariant operation flows, the commonality of the testing programs can be improved, the automated testing efficiency can be greatly improved and the testing workload can be reduced; in addition, as the operation flows are thinned into the atomic flows, the error atomic flows can be tracked and positioned so as to find error points in time and improve the testing effect.

Application Domain

Technology Topic

Process decompositionWorkload +6

Image

  • Web application system automatized test method and apparatus
  • Web application system automatized test method and apparatus
  • Web application system automatized test method and apparatus

Examples

  • Experimental program(1)

Example Embodiment

[0043] In order to make the above objectives, features and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0044] The embodiment of the present invention provides a component-based Web application business process automated test method. The method decomposes the complex business of the Web application into multiple relatively independent atomic processes, and designs corresponding automated test components for these atomic business processes. When the automated test tool executes the automated test case, it is based on the atomic business process configured in the case The sequence dynamically invokes the corresponding automated test component, so as to realize the automated test of the Web application based on the business process drive.
[0045] In the embodiment of the present invention, the concept of component is introduced. A software component is a reusable software module oriented to a software architecture. It is a software module with a standardized interface and explicit context dependence, which can be independently released and can be assembled. Components should be easy to configure in different contexts through parameterization and other methods, and can work in different hardware operating platforms and software environments.
[0046]The component-based automated testing method is a method of using automated test components to assemble and test Web application business processes. After decomposing each business process into atomic processes, you only need to simply call each test component "assembly" when configuring test cases. Just get up. For example, a business process includes four sub-business processes A, B, C, and D. In order to fully cover and test the business process, the tester may need to test the following three processes: A->B->C->D, A- >B->D, A->C->D. If the test method described in the prior art is adopted, the test tool needs to develop test programs for the three processes separately. When the needs of testers change, such as the need to test another process A->D, the previously developed test program cannot "On demand". The component-based testing method of the embodiment of the present invention respectively produces corresponding automated test components a, b, c, and d for the four sub-business processes. Testers can “assemble” the test components according to business needs during testing. Test different business processes.
[0047] In practical applications, Web application systems usually target a certain type of special business, and there are many same basic operations for processing the same type of business. Therefore, the atomic process decomposed into the smallest unit is not only suitable for one business process, but also for other types of business. Process. Based on the principle, when designing an automated test component, a reusable test component is created for the same type of business module, and different component combinations can test various possible business processes of the business. The design of test components is very important to the test process, because components that can be reused multiple times can improve the efficiency and flexibility of the development and maintenance of automated test tools.
[0048] The following is a detailed description of the process of calling the test component to test the Web application system. Reference figure 1 , Is the flow chart of the steps of the automated testing method.
[0049] Step 101, configure a test case. It needs to be configured for each business process, because the test case is completely related to the business process being tested. If the business process changes, the test case must be modified accordingly. The main data structure of the test case is shown in Table 1:
[0050] Chinese data name
[0051] Test pass conditions
[0052] Table 1 Data structure table of test case
[0053] In Table 1, "Case Number" is used to distinguish multiple test cases during the test execution process, "Tested Module" indicates the business module in the tested Web application system, and "Atomic Business Process Sequence" records the tested business The atomic business process and the execution sequence of the atomic business process included in the process, the "test passing condition" is used to compare with the test results to find problems in the web application system.
[0054] Step 102: Read the test case.
[0055] Preferably step 103, pre-check whether the data of the test case conforms to the specification, if it does not conform to the specification, return an error message to the tester; if the pre-check passes, prepare data, apply for resources, etc. for the execution of the test case.
[0056] During the pre-inspection, first check whether the key data items of the test case are filled in according to the case specifications, for example, whether the items in Table 1 are filled in according to the requirements of each field; secondly, the number of the atomic business process needs to be converted to the number of the component, and check Whether the automated test component that needs to be called exists, if it exists, it is loaded into the memory and ready to be executed, otherwise detailed information that does not conform to the specification is returned to the tester. This step can prevent incorrect test case data from entering the test link in time, causing abnormal operation and errors in the test process.
[0057] Step 104: According to the atomic business process sequence configured by the test case, the matching automated test component is sequentially invoked for serialized execution, the specific business process of the Web application system is tested, and the test result is recorded.
[0058] Preferably, during the testing process, each time an atomic business process is executed, the execution return value of the corresponding test component is compared with the above "test passing conditions", and if they are the same, the next atomic business process will continue to be tested; if they are not the same, If there is a problem with the atomic business process, the execution of this test case is immediately ended. In this way, the error points can be found in time, and the wrong test result data can be used in the subsequent testing process, which may cause abnormal operation of the test software and errors; it can also find the problems of the Web application system in time and identify the error location of the specific atomic business process. Record the relevant data as part of the test results.
[0059] Preferably in step 105, the test results are analyzed, the test pass rate and other data therein are counted, and the analysis and statistical results are organized into a test report according to a specified format, and output to the tester.
[0060] Preferably, during the entire process of the above-mentioned test execution, the execution status of each test step is tracked and recorded, and a log file is generated for subsequent analysis and use by the tester. For example, according to the error location recorded in the test report, by searching for more context information in the log file, the cause of the error can be obtained by analysis.
[0061] The following uses a detailed example to illustrate the component-based automated testing process. In this embodiment, the tested Web application system is an internal card error handling platform.
[0062] This platform implements error processing (account adjustment) for cash withdrawal and consumer transactions between acquiring institutions (such as POS machines, ATM machines) and card issuing institutions (such as card issuing banks). Platform functions: Confirmation of inquiries, credit adjustments, one-time chargebacks and other error services. The error may be: the cardholder has withdrawn money at the ATM but did not dispense money, but the cardholder’s account has been debited or the cardholder spends at the merchant’s POS. The POS shows that the transaction is unsuccessful, but the cardholder has actually been deducted Account balance, etc. For each transaction, the card issuer retains the complete original transaction data. When making error adjustments, it needs to call these original data for processing for balance and settlement.
[0063] Taking the credit adjustment business as an example, the following describes the specific operation process. When a credit error occurs, the clerk of the acquiring institution first logs in to the error handling platform and inquires the original transaction data (main account number, settlement date) User transaction data, select the wrong transaction, select to initiate a credit adjustment application, fill in the relevant application information, and submit the application, waiting for review. After the reviewer logs on to the platform, he inquires about the unreviewed credit application. After the review is passed, the erroneous transaction data is recorded in the database to be cleared, and the credit adjustment process is completed.
[0064] As a module to be tested, the credit adjustment business is the Web application business process, which can be broken down into the following atomic business processes: the acquiring institution manager logs in and enters the error platform sf1, the acquiring institution manager queries the need to make a loan Record adjusted historical transactions sf2, the acquiring institution manager initiates a credit adjustment transaction sf3 for the inquired transaction, the acquirer manager exits the error platform sf4, the acquirer reviewer logs in and enters the error platform sf5, the acquirer The reviewer found the credit adjustment and performed the review operation sf6, the acquirer reviewer canceled the transaction that passed the review sf7, the acquirer reviewer exited the error platform sf8, and the acquirer manager modified the transaction that did not pass the review sf9, The clerk of the acquiring institution deletes the transaction sf10 that has not passed the review.
[0065] After analysis, sf1 and sf5 can be combined into an automated test component c1 that logs in to the error platform, sf4 and sf8 can be combined into an automated test component c4 that exits the error platform, sf2 is designed into component c2, and sf3 is designed into component c3. Design sf6 as component c6, sf7 as component c7, sf9 as component c9, and sf10 as component c10.
[0066] For the test of credit adjustment business, here are two common test cases, as shown in Table 2.
[0067] Case name
[0068] Table 2 Test case table of credit adjustment business
[0069] In Table 2, the atomic business process is the smallest business process unit decomposed according to the specific business, such as sf1, sf3, etc. in this example; the atomic business process sequence is the test execution sequence of the atomic business process, such as sf1-> in this example sf2->sf3->sf4->sf5->sf6->sf8.
[0070] Reference figure 2 , Is a flowchart of the automated test method of the present invention taking the credit adjustment business as an example.
[0071] Step 201: Read all test cases, check the data specification, and check whether the test component that needs to be called exists. If it passes the inspection, proceed to step 202; otherwise, end the test of this case and return the error message to the tester.
[0072] Step 202: Prepare data for the execution of the test case. According to specific test cases, prepare corresponding test input data.
[0073] Step 203, according to the atomic business process sequence, determine whether all the atomic business processes have been tested, if not, proceed to step 204; if all the tests are completed, jump to step 207 and record all the test results.
[0074] Step 204: Prepare the parameters of the test component for the atomic business process to be tested. In this example, component c1 corresponds to two atomic business processes sf1 and sf5, which are called twice in case 1, but the atomic business process that calls component c1 is different, so it is necessary to pass different parameters to component c1 to execute different atoms Business Process.
[0075] Step 205: Invoke the corresponding automated test component, pass corresponding parameters to the component, and test the atomic business process.
[0076] Step 206: Obtain the execution return value of the automated test component and check whether it matches the expected value. If it matches, return to step 203 to continue the next atomic business process test; if it does not match, end the execution of the current test case and execute the steps 207. Record the error location and related data.
[0077] In step 207, the test result is recorded, a test report is generated, and the execution of a test case ends. Wherein, the test result includes information such as the number of test successes, the number of failures, the location of the error, and the error reason code.
[0078] Step 208: Judge whether all the test cases have been executed. If there are other cases, return to step 202 to start the execution of the next test case; if all the test cases have been executed, end this run.
[0079] For the component-based automated testing method, the embodiment of the present invention also provides an automated testing device for a Web application system. Reference image 3 , Is a structural diagram of the device, which mainly includes an automated test component library 301, a case reading module 302, and a test control module 303.
[0080] The automated test component library 301 is a collection of automated test components, which stores the description part of the component in a structured manner, which is convenient for testers and the modules of the automated test tool to retrieve the automated test components according to various conditions. In addition, the automated test component library 301 also provides testers with the function of maintaining and upgrading automated test components. Among them, each test component is created corresponding to the atomic business process, and different test component combinations are used to test different business processes. A test component may correspond to one atomic business process, or it may correspond to multiple atomic business processes. If it corresponds to multiple, different atomic business processes are tested by receiving different parameter assignments.
[0081]The case reading module 302 is used to read a pre-configured test case and send it to the test control module 303 for execution. The test control module 303 is used to schedule the execution of the test case, call the corresponding test component from the automated test component library 301 according to the atomic business process sequence in the test case, serialize the test of the atomic business process, and record the test result.
[0082] Preferably, the test control module 303 includes a test unit, a control unit and a recording unit. Among them, the test unit is used to correspond to each atomic business process, call a matching test component from the automated test component library 301, and test the specific business process of the Web application system. The control unit plays a role in scheduling case execution and test component calls in the entire process. After receiving the component execution return value sent by the test unit, it compares the return value with the expected value recorded in the test case, and if it matches , The test unit is triggered to call the component to continue executing the next atomic business process; if it does not match, the execution of the current test case is ended, and the recording unit is triggered to record the error location and related data. When all the atomic business processes have been tested, the control unit schedules the next test case for testing. The recording unit is used to record the test results performed by each component after the test case is executed, and take the above-mentioned comparison result with the expected value as a part of the test result, and the test result also includes the error location and related data.
[0083] Preferably, the device further includes a test result analysis module 304, configured to analyze and count the test results obtained by the test control module 303, and generate a test report according to a specified format.
[0084] Preferably, the device further includes a case analysis module 305, which is used to check whether the data of the test case conforms to the case specification, convert the number of the atomic business process into the test component number, and check whether there is any need to be called in the automated test component library 301 Test component number. If the inspection is passed, the test control module 303 is triggered, otherwise the error message is returned to the tester.
[0085] Preferably, the device further includes a log tracking module 306 for tracking and recording the execution of the case reading module 302, the test control module 303, the test result analysis module 304, and the case analysis module 305, and generates a log file for preparation Testers analyze and use afterwards. For example, according to the error location recorded in the test report, by searching for more context information in the log file, the cause of the error can be obtained by analyzing.
[0086] Preferably, the device further includes a case configuration module for configuring various test cases from all possible business processes of the system according to the business characteristics of the Web application system, so as to achieve the purpose of comprehensively testing the Web application system. The main data structure of the test case can refer to Table 1.
[0087] The execution process of the automated testing device is: after receiving the test execution instruction issued by the tester, the case reading module 302 starts to read the test case, and then the case analysis module 305 checks the case data. If the pre-check is passed, Then, prepare data and apply for resources for the execution of the test case. After all preparations are completed, the control right is transferred to the test control module 303 to continue processing. The test control module 303 executes each test case in sequence in the order of the test cases. When executing a single test case, according to the component sequence converted by the case analysis module 305, it calls the automated test component library 301 for execution in turn. After obtaining the execution return value of the automated test component, check whether it is the same as the expected value in the "Test Passing Condition" field. If it is the same, continue to execute the next automated test component, otherwise directly return the test result, including the atomic business process where the error occurred. Location and cause of error. After all the atomic business process tests are completed, the test control module 303 records the test results, and the test result analysis module 304 generates a test report after analyzing the test results, and then enters the test execution link of the next test case.
[0088] The embodiment of the present invention also provides an automated test component that has a unified interface specification, is easy to transplant, and is easy to upgrade, which is used in the aforementioned automated test device and can work in different hardware operating platforms and software environments.
[0089] Refer to Figure 4 , Is a structural diagram of the automated test component, the component includes an interface 401, a component implementation 402, and a component specification 403. The interface 401 provides a connection between an external module and a component implementation 402, the external module calls the component implementation through the interface, or the component implementation calls the external module through the interface. When the test is executed, the test control module 303 calls the component implementation 402 through the interface 401 to perform the test. The component realization 402 corresponds to the atomic business process and provides corresponding test functions. It is the test program of the atomic business process corresponding to the test realized by the automated test component, and it is the core of the automated test component. The component specification 403 is to restrict the structure of the automated test component. Its main function is to specify the structure and description of the component, and it is implemented with xml technology. The component specification 403 can be understood as an explanation of the component, which is convenient for the tester to find and grasp the relevant information of each component.
[0090] The following table shows the main elements and descriptions of the component description in the component specification:
[0091] Element name
[0092] Table 3 Description of the component description part in the component specification
[0093] Automated test components are divided into atomic automated test components and composite automated test components. The component specification part of the atomic automated test component needs to indicate that the component is an atomic automated test component, and describe the function, version number and other information of the component; composite automation The component specification part of the test component needs to indicate that the component is a composite automated test component and describe the function, version number and other information of the component. It also needs to indicate which atomic components the composite component is composed of, and the order in which these atomic components are composed. And the mapping of various atomic components.
[0094] To illustrate atomic components and composite components, take the credit adjustment business as an example. The automated test components c1, c2, c3, and c4 mentioned above are all atomic automated test components, which correspond to the smallest Atomic business process. However, in many cases, for a fixed common business process, for example, the manager initiates a credit adjustment to the reviewer to pass this common test process. In practice, the utilization rate is very high, and the atomic automated test component can be used. c1->c2->c3->c4->c1->c6->c4 are combined to form a composite component, and each time the component sequence is executed c1->c2->c3->c4->c1->c6- >c4, just call the corresponding composite component directly. This avoids the shortcomings of multiple calls to atomic components due to components decentralizing business processes into atomic business processes, thereby improving testing efficiency.
[0095] image 3 , Figure 4 The unspecified parts of the device shown can be found in figure 1 , figure 2 For the sake of space, the relevant parts of the method shown are not detailed here.
[0096] The above provides a detailed introduction to the automated testing method and device for a Web application system provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation of the present invention. The description of the above embodiments is only for help Understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation and the scope of application. In summary, the content of this specification should not be construed as limiting the present invention.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Similar technology patents

Numerically-controlled machine tool thermal error on-line compensation method and system

ActiveCN105759718AImprove versatilityEasy to operateProgramme controlComputer controlMultivariable linear regressionLinear regression
Owner:UNIV OF ELECTRONIC SCI & TECH OF CHINA

Classification and recommendation of technical efficacy words

  • Improve test efficiency
  • Improve versatility

Automatic test method based on Android

ActiveCN102141960AEasy to testImprove test efficiencySoftware testing/debuggingTest sequenceTest program
Owner:GUANGDONG OPPO MOBILE TELECOMM CORP LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products