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

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

Info

Publication number
CN114090419A
CN114090419A CN202011406306.9A CN202011406306A CN114090419A CN 114090419 A CN114090419 A CN 114090419A CN 202011406306 A CN202011406306 A CN 202011406306A CN 114090419 A CN114090419 A CN 114090419A
Authority
CN
China
Prior art keywords
test
information
program
execution
data
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
CN202011406306.9A
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.)
Beijing Jingdong Shangke Information Technology Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Shangke Information Technology Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Shangke Information Technology Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Shangke Information Technology Co Ltd
Priority to CN202011406306.9A priority Critical patent/CN114090419A/en
Publication of CN114090419A publication Critical patent/CN114090419A/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
    • 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/3692Test management for test results analysis

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)

Abstract

The invention discloses a program testing method, a system, a device, an electronic device and a readable storage medium. The method comprises the following steps: receiving an execution file and external interface information of at least one program to be tested, wherein the external interface information is interface information corresponding to the program to be tested; and configuring an information interface according to the external interface information corresponding to the execution file, and performing execution test according to the preset test data and the flow logic relation by corresponding to the execution file and the information interface to obtain a test result. Through the configuration of the information interface, the process logic relationship and the test data, the simultaneous and efficient test of different programs to be tested is realized, so that the technical problem that the prior art cannot efficiently test different types of test programs is solved.

Description

Program testing method, system, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computers, and in particular, to a program testing method and apparatus, an electronic device, and a storage medium.
Background
Currently, the prior art adopts a mode of individually testing each program for program testing. The program test needs to be performed independently, and because each program has different data interface configurations and different test environments and scenarios, it is difficult to perform automatic batch test. It is clear that testing each program individually is inefficient.
Therefore, a program testing method is urgently needed, which can perform batch testing on a large number of different types of test programs, and is helpful for solving the technical problem that the prior art cannot perform efficient testing on different types of test programs.
Disclosure of Invention
The application provides a program testing method, which aims to realize the simultaneous and efficient testing of different programs to be tested through the configuration of information interfaces and flow logic relations so as to help solve the technical problem that the prior art cannot perform batch and efficient testing on different types of test programs.
The method comprises the following steps:
receiving an execution file and external interface information of at least one program to be tested, wherein the external interface information is interface information corresponding to the program to be tested;
configuring an information interface according to the external interface information corresponding to the execution file, wherein the information interface is a data interface provided for the outside and/or a required data interface;
and performing execution test corresponding to the execution file according to the pre-configured test data and the flow logic relation to obtain a test result.
In another optional embodiment, after the step of receiving the execution file and the external interface information of the at least one program under test, where the external interface information is interface information of test data corresponding to the program under test, the method further includes:
and respectively and independently storing the execution file and the external interface information of each program to be tested in a preset database so as to respectively execute the subsequent steps.
In another optional embodiment, before the step of obtaining the test result by performing the execution test corresponding to the execution file and the information interface according to the preconfigured test data and the flow logic relationship, the method further includes:
and editing and/or sharing and/or grouping and/or checking and/or parameterizing and/or referring the flow logic relation between the test data and the execution file according to a preset configuration mode.
In another optional embodiment, the obtaining of the test result by performing the execution test corresponding to the execution file and the information interface according to the preconfigured test data and the flow logic relationship includes:
and starting the execution test corresponding to the execution file in a user operation or automatic test mode according to the test data and the flow logic relation to obtain a test result.
In another optional embodiment, after the step of obtaining the test result by performing the execution test corresponding to the execution file according to the test data and the flow logic relationship, the method further includes:
comparing the test result with a preset expected result to obtain a comparison result, wherein the test result comprises the test data and an operation test result of the flow logic relationship;
and verifying the program to be tested and/or the test data and/or the flow logic relation according to the comparison result.
The application also provides a program testing system, which also comprises a testing platform, a testing data source, a configuration module and a testing result display module;
the test platform is used for receiving an execution file and external interface information of at least one program to be tested, wherein the external interface information is interface information corresponding to the program to be tested;
the configuration module is configured to configure an information interface according to the external interface information corresponding to the execution file, where the information interface is a data interface provided to the outside and/or a required data interface;
and the test platform is used for executing a test according to the preset test data and the flow logic relation and corresponding to the execution file and the information interface to obtain a test result.
And the test result display module is used for inquiring and/or displaying the test result and/or outputting a test result report.
The application also provides a program testing system, which comprises a database;
the test platform is further configured to store the execution file and the external interface information of each program to be tested in a preset database independently, so as to perform subsequent steps respectively.
There is also provided in the present application a program testing apparatus, the apparatus comprising:
the system comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for executing files and external interface information of at least one program to be tested, and the external interface information is interface information corresponding to the program to be tested;
the configuration module is used for configuring an information interface according to the external interface information corresponding to the execution file, wherein the information interface is a data interface provided for the outside and/or a required data interface;
the execution module is used for executing a test through the corresponding execution file and the information interface according to the preset test data and the flow logic relation to obtain a test result;
and the test result display module is used for inquiring and/or displaying the test result and/or outputting a test result report. .
The present application further provides an electronic device, which includes: a processor and a memory;
the memory has stored therein an application program executable by the processor for causing the processor to perform the steps of the program test method as described.
The present application also provides a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the program testing method.
As can be seen from the above, based on the above embodiments, the present application implements simultaneous and efficient testing of different programs to be tested by configuring the information interface and the flow logic relationship, so as to help solve the technical problem that the prior art cannot perform batch testing on different types of test programs.
Drawings
FIG. 1 is a flowchart illustrating a program testing method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a data structure of a test platform in the program test system according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a data structure of an execution file in a program test system when testing with test data via a process logic relationship according to an embodiment of the present invention;
FIG. 4 is a block diagram of a program testing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The inventor finds that the information system faces the problems of large program testing workload, low testing coverage, high testing work repeatability, low manual testing efficiency and the like in daily operation, maintenance, upgrading and modification, the program testing workload is very large, but different programs have different testing data requirements and logic relations because each program test faces different application scenes, and therefore different types of test programs cannot perform batch program tests and need to perform independent tests. For example, the first program test is a financial interactive program, the second program test is a logistic interactive program, and obviously, the test data and the flow logic relationship in the program execution process of the first program test and the second program test are different, so that the batch automation efficient test cannot be realized at all, and the test personnel needs to configure according to different data sources and flow logic relationships. Therefore, a program testing method is urgently needed, so that a large number of programs can be efficiently tested in batch and simultaneously, and the technical problem that a plurality of programs cannot be efficiently and automatically tested in the prior art is solved.
Fig. 1 is a schematic flow chart of a program testing method according to an embodiment of the present invention, fig. 2 is a schematic data structure diagram of a testing platform in a program testing system according to an embodiment of the present invention, and fig. 3 is a schematic data structure diagram of an execution file in the program testing system according to an embodiment of the present invention when testing is performed with a test data through a flow logic relationship. As shown in fig. 1 and 2, and fig. 3, in one embodiment, a program testing method is provided, the method comprising:
s101, receiving an execution file and external interface information of at least one program to be tested, wherein the external interface information is the interface information of the program to be tested;
in this step, a specific step of receiving the execution file and the external interface information is provided. In this step, at least one item of the program to be tested needs to be received, and for each item of the program to be tested, the program to be tested has the corresponding execution file and the external interface information, and the execution file may adopt a war package or an exe file or provide a packaging command. In addition to the execution file, the external interface information needs to be received, where the external interface information is interface information of test data corresponding to the program to be tested, for example, in a financial system, a user needs to transfer 100 yuan from bank a to bank B, so that bank a must configure a data transfer interface for data interaction of transfer information, and the data transfer interface can be understood as an interface to be described by the external interface information. .
And S102, configuring an information interface according to the external interface information corresponding to the execution file, wherein the information interface is a data interface provided for the outside and/or a required data interface.
In this step, a specific implementation of establishing an information interface according to the external interface information is provided. The information interface is used for providing data for an external system, or the external system feeds back data, and interaction is also required to be carried out through the information interface.
And S103, executing the test through the corresponding execution file and the information interface according to the preset test data and the flow logic relation to obtain a test result.
In this step, a specific step of testing the result of the test is provided. It should be noted that, since the corresponding external system data is obtained from the information interface in the previous step and the test data and the flow logic relationship are obtained by configuration, the execution test can be performed through the execution file according to the test data and the flow logic relationship, and the test result is finally obtained. It is noted that the test data comprises internal reference data and/or external reference data.
In this embodiment, a specific implementation of a program testing method is provided. Firstly, receiving an execution file and external interface information of at least one program to be tested, wherein the external interface information is the interface information of the program to be tested. The external interface information includes: the interface Service type comprises an interface class name, a method name, interface parameter number and types, an interface parameter output type, an interface Service type (three types including a Service interface, an external interface and a result output interface), an interface technology type (Http, RPC, Restful Service, a Web Service interface and the like), an interface description and test data (comprising parameter test data and parameter test data), a type support basic type and an object type, and the parameter test data uses a JSON format. (JSON (JavaScript Object Notation) is a lightweight data exchange format.) the external interface information import function realizes the import function of the interface class, identifies the interface method, access reference and other information in the interface class file, generates the external interface information, supports batch import and realizes the quick establishment of the information system to-be-tested environment.
And then, configuring an information interface according to the external interface information corresponding to the execution file, wherein the information interface is a data interface provided for the outside and/or a required data interface. And finally, performing execution test through the corresponding execution file and the information interface according to the preset test data and the flow logic relation to obtain a test result. In this embodiment, the external interface information of the program to be tested is acquired, the information interface is established by the external interface information, data is provided or acquired from the external system, and a final test is realized by the test data and the process logic relationship which are pre-configured by a tester or automatically. The technical problem that a plurality of programs cannot be efficiently and automatically tested in the prior art is solved. In addition, it should be noted that the test data and the flow logic relationship may be designed and configured in a use case manner.
Fig. 2 and fig. 3 show a specific manner how to perform data operation in the manner of this embodiment, taking the program to be tested of one payment type as an example. The information interface is used for providing the payment amount in the amount data of the external bank system and acquiring the feedback data information, and the process logic relation 1 and the test data 1 can be understood as a use case.
In another embodiment, after the step of receiving the execution file and the external interface information of the at least one program under test, where the external interface information is interface information of test data corresponding to the program under test, the method further includes:
and respectively and independently storing the execution file and the external interface information of each program to be tested in a preset database so as to respectively execute the subsequent steps.
In this embodiment, different programs to be tested are independently stored in the database, so that interference between different programs to be tested is avoided, and a plurality of programs to be tested are tested in parallel.
In another embodiment, the configuring the flow logic relationship between the test data and the execution file according to the predetermined configuration mode is editing and/or sharing and/or grouping and/or checking and/or parameterizing and/or referencing the flow logic relationship between the test data and the execution file according to the predetermined configuration mode.
In this embodiment, a specific configuration manner for the flow logic relationship is provided. Taking a case mode to configure the flow logic relationship and the test data as an example, the case describes the relationship between the test data and the execution file with different entries, the specific configuration party is not limited to editing, that is, the entries are increased or decreased, or the edited flow logic relationship is shared, so that the test efficiency of the program to be tested with the same flow logic relationship can be improved, the repeated editing of the flow logic relationship is avoided, after different programs to be tested are tested continuously, a large number of configured flow logic relationships can be left, and the left flow logic relationships can be grouped, for example, belong to finance, logistics or other categories. In addition, the process logic relationships may be examined or parameterized. It should be noted that the entry may be updated to all subsequent tests of the program under test using the entry after the entry is edited and modified.
In another embodiment, the obtaining of the test result by performing the execution test corresponding to the execution file and the information interface according to the preconfigured test data and the flow logic relationship includes:
and starting the execution test corresponding to the execution file in a user operation or automatic test mode according to the test data and the flow logic relation to obtain a test result. .
The embodiment provides a specific implementation manner for executing the execution file in different starting manners. If the method is in an automatic mode, the method automatically initiates execution: and according to the configuration information of the information system, if the Corn expression which needs to be automatically operated and is automatically operated is configured, automatically initiating the execution of all cases to be tested according to the timing rule of the Corn expression. If the method is a user operation mode, the execution is initiated manually, namely, an entry for initiating the test execution by the user is provided on the case execution management page, the cases to be tested (the shared cases can not be executed) can be screened according to the belonging information system and the test grouping (can be empty), then all or part of the cases to be tested are selected to initiate the execution, and the cases to be tested can be directly initiated to execute according to the belonging information system and the test grouping (can be empty). Or after the manual starting test is successful and stable, starting a timing automatic test function, for example, setting the development submission code and then carrying out the automatic test 12 points per night, and the automatic test result of the previous night can be seen in the morning and on duty.
In another embodiment, after the step of obtaining the test result by performing the execution test corresponding to the execution file according to the test data and the flow logic relationship, the method further includes:
s201, comparing the test result with a preset expected result to obtain a comparison result, wherein the test result comprises the test data and the operation test result of the flow logic relationship.
The specific steps for comparing the test results are provided in this step.
S202, checking and/or inquiring the program to be tested and/or the test data and/or the flow logic relation according to the comparison result.
In this step, it is provided that the program to be tested and the use case (i.e. the test data and/or the flow logic relationship) are verified through the comparison result, and the next processing is performed after the verification and the query.
In this example, a specific embodiment of comparing the test results is provided. The essence of this is to manage the test results, and the specific management manner will be further described later, which is not described herein again.
In another embodiment, the present application further provides a program testing system, which includes a testing platform, a testing data source, and a configuration device;
the test platform is used for receiving an execution file and external interface information of at least one program to be tested, wherein the external interface information is interface information of test data corresponding to the program to be tested;
the configuration module is configured to configure an information interface according to the external interface information corresponding to the execution file, where the information interface is a data interface provided to the outside and/or a required data interface;
the test platform is used for carrying out execution tests through the corresponding execution files and the information interfaces according to the test data and the flow logic relationship which are configured in advance to obtain test results;
and the test result display module is used for inquiring and/or displaying the test result and/or outputting a test result report.
After configuring the test data and the flow logic relationship in a case manner, the system and the workflow manner of the present application are further described in detail below, where the test platform includes four directions, system interface management, case design, test execution, and test report management. The system interface management is responsible for collecting and managing the basic information of the test platform, importing and managing the external interface information and maintaining the test data; the use case design is equivalent to the design of the flow logic relationship, and the functions of the use case design mainly comprise: the method comprises the following steps of test case basic information management, maintenance, reference, sharing and verification management of case item data, case test expected result management, case grouping management and parameter management; the test execution module is responsible for initiating the execution file by the test case, executing the execution file process and executing the recorded information management; the management of the test result specifically includes: and managing the test result, and inquiring the test case execution result and the case execution detail. Finally, the application of the automated testing method and system is illustrated by using a process description.
The system is realized as an independent component, can be independently deployed and operated, and stores the relevant data of the test case to the database. For example, a runnable war package in the Java language, or an exe executable in the C # language. The system provides a test user operation interface for managing and executing the test cases, provides a database table structure for storing the test cases and the operation result data thereof, and provides a background automatic test service for realizing the automatic test of the information system based on the external interface.
The system supports a plurality of programs to be tested to be automatically tested on line simultaneously, and test cases and operation result data of the programs to be tested are respectively isolated and stored. The system design is imported to realize the construction of an information system to-be-tested environment (namely the configuration of the external interface and the flow logic relation), the test cases are quickly constructed through the functions of reference, verification and the like of the test data of the external interface and the cases, the test cases are quickly updated after the information system is upgraded through the sharing of test case items, the coverage of the test cases is increased through the parameterized management of the test case item data, the test cases are quickly executed by starting a program to be tested in a Mock mode, the test results are verified through the defined case test expectation, and the complete content of the test report is displayed through the test case execution results and the detail information thereof.
Management of the external interface
The management of the external interface of the system is responsible for the management of a program to be tested and the management of the information of the external interface, and receives the relevant execution file of the program to be tested, wherein the execution file has test configuration information and environment information.
Managing the program to be tested: the basic information management of the program to be tested is realized, the relevant test configuration information and the environment information are collected, the execution file of the program to be tested is mainly provided, and the addition, deletion, modification and check can be carried out. The test configuration information and the environment information include: the method comprises the following steps of testing the name of a program to be tested, the code (unique identifier) of the program to be tested, a responsible person of the program to be tested, the brief introduction of the program to be tested, the execution file, the type of the execution file and the like, wherein the test configuration information comprises the following steps: source code address, packed command, whether to autorun, autorun Corn expression, and whether to pre-run packing, etc.
External interface management: and managing all the external interface information of each program to be tested. Besides the basic functions of adding, deleting, modifying and checking the external interface information, the functions of importing the external interface information, managing the external interface test data, copying the external interface information and the like are added. The external interface test data management function realizes the online maintenance and file import of each interface test data, and the interface test data is used for supporting the reference function of the test case. The external interface information copying function realizes the rapid construction of the similar external interface and supports the interface copying of the cross-information system.
Design of use case (i.e. logical relationship of flow)
The case design realizes the quick construction and quick update of the test case, and realizes the functions of reference, sharing, inspection, grouping, parameterization and the like of the test case. The method specifically comprises function modules such as use case information management, use case item data management, use case test expectation management, use case grouping management, parameter management and the like.
And (3) case information management: the basic information of the test case is added, deleted, checked and maintained, and the basic information of the case comprises information such as case numbers, case names, case descriptions, belonging information systems, case types (shared cases and cases to be tested), case groups, case entry position external interfaces and the like. Meanwhile, the function of sharing the case information is realized, the existing shared case can be directly shared when a new case is added, all the case entry data are mainly shared, and the case basic information and the case test expected data are copied and can be independently modified.
And (3) managing the use case entry data: the functions of increasing, deleting, modifying, checking and parameterizing all relevant external interface input and output data information under the test case and the functions of reference, sharing, checking and parameterization of case entry data are realized. The input and output data of each relevant external interface form test case entry data, and each test case comprises a plurality of entry data. Each test case comprises a case entrance position external interface and a plurality of service interfaces depending on external systems. When the use case item information is newly added or modified, the external interface test data can be referred, the reference of the item data from other test cases is also supported (the item data is copied into the test case and used as new use case item data), and meanwhile, the sharing of part of use case items in the existing sharing use case is supported (after the sharing, if the original item data in the sharing use case is modified, the item data in the use case always keeps the latest data). And when the JSON data is input and output by the interface is modified, an online checking function is provided, and the legality of the value is checked by using the interface input and output parameter definition. The interface input output JSON data supports parameter variables (alphanumeric underlined combinations beginning with $) whose parameter values are maintained in the parameter management function.
Case test expectation management: and the verification information collection of result data expected to be output by the test case is realized, and the verification information collection is mainly the check-in data and the check-out data of the result output interface. A test case may have multiple results output (e.g., to a database, to an external file, to a message queue, and to an external system) that is primarily checked for these results output external interface calls. And the check rule expression of each entry of the external interface is output by the entry check data, namely the collection result, and is used for checking whether the execution result after the test case is executed is correct or not, and the entry check data is in a JSON format. The parameter output data is the same as the parameter output data in the use case entry data, and the format is also JSON, so that the parameter output data can meet the expected result of the information system.
And (3) test grouping management: the test cases are grouped, and generally, a service scene can be used as a grouping name. The functional module is responsible for the increase, deletion, modification, check and maintenance of test grouping information, and the test grouping information comprises the following components: packet name, packet code, packet description, and belonging information system.
Parameter management: the method realizes the addition, deletion, modification and check maintenance of the parameter variable values in the test case entry data, and the maintained information comprises the following steps: parameter variables, parameter values and the associated information systems. The parameter values are shared by all test cases in the corresponding program to be tested, and if parameter values in the test case entry data are different, different parameter variables are required to be used.
Test execution
The test execution realizes the manual execution and the automatic execution of the test case of the information system, realizes the recording of each execution information, and mainly comprises two functional modules of case execution management and execution record management.
And (3) case execution management: the manual initiation execution, the automatic initiation execution and the execution of the case to be tested of the information system test case are realized. Automatically initiating execution: and according to the configuration information of the information system, if the Corn expression which needs to be automatically operated and is automatically operated is configured, automatically initiating the execution of all cases to be tested according to the timing rule of the Corn expression. The method comprises the steps of manually initiating execution, providing an entrance for a user to initiate test execution on a case execution management page, screening cases to be tested (shared cases cannot be executed) according to a belonging information system and a test group (can be empty), then selecting all or part of cases to be tested to initiate execution, and directly initiating the cases to be tested to execute according to the belonging information system and the test group (can be empty).
Executing the case to be tested: and carrying out test execution according to the to-be-tested case initiating execution, recording case execution information and generating a test report. Firstly, checking an executable file according to configuration information of an information system, if a source code address is configured and the executable file needs to be packed before operation, pulling a source code, executing a packing command to carry out information system compiling and packing to generate an executable war pack or exe file; secondly, a Mock mode (the Mock mode is a test simulation mode, a simulation environment is used for starting an information system to be tested, external interface calls involved in the running of the system are all called from the simulation environment instead of calling a real external system, so that test case entry data (namely the external interface Mock data) can be used for driving the execution of the test, and an expected case execution result is obtained) is used for starting a program to be tested to run a file; sequentially triggering the cases to be tested to be executed in a Mock mode according to the case list to be tested when the test is initiated, replacing parameter variables in case entry data with parameter values, inputting the case entry data as Mock data to an external interface of the case execution process to be tested for calling, using the expected test data of the cases to be tested to check the execution result of the cases to be tested, and determining that the cases to be tested are executed if all expected results of the cases to be tested are verified to be passed, otherwise, determining that the cases to be tested are not executed; and finally, sending the execution result information of all the cases to be tested to a test report management function module to generate a test report. The specific method of Mock can be seen in Easymock, Powermock and other frameworks.
Performing record management: and realizing the recording and query management of the use case execution information. The execution (whether manually or automatically initiated) of the case to be tested is recorded each time, and the recorded information comprises: the method comprises the steps of a program to be tested, a starting mode (manual or automatic), a test group (can be empty), test execution initiation time, the number of cases to be tested, a case number list to be tested, compiling and packaging, whether the test is normally operated or not, test execution completion time, test operation failure reasons, the number of cases passed by the test and the number of cases failed by the test. When the test operation fails, a test report can not be generated, the failure reason is recorded, and the problem needs to be manually checked.
Test report management (i.e. the test result management)
And the test report management realizes the generation and query management of the test report. The method mainly comprises the following steps: and the functional modules comprise an execution report management module, a use case execution result query module, a use case execution detail query module and the like.
Performing report management: and generating a test report according to the execution result information sent by the test case execution, and providing query functions of all test reports (querying according to test execution initiation time, to-be-tested programs, test groups and the like). The test report comprises test report summary information, case execution result information and case execution detail information. The test report summary information includes: the method comprises the following steps of (1) testing a program to be tested, a test group (which can be empty), the number of cases to be tested, a list of case names to be tested, test execution initiation time, test execution completion time, the number of cases passing the test, the number of cases failing the test, the percentage of cases passing the test and the like; the case execution result information includes execution result information of each case to be tested in one test execution, and specifically includes: test case number, test case name, test execution time, and case execution result (pass or fail); the case execution detail information includes: and each use case in each use case tests whether an expected check result (check is passed or not passed) and an external interface corresponding to each use case entry are called or not and whether the external interface is called according to the access data or not.
And (3) case execution result query: and realizing the query of the case execution result information. The method is an extension of the content of a case execution report, firstly, a case test report is inquired from the report execution management, summary report information is browsed, and then, the inquiry is carried out in a drilling mode until the execution result information of all test cases corresponding to the test execution.
And using case execution detail query: and realizing the query of the case execution detail information. The method is an extension of the execution result information of the use cases, and the detailed information of the execution of the use cases can be inquired by continuously drilling from the execution result information of each use case. When the test case does not pass the operation, the problem of the program to be tested can be positioned by inquiring the external interface calling condition and the case test expected verification condition in the case detail information.
Description of the application
Firstly, packaging the program to be tested into an executable war package or exe file or providing a packaging command, inputting basic information and configuration information of the program to be tested into the system, and then importing all external interface files (such as Java interface files) of the program to be tested into the system to form external interface information, wherein test data can be given out in the interface files through annotations of interfaces, and can also be input online or imported into the patent system through independent test data files; secondly, sharing cases are constructed on line by using interface test data, cases to be tested are constructed quickly by using the sharing cases, the test cases are constructed quickly by fully utilizing the functions of reference, sharing, verification, grouping, parameterization and the like, and fine management of case test expected verification is well done; then configuring parameter values, selecting the case groups to be tested or all cases and submitting the cases to test execution to generate a test report; and finally, checking the test execution report and the detailed result thereof, wherein the test is completed when all the use cases pass, and the further processing is performed when the use cases fail. When the information system is upgraded and modified, the test case is adjusted according to the requirements of change and new increase and in combination with the detailed design condition of the program to be tested. Aiming at the shared use cases, the test cases are modified at one place, and all the test cases sharing the shared use cases are automatically updated; when a specific case group is influenced by requirement updating, inquiring the test case of the group, and intensively updating the case; the parameter value can be directly modified by using case updating through parameter value modification. After the use case is updated rapidly, regression testing can be performed after the program to be tested is upgraded and developed. When a new test case needs to be added to a new demand, the new test case is built quickly by utilizing the functions of reference, sharing, verification, grouping, parameterization and the like, and the automatic test of the new demand function is realized.
The system needs the tested information system to provide an executable war packet or exe file, or provide a packaging command capable of compiling and packaging a source code address of the executable file, and regularly execute compiling and packaging, regularly run test cases and generate an automatic test report through system configuration.
And (3) formulating a standardized service development standard, and starting from a system interface management part, a case design part, a test execution part and a test report management part under the guidance of a related standard convention to respectively realize landing.
In another optional embodiment, the system further comprises a database;
the test platform is further configured to store the execution file and the external interface information of each program to be tested in a preset database independently, so as to perform subsequent steps respectively.
FIG. 4 is a block diagram of a program testing apparatus according to an embodiment of the present invention. In another alternative embodiment, as shown in fig. 4, the present application provides a program test device comprising:
a receiving module 101, configured to receive an execution file and external interface information of at least one program to be tested, where the external interface information is interface information of the program to be tested;
a configuration module 102, configured to configure an information interface according to the external interface information corresponding to the execution file, where the information interface is used for data interaction in a test process; configuring the flow logic relation between the test data and the execution file through a preset configuration mode according to the information interface;
the execution module 103 is configured to perform an execution test on the execution file according to the test data and the flow logic relationship to obtain a test result;
and the test result display module 104 is configured to query the test result and/or display and/or output a test result report.
In another alternative embodiment, the present application further provides an electronic device comprising: a processor and a memory;
the memory has stored therein an application program executable by the processor for causing the processor to perform the steps of the program test method as described.
In a further alternative embodiment, a computer-readable storage medium, on which a computer program is stored, is characterized in that the program realizes the steps of the program testing method described when executed by a processor.
In addition, the method steps described in this application may be implemented by hardware, for example, logic gates, switches, Application Specific Integrated Circuits (ASICs), programmable logic controllers, embedded microcontrollers, and the like, in addition to data processing programs. Such hardware capable of implementing the methods described herein may also constitute the present application.
The flowchart and block diagrams in the figures of the present application illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments disclosed herein. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not explicitly recited in the present application. In particular, the features recited in the various embodiments and/or claims of the present application may be combined and/or coupled in various ways, all of which fall within the scope of the present disclosure, without departing from the spirit and teachings of the present application.
The principles and embodiments of the present invention are explained herein using specific examples, which are provided only to help understanding the method and the core idea of the present invention, and are not intended to limit the present application. It will be appreciated by those skilled in the art that changes may be made in this embodiment and its broader aspects and without departing from the principles, spirit and scope of the invention, and that all such modifications, equivalents, improvements and equivalents as may be included within the scope of the invention are intended to be protected by the claims.
In practical applications, the computer readable medium may be included in the apparatus/device/system described in the above embodiments, or may exist alone without being assembled into the apparatus/device/system. The computer readable storage medium carries one or more programs which, when executed, implement the described data sorting apparatus to perform a data sorting method.
According to embodiments disclosed herein, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example and without limitation: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing, without limiting the scope of the present disclosure. In the embodiments disclosed herein, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

Claims (10)

1. A program testing method, comprising:
receiving an execution file and external interface information of at least one program to be tested, wherein the external interface information is interface information corresponding to the program to be tested;
configuring an information interface according to the external interface information corresponding to the execution file, wherein the information interface is a data interface for providing data to the outside and/or a data interface for acquiring required external data;
and performing execution test through the corresponding execution file and the information interface according to the preset test data and the flow logic relation to obtain a test result.
2. The program testing method according to claim 1, wherein after the step of receiving the execution file and the external interface information of the at least one program under test, the method further comprises:
and respectively and independently storing the execution file and the external interface information of each program to be tested in a preset database so as to respectively execute the subsequent steps.
3. The program testing method according to claim 1 or 2, wherein before the step of obtaining the test result by performing the execution test corresponding to the execution file and the information interface according to the pre-configured test data and the flow logic relationship, the method further comprises:
and editing and/or sharing and/or grouping and/or checking and/or parameterizing and/or referring the flow logic relation between the test data and the execution file according to a preset configuration mode.
4. The program testing method according to claim 1, wherein the obtaining of the test result by performing the execution test corresponding to the execution file and the information interface according to the pre-configured test data and the flow logic relationship comprises:
and starting the execution test corresponding to the execution file in a user operation or automatic test mode according to the test data and the flow logic relation to obtain a test result.
5. The program testing method according to claim 4, wherein after the step of obtaining the test result by performing the execution test corresponding to the execution file according to the test data and the flow logic relationship, the method further comprises:
comparing the test result with a preset expected result to obtain a comparison result, wherein the test result comprises the test data and an operation test result of the flow logic relationship;
and checking and/or inquiring the program to be tested and/or the test data and/or the flow logic relation according to the comparison result.
6. A program test system is characterized in that the system comprises a test platform, a test data source, a configuration device and a test result display module;
the test platform is used for receiving an execution file and external interface information of at least one program to be tested, wherein the external interface information is interface information corresponding to the program to be tested;
the configuration module is configured to configure an information interface according to the external interface information corresponding to the execution file, where the information interface is a data interface provided to the outside and/or a required data interface;
the test platform is used for carrying out execution tests through the corresponding execution files and the information interfaces according to the test data and the flow logic relationship which are configured in advance to obtain test results;
and the test result display module is used for inquiring and/or displaying the test result and/or outputting a test result report.
7. The program test system of claim 6, wherein the system further comprises a database;
the test platform is further configured to store the execution file and the external interface information of each program to be tested in a preset database independently, so as to perform subsequent steps respectively.
8. A program testing apparatus, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for executing files and external interface information of at least one program to be tested, and the external interface information is interface information of test data corresponding to the program to be tested;
the configuration module is used for configuring an information interface according to the external interface information corresponding to the execution file, wherein the information interface is a data interface provided for the outside and/or a required data interface;
the execution module is used for executing a test through the corresponding execution file and the information interface according to the preset test data and the flow logic relation to obtain a test result;
and the test result display module is used for inquiring and/or displaying the test result and/or outputting a test result report.
9. An electronic device, characterized in that the electronic device comprises: a processor and a memory;
the memory has stored therein an application program executable by the processor for causing the processor to perform the steps of the program testing method according to any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the steps of the program testing method of any one of claims 1 to 5.
CN202011406306.9A 2020-12-03 2020-12-03 Program testing method, system, device, electronic equipment and storage medium Pending CN114090419A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011406306.9A CN114090419A (en) 2020-12-03 2020-12-03 Program testing method, system, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011406306.9A CN114090419A (en) 2020-12-03 2020-12-03 Program testing method, system, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114090419A true CN114090419A (en) 2022-02-25

Family

ID=80295900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011406306.9A Pending CN114090419A (en) 2020-12-03 2020-12-03 Program testing method, system, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114090419A (en)

Similar Documents

Publication Publication Date Title
CN107273286B (en) Scene automatic test platform and method for task application
CN108287694B (en) Application program construction method, system, computer device and storage medium
US10572249B2 (en) Software kit release management
US11733975B1 (en) System and method for migrating legacy software to a system common architecture
JP2020510925A (en) Method and apparatus for performing a test using a test case
CN108845940B (en) Enterprise-level information system automatic function testing method and system
EP2133795A1 (en) System and method for testing a software product
CN111158674A (en) Component management method, system, device and storage medium
US20050137839A1 (en) Methods, apparatus and programs for system development
CN113127347A (en) Interface testing method, device, equipment and readable storage medium
CN113434158A (en) User-defined management method, device, equipment and medium for big data component
CN114637511A (en) Code testing system, method, device, electronic equipment and readable storage medium
CN111881042A (en) Automatic test script generation method and device and electronic equipment
EP2913757A1 (en) Method, system, and computer software product for test automation
KR20090099977A (en) A reserved component container based software development method and apparatus
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
CN114090419A (en) Program testing method, system, device, electronic equipment and storage medium
CN115827051A (en) Software integration management system, method and server
CN114756224A (en) Activity execution method and device
CN114936152A (en) Application testing method and device
CN113504904A (en) User-defined function implementation method and device, computer equipment and storage medium
US20100251246A1 (en) System and Method for Generating Job Schedules
CN117573564B (en) Method for automatically identifying differences based on gitlab code submitted log
CN112950138B (en) Collaborative development state management method, device and server
US20230168656A1 (en) Automatically assigning natural language labels to non-conforming behavior of processes

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