CN110399305B - BTT module testing method and device - Google Patents

BTT module testing method and device Download PDF

Info

Publication number
CN110399305B
CN110399305B CN201910702804.9A CN201910702804A CN110399305B CN 110399305 B CN110399305 B CN 110399305B CN 201910702804 A CN201910702804 A CN 201910702804A CN 110399305 B CN110399305 B CN 110399305B
Authority
CN
China
Prior art keywords
data
abnormal
format
operation request
data processing
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.)
Active
Application number
CN201910702804.9A
Other languages
Chinese (zh)
Other versions
CN110399305A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910702804.9A priority Critical patent/CN110399305B/en
Publication of CN110399305A publication Critical patent/CN110399305A/en
Application granted granted Critical
Publication of CN110399305B publication Critical patent/CN110399305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The invention provides a test method and a test device of a BTT module, wherein the method comprises the following steps: acquiring operation request data in a web page for accessing the BTT module; the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data; receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data; and judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test. The invention can improve the test efficiency and the test coverage rate, simplify the test method of the BTT module, and is easier to maintain and optimize.

Description

BTT module testing method and device
Technical Field
The invention relates to the technical field of software testing, in particular to a method and a device for testing a BTT module.
Background
BTT is an e-commerce application framework model for financial institutions, which is a comprehensive solution based on WebSphere, J2EE component technology, cross-platform, supporting multi-channel financial services and SOA architecture.
The BTT framework provides a set of native methods (mainly in bttcore. Jar) for initializing the BTT framework, initializing Op objects, retrieving Op step from Op objects, executing Op step, etc. For the test based on the BTT framework, the adopted method is different in size, namely, the BTT original method is used as a bottom layer, a set of test method is packaged, and the original method is regulated by the test method during the test to execute the electronic banking transaction.
However, such a test method is highly dependent on the BTT framework, resulting in a complicated and inefficient test method for electronic transactions.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a test method and a test device for a BTT module, which can improve the test efficiency of the BTT module and are easier to maintain and optimize.
In order to solve the technical problems, the invention provides the following technical scheme:
in a first aspect, the present invention provides a method for testing a BTT module, including:
acquiring operation request data in a web page for accessing the BTT module;
the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data;
Receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data;
and judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test.
Wherein after the operation request data in the web page for accessing the BTT module is acquired, the method further comprises:
the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data, and abnormal data corresponding to the operation request data is sent out after the data processing is overtime;
receiving the abnormal data, performing format conversion on the abnormal data to obtain an abnormal result corresponding to the abnormal data, and determining an abnormal type corresponding to the abnormal result;
sending out an alarm message; the alarm message is used for prompting the BTT module to process abnormality and abnormality type of the request data.
The obtaining operation request data in the web page for accessing the BTT module includes:
analyzing the web page for accessing the BTT module to obtain web page source codes;
Extracting a target page element in the source code of the web page and a request address in a target function;
and generating a storage table according to the target page element and the request address, and screening the storage table to obtain the operation request data.
The step of receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data includes:
determining the format of the data processing data, and identifying the data processing data according to an element identification mode corresponding to the format of the data processing data to obtain a test result corresponding to the data processing data.
The step of receiving the abnormal data and performing format conversion on the abnormal data to obtain an abnormal result corresponding to the abnormal data and determining an abnormal type corresponding to the abnormal result comprises the following steps:
determining the format of the abnormal data and identifying the abnormal data according to an element identification mode corresponding to the format of the abnormal data to obtain an abnormal result corresponding to the abnormal data;
searching the abnormal result in a preset dictionary and determining the abnormal type corresponding to the abnormal result in the dictionary.
Wherein the format of the web page comprises: jsp, asp and html.
Wherein the target page element comprises: at least one of form, input and table.
Wherein the objective function is: a subset function.
Wherein the format of the data processing data comprises: any one of html, xml and json.
Wherein the anomaly type includes: any one of request timeout, address error, parameter error, and return error hint.
In a second aspect, the present invention provides a test apparatus for a BTT module, including:
an acquiring unit, configured to acquire operation request data in a web page for accessing the BTT module;
the first sending unit is used for sending the operation request data to the BTT module so that the BTT module can perform corresponding data processing on the operation request data and send out data processing data corresponding to the operation request data;
the first receiving unit is used for receiving the data processing data and converting the format of the data processing data to obtain a test result corresponding to the operation request data;
and the judging unit is used for judging whether the test result is the same as a preset theoretical result of the BTT module, and if so, determining that the BTT module passes the test.
Wherein, still include:
the second sending unit is used for sending the operation request data to the BTT module so that the BTT module can perform corresponding data processing on the operation request data and send out abnormal data corresponding to the operation request data after the data processing is overtime;
the second receiving unit is used for receiving the abnormal data, performing format conversion on the abnormal data to obtain an abnormal result corresponding to the abnormal data and determining an abnormal type corresponding to the abnormal result;
the alarm unit is used for sending out alarm information; the alarm message is used for prompting the BTT module to process abnormality and abnormality type of the request data.
Wherein the acquisition unit includes:
the analysis subunit is used for analyzing the web page for accessing the BTT module to obtain web page source codes;
the extraction subunit is used for extracting a target page element in the source code of the web page and a request address in the target function;
and the screening subunit is used for generating a storage table according to the target page element and the request address, and screening the storage table to obtain the operation request data.
Wherein the first receiving unit includes:
The first receiving subunit is used for determining the format of the data processing data and identifying the data processing data according to an element identification mode corresponding to the format of the data processing data to obtain a test result corresponding to the data processing data.
Wherein the second receiving unit includes:
the second receiving subunit is used for determining the format of the abnormal data and identifying the abnormal data according to an element identification mode corresponding to the format of the abnormal data to obtain an abnormal result corresponding to the abnormal data;
the searching subunit is used for searching the abnormal result in a preset dictionary and determining the abnormal type corresponding to the abnormal result in the dictionary.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the BTT module testing method when executing the program.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the BTT module testing method.
As can be seen from the above technical solution, the present invention provides a method and an apparatus for testing a BTT module, by acquiring operation request data in a web page for accessing the BTT module; the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data; receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data; judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test, so that the test efficiency and the test coverage rate can be improved, the test method of the BTT module is simplified, and the BTT module is easier to maintain and optimize.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a first method for testing a BTT module according to an embodiment of the invention.
Fig. 2 is a second flowchart of a test method of a BTT module according to an embodiment of the invention.
Fig. 3 is a schematic structural diagram of a testing device of a BTT module in an embodiment of the invention.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present 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.
The invention provides an embodiment of a test method of a BTT module, referring to FIG. 1, the test method of the BTT module specifically comprises the following steps:
s101: acquiring operation request data in a web page for accessing the BTT module;
in this step, a web page of the BTT module is acquired, and the format of the web page includes: jsp, asp and html.
Analyzing the web page for accessing the BTT module to obtain the source code of the web page; extracting a target page element in the source code of the web page and a request address in a target function; wherein the target page element comprises: at least one of form, input and table. The objective function is: a subset function.
When extracting a target page element form in the source code of the web page, identifying a form start tag "< form" and an end tag "</form" or "/>" by taking "form" as a keyword, and matching in pairs.
When extracting a target page element input in the source code of the web page, identifying a form by taking input as a keyword, and matching a start tag "< input" and an end tag "</input" or "/>" of an input field in pairs.
When a request address in an objective function submit in the source code of the web page is extracted, a keyword of 'submit ()' is used for identifying a javascript function name containing the submit function in an input field.
And generating a storage table according to the target page element and the request address, and screening the storage table to obtain the operation request data.
Screening the stored table is to remove unwanted target page elements or request addresses in the target function from the table. Specifically, enumeration of a request address and a request parameter is used as a keyword by using a javascript function, and a target page element and a request address in a storage table are screened.
S102: the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data;
in this step, the operation request data is sent to the BTT module in a manner of script sending an http request to a specified address, and the operation request data with parameters is received and the data processing data (response result) corresponding to the operation request data is received.
In specific implementation, a java. Net. Url object is initialized, and an openConnection mode is called to initialize a java. Net. Httpu rlconnection (hereinafter referred to as httpu rlconnection) object.
And setting connection type (json/html/xml), connection mode (post) and timeout time attribute of the initialized httpullconnection object. And call up
The initialized getOutputStream mode of the HttpURLconnection object establishes a link with the requested address, and transmits operation request data with parameters to the link and receives data processing data corresponding to the operation request data.
S103: receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data;
In this step, the process of processing the request data is performed, and according to the data type, a corresponding data analysis mode is adopted to analyze the request data, and the analysis result is stored.
The format conversion process specifically converts the character stream in the Bytes format into String and List formats.
Wherein the format of the data processing data comprises: any one of html, xml and json.
Determining the format of the data processing data and identifying the data processing data according to an element identification mode corresponding to the format of the data processing data to obtain a test result corresponding to the data processing data, wherein the method specifically comprises the following steps of:
recognizing the data after format conversion processing by taking 'html' and 'xml' as keywords, and judging the data content beginning with 'html' as an html format; judging the data content of the head of the "< xml" as an xml format; and judging the data content which does not contain the keywords as json format.
The json-format data content is converted into jsonoobject objects by calling the parame object of com.
And calling a getInnerMap mode of the JSONBject object, and placing the JSONBject object into a table of the memory to form a first data table.
And identifying an html tag beginning with a "< keyword" in the html format data content by taking the expected returned field name as a keyword, and obtaining attribute values such as value of the tag.
And identifying an xml tag beginning with "< keyword" in the xml format data content by taking the expected return field name as a keyword, and acquiring attribute values such as value of the tag.
And placing the attribute values such as 'value' corresponding to the html format or the attribute values such as 'value' corresponding to the xml format into one table of the memory to form a second data table.
S104: and judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test.
In this step, the JSON element value is obtained by calling the getString mode of the JSONOObject object with the expected return attribute name as a key.
And screening the attribute of the WEB element by taking the expected returned attribute name as a keyword.
And storing the JSON element value or the WEB element attribute into a memory or a local file, comparing the JSON element value or the WEB element attribute with a preset theoretical result of the BTT module, judging whether the test result is the same as the preset theoretical result of the BTT module, and if so, determining that the BTT module passes the test.
The embodiment tests in a manner of sending an http request and receiving an electronic banking transaction response. The http request does not need to pay attention to the processing process of the BTT framework to Op and OpStep, so that a native method independent of the BTT framework is realized, and the test flexibility of the BTT module is improved by testing and decoupling the BTT module through the data and the state of electronic banking transaction. The embodiment can be a testing tool written in java language, and the testing tool can automatically identify and store the request parameters of the web page, send an http request to a target address and automatically process and store the data returned by the request.
As can be seen from the above description, the method for testing a BTT module according to the embodiments of the present invention obtains operation request data in a web page for accessing the BTT module; the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data; receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data; judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test, so that the test efficiency and the test coverage rate can be improved, the test method of the BTT module is simplified, and the BTT module is easier to maintain and optimize.
On the basis of the above embodiment, referring to fig. 2, the method further includes the following steps:
s105: the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data, and abnormal data corresponding to the operation request data is sent out after the data processing is overtime;
in this step, the BTT module performs corresponding data processing on the operation request data, and if the response time of the request is longer than the preset timeout time, sends out abnormal data for prompting.
S106: receiving the abnormal data, performing format conversion on the abnormal data to obtain an abnormal result corresponding to the abnormal data, and determining an abnormal type corresponding to the abnormal result;
in this step, the process of processing the request data specifically includes:
1. determining the format of the abnormal data and identifying the abnormal data according to an element identification mode corresponding to the format of the abnormal data to obtain an abnormal result corresponding to the abnormal data;
after the abnormal data is received, the content format of the abnormal data is identified by taking 'html' and 'xml' as keywords, and the data content beginning with 'html' is identified as the html format; judging the data content of the head of the "< xml" as an xml format; and judging the data content which does not contain the keywords as json format.
The element identification of the corresponding format is carried out on the corresponding data content of the html format, the xml format and the json format, and the method specifically comprises the following steps:
an html tag beginning with "< a" "< td" and the like in html format data content is identified by using "error", "error" as a keyword, and an attribute value such as "value" of the tag is obtained.
And identifying an xml tag in the xml format data content by taking "error" and "error" as keywords, and obtaining attribute values such as "value" of the tag.
Invoking the paramepobject mode of the JSONObject object to convert jsson format data content into the JSONObject object.
2. Searching the abnormal result in a preset dictionary and determining the abnormal type corresponding to the abnormal result in the dictionary.
And according to the attribute values such as value corresponding to the html tag, the attribute values such as value corresponding to the xml tag or the JSONOBject object, carrying out query comparison with a preset dictionary, and identifying the abnormal type.
Wherein, the exception type includes: any one of request timeout, address error, parameter error, and return error hint.
It should be noted that, the request timeout refers to an exception with a timeout type, the address error refers to an exception with an address error type, the parameter error refers to an exception with a parameter error type, and the return error prompt refers to return corresponding preset prompt information according to the exception type.
S107: sending out an alarm message; the alarm message is used for prompting the BTT module to process abnormality and abnormality type of the request data.
In the step, if the abnormal condition occurs, an alarm is given, the prompt of abnormal data is realized, and then a test tool written by java language is used for judging and prompting the abnormal data which is requested to be returned during the specific implementation.
As can be seen from the above description, the method for testing a BTT module according to the embodiment of the present invention tests a BTT module by means of an http request, and has the following beneficial effects:
1. simplified BTT test method: the BTT native method is to operate a single Op, and needs to manually initialize an Op object, execute OpStep and the like, and has the advantages of multiple called functions and long code steps; the http request method does not need to use a BTT native method, does not need to pay attention to the processing process of the BTT framework to Op and OpStep, only needs an action of sending the http request, and the operation of the Op is automatically completed by the BTT framework.
2. Improving test maintainability: using BTT native methods, one test script can only test one Op; based on the http request method, one test script can test multiple ops. Assuming a project with ten thousand ops, the native method may require writing ten thousand test scripts; the http-based request method may only require writing hundreds of test scripts. It can be seen that the number of scripts is greatly reduced, so that the maintenance and optimization are easier.
3. The test efficiency and the test coverage rate are improved: one test script contains one http request, one http request corresponds to one or more transactions, one transaction corresponds to one or more ops, and one Op contains one or more Op step, so that one test script is executed, and whether the operations of a plurality of ops and Op step are correct or not can be tested simultaneously.
The embodiment of the invention provides a specific implementation manner of a BTT module testing device capable of implementing all contents in the BTT module testing method, referring to fig. 3, the BTT module testing device specifically includes the following contents:
an acquiring unit 10 for acquiring operation request data in a web page for accessing the BTT module;
the first sending unit 20 is configured to send the operation request data to the BTT module, so that the BTT module performs corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data;
a first receiving unit 30, configured to receive the data processing data and perform format conversion on the data processing data to obtain a test result corresponding to the operation request data;
and the judging unit 40 is configured to judge whether the test result is the same as a preset theoretical result of the BTT module, and if yes, determine that the BTT module passes the test.
Wherein, still include:
a second sending unit 50, configured to send the operation request data to the BTT module, so that the BTT module performs corresponding data processing on the operation request data, and sends out abnormal data corresponding to the operation request data after the data processing is overtime;
a second receiving unit 60, configured to receive the abnormal data and perform format conversion on the abnormal data to obtain an abnormal result corresponding to the abnormal data, and determine an abnormal type corresponding to the abnormal result;
an alarm unit 70 for sending out an alarm message; the alarm message is used for prompting the BTT module to process abnormality and abnormality type of the request data.
Wherein the acquisition unit includes:
the analysis subunit is used for analyzing the web page for accessing the BTT module to obtain web page source codes;
the extraction subunit is used for extracting a target page element in the source code of the web page and a request address in the target function;
and the screening subunit is used for generating a storage table according to the target page element and the request address, and screening the storage table to obtain the operation request data.
Wherein the first receiving unit includes:
The first receiving subunit is used for determining the format of the data processing data and identifying the data processing data according to an element identification mode corresponding to the format of the data processing data to obtain a test result corresponding to the data processing data.
Wherein the second receiving unit includes:
the second receiving subunit is used for determining the format of the abnormal data and identifying the abnormal data according to an element identification mode corresponding to the format of the abnormal data to obtain an abnormal result corresponding to the abnormal data;
the searching subunit is used for searching the abnormal result in a preset dictionary and determining the abnormal type corresponding to the abnormal result in the dictionary.
The embodiment of the test device for a BTT module provided by the present invention may be specifically used for executing the processing flow of the embodiment of the test method for a BTT module in the above embodiment, and the functions thereof are not described herein in detail, and reference may be made to the detailed description of the above method embodiment.
As can be seen from the above description, the test device for a BTT module provided by the embodiment of the present invention obtains operation request data in a web page for accessing the BTT module; the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data; receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data; judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test, so that the test efficiency and the test coverage rate can be improved, the test method of the BTT module is simplified, and the BTT module is easier to maintain and optimize.
The application provides an embodiment of an electronic device for realizing all or part of contents in a test method of a BTT module, which specifically comprises the following contents:
a processor (processor), a memory (memory), a communication interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete communication with each other through the bus; the communication interface is used for realizing information transmission between related devices; the electronic device may be a desktop computer, a tablet computer, a mobile terminal, etc., and the embodiment is not limited thereto. In this embodiment, the electronic device may be implemented with reference to an embodiment of the method for implementing the BTT module and an embodiment of the testing device for implementing the BTT module, and the contents of the embodiments are incorporated herein, and are not repeated here.
Fig. 4 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 4, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 4 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the test functionality of the BTT module may be integrated into the central processor 9100. The central processor 9100 may be configured to perform the following control: acquiring operation request data in a web page for accessing the BTT module; the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data; receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data; and judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test.
As can be seen from the above description, the electronic device provided by the embodiment of the present application obtains operation request data in a web page for accessing the BTT module; the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data; receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data; judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test, so that the test efficiency and the test coverage rate can be improved, the test method of the BTT module is simplified, and the BTT module is easier to maintain and optimize.
In another embodiment, the test device of the BTT module may be configured separately from the cpu 9100, for example, the test of the BTT module may be configured as a chip connected to the cpu 9100, and the test function of the BTT module is implemented by the control of the cpu.
As shown in fig. 4, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 need not include all of the components shown in fig. 4; in addition, the electronic device 9600 may further include components not shown in fig. 4, and reference may be made to the related art.
As shown in fig. 4, the central processor 9100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 9100 receives inputs and controls the operation of the various components of the electronic device 9600.
The memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 9100 can execute the program stored in the memory 9140 to realize information storage or processing, and the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 9140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, etc. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 storing application programs and function programs or a flow for executing operations of the electronic device 9600 by the central processor 9100.
The memory 9140 may also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. A communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and to receive audio input from the microphone 9132 to implement usual telecommunications functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100 so that sound can be recorded locally through the microphone 9132 and sound stored locally can be played through the speaker 9131.
The embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the test method of a BTT module in the above embodiment, the computer-readable storage medium storing thereon a computer program which, when executed by a processor, implements all the steps in the test method of a BTT module in the above embodiment, for example, the processor implements the following steps when executing the computer program: acquiring operation request data in a web page for accessing the BTT module; the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data; receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data; and judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test.
As can be seen from the above description, the computer-readable storage medium provided by the embodiments of the present invention is configured to obtain operation request data in a web page for accessing a BTT module; the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data; receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data; judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test, so that the test efficiency and the test coverage rate can be improved, the test method of the BTT module is simplified, and the BTT module is easier to maintain and optimize.
Although the invention provides method operational steps as described in the examples or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented by an actual device or client product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or figures.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, apparatus (system) or computer program product. Accordingly, the present specification embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments. In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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. The orientation or positional relationship indicated by the terms "upper", "lower", etc. are based on the orientation or positional relationship shown in the drawings, are merely for convenience of description and to simplify the description, and are not indicative or implying that the apparatus or elements in question must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as limiting the present invention. Unless specifically stated or limited otherwise, the terms "mounted," "connected," and "coupled" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances. It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other. The present invention is not limited to any single aspect, nor to any single embodiment, nor to any combination and/or permutation of these aspects and/or embodiments. Moreover, each aspect and/or embodiment of the invention may be used alone or in combination with one or more other aspects and/or embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention, and are intended to be included within the scope of the appended claims and description.

Claims (7)

1. A method for testing a BTT module, comprising:
acquiring operation request data in a web page for accessing a BTT module, comprising: analyzing the web page for accessing the BTT module to obtain web page source codes; extracting a target page element in the source code of the web page and a request address in a target function; generating a storage table according to the target page element and the request address, and screening the storage table to obtain the operation request data;
the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data;
Receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data;
judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test;
the step of receiving the data processing data and performing format conversion on the data processing data to obtain a test result corresponding to the operation request data comprises the following steps:
determining the format of the data processing data and identifying the data processing data according to an element identification mode corresponding to the format of the data processing data to obtain a test result corresponding to the data processing data;
the sending the operation request data to the BTT module, so that the BTT module performs corresponding data processing on the operation request data and sends out data processing data corresponding to the operation request data, including:
an opening connection mode is called to initialize an HttpURLconnection object;
setting the connection type, connection mode and timeout time attribute of the initialized httpullconnection object;
calling the getOutputStream mode of the initialized HttpURLconnection object to establish a link with the requested address, sending operation request data with parameters to the link, and receiving data processing data corresponding to the operation request data;
After the operation request data in the web page for accessing the BTT module is acquired, further comprising:
the operation request data is sent to the BTT module, so that the BTT module carries out corresponding data processing on the operation request data, and abnormal data corresponding to the operation request data is sent out after the data processing is overtime;
receiving the abnormal data, performing format conversion on the abnormal data to obtain an abnormal result corresponding to the abnormal data, and determining an abnormal type corresponding to the abnormal result;
sending out an alarm message; the alarm message is used for prompting the BTT module to process abnormality and abnormality type of the request data;
the steps of receiving the abnormal data and performing format conversion on the abnormal data to obtain an abnormal result corresponding to the abnormal data and determining an abnormal type corresponding to the abnormal result include:
determining the format of the abnormal data and identifying the abnormal data according to an element identification mode corresponding to the format of the abnormal data to obtain an abnormal result corresponding to the abnormal data, wherein the method comprises the following steps of:
after the abnormal data is received, identifying the content format of the abnormal data by taking 'html' and 'xml' as keywords, and judging the content format of the abnormal data beginning with 'html' as an html format; judging the content format of the abnormal data at the head of "< xml" as an xml format; judging the content format of the abnormal data without the keywords as json format;
Performing element identification of corresponding formats on corresponding abnormal data of an html format, an xml format and a json format, wherein the element identification comprises the following steps: identifying an html tag beginning with "< a" < td "in the abnormal data in the html format by taking" error "," error "as a keyword, and obtaining a value attribute value of the html tag; recognizing an xml tag in the abnormal data in an xml format by taking "error" and "error" as keywords, and obtaining a value attribute value of the xml tag; invoking a parameobject mode of the JSONOBject object, and converting the abnormal data in the json format into the JSONOBject object;
searching the abnormal result in a preset dictionary and determining the abnormal type corresponding to the abnormal result in the dictionary, wherein the method comprises the following steps:
according to the value attribute value corresponding to the html tag, the value attribute value corresponding to the xml tag or the JSONObject object, and the preset dictionary, identifying an abnormal type, wherein the abnormal type comprises: any one of request timeout, address error, parameter error, and return error hint.
2. The method for testing a BTT module according to claim 1, wherein the format of the web page includes: jsp, asp and html.
3. The method for testing a BTT module of claim 1, wherein the target page element includes: at least one of form, input and table.
4. The method of claim 1, wherein the objective function is: a subset function.
5. A BTT module testing apparatus, comprising:
an acquiring unit, configured to acquire operation request data in a web page for accessing the BTT module;
the first sending unit is used for sending the operation request data to the BTT module so that the BTT module can perform corresponding data processing on the operation request data and send out data processing data corresponding to the operation request data;
the first receiving unit is used for receiving the data processing data and converting the format of the data processing data to obtain a test result corresponding to the operation request data;
the judging unit is used for judging whether the test result is the same as a preset theoretical result of the BTT module, if so, determining that the BTT module passes the test;
the first receiving unit includes:
the first receiving subunit is used for determining the format of the data processing data and identifying the data processing data according to an element identification mode corresponding to the format of the data processing data to obtain a test result corresponding to the data processing data;
The first sending unit is specifically configured to initialize an httpurlnlnconnect object by invoking an openconnect mode; setting the connection type, connection mode and timeout time attribute of the initialized httpullconnection object; calling the getOutputStream mode of the initialized HttpURLconnection object to establish a link with the requested address, sending operation request data with parameters to the link, and receiving data processing data corresponding to the operation request data;
the second sending unit is used for sending the operation request data to the BTT module so that the BTT module can perform corresponding data processing on the operation request data and send out abnormal data corresponding to the operation request data after the data processing is overtime;
the second receiving unit is used for receiving the abnormal data, performing format conversion on the abnormal data to obtain an abnormal result corresponding to the abnormal data and determining an abnormal type corresponding to the abnormal result;
the alarm unit is used for sending out alarm information; the alarm message is used for prompting the BTT module to process abnormality and abnormality type of the request data;
the second receiving unit includes:
the second receiving subunit is configured to determine a format of the abnormal data and identify the abnormal data according to an element identification manner corresponding to the format of the abnormal data to obtain an abnormal result corresponding to the abnormal data, where the second receiving subunit is specifically configured to:
After the abnormal data is received, identifying the content format of the abnormal data by taking 'html' and 'xml' as keywords, and judging the content format of the abnormal data beginning with 'html' as an html format; judging the content format of the abnormal data at the head of "< xml" as an xml format; judging the content format of the abnormal data without the keywords as json format;
performing element identification of corresponding formats on corresponding abnormal data of an html format, an xml format and a json format, wherein the element identification comprises the following steps: identifying an html tag beginning with "< a" < td "in the abnormal data in the html format by taking" error "," error "as a keyword, and obtaining a value attribute value of the html tag; recognizing an xml tag in the abnormal data in an xml format by taking "error" and "error" as keywords, and obtaining a value attribute value of the xml tag; invoking a parameobject mode of the JSONOBject object, and converting the abnormal data in the json format into the JSONOBject object;
the searching subunit is configured to search the abnormal result in a preset dictionary and determine an abnormal type corresponding to the abnormal result in the dictionary, where the searching subunit is specifically configured to:
according to the value attribute value corresponding to the html tag, the value attribute value corresponding to the xml tag or the JSONObject object, and the preset dictionary, identifying an abnormal type, wherein the abnormal type comprises: any one of request timeout, address error, parameter error and return error prompt;
The acquisition unit includes:
the analysis subunit is used for analyzing the web page for accessing the BTT module to obtain web page source codes;
the extraction subunit is used for extracting a target page element in the source code of the web page and a request address in the target function;
and the screening subunit is used for generating a storage table according to the target page element and the request address, and screening the storage table to obtain the operation request data.
6. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the BTT module testing method of any one of claims 1 to 4 when the program is executed by the processor.
7. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the BTT module testing method of any one of claims 1 to 4.
CN201910702804.9A 2019-07-31 2019-07-31 BTT module testing method and device Active CN110399305B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910702804.9A CN110399305B (en) 2019-07-31 2019-07-31 BTT module testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910702804.9A CN110399305B (en) 2019-07-31 2019-07-31 BTT module testing method and device

Publications (2)

Publication Number Publication Date
CN110399305A CN110399305A (en) 2019-11-01
CN110399305B true CN110399305B (en) 2023-12-08

Family

ID=68326890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910702804.9A Active CN110399305B (en) 2019-07-31 2019-07-31 BTT module testing method and device

Country Status (1)

Country Link
CN (1) CN110399305B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199296B (en) * 2020-10-29 2022-09-23 腾讯科技(深圳)有限公司 Page testing method and device, computer equipment and storage medium
CN117609104A (en) * 2024-01-24 2024-02-27 盛威时代科技股份有限公司 Page exception processing method, system and equipment in client test process

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102333126A (en) * 2011-10-15 2012-01-25 西安交通大学 Streaming media on demand method based on Hadoop and virtual streaming media server cluster
CN103955425A (en) * 2014-04-16 2014-07-30 中国工商银行股份有限公司 Webpage (WEB) exploring testing device and method
CN105701005A (en) * 2014-11-28 2016-06-22 阿里巴巴集团控股有限公司 OSGI (Open Service Gateway Initiative) based application frame test method and system
CN106569951A (en) * 2016-11-04 2017-04-19 杭州顺网科技股份有限公司 Web test method independent of page
CN106992899A (en) * 2016-01-20 2017-07-28 泰康保险集团股份有限公司 A kind of network interface test device and method
CN107102947A (en) * 2017-05-12 2017-08-29 中国工商银行股份有限公司 ATM transaction flows test device and method
CN107480117A (en) * 2017-07-25 2017-12-15 中国工商银行股份有限公司 Automate the restoration methods and device of page table list data
CN107508720A (en) * 2017-07-25 2017-12-22 中国银联股份有限公司 A kind of automated testing method and device
CN107783906A (en) * 2017-09-28 2018-03-09 广州酷狗计算机科技有限公司 Method of testing, device and storage medium
CN108197021A (en) * 2017-12-28 2018-06-22 深圳市彬讯科技有限公司 A kind of web system automated testing method, device, equipment and storage medium
CN108845950A (en) * 2018-08-03 2018-11-20 平安科技(深圳)有限公司 Test device, the method for test and storage medium
CN109413049A (en) * 2018-09-30 2019-03-01 中电科新型智慧城市研究院有限公司福州分公司 A kind of data safety means of communication and system based on web map transmission

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2356018A1 (en) * 2001-08-29 2003-02-28 Ibm Canada Limited-Ibm Canada Limitee Http connector
US10108535B2 (en) * 2016-07-08 2018-10-23 Accenture Global Solutions Limited Web application test script generation to test software functionality

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102333126A (en) * 2011-10-15 2012-01-25 西安交通大学 Streaming media on demand method based on Hadoop and virtual streaming media server cluster
CN103955425A (en) * 2014-04-16 2014-07-30 中国工商银行股份有限公司 Webpage (WEB) exploring testing device and method
CN105701005A (en) * 2014-11-28 2016-06-22 阿里巴巴集团控股有限公司 OSGI (Open Service Gateway Initiative) based application frame test method and system
CN106992899A (en) * 2016-01-20 2017-07-28 泰康保险集团股份有限公司 A kind of network interface test device and method
CN106569951A (en) * 2016-11-04 2017-04-19 杭州顺网科技股份有限公司 Web test method independent of page
CN107102947A (en) * 2017-05-12 2017-08-29 中国工商银行股份有限公司 ATM transaction flows test device and method
CN107480117A (en) * 2017-07-25 2017-12-15 中国工商银行股份有限公司 Automate the restoration methods and device of page table list data
CN107508720A (en) * 2017-07-25 2017-12-22 中国银联股份有限公司 A kind of automated testing method and device
CN107783906A (en) * 2017-09-28 2018-03-09 广州酷狗计算机科技有限公司 Method of testing, device and storage medium
CN108197021A (en) * 2017-12-28 2018-06-22 深圳市彬讯科技有限公司 A kind of web system automated testing method, device, equipment and storage medium
CN108845950A (en) * 2018-08-03 2018-11-20 平安科技(深圳)有限公司 Test device, the method for test and storage medium
CN109413049A (en) * 2018-09-30 2019-03-01 中电科新型智慧城市研究院有限公司福州分公司 A kind of data safety means of communication and system based on web map transmission

Also Published As

Publication number Publication date
CN110399305A (en) 2019-11-01

Similar Documents

Publication Publication Date Title
WO2018223717A1 (en) Webpage front-end testing method, device, system, apparatus and readable storage medium
EP3762882B1 (en) System and method for establishing common request processing
CN110941563B (en) Automatic script testing method and device
CN110399305B (en) BTT module testing method and device
CN110399306B (en) Automatic testing method and device for software module
CN110543301B (en) Method and device for generating jenkins code file
CN112631557A (en) Method, device and storage medium for generating interface code and/or interface document
CN110798445A (en) Public gateway interface testing method and device, computer equipment and storage medium
CN112988601A (en) Test script development method and device
WO2023284505A1 (en) Method and apparatus for code-scanning payment
CN113110995A (en) System migration test method and device
CN110543428B (en) Application system testing method and device
US20170353814A1 (en) Automatic system and method for conversion of smart phone applications to basic phone applications
CN111415684A (en) Voice module testing method and device and computer readable storage medium
CN109598602A (en) Account checking method, device, equipment and computer readable storage medium
CN114138372A (en) Front-end component loading method and device
CN110442806B (en) Method and apparatus for recognizing image
US10803861B2 (en) Method and apparatus for identifying information
CN111931465B (en) Method and system for automatically generating user manual based on user operation
CN111859041B (en) Data reporting method and device
CN111538542B (en) System configuration method and related device
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN111949522B (en) Automatic testing method and device for user interface
CN111930625A (en) Log obtaining method, device and system based on cloud service platform
US20100262416A1 (en) Computer and method for simulating an attention command test of a mobile phone

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