Disclosure of Invention
Aiming at the fact that no analysis tool exists in the market at present, the invention aims to provide a method and a system for automatically distributing projects, automatically configuring project information and automatically calling a testing tool to conduct testing analysis.
Specifically, the invention provides a method for automatically configuring and calling a testing tool to carry out test analysis, which is applied to an automatic testing system, wherein the system comprises a control center server and a testing machine connected with the control center server through a communication network, and is characterized by comprising the following steps:
s1) a control center server configures tested item information:
different project information parameters are configured according to different test projects, wherein the project information parameters comprise project types, development environments, development languages, rules to be used, environment variables to be called, test report formats and header file configuration paths;
s2) the control center server activates the test tool:
creating a dynamic link library DLL document when developing a test tool; when loading the testing tool, writing the route of the DLL document of the testing tool into a registration database of the control center server; the control center server providing the test tool to the tester via the network;
s3) configuring a test environment by the tester:
starting a testing machine, and downloading the testing tool from a control center server through a communication network; installing a testing tool and configuring testing environment variables including a header file directory, a library file directory and a bin directory; setting a head file directory and a library file directory by executing batch files;
s4) the control center server distributes items:
adding IP addresses and test tools of all the testers in a control center server, and sending the project information parameters to all the testers by the control center server;
s5) starting an automatic test procedure:
after receiving the project information parameters sent by the control center server, the testing machine combines the project information parameters and compiles a test message queue by using a script language; calling an environment variable configuration file to configure environment variables; setting a plurality of executable test modules for controlling the tested units; the test message queue is associated with the executable test module;
constructing a test item based on the executable test modules, compiling the test item, directly testing and analyzing the test item if the test item is compiled, and returning error information if the item is compiled to fail;
s6) the control center server collects test analysis results from the testing machine, displays the test results through pages, checks and processes problems by testing staff or developers, stores the problem processing results into a database after confirmation is completed, and compiles and generates a test report based on the test state information stored by the analysis monitor and the problem processing results.
The invention also provides a system for automatically configuring and calling the testing tool to carry out testing analysis, the system comprises a control center server and a testing machine connected with the control center server through a communication network, and the system is characterized in that:
the control center server is configured to:
creating a dynamic link library DLL document when developing a test tool;
when loading the testing tool, writing the route of the DLL document of the testing tool into a registration database of the control center server;
providing the test tool to the tester via the network;
adding IP addresses and test tools of all the testers in a control center server, and sending the project information parameters to all the testers by the control center server;
collecting test analysis results from a testing machine, displaying the test results through a page, checking and processing problems by a tester or a developer, storing the problem processing results into a database after confirmation, and compiling and generating a test report based on the test state information stored by the analysis monitor and the problem processing results;
the tester is configured to:
downloading the test tool from a control center server via a communication network;
installing a testing tool and configuring testing environment variables including a header file directory, a library file directory and a bin directory; setting a head file directory and a library file directory by executing batch files;
after receiving the project information parameters sent by the control center server, combining the project information parameters, and writing a test message queue by using a script language; calling an environment variable configuration file to configure environment variables; setting a plurality of executable test modules for controlling the tested units; the test message queue is associated with the executable test module;
and constructing a test item based on the executable test modules, compiling the test item, directly testing and analyzing the test item if the test item is compiled, and returning error information if the item is compiled to fail.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to specific embodiments of the present invention and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 shows a flow chart of the method of the invention, which is applied to an automatic test system, the system comprises a control center server and a tester connected with the control center server through a communication network, and the method comprises the following steps:
s1) a control center server configures tested item information:
different project information parameters are configured according to different test projects, including project types, development environments, development languages, rules used, environment variables required to be called, test report formats and header file configuration paths.
The information required by the tested project is configured on the control center server according to different testing projects, and generally comprises project types, development environments, development languages, rules required to be used, environment variables required to be called, report formats and the like. For common projects, after the projects are loaded, the types of the projects can be automatically analyzed, the development environment, the development language, default rules and the like are matched, but for the projects with complex types, the default matching can be incorrect, and adjustment is needed.
Taking the DSP6713 chip in the embedded development environment CCS3.3 for testing the Windows operating system as an example, the CCS3.3 environment variables are configured, there are dosrun. Bat batch files under the CCS3.3 installation directory, and executing this file sets the header file and library file directory of the chip model, including the DSP6713 chip model. Before the test tool analyzes the project, the tested project needs to be compiled, so that the project can be correctly constructed in the CCS3.3 development environment. The information of the tested item includes item type CCS3.3 pjt item, development environment CCS3.3 DSP6713 type, development language C, rule used MISRA C2004, environment variable dosrun.bat to be called, report format html, header configuration path, etc.
S2) the control center server activates the test tool:
creating a dynamic link library DLL document when developing a test tool; when loading the testing tool, writing the route of the DLL document of the testing tool into a registration database of the control center server; the control center server provides the test tool to the tester via the network.
The dynamic link library DLL file comprises description information of the test process and the layout of the test tool, when the test tool is loaded, the information of the DLL file route is required to be written into a registration database of the control center server, and after the test tool is loaded, if the test tool is renamed or upgraded, the test center server provides a management interface, and can test the update condition of the test tool and provide operation guidance.
S3) configuring a test environment by the tester:
starting a testing machine, and downloading the testing tool from a control center server through a communication network; installing a testing tool and configuring testing environment variables including a header file directory, a library file directory and a bin directory; wherein the head file directory and the library file directory are set by executing batch files.
When the test tool analyzes the project, the tested project needs to be compiled, so that the project can be correctly tested and analyzed, and different projects need different compiling environments, so that the environment variables need to be correctly configured when the analysis is performed; meanwhile, a head file catalog, a library file catalog and a bin catalog are required to be configured, and for some special development environments, the configuration is carried out according to an operation manual; for embedded development environments, information such as chip type needs to be configured. In order to ensure that various environment variables on a computer do not conflict with each other, parameters of each development environment are made into a file form, executable rights are then given,
under the embedded development environment of the Windows operating system, the tester configures CCS3.3 environment variables, and executes dosrun.bat batch file setting of header files and library file catalogues which accord with the chip model; under the embedded development environment of the Linux operating system, the tester configures a QT creator environment variable, and writes a bin directory and a library file directory of the QT creator into a batch processing file QT. When testing items, environment variables are set in the form of calling files, and after the testing is completed, the environment variables disappear, so that the next testing cannot be influenced.
S4) the control center server distributes items:
and adding the IP addresses and the test tools of all the testers in the control center server, and sending the project information parameters to all the testers by the control center server.
S5) starting an automatic test process, wherein a test flow chart is shown in FIG. 2:
after receiving the project information parameters sent by the control center server, the testing machine combines the project information parameters and compiles a test message queue by using a script language; calling an environment variable configuration file to configure environment variables; setting a plurality of executable test modules for controlling the tested units; the test message queue is associated with the executable test module;
and constructing a test item based on the executable test modules, compiling the test item, directly testing and analyzing the test item if the test item is compiled, and returning error information if the item is compiled to fail.
The executable test module is bound with the test case; the test message queue includes references to the availability
Executing the command of the test module.
And reading commands in a plurality of test message queues in the test item, executing corresponding executable test modules, and analyzing and verifying the script language in the test message queues.
Each tester also includes an analysis monitor:
the analysis monitor is used for monitoring and storing test state information, and periodically retrieving information from the testing machine to determine whether the testing machine fails or not; identifying the capability of the testing machine, determining whether the testing machine meets the testing resources required by the testing project, and providing constraints on the testing to be executed for a control center server; the analysis monitor also records the running process information of the test script and generates a test execution log file.
The test item includes a plurality of versions, each version being one or more scenarios associated with test code for testing a different aspect of the item; each version contains two file libraries for tracking compiled code and for tracking uncompiled files required for testing, respectively.
S6) the control center server collects test analysis results from the testing machine, displays the test results through pages, checks and processes problems by testing staff or developers, stores the problem processing results into a database after confirmation is completed, and compiles and generates a test report based on the test state information stored by the analysis monitor and the problem processing results.
The test result can be one or more result sets, the result sets are displayed to a tester or a developer in an XML format for viewing and processing, the tester or the developer can view each problem, confirm that the problem is not caused, edit and delete the problem, and restore the result sets to a database after the confirmation is completed, and meanwhile, a test report can be generated.
The invention also provides a system for automatically configuring and calling the testing tool to carry out testing analysis, which comprises a control center server and a testing machine connected with the control center server through a communication network;
the control center server is configured to:
creating a dynamic link library DLL document when developing a test tool;
when loading the testing tool, writing the route of the DLL document of the testing tool into a registration database of the control center server;
providing the test tool to the tester via the network;
adding IP addresses and test tools of all the testers in a control center server, and sending the project information parameters to all the testers by the control center server;
collecting test analysis results from a testing machine, displaying the test results through a page, checking and processing problems by a tester or a developer, storing the problem processing results into a database after confirmation, and compiling and generating a test report based on the test state information stored by the analysis monitor and the problem processing results;
the tester is configured to:
downloading the test tool from a control center server via a communication network;
installing a testing tool and configuring testing environment variables including a header file directory, a library file directory and a bin directory; setting a head file directory and a library file directory by executing batch files;
after receiving the project information parameters sent by the control center server, combining the project information parameters, and writing a test message queue by using a script language; calling an environment variable configuration file to configure environment variables; setting a plurality of executable test modules for controlling the tested units; the test message queue is associated with the executable test module;
and constructing a test item based on the executable test modules, compiling the test item, directly testing and analyzing the test item if the test item is compiled, and returning error information if the item is compiled to fail.
It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for making a computer device (which may be a personal computer, a physical machine Server, or a network cloud Server, etc., and need to install a Windows or Windows Server operating system) execute part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only of the preferred embodiments of the present invention, and is not intended to limit the present invention in any way, but any simple modification, equivalent variation and modification made to the above embodiments according to the technical substance of the present invention still fall within the scope of the technical solution of the present invention.