CN116383087A - Program testing method and device, electronic equipment and storage medium - Google Patents

Program testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116383087A
CN116383087A CN202310499086.6A CN202310499086A CN116383087A CN 116383087 A CN116383087 A CN 116383087A CN 202310499086 A CN202310499086 A CN 202310499086A CN 116383087 A CN116383087 A CN 116383087A
Authority
CN
China
Prior art keywords
program
data
target
function
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310499086.6A
Other languages
Chinese (zh)
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.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202310499086.6A priority Critical patent/CN116383087A/en
Publication of CN116383087A publication Critical patent/CN116383087A/en
Pending legal-status Critical Current

Links

Images

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/3684Test management for test design, e.g. generating new test cases
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application discloses a program testing method, a device, electronic equipment and a storage medium, which can be applied to the financial field or other fields, acquire a front-end program, and further construct back-end support data aiming at the front-end program, wherein the back-end support data are associated with the back-end program, the back-end program and the front-end program form a target program, the target program is used for realizing a target function, and the front-end program is tested at least according to the back-end support data so as to obtain a front-end testing result for representing whether the front-end program can realize the front-end function in the target function. Therefore, the front-end program is obtained, the back-end supporting data corresponding to the front-end program is further constructed, the front-end program is tested according to the back-end supporting data, and therefore a front-end test result representing whether the front-end program can realize the front-end function in the target function or not is obtained.

Description

Program testing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a program testing method, a program testing device, an electronic device, and a storage medium.
Background
When the project is developed, business personnel communicate with developers on the basis of customer requirements, the developers write programs based on the customer requirements, and then testers test the written programs.
However, when testing a program, the front-end program and the back-end program are usually tested after the front-end program and the back-end program are written, and when the front-end program is written and the back-end program is not written, the front-end program cannot be tested.
Disclosure of Invention
In view of the foregoing, the present application has been proposed to provide a program testing method, apparatus, electronic device, and storage medium, so as to implement an individual test of a front-end program. The specific scheme is as follows:
a program testing method, the method comprising:
acquiring a front-end program;
constructing back-end support data aiming at the front-end program, wherein the back-end support data is associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function;
and testing the front-end program at least according to the back-end supporting data to obtain a front-end test result, wherein the front-end test result represents whether the front-end program can realize the front-end function in the target functions.
Optionally, the back-end supporting data at least includes an objective function, where the objective function is configured to process the front-end program output data to obtain the front-end test result.
Optionally, at least according to the back-end supporting data, testing the front-end program to obtain a front-end test result, including:
acquiring test data, wherein the test data has a corresponding relation with functional information, the functional information is acquired based on a target code, and the target code corresponds to the target program;
obtaining display data according to the test data, the front-end program and the objective function;
and obtaining a front-end test result according to the function information, the display data and the test data.
Optionally, obtaining display data according to the test data, the front-end program and the objective function includes:
performing first processing on the test data through the front-end program to obtain front-end output data;
performing second processing on the front-end output data through the objective function to obtain back-end processing data;
outputting the back-end processing data to a target interface corresponding to the front-end program through the front-end program;
And acquiring a display picture of the target interface to obtain display data.
Optionally, the front-end test result includes a first test result or a second test result, where the first test result characterizes that the front-end program can implement a front-end function of the target functions, and the second test result characterizes that the front-end program cannot implement a front-end function of the target functions;
and obtaining a front-end test result according to the function information, the display data and the test data, wherein the front-end test result comprises:
judging whether the display data and the test data are matched according to the function information;
under the condition that the display data and the test data are matched, obtaining the first test result;
and under the condition that the display data and the test data are not matched, obtaining the second test result.
Optionally, the back-end program corresponds to front-end support data, where the front-end support data includes an interface program, where the interface program is configured to receive data for testing, output the data for testing to the back-end program, and output the data output by the back-end program to a corresponding interface, and obtain a back-end test result according to the displayed data acquired by the output interface and the data for testing input to the interface program.
Optionally, the acquiring the front-end program includes:
acquiring a target program;
and performing front-end and back-end separation processing on the target program to obtain a front-end program.
A program testing apparatus comprising:
the program acquisition unit is used for acquiring a front-end program;
the data construction unit is used for constructing back-end support data aiming at the front-end program, wherein the back-end support data is associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function;
and the testing unit is used for testing the front-end program at least according to the back-end supporting data so as to obtain a front-end testing result, wherein the front-end testing result represents whether the front-end program can realize the front-end function in the target functions.
An electronic device, comprising: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement: acquiring a front-end program; constructing back-end support data aiming at the front-end program, wherein the back-end support data is associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function; and testing the front-end program at least according to the back-end supporting data to obtain a front-end test result, wherein the front-end test result represents whether the front-end program can realize the front-end function in the target functions.
A storage medium having stored thereon a computer program which, when executed by a processor, performs: acquiring a front-end program; constructing back-end support data aiming at the front-end program, wherein the back-end support data is associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function; and testing the front-end program at least according to the back-end supporting data to obtain a front-end test result, wherein the front-end test result represents whether the front-end program can realize the front-end function in the target functions.
By means of the technical scheme, the front-end program is obtained, and then the back-end supporting data is built for the front-end program, wherein the back-end supporting data is associated with the back-end program, the back-end program and the front-end program form the target program, the target program is used for realizing the target function, and the front-end program is tested at least according to the back-end supporting data, so that a front-end test result representing whether the front-end program can realize the front-end function in the target function is obtained. Therefore, the front-end program and the back-end program can be tested separately, back-end supporting data corresponding to the front-end program can be constructed under the condition that only the front-end program is developed, the front-end program can be tested based on the back-end supporting data, the front-end program does not need to be tested after the back-end program is developed, and the front-end program and the back-end program are tested together, so that the front-end program can be tested in advance.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flow chart of a program testing method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a front end testing method according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of a display data acquisition method according to an embodiment of the present disclosure;
FIG. 4 is a flow chart of a front end test result obtaining method according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of a target program obtaining method according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a program testing apparatus according to a second embodiment of the present disclosure;
fig. 7 is a schematic device structure diagram of a test unit according to a second embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to a third embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The application provides a program test scheme, which is used for acquiring a front-end program, further constructing rear-end supporting data corresponding to the front-end program, and testing the front-end program according to the rear-end supporting data to obtain a front-end test result which characterizes whether the front-end program can realize the front-end function in a target function or not.
The scheme of the application can be realized based on the electronic equipment with the data processing capability, and the electronic equipment can be a computer, a local server, a cloud server and the like.
The program testing method, the device, the electronic equipment and the storage medium can be applied to the financial field or other fields, for example, the program testing method, the device, the electronic equipment and the storage medium can be applied to the testing of the front-end program of the input box or the search box in the financial field. Other fields are any field other than the financial field, for example, the data processing technical field. The foregoing is merely an example, and the application fields of the program testing method, the apparatus, the electronic device and the storage medium provided by the present invention are not limited.
Next, referring to fig. 1, a program testing method according to an embodiment of the present application may include the following steps:
step 101, acquiring a front-end program.
The front-end program is a program written by a developer aiming at functions which need to be realized by the front-end in service requirements.
Specifically, the application may acquire the front-end program from the developer, or may acquire the front-end program from the code sharing platform after the developer uploads the front-end program to the code sharing platform.
Step 102, building back-end support data for the front-end program.
The back-end support data is associated with the back-end program, and can realize part of functions of the back-end program; the back-end program and the front-end program form a target program, and the target program is used for realizing a target function; the back-end support data includes a basic test environment that provides basic test functionality for the front-end program to test.
For example, if the target function is capable of inputting data and displaying the input data, the front-end program needs to be capable of inputting and transmitting the input data to the back-end, the back-end program needs to store the data output by the front-end program and output the stored data to the front-end program, and the front-end program also needs to output the received data to the display interface.
And step 103, testing the front-end program at least according to the back-end support data to obtain a front-end test result.
Wherein the front-end test results characterize whether the front-end program is capable of implementing a front-end function of the target functions.
That is, according to the constructed back-end support data, the front-end program is tested, and whether the front-end program can meet the front-end function in the target functions can be obtained.
As can be seen from the foregoing, in the program testing method provided in the first embodiment of the present application, a front-end program is obtained, and further, back-end support data corresponding to the front-end program is constructed, and the front-end program is tested according to the back-end support data, so as to obtain a front-end testing result that characterizes whether the front-end program can implement a front-end function in a target function, so that the application can implement direct testing of the front-end program after the front-end program is developed.
In one implementation, the back-end support data includes at least an objective function that is used to process the front-end program output data to obtain a front-end test result. That is, the data output by the front-end program is processed at least according to the objective function in the back-end support program to obtain whether the front-end program can realize the front-end function of the objective functions. The back-end supporting data may further include a database, so as to implement a test on the front-end program that needs to be supported by the database, for example, when the search box is tested, the database is needed.
In the embodiment of the application, the data output by the front-end program can be processed at least according to the objective function in the back-end support data, so that the front-end test result can be obtained.
In one implementation, step 103, when testing the front-end program, includes the following steps in conjunction with fig. 2:
step 201, test data are acquired.
The test data has a corresponding relation with the functional information, the functional information is acquired based on a target code, and the target code corresponds to a target program. The test data is input by a tester according to the function information, and the test data can comprise data conforming to the front end function, data not conforming to the front end function and null data, and the test data can be 5 numbers, 5 characters, 4 numbers or 4 characters or nothing, for example, by testing an input box for inputting 5 numbers.
Specifically, test data input by a tester may be received through an interface.
Step 202, obtaining display data according to the test data, the front-end program and the objective function.
Specifically, the front-end program may be tested by the test data and the objective function, to obtain the displayed data obtained after the test is completed.
And 203, obtaining a front-end test result according to the function information, the display data and the test data.
That is, it is determined whether the front-end program can satisfy the front-end function among the target functions based on the function information of the target functions, the data output by the front-end program, and the data input to the front-end program.
In the embodiment of the application, the test data is obtained, and then the display data is obtained according to the test data, the front-end program and the objective function, so that the front-end test result can be obtained according to the display data and the test data.
In one implementation, step 202, when obtaining display data, in combination with fig. 3, includes the steps of:
step 301, performing a first process on the test data through a front-end program to obtain front-end output data.
The first process is to output test data, or judge the test data and output corresponding data according to the judging result, for example, the function realized by the front-end program is that 4 numbers can be input, after the test data enter the front-end program, the front-end program judges whether the input test data are 4 numbers and are digital, if the input test data are 4 numbers and are digital, one data are output to the rear end, and if the input test data are not 4 numbers or are not digital, the other data are output to the rear end.
Step 302, performing a second process on the front-end output data through the objective function to obtain back-end processed data.
The second processing may include storage, or may include matching and storage, where the back-end processing data is front-end output data in a case where the second processing includes only storage, and where the back-end processing data includes front-end output data and data matching the front-end output data in a case where the second processing includes matching and storage. For example, the second process may include only storage when testing the input box and storage and matching when testing the search box.
Specifically, in the case where the second processing includes only storage, the objective function may store the front-end output data to obtain back-end processing data; in the case that the second processing includes storing and matching, the objective function may also match the front-end output data in a preset database to obtain data matching the front-end output data, and match the front-end output data
Step 303, outputting the back-end processing data to a target interface corresponding to the front-end program through the front-end program.
For example, when the input box is tested, the front end output data is output to the target interface, and when the search box is tested, the front end output data and the data matched with the front end output data are output to the target interface.
And 304, collecting a display picture of the target interface to obtain display data.
That is, after the front-end program outputs to the target interface, the display screen of the target interface needs to be acquired, so as to obtain the data displayed by the target interface.
In the embodiment of the application, the front-end program is tested at least based on the objective function, so that whether the front-end program can be a front-end function for realizing the objective function or not can be tested when the front-end program performs first processing and outputs the back-end processing data to the objective interface for display.
In one implementation, the front-end test results include a first test result that characterizes the front-end program as being capable of implementing the front-end function of the target functions or a second test result that characterizes the front-end program as being incapable of implementing the front-end function of the target functions. Based on this, when the front-end test result is obtained in step 203, in conjunction with fig. 4, the following steps may be included:
step 401, judging whether the display data and the test data are matched according to the function information, executing step 402 if the display data and the test data are matched, and executing step 403 if the display data and the test data are not matched.
The display data are matched with the test data, the front-end program is characterized in that the front-end program can realize the front-end function in the target functions, the display data are not matched with the test data, and the front-end program is characterized in that the front-end program cannot realize the front-end function in the target functions.
Taking the front-end program as an example, the front-end program can realize the input of 5 numbers, if the input test data is 12345 according to the function information, and the display data is 12345, the test data is characterized to be matched with the display data, and if the display data is 45612, the test data is not matched with the display data; if the input test data is "1234" and the display data is only "1234" according to the functional information, the test data is not matched with the display data, and the display data should output error reporting information while displaying "1234" because the test data does not meet the input conditions, for example, please input 5 numbers; if the input test data is '1234' according to the function information, the display data is '1234' and error reporting information, the characterization test data is matched with the display data.
Step 402, obtaining a first test result.
That is, in the case where the display data matches the test data, a test result characterizing that the front-end program is capable of realizing the front-end function among the target functions is acquired.
Step 403, obtaining a second test result.
That is, in the case where the display data does not match the test data, a test result that characterizes the front-end function of the target functions that the front-end program cannot realize is acquired.
In the embodiment of the application, the first test result is obtained under the condition that the display data is matched with the test data, and the second test result is obtained under the condition that the display data is not matched with the test data, so that whether the front-end program can realize the front-end function in the target functions or not can be obtained according to whether the display data is matched with the test data or not.
In one implementation manner, the application may also be applied to a situation that development of the back-end program is completed, where the back-end program corresponds to front-end support data, where the front-end support data includes an interface program, where the interface program is configured to receive data for testing and output the data for testing to the back-end program, and further is configured to output the data output by the back-end program to a corresponding interface, and obtain a back-end test result according to the displayed data acquired by the output interface and the data for testing input to the interface program.
The process of testing the backend program may include: acquiring the test data of the rear end, inputting the test data of the rear end into an interface program, outputting the test data of the rear end to the rear end program by the interface program, processing the test data of the rear end by the rear end program to obtain rear end output data, sending the rear end output data to the interface program, outputting the rear end output data to a target interface by the interface program, acquiring a display picture of the target interface to obtain display data, and further acquiring a rear end test result according to the display data and the test data of the rear end, namely acquiring a test result representing that the rear end program can realize the rear end function in the target function under the condition that the display data is not matched with the test data of the rear end, and acquiring a test result representing that the rear end program cannot realize the rear end function in the target function under the condition that the display data is not matched with the test data of the rear end.
In the embodiment of the application, the back-end program can be independently tested through the interface program.
In one implementation manner, after the development of the target program is completed, the front-end program may also be tested separately based on the method provided in the present application, and based on this, when the front-end program is acquired in step 101, in conjunction with fig. 5, the method includes the following steps:
step 501, acquiring a target program.
Specifically, the target program may be acquired from the code sharing platform.
Step 502, performing front-end and back-end separation processing on the target program to obtain a front-end program.
The target program comprises a front-end program and a back-end program, and languages written by the front-end program and the back-end program are different, so that front-end and back-end separation processing can be performed on the target program according to a compiling language, and the front-end program is further obtained.
It should be noted that, the embodiment of the present application may also be applied to acquiring a backend program from a target program, so as to implement a test on the backend program separately.
In the embodiment of the application, the front-end program is acquired from the target program to realize the independent test of the front-end program, so that if the front-end program cannot realize the front-end function in the target functions, only the front-end program is required to be modified, and the investigation time of a tester can be reduced.
The program testing device provided in the second embodiment of the present application is described below, and the program testing device described below and the program testing method described above may be referred to correspondingly.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a program testing device according to an embodiment of the present application.
As shown in fig. 6, the apparatus may include:
a program acquisition unit 601, configured to acquire a front-end program;
the data construction unit 602 is configured to construct, for a front-end program, back-end support data, where the back-end support data is associated with the back-end program, and the back-end program and the front-end program form a target program, where the target program is configured to implement a target function;
the testing unit 603 is configured to test the front-end program at least according to the back-end support data, so as to obtain a front-end test result, where the front-end test result characterizes whether the front-end program can implement a front-end function of the target functions.
As can be seen from the above solution, in the program testing device provided in the second embodiment of the present application, the front end program is obtained, and then the back end supporting data corresponding to the front end program is constructed, and the front end program is tested according to the back end supporting data, so as to obtain a front end testing result indicating whether the front end program can implement the front end function in the target function, so that the application can directly test the front end program after the front end program is developed.
In one implementation, the back-end support data includes at least an objective function that is used to process the front-end program output data to obtain a front-end test result.
In one implementation, in conjunction with fig. 7, the test unit 603 further includes the following means:
a test data acquisition unit 701, configured to acquire test data, where the test data is data corresponding to a front-end function of the target functions.
The display data obtaining unit 702 is configured to obtain display data according to the test data, the front-end program, and the objective function.
The test result obtaining unit 703 is configured to obtain a front end test result according to the display data and the test data.
In one implementation, the display data obtaining unit 702 is further configured to perform, through a front-end program, a first process on the test data to obtain front-end output data; performing second processing on the front-end output data through an objective function to obtain back-end processing data; the back-end processing data is output to a target interface corresponding to the front-end program through the front-end program; and acquiring a display picture of the target interface to obtain display data.
In one implementation, the front-end test results include a first test result that characterizes the front-end program as being capable of implementing the front-end function of the target functions or a second test result that characterizes the front-end program as being incapable of implementing the front-end function of the target functions. Based on this, the test result acquisition unit 703 is further configured to determine whether the display data and the test data match; under the condition that the display data and the test data are matched, a first test result is obtained; and obtaining a second test result under the condition that the display data and the test data are not matched.
In one implementation, the back-end program corresponds to front-end support data, the front-end support data includes an interface program, the interface program is used for receiving data for testing, outputting the data for testing to the back-end program, and outputting the data output by the back-end program to a corresponding interface, and obtaining a back-end test result according to the displayed data acquired by the output interface and the data for testing of the input interface program.
In one implementation, the program obtaining unit 601 is further configured to obtain a target program; and performing front-end and back-end separation processing on the target program to obtain a front-end program.
The program testing device provided by the embodiment of the application can be applied to electronic equipment, such as: computer, local server, cloud server, etc. Optionally, fig. 8 shows a block diagram of a hardware structure of an electronic device according to the third embodiment of the present application, and referring to fig. 8, the hardware structure of the electronic device may include: at least one processor 801, at least one communication interface 802, at least one memory 803, and at least one communication bus 804;
in the embodiment of the present application, the number of the processor 801, the communication interface 802, the memory 803, and the communication bus 804 is at least one, and the processor 801, the communication interface 802, and the memory 803 complete communication with each other through the communication bus 804;
The processor 801 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present application, etc.;
the memory 803 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory), etc., such as at least one magnetic disk memory;
wherein the memory stores a program, the processor is operable to invoke the program stored in the memory, the program operable to:
acquiring a front-end program;
for a front-end program, back-end supporting data are built, the back-end supporting data are associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function;
and testing the front-end program at least according to the back-end support data to obtain a front-end test result, wherein the front-end test result characterizes whether the front-end program can realize the front-end function in the target functions.
Alternatively, the refinement function and the extension function of the program may be described with reference to the above.
A fourth embodiment of the present application also provides a storage medium storing a program adapted to be executed by a processor, the program being configured to:
Acquiring a front-end program;
for a front-end program, back-end supporting data are built, the back-end supporting data are associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function;
and testing the front-end program at least according to the back-end support data to obtain a front-end test result, wherein the front-end test result characterizes whether the front-end program can realize the front-end function in the target functions.
Alternatively, the refinement function and the extension function of the program may be described with reference to the above.
Taking the program test of the input box and the search box as an example, in combination with the scheme set forth in the application above, the program test of the input box and the search box is described in detail below.
The traditional project development flow is business-development-testing. Business and development are discussed according to requirements, the requirements are arranged and recorded, test points are extracted through testing, test cases are written for testing, but when testing is conducted, testing can only be conducted on a complete program, and when only front-end program development is completed, the front-end program cannot be independently tested.
After the front-end program is acquired, a front-end testing environment (namely the front-end supporting data in the front) is built for the front-end program, and then the front-end program is tested according to the front-end testing environment to obtain a front-end testing result, so that the front-end program can be independently tested.
In a specific implementation, the front-end test environment may include a basic test environment and basic interface data (i.e., the objective functions mentioned above), and the front-end test environment may also include a basic test environment, a background database, and basic interface data. The basic test environment may include basic compiling software, necessary network environment and basic hardware equipment.
When the front-end program is tested, the front-end program receives test data, performs first processing on the test data to obtain front-end output data, outputs the front-end output data to basic interface data, stores the front-end output data to obtain rear-end processing data, outputs the rear-end processing data to the front-end program, outputs the rear-end processing data to a target interface, performs display picture acquisition on the target interface to obtain display data, and characterizes the front-end program to realize the front-end function in the target function if the display data is matched with the test data, and characterizes the front-end program to not realize the front-end function in the target function if the display data is not matched with the test data.
Taking the target function realized by the input box as an example of inputting 5 numbers, if '1234' is taken as test data and is input to a front-end program, the front-end program receives '1234', outputs '1234' to basic interface data, and the basic interface data judges '1234' not to meet the input condition, error reporting information is obtained, '1234' and the error reporting information are stored and output to the front-end program, the front-end program outputs '1234' and the error reporting information to a target interface, and images of the target interface are acquired to obtain '1234' and the error reporting information.
In the above example, only when the test data is "1234" and the display data is "1234" and the error information is reported, the front-end program can implement the front-end function in the target function, and any error in the middle may cause the display data not to be "1234" and the error information, at this time, the front-end program cannot implement the front-end function in the target function, and modification of the front-end program is required.
Taking the search box as an example that the target function can be realized, searching 5 numbers, if '12345' is taken as test data and is input to a front-end program, the front-end program receives '12345', takes '12345' as front-end output data and outputs the data to basic interface data, the basic interface data takes '12345' as a keyword, matches is carried out in a background database to obtain '12345' matched data, for example, '123456' or '123453', the '12345' and the data matched with '12345' are stored, the '12345' and the data matched with '12345' are sent to the front-end program, and the front-end program outputs '12345' and the data matched with '12345' to a target interface and collects pictures of the target interface to obtain '12345' and the data matched with '12345'.
It should be noted that, in the above example, when the test data is "12345" and the display data is "12345" and the data matched with "12345", the front-end program can implement the front-end function in the target function, and any error in the middle may cause the display data to be not "12345" and the data matched with "12345", for example, when the front-end program transmits to the basic interface data, an error may occur, and at this time, the front-end program cannot implement the front-end function in the target function, and modification of the front-end program is required.
In addition, the application may also implement testing of the back-end program separately, and also needs to construct a back-end testing environment (i.e., the front-end supporting data in the foregoing description), where the back-end testing environment includes a basic testing environment and basic interface elements (i.e., the interface program in the foregoing description), where the basic interface elements may include basic elements such as buttons and a result display interface, for example, the input box may include elements such as an input button, a delete button, a reset button, and an input box, and the search box may include elements such as a delete button, a reset button, a search box, and a result display box.
When the back-end program is tested, test data are input into the basic interface element, the basic interface element transmits the test data to the back-end program, the back-end program carries out corresponding processing on the test data to obtain back-end output data, the back-end output data are transmitted to the basic interface element, the basic interface element outputs the back-end output data to the target interface, and a display picture of the target interface is collected to obtain display data, if the display data are matched with the test data, the back-end program can realize the back-end function in the target function, and if the display data are not matched with the test data, the back-end program cannot realize the back-end function in the target function.
Taking the example that the input box can realize the target function as 4 digits, if the test data is '1234', the basic interface element transmits '1234' to the back-end program, the back-end program stores '1234', outputs '1234' to the basic interface element, the basic interface element outputs '1234' to the target interface, and the target interface is acquired to obtain '1234'.
It should be noted that, the above example is a case where the back-end program can implement the back-end function in the target functions, and when the display data is "1234", the back-end program can implement the back-end function in the target functions, and any error in the middle may cause the display data not to be "1234", and at this time, the back-end program cannot implement the back-end function in the target functions, and modification of the back-end program is required.
Taking the search box as an example for searching 5 numbers, if the test data is "12345", inputting "12345" to a basic interface element, outputting "12345" to a back-end program by the basic interface element, firstly judging whether "12345" meets the input condition or not, then searching the stored data by using "12345" as a keyword by the back-end program, obtaining the data matched with "12345", storing the data matched with "12345" and "12345", outputting the data matched with "12345" to a basic interface element, outputting the back-end output data to a target interface by the basic interface element, and collecting the display picture of the target interface to obtain the data matched with "12345" and "12345".
In the above example, the back-end program is capable of implementing the back-end function of the target function, and when the display data is "12345" and the data matching "12345", the back-end program is only capable of implementing the back-end function of the target function, and any error in the middle may cause the display data to be not "12345" and the data matching "12345", and at this time, the back-end program cannot implement the back-end function of the target function, and modification of the back-end program is required.
Before testing the target program, firstly, service personnel can register an isolated search box and an input box in own needs through a needs registering module, and input own needs detailed information, for example:
input box: bit number limitation, data type limitation, etc
Search box: bit number limits, data type limits, whether fuzzy queries are allowed, query rules, etc.
After the business personnel finishes inputting according to the information, the label setting module generates a label according to the type of the object and the related information, and then the number setting module generates a unique number (namely the target number in the previous text) according to the label information.
After the development has finished the writing of the target program, the target program can be packed and uploaded to the code real-time sharing module, then the function manual generating module can generate a basic function manual according to the target program in the code real-time sharing module, then the target program is divided into a front-end program and a rear-end program according to the program language, after the division is finished, the front-end program is matched with a proper front-end testing environment, the rear-end program is matched with a rear-end testing environment, and after the matching is finished, the service and the testers are allowed to conduct different types of tests through the real-time testing platform.
The program test scheme provided by the application further comprises the following steps: the system comprises a demand registration module, a label setting module, a number setting module, a code real-time sharing module, a real-time test platform, a test environment building module, a front-rear end separation module, a function manual generation module, a corresponding variable setting module and an environment real-time management and control module, wherein the modules are specifically applied as follows:
a demand registration module: the business person may compose project requirements (i.e., the functional information in the foregoing) at the module, such as, for example, input box requirements.
The label setting module: the method is used for matching with a requirement registration module, and corresponding labels can be set for the project requirements after the project requirements are written.
The number setting module: the module cooperates with the requirement registering module and the label setting module to generate a unique number (i.e. the target code in the foregoing) and the item requirement one-to-one correspondence.
Code real-time sharing module: the developer can upload the target program corresponding to the project requirement to the code real-time sharing module for sharing.
And (3) a real-time test platform: in cooperation with the code real-time sharing module, the module provides basic functional tests after the developer submits the corresponding target program.
And (3) building a testing environment: the control logic test system comprises a plurality of basic auxiliary functions, can be matched with a simple control logic test, and is matched with a front-end and back-end separation module, and comprises a front-end test environment and a back-end test environment.
Front-rear end separation module: the target program is divided into a front-end program and a back-end program according to a programming language.
The function manual generation module: the module generates a related code manual after the developer submits the target program, including: function interface, variable, in-parameter type, out-parameter type.
The corresponding variable setting module: the module requires a developer to specify the corresponding interface, and the parameter types when submitting the target program.
And the environment real-time management and control module is as follows: the module can cooperate with a corresponding variable setting module to call different environment databases for different test environments aiming at developing selected information, for example, the search needs data of string type, int type or float type, and the environment real-time management and control module needs to call databases containing data of string type, int type or float type.
Finally, it is further noted that relational terms such as first and second, and the like are 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. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the present specification, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and may be combined according to needs, and the same similar parts may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A program testing method, the method comprising:
acquiring a front-end program;
constructing back-end support data aiming at the front-end program, wherein the back-end support data is associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function;
and testing the front-end program at least according to the back-end supporting data to obtain a front-end test result, wherein the front-end test result represents whether the front-end program can realize the front-end function in the target functions.
2. The method of claim 1, wherein the back-end support data includes at least an objective function for processing the front-end program output data to obtain the front-end test result.
3. The method of claim 2, wherein testing the front-end program based at least on the back-end support data to obtain a front-end test result comprises:
acquiring test data, wherein the test data has a corresponding relation with functional information, the functional information is acquired based on a target code, and the target code corresponds to the target program;
obtaining display data according to the test data, the front-end program and the objective function;
and obtaining a front-end test result according to the function information, the display data and the test data.
4. A method according to claim 3, wherein obtaining display data from the test data, the front-end program and the objective function comprises:
performing first processing on the test data through the front-end program to obtain front-end output data;
performing second processing on the front-end output data through the objective function to obtain back-end processing data;
Outputting the back-end processing data to a target interface corresponding to the front-end program through the front-end program;
and acquiring a display picture of the target interface to obtain display data.
5. A method according to claim 3, wherein the front-end test results comprise a first test result or a second test result, the first test result being indicative of the front-end program being capable of achieving a front-end function of the target functions, the second test result being indicative of the front-end program being incapable of achieving a front-end function of the target functions; and obtaining a front-end test result according to the function information, the display data and the test data, wherein the front-end test result comprises:
judging whether the display data and the test data are matched according to the function information;
under the condition that the display data and the test data are matched, obtaining the first test result;
and under the condition that the display data and the test data are not matched, obtaining the second test result.
6. The method according to claim 1, wherein the back-end program corresponds to front-end support data, the front-end support data includes an interface program, the interface program is configured to receive data for testing and output the data for testing to the back-end program, and is further configured to output the data output by the back-end program to a corresponding interface, and obtain a back-end test result according to the displayed data collected by the output interface and the data for testing input to the interface program.
7. The method of claim 1, wherein acquiring the front-end program comprises:
acquiring a target program;
and performing front-end and back-end separation processing on the target program to obtain a front-end program.
8. A program testing apparatus, comprising:
the program acquisition unit is used for acquiring a front-end program;
the data construction unit is used for constructing back-end support data aiming at the front-end program, wherein the back-end support data is associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function;
and the testing unit is used for testing the front-end program at least according to the back-end supporting data so as to obtain a front-end testing result, wherein the front-end testing result represents whether the front-end program can realize the front-end function in the target functions.
9. An electronic device, comprising: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement: acquiring a front-end program; constructing back-end support data aiming at the front-end program, wherein the back-end support data is associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function; and testing the front-end program at least according to the back-end supporting data to obtain a front-end test result, wherein the front-end test result represents whether the front-end program can realize the front-end function in the target functions.
10. A storage medium having a computer program stored thereon, the computer program, when executed by a processor, being adapted to: acquiring a front-end program; constructing back-end support data aiming at the front-end program, wherein the back-end support data is associated with the back-end program, the back-end program and the front-end program form a target program, and the target program is used for realizing a target function; and testing the front-end program at least according to the back-end supporting data to obtain a front-end test result, wherein the front-end test result represents whether the front-end program can realize the front-end function in the target functions.
CN202310499086.6A 2023-05-05 2023-05-05 Program testing method and device, electronic equipment and storage medium Pending CN116383087A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310499086.6A CN116383087A (en) 2023-05-05 2023-05-05 Program testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310499086.6A CN116383087A (en) 2023-05-05 2023-05-05 Program testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116383087A true CN116383087A (en) 2023-07-04

Family

ID=86967623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310499086.6A Pending CN116383087A (en) 2023-05-05 2023-05-05 Program testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116383087A (en)

Similar Documents

Publication Publication Date Title
CN107861870B (en) Interface test and test data generation method, device, terminal and storage medium
CN110221965B (en) Test case generation method, test case generation device, test case testing method, test case testing device, test equipment and test system
CN111722839B (en) Code generation method and device, electronic equipment and storage medium
US8799869B2 (en) System for ensuring comprehensiveness of requirements testing of software applications
CN111767057B (en) Data processing method and device
CN110347644A (en) A kind of with no paper inspection and detection system and its operating method
US20070180326A1 (en) Software test method and software test apparatus
CN110083814A (en) A kind of report form generation method and device, computer readable storage medium
CN112417002B (en) Information literacy data mining method and system applied to education informatization
CN109446065A (en) User tag test method, device, computer equipment and storage medium
CN113590102A (en) Zero-code rapid software development method, system, medium and equipment
CN106201864A (en) A kind of application programming interface API method of testing, device and mobile device
US20210286782A1 (en) Data complementing system and data complementing method
KR102243794B1 (en) Data integration device and data integration method
CN114594927A (en) Low code development method, device, system, server and storage medium
CN109492036A (en) A kind of electronization test report system
CN116383087A (en) Program testing method and device, electronic equipment and storage medium
CN111913880A (en) Application software testing method and device
CN111210328A (en) Voucher generation method and device, storage medium and electronic equipment
Richter et al. HeidelPlace: An extensible framework for geoparsing
CN109597828A (en) A kind of off-line data checking method, device and server
WO2014073581A1 (en) Assessment device, assessment system, assessment method, and computer-readable storage medium
CN113377885B (en) Data supplementing system and data supplementing method
JP7344521B1 (en) Program, method, information processing device, and system
JP6833235B1 (en) Information processing system and information processing method

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