Disclosure of Invention
The technical problem to be solved by the invention is to provide a multithreading test flow project configuration system which is simple in maintenance and configuration and greatly reduces the quality requirement of users.
In order to solve the problems, the technical scheme adopted by the invention is as follows:
a multithreading test flow project configuration system comprises an upper computer and a test instrument, wherein multithreading test flow project configuration software is stored in a memory of the upper computer and comprises a main control module, a communication module and an instrument control module; the main control module is responsible for establishing and controlling the whole test process, a plurality of sub-threads and instrument control objects are established in the main process, and other modules are controlled in a message mode to complete the whole test process; the communication module is responsible for communicating with the tested board and is called by the main control module; the instrument control module is responsible for communication with an instrument, the instrument is controlled to carry out measurement and a test result is returned, and when the sub-thread calls an instrument control object to carry out measurement, the instrument control module is called through the main process to realize and prevent multithreading from being called simultaneously; the test instrument is connected with the upper computer and the tested board and is called and controlled by a main control module of the upper computer.
Further, the main control module includes a functional keyword module, a waiting point, a keyword set module, a test item configuration module, a test flow configuration module, a test item and a flow execution module, where the functional keyword module is used to implement a test of a specified function, the keyword set module is a set of all functional keyword modules, the test item configuration module is used to configure a required functional keyword for each test item and adjust a test sequence of the functional keyword, the waiting point is a special test item, the test flow configuration module is used to configure and sequentially adjust test items required by sub-threads, and the test item and flow execution module is used to execute the configured test items and sub-threads to implement a test of a board to be tested.
Preferably, the function keyword module is displayed in a graphical manner, provides a designated function externally in the form of a class or a function or an interface, and is integrally displayed in the keyword set module.
Preferably, the test item configuration module includes a plurality of test items to be configured that are displayed graphically, when a certain test item is configured, the number and sequence of the functional keywords in the test item are configured according to actual test requirements, and the configured functional keywords automatically generate a program of the test item in real time through the main control module.
Preferably, the test flow configuration module is a test sub-thread displayed in a graphic manner and is represented by a line segment with a direction from top to bottom, the test items in the test item configuration module are sequentially dragged to the line segment, the test item sequence is realized by adjusting the upper position and the lower position of the test item on the line segment, and the configured test items automatically generate the program of the test sub-thread in real time through the main control module.
Adopt the produced beneficial effect of above-mentioned technical scheme to lie in: the invention realizes the function of rapid, visual, convenient and multi-thread test flow project configuration and overcomes the defect of the traditional test flow project configuration. The invention can be used only by simply training the user, thereby reducing the requirement on the user.
Detailed Description
The invention is described in further detail below with reference to the accompanying drawings:
the invention comprises an upper computer and a test instrument, wherein multithreading test flow project configuration software is stored in a memory of the upper computer, and the software comprises a main control module, a communication module and an instrument control module; the main control module is responsible for establishing and controlling the whole test process, a plurality of sub-threads and instrument control objects are established in the main process, and other modules are controlled in a message mode to complete the whole test process; the communication module is responsible for communicating with the tested board and is called by the main control module; the instrument control module is responsible for communication with an instrument, the instrument is controlled to carry out measurement and a test result is returned, and when the sub-thread calls an instrument control object to carry out measurement, the instrument control module is called through the main process to realize and prevent multithreading from being called simultaneously; the test instrument is connected with the upper computer and the tested board and is called and controlled by a main control module of the upper computer.
The system flow chart of the invention is shown in fig. 1, the invention adopts a multithread mode, realizes competitive instrument calling by program mutual exclusion lock, and the sub-thread is in a state of waiting in line for unlocking the instrument control object, thereby achieving the purpose of reducing the idleness of the instrument control object and improving the utilization rate of the instrument.
The main control module of the invention comprises a function keyword module, a waiting point, a keyword set module, a test item configuration module, a test flow configuration module, test items and a flow execution module, wherein the function keyword module is used for realizing the test of the appointed function, the keyword set module is the set of all the function keyword modules, the test item configuration module is used for configuring the required function keywords for each test item and adjusting the test sequence of the function keywords, the waiting point is a special test item, the test flow configuration module is used for configuring and adjusting the sequence of the test items required by the sub-threads, and the test items and the flow execution module are used for executing the configured test items and sub-threads to realize the test of the tested board. The modules are described in further detail below:
function keyword module: the function key word mentioned in the invention is a packaged function code module, which is the smallest function implementation module in the system and provides a specified pre-designed function to the outside. The specified functions are provided externally in the form of classes or functions or interfaces, and a plurality of functional key modules are arranged in the system so as to realize different functions. The functional keyword module is displayed in a graphical mode and is integrally displayed in the keyword set module.
Waiting for a point: in the actual multi-thread testing process, it is often encountered that a thread can continue testing after running a certain test item or before running other threads to a specified test item, the waiting point is the time needing waiting, the waiting point is a special test item, and special processing is performed on the waiting point during code development to realize a specified waiting function. In the test flow configuration module, the waiting point appears in the item list in the form of a small dot for the test flow configuration module to drag for use.
A keyword set module: the module loads all functional keyword modules required to be used in the test process, and provides a functional keyword name list and a keyword calling interface for the test item configuration module.
The test item configuration module: the method provides a test item configuration editing function, displays the function keywords provided by the system on the test item in the form of draggable squares (or other draggable forms), and can realize the editing of the test item and the adjustment of the running sequence of the function keywords by dragging the function keyword squares. The test item configuration module comprises a plurality of test items to be configured which are displayed graphically, when a certain test item is configured, the number and the sequence of the functional keywords in the test item are configured according to the actual test requirement, and the configured functional keywords automatically generate the program of the test item in real time through the main control module.
A test flow configuration module: the method provides a test flow configuration editing function, creates a test sub-thread marking line (a marked dotted line from top to bottom, which indicates that the test item on the marking line can run from top to bottom during the test) according to the actual requirement, can realize the function of editing the test sequence of the test item and the sub-thread used during the test by dragging the test item onto the test sub-thread marking line, and can arrange the function of waiting for the items among the sub-threads by dragging a waiting point (small dot). The test item sequence is realized by adjusting the upper and lower positions of the test item on the line segment, and the configured test item automatically generates the program of the test sub-thread in real time through the main control module.
The test item and flow execution module: the function of the module is to create a test thread according to the test items and the flow edited by the test item configuration module and the test flow configuration module, run the corresponding test items on the corresponding threads, and further run the functional keywords in the test items.
The core of the invention has 2 parts:
the first part is to graph the function keyword module in the test item configuration module (for example, a text box or other draggable forms), list the test items (lists or other forms can be used), drag the function keyword boxes (graphical function keywords) to the proper positions in the function keyword list in the test items by dragging to determine the order of the function keywords running when running the test items, and also drag the function keyword boxes in the function keyword list to adjust the execution order. (see FIG. 3)
The second part is to graph the test items (which may be in the form of a text box or a box displaying the names of the test items) in the test flow configuration module, graph the test sub-threads (a directional line segment or other similar form that can place the test items from top to bottom, and is subsequently called a test sub-thread running reticle), move the test item box (the graphical test items) from the test item list onto the test sub-thread running reticle by dragging, and arrange a test sequence on the test sub-thread running reticle (the sequence of the test items can be adjusted by dragging the test items), where the test items already on the test sub-thread reticle can also be dragged onto other test sub-thread reticles, so as to achieve the transfer of the threads where the test items are located (see fig. 4). And moving the waiting point to the test sub-thread running marking line in a dragging mode, and connecting the waiting points on the two test sub-thread marking lines in the dragging mode to realize the waiting function required between the configuration sub-threads. (see FIG. 5).
Each test sub-thread running marking in the test flow configuration module represents an actual test thread during running, after the test starts, the system creates a corresponding number of test threads according to the number of the test sub-thread running markings, and runs a corresponding test item on the thread (the test running flow is shown in fig. 2).
The following steps are described for implementing the drag function in the test item configuration module (as shown in fig. 3):
and acquiring a functional keyword list through a keyword set module, and displaying each functional keyword in the list in a left functional keyword list field. And adding a new test item (or selecting an existing test item) in the test item list, and displaying the function keyword added with the test item in the function keyword editing area.
The step of adding the function keyword by the drag function is as follows:
and clicking one functional keyword box in the functional keyword list by a left mouse button, and recording the name M of the selected keyword at the moment.
Dragging the keyword frame to the functional keyword editing area by a mouse, acquiring the position of the keyword frame in the editing area at the moment, and calculating the functional keyword serial number A above the position and the functional keyword serial number B below the position. And releasing the left mouse button, and inserting a new functional keyword M between the functional keyword A and the functional keyword B at the moment.
The steps of moving the function keyword sequence by the drag function are as follows:
and clicking one functional keyword box in the functional keyword editing area by a left mouse button, and recording the name M of the selected keyword at the moment. Dragging the keyword frame to other proper positions in the functional keyword editing area by a mouse, acquiring the position of the keyword frame in the editing area at the moment, and calculating the functional keyword serial number A above the position and the functional keyword serial number B below the position. And (4) releasing the left mouse button, inserting a new functional keyword M between the functional keyword A and the functional keyword B at the moment, and then deleting the original functional keyword M.
The following steps for implementing the drag function of the test item in the test flow configuration module are described as follows (as shown in fig. 4):
and acquiring a test item list through the test item set module, and displaying each test item in the list in the left test item list field. And adding a plurality of test sub-thread marked lines according to actual needs.
The steps of adding test items by the drag function are as follows:
and clicking a test item box in the test item list by the left mouse button, and recording the selected test item name M at the moment. The mouse drags the test item box to a proper position on a proper test thread marking line, at the moment, a test thread marking line L where the test item box is located is obtained, the position on the test thread marking line is obtained, and the test item serial number A above the position and the test item serial number B below the position are calculated. The left mouse button is released, and a new test item M is inserted between test item A and test item B on the test thread line L.
The steps of moving the test item sequence and the test thread marking line through the dragging function are as follows:
and clicking a test item box on the test thread marking line by a left mouse button, and recording the name M of the selected test item at the moment.
The mouse drags the test item box to other proper positions on the same (or different) test thread marking line, at the moment, the test thread marking line L where the test item box is located is obtained, the position on the test thread marking line is obtained, and the test item serial number A above the position and the test item serial number B below the position are calculated. The left mouse button is released, and a new test item M is inserted between test item A and test item B on the test thread line L. And deleting the original test item M.
The following steps are described for the specific implementation of the dragging function of the waiting point in the test flow configuration module (as shown in fig. 5):
the steps of adding a waiting point by the drag function are as follows:
and clicking a circular icon waiting for a point by using the left mouse button. And dragging the circular icon of the waiting point to a proper position on a proper test thread marking line by the mouse, acquiring the test thread marking line L where the circular icon of the waiting point is positioned, acquiring the position on the test thread marking line, and calculating the test item serial number A above the position and the test item serial number B below the position. The left mouse button is released, at which time a waiting point circular icon is inserted between test item A and test item B on the test thread reticle L.
Naming DM (a random and non-repeating value) for newly inserted waiting point
The steps of connecting the waiting point with other testing thread marking lines through the dragging function are as follows:
and clicking a waiting point circular icon on the test thread marking line by the left mouse button, and recording the selected waiting point name DM at the moment. The mouse drags the waiting point circular icon to a proper position on the marking line of other test threads, at the moment, the test thread marking line L2 where the waiting point circular icon is located is obtained, the position on the test thread marking line is obtained, and the test item serial number A above the position and the test item serial number B below the position are calculated. The left mouse button is released, at which time a new wait point, named DM (the same as the original wait point), is inserted between test item A and test item B on test thread line L2.
A dashed line is drawn between the two test thread reticles L and the wait point DM on L2 to indicate that the two wait points have a wait relationship.
The A, B, L, M, L2, DM, etc. mentioned above are not specific values, but only code numbers.