Summary of the invention
In order to solve the problems of the prior art, the invention provides a kind of automated testing method.
The invention provides a kind of automated testing method, be included in the AD emulation mode run in device being tested, described AD emulation mode comprises:
Order receiving step, the order that receiving computer control module sends;
Input signal simulation process, according to the order received, calculates consistent simulate signal to needing the analog input signal produced;
Sampling exports step, samples, obtains discrete data values, be saved in samples storage module, be supplied to data processing module according to the data sampling consistent with true A/D module and processing logic to simulate signal, realizes the emulation input process of replacing true A/D module.
As a further improvement on the present invention, in described AD emulation mode, emulate, cover all input channels to all analog quantity channels of device being tested, quantification control parameter is amplitude, frequency and phase place.
As a further improvement on the present invention, in described AD emulation mode, the output of the form control emulated data of using state sequence, single status sequence comprises all analog quantity channels, export the analog signals of identical amplitude, phase place and frequency and continue the default time, switched the output changing emulated data by different status switches, realize the change of waveform and the output of various stable state and transient waveform.
As a further improvement on the present invention, in this automated testing method, also comprise computer control method, comprise at this computer control method:
Computer control unit and device being tested communication, the execution that control AD emulation module exports, test process is adjusted, controlled to the functional parameter of device being tested, read test result data compare with expected results and draw test result, all condition entries, parameter tuning, process performs and result output is all pooled to computer control unit, computer control unit performs all test processs, possess the function that test case is preserved, is loaded into and performs in batches, automatically perform all Test cases technology test report.
As a further improvement on the present invention,
In described AD emulation mode, open communication interface is to the communication protocol module of device being tested, the output of received communication instruction control imitation data, the configurable parameter of each status switch, by a communication instruction write, starts the output of the emulated data set by an enabled instruction after completing parameter configuration;
Computer control unit performs the transmission of configuration-direct, does not need manual intervention communication control process, provides the visualization interface at tester interface to arrange AD emulation module;
In described computer control method, by setting up communication protocol communication with device being tested, the condition entry of test can be performed, optimum configurations, result generate the complete test case of formation one and perform, the data comprising controls AD emulation module export, arrange easily the functional parameter of device being tested, input expected test result, the test result data of reading device being tested, comparing result draw test result;
In described computer control method, single test case can be saved as use-case file, import all use-case files of testing scheme, automatically perform one by one, complete all test events, realize automatic test.
Present invention also offers a kind of automatization test system, be included in the AD emulation module run in device being tested, described AD emulation module comprises:
Order receiver module, for the order that receiving computer control module sends;
Input signal emulation module, for according to the order received, calculates consistent simulate signal to needing the analog input signal produced;
Sampling output module, for sampling to simulate signal according to the data sampling consistent with true A/D module and processing logic, obtaining discrete data values, being saved in samples storage module, be supplied to data processing module, realize the emulation input process of replacing true A/D module.
As a further improvement on the present invention, sampling output module, for sampling to simulate signal according to the data sampling consistent with true A/D module and processing logic, obtain discrete data values, be saved in samples storage module, be supplied to data processing module, realize the emulation input process of replacing true A/D module.。
As a further improvement on the present invention, in described AD emulation module, the output of the form control emulated data of using state sequence, single status sequence comprises all analog quantity channels, export the analog signals of identical amplitude, phase place and frequency and continue the default time, switched the output changing emulated data by different status switches, realize the change of waveform and the output of various stable state and transient waveform.
As a further improvement on the present invention, in this automatization test system, also comprise computer control unit, comprise at this computer control unit:
Computer control unit and device being tested communication, the execution that control AD emulation module exports, test process is adjusted, controlled to the functional parameter of device being tested, read test result data compare with expected results and draw test result, all condition entries, parameter tuning, process performs and result output is all pooled to computer control unit, computer control unit performs all test processs, possess the function that test case is preserved, is loaded into and performs in batches, automatically perform all Test cases technology test report.
As a further improvement on the present invention,
In described AD emulation module, open communication interface is to the communication protocol module of device being tested, the output of received communication instruction control imitation data, the configurable parameter of each status switch, by a communication instruction write, starts the output of the emulated data set by an enabled instruction after completing parameter configuration;
Computer control unit performs the transmission of configuration-direct, does not need manual intervention communication control process, provides the visualization interface at tester interface to arrange AD emulation module;
In described computer control unit, by setting up communication protocol communication with device being tested, the condition entry of test can be performed, optimum configurations, result generate the complete test case of formation one and perform, the data comprising controls AD emulation module export, arrange easily the functional parameter of device being tested, input expected test result, the test result data of reading device being tested, comparing result draw test result;
In described computer control unit, single test case can be saved as use-case file, import all use-case files of testing scheme, automatically perform one by one, complete all test events, realize automatic test.
The invention has the beneficial effects as follows:
1. do not need to use testing tool, the emulated data using AD emulation module to export, as the initial conditions of test, can break away from restriction and the resource consumption of testing tool;
2. do not need at device being tested and the enterprising line operate of tester, computer control unit performs all condition entries, parameter tuning, process and result exports and is all pooled on computing machine, provides more convenient, mode of operation intuitively, and simplify the operation step;
3. by AD emulation module, realization makes test input condition of computerizeing control, communication protocol is coordinated to control device being tested again, all operations are all performed by computer control system, computing machine is used to carry out test operation, realize preservation and the repetition of test operation, and the entrance of automatic test is provided;
4. computer control unit possesses the function that test case is preserved, is loaded into and performs in batches, automatically performs all Test cases technology test report, realizes automatic test.All tests once performed all are recorded, formed complete, cover comprehensive use-case storehouse, when entering the regression test stage, test is automatically used to carry out covering comprehensive test, ensure that product does not return, increase testing cost hardly, and testing efficiency is high, ensures the time schedule in regression test stage.
Embodiment
As shown in Figure 3, the invention discloses a kind of automated testing method, be included in the AD emulation mode run in device being tested, described AD emulation mode comprises:
Order receiving step, the order that receiving computer control module sends;
Input signal simulation process, according to the order received, draws consistent simulate signal to needing the analog input signal produced by fourier series formulae discovery;
Sampling exports step, samples, obtains discrete data values, be saved in samples storage module, be supplied to data processing module according to the data sampling consistent with true A/D module and processing logic to simulate signal, realizes the emulation input process of replacing true A/D module.
In described AD emulation mode, emulate, cover all input channels to all analog quantity channels of device being tested, quantification control parameter is amplitude, frequency and phase place.
In described AD emulation mode, the output of the form control emulated data of using state sequence, single status sequence comprises all analog quantity channels, export the analog signals of identical amplitude, phase place and frequency and continue the default time, switched the output changing emulated data by different status switches, realize the change of waveform and the output of various stable state and transient waveform.
In this automated testing method, also comprise computer control method, comprise at this computer control method:
Computer control unit and device being tested communication, the execution that control AD emulation module exports, test process is adjusted, controlled to the functional parameter of device being tested, read test result data compare with expected results and draw test result, all condition entries, parameter tuning, process performs and result output is all pooled to computer control unit, computer control unit performs all test processs, possess the function that test case is preserved, is loaded into and performs in batches, automatically perform all Test cases technology test report.
In described AD emulation mode, open communication interface is to the communication protocol module of device being tested, the output of received communication instruction control imitation data, the configurable parameter of each status switch, by a communication instruction write, starts the output of the emulated data set by an enabled instruction after completing parameter configuration;
Computer control unit performs the transmission of configuration-direct, does not need manual intervention communication control process, provides the visualization interface at tester interface to arrange AD emulation module;
In described computer control method, by setting up communication protocol communication with device being tested, the condition entry of test can be performed, optimum configurations, result generate the complete test case of formation one and perform, the data comprising controls AD emulation module export, arrange easily the functional parameter of device being tested, input expected test result, the test result data of reading device being tested, comparing result draw test result;
In described computer control method, single test case can be saved as use-case file, import all use-case files of testing scheme, automatically perform one by one, complete all test events, realize automatic test.
The invention also discloses a kind of automatization test system, comprise computer control unit and device being tested and built-in AD emulation module thereof, AD emulation module, realized by the program being implanted to device being tested inside, replace real A/D module, emulated data passes to data processing module, AD sampling process that is virtually reality like reality, AD emulation module has communication interface, can control the content of Output simulation data, just can carry out functional test without the need to tester; Device being tested refers to the object that emulation test system is tested, the various embedded intelligence observing and controlling mainly in secondary equipment in power system and protective device.
At this automatization test system, be included in the AD emulation module run in device being tested, described AD emulation module comprises:
Order receiver module, for the order that receiving computer control module sends;
Input signal emulation module, for according to the order received, calculates consistent simulate signal to needing the analog input signal produced;
Sampling output module, for sampling to simulate signal according to the data sampling consistent with true A/D module and processing logic, obtaining discrete data values, being saved in samples storage module, be supplied to data processing module, realize the emulation input process of replacing true A/D module.Data processing module obtains sampling and exports data, carries out data processing, output function result, thus uses emulated data can obtain function treatment result as test input condition during test.
In described AD emulation module, emulate, cover all input channels to all analog quantity channels of device being tested, quantification control parameter is amplitude, frequency and phase place.
In described AD emulation module, the output of the form control emulated data of using state sequence, single status sequence comprises all analog quantity channels, export the analog signals of identical amplitude, phase place and frequency and continue the default time, switched the output changing emulated data by different status switches, realize the change of waveform and the output of various stable state and transient waveform.
In this automatization test system, also comprise computer control unit, comprise at this computer control unit:
Computer control unit and device being tested communication, the execution that control AD emulation module exports, test process is adjusted, controlled to the functional parameter of device being tested, read test result data compare with expected results and draw test result, all condition entries, parameter tuning, process performs and result output is all pooled to computer control unit, computer control unit performs all test processs, possess the function that test case is preserved, is loaded into and performs in batches, automatically perform all Test cases technology test report.
In described AD emulation module, open communication interface is to the communication protocol module of device being tested, the output of received communication instruction control imitation data, the configurable parameter of each status switch, by a communication instruction write, starts the output of the emulated data set by an enabled instruction after completing parameter configuration.
Computer control unit performs the transmission of configuration-direct, does not need manual intervention communication control process, provides the visualization interface at tester interface to arrange AD emulation module, the convenient setting carrying out test input condition intuitively.
In described computer control unit, by setting up communication protocol communication with device being tested, the condition entry of test can be performed, optimum configurations, result generate the complete test case of formation one and perform, the data comprising controls AD emulation module export, arrange easily the functional parameter of device being tested, input expected test result, the test result data of reading device being tested, comparing result draw test result.
In described computer control unit, single test case can be saved as use-case file, import all use-case files of testing scheme, automatically perform one by one, complete all test events, realize automatic test.
In the present invention, data simulation can be carried out to all sampling channels of device being tested, by the communication protocol of device being tested, Control on Communication be carried out to the output of AD emulation module, just can add data controlled arbitrarily to CPU without the need to using tester; Computer control unit for control AD emulation module the way of output and perform test process, by communication protocol and device being tested communication, send communication instruction to export, the functional parameter of device being tested of adjusting, obtain the result data that test process needs by control AD emulation module, compare with expected results and draw test result, possess the function that test case is preserved, is loaded into and performs in batches, automatically perform all Test cases technology test report.
In the present invention, the data handling procedure of built-in AD emulation is consistent with the true AD of logical and, only change signal source, true AD gathers real simulating signal, AD emulation module adopts emulated data, is consistent to the process of signal, and the process exporting data to data processing module is also consistent, therefore the test adopting emulation AD to carry out and the test adopting true AD to carry out, the result obtained is consistent.When adopt AD emulation module carry out test find that smart machine exists function treatment problem time, true A/D module exist equally problem.Use emulation testing module to carry out testing and can not impact to the actual use of smart machine, in the actual use procedure of smart machine, AD emulation module does not drop into, and only uses during test.
For the analog quantity sampling channel that device being tested has, the program that realizes of AD emulation module can produce the analogue simulation amount passage consistent with it.According to the cyclophysis of ac analog in electrical system, be quantified as the configuration parameter of amplitude, frequency and phase place.By the amplitude of adjustment analogue simulation amount each passage, frequency and phase place, produce and export consistent signal data with analog generator tester.Identical analog data keeps exporting a period of time, and synthesize a status switch, the setting of status switch comprises the parameter of all analog quantity channels and the duration of status switch.Different amplitudes, frequency and phase place are switched by status switch.After retention time of a status switch terminates, be switched to the analog output of next status switch, the rest may be inferred.After retention time of all status switches terminates, recover without data mode.A certain status switch also can being set for keeping, terminating, exporting the analog quantity of this state all the time, re-writing the status switch of band retention time, terminate after the retention time.The opening of AD emulation module can be adjusted the status switch quantity of quantity, the configurable value of each status switch, comprises the setting value of all analog quantity channels, duration and whether service marking position.Each status switch of AD emulation module has a communication instruction configuring all parameters of this status switch, and an enabled instruction with each status switch whether service marking position.First send the configuration-direct of each status switch, after completing configuration, send a startup command, AD emulation module, according to the status switch situation of configuration, carries out signal output and switching according to the duration.Whether each status switch can be selected to enable, and if do not enabled, is 0 in the mark position of startup command, does not trigger the output of this status switch when sending startup command; The status switch do not enabled can not write configuration parameter.Each configurable value, is written to AD emulation module by the communication protocol of device being tested.Emulated data applies, and takes to be loaded into optimum configurations in advance, is triggered by enabled instruction, and the data starting AD emulation module export, and ageing to ensure, workflow as shown in Figure 1, 2.
Computer control unit, comprises the computing machine of automatic testing software and operation; Automatic testing software comprises emulation AD control module, fixed value adjusting module, expected results module, testing execution module, use-case file access module and automatic test module; Computer run automatic testing software, is established a communications link by communication interface and device being tested, carries out the exchanges data of automatic testing software and device being tested according to the communication protocol of device being tested.
Described emulation AD control module, the visualized data configuration interface being similar to tester is provided by computer control system, for arranging the parameter of AD emulation module, under comprising each status switch all analog quantity channels amplitude, phase place, frequency, duration and enable mark, according to the parameter of configuration, be used for the status switch configuration-direct of control imitation module by testing execution module by the order format generation of communication according to stipulations and export enabled instruction.When starting AD emulation module data and exporting, computer control unit starts timing, the switching of synchronization interface display status switch, keeps, with the timing synchronization of AD emulation module, making tester's observation test process intuitively.
Described fixed value adjusting module, be loaded into the parameter configuration list of device being tested, thered is provided by computer control unit and fixed value adjusting interface like interface phase is set with device being tested definite value, use the mode of quick indexing and operation indicating, intuitively, configure the functional parameter of device being tested quickly on computers, eliminate the manual process of button operation.According to the data of fixed value adjusting module installation, communication protocol write parameters is utilized to be configured to device being tested by testing execution module.
Described expected results module, is provided the interface of the anticipatory data of configuration testing result, is supplied to testing execution module by computer control unit.
Described testing execution module, the communication protocol information of integrated device being tested, carries out Code And Decode to communication instruction, for communicating with device being tested, sets up the exchanges data of modules and device being tested above, reads the result data needing to obtain; Comprising the instruction of communication, the description, test phase, object information etc. of instruction resolves to Word message, is recorded in text box, allows tester can get information about measuring executing process; After test terminates, the result data reading device being tested, with expected result Data Comparison, show that whether function is correct, record test result.
Described use-case file access module, by computer control system, the setting data of AD emulation module, fixed value adjusting module, expected results module is recorded, save as use-case file, when being again loaded into, the data that can obtain each module are arranged, perform test process by testing execution module, form a complete test case implementation.
Described automatic test module, can be loaded into multiple use-case file in batches, uses above-mentioned module to perform use-case file one by one, gathers the test result of all use-cases, generates survey report; The test case checked for device being tested various functions is gone out by aforementioned each block configuration, the test case collecting all functions forms the complete testing scheme to device being tested, when test enters the regression test stage, computer control system is used to be loaded into all use-case files preserved, performed by the batch of automatic test module, draw the test report of device being tested.
Concrete operating process:
1, computing machine is coupled together by communication interface and device being tested, sets up the communication connection of computer control unit and device being tested;
2, by the configuration interface of computer control unit, the output valve of configuration AD emulation module, the functional parameter of device being tested and expected results;
3, on computer control unit, test is started, testing execution module send configuration-direct to device being tested arrange function test parameter, send configuration-direct to AD emulation module, start emulated data to export, the data that the CPU of device being tested obtains inputting carry out function treatment, output test result; Testing execution module reads the Output rusults data of device being tested by communication protocol;
4, computer control unit compares the result data got with expected results, draws test result;
5, computer control unit is by automatic test module, performs all use-case files, exports test report.
Computer control method of the present invention comprises: step 1, connection setup, by special communication protocol, and computer control unit and device being tested communication; Step 2, the functional parameter of device being tested is adjusted, and the Test Sample Design of each state, is saved to test case library; Step 3, is exported by the mode control AD emulation module of status switch, use-case storehouse Testcase execution; Step 4, read test result data also compares with expected results and draws test result, generates test report.The invention has the beneficial effects as follows: controlled by computing machine, effectively utilize the resource of tested device, make the AD emulation module Output simulation data running on tested device inside, as the initial conditions of test, thoroughly can break away from the restriction that classic method needs testing tool, reduce test resource and drop into.
In sum, by the cooperation of computer control unit and AD emulation module, the input of test condition can be carried out to device being tested by control AD emulation module, the effect of replacement test instrument; Then setting function parameter, record expected results, executive communication process and contrast test result, draw the test result of use-case; Reach automatic test by batch implementation of test cases, and export test report.The present invention draws the functional test of result to being based upon CPU from sampled data, can be completely alternative; True A/D module is supplemented by manual test the partial function that external input signal is sampled.In test process, form test case file, being loaded into use-case file can repeated test, and the use-case file being performed all accumulation by batch realizes automatic test, realizes complete Test coverage and high-level efficiency test in the regression test stage.
Above content is in conjunction with concrete preferred implementation further description made for the present invention, can not assert that specific embodiment of the invention is confined to these explanations.For general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, some simple deduction or replace can also be made, all should be considered as belonging to protection scope of the present invention.