CN106201891A - A kind of model automatization method of testing and device - Google Patents
A kind of model automatization method of testing and device Download PDFInfo
- Publication number
- CN106201891A CN106201891A CN201610571288.7A CN201610571288A CN106201891A CN 106201891 A CN106201891 A CN 106201891A CN 201610571288 A CN201610571288 A CN 201610571288A CN 106201891 A CN106201891 A CN 106201891A
- Authority
- CN
- China
- Prior art keywords
- test
- excel
- document
- model
- simulink
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
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 kind of model automatization method of testing and device, load Simulink model and the parameter of demarcation of required test;Call Excel test document, perform every test case successively according to the time flow relation defined in Excel test document;Judge that test result is the most identical with the expected value in corresponding Excel test file.Therefore, Matlab, Simulink can be integrated by the present invention, and the algorithm quickly can built user carries out emulation testing, and emulation testing is reliable and stable, and generate test result report, then can save research staff in a large number and develop the time of algorithm, and experimental situation is unrestricted.
Description
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of based on the survey of Matlab/Simulink model automatization
Method for testing and device.
Background technology
At present, in the environment of based on Matlab/Simulink rapid prototype development, generally require the algorithm researched and developed
Carrying out certain test, this test process is that conventionally employed HIL tests to control strategy stability and functional a kind of guarantee
(hardware-in-the-loop test), this test process advantage is that comparison is true and reliable, shortcoming be need to expend certain material resources and
Financial resources (need to build the HIL test environment of complete set according to testing requirement), and this test process consuming time is longer.So
Can cause a vicious cycle: user's needs a specific experimental situation take a substantial amount of time verify one wrong
Algorithm.
Specifically, general method of testing is manually to add input signal, then by oscillograph or work
Make space storage document test result is analyzed.There are four inevitable shortcomings in this process: 1. when input stimulus is believed
Time number more, user needs to add different pumping signals in the different moment, this process and loaded down with trivial details;2. when output observation letter
Time number more, user adds multiple data storage document equally and is observed relative analysis;3. user needs manually test result
It is analyzed, manually completes and mistake is assessed by test result.4. need manually to write test result literary composition after test completes
Shelves and test process, and mark the testDate of correspondence.
Summary of the invention
In view of this, it is an object of the invention to propose a kind of model automatization method of testing and device, solve for
The model of Matlab/Simulink carries out test and takes time and effort, the problem of poor accuracy.
Model automatization method of testing is provided, including step based on the above-mentioned purpose present invention:
Load Simulink model and the parameter of demarcation of required test;
Call Excel test document, perform every test successively according to the time flow relation defined in Excel test document
Use-case;
Judge that test result is the most identical with the expected value in corresponding Excel test file, if identical, this test
Use-case passes through and marks PASS, and otherwise this test case is not by then being covered by yellow area and marking FALSE.
In some embodiments of the invention, also include:
Judge whether Excel test document every page has tested;
According to judged result, if every page of test completes, judge test result and the phase in corresponding Excel test file
Prestige value is the most identical, otherwise continues to perform every test case successively according to the time flow relation defined in Excel test document.
In some embodiments of the invention, described in call Excel test document, including:
Automatically required Excel test document is called;
By importdata function importing Excel test document to work space, obtain test by length function
The number of pages of document Excel test document.
In some embodiments of the invention, it is judged that test result with the expected value in corresponding Excel test file is
No identical, including:
Simulink is set and sets up the desired value of model, when setting up Excel and testing form, write input value and expection
Value;
The test result of output, after test, is written in Excel test form by the model that Simulink sets up;
Judge that the test result of output is the most identical with described desired value.
In some embodiments of the invention, also include:
The test result of output write in Excel test document newly-built collects in the page, and marks out test and do not lead to
The sequence crossed presents.
On the other hand, present invention also offers a kind of model automatization method of testing and device, including:
Loading unit, for loading Simulink model and the parameter of demarcation of required test;
Call unit, is used for calling Excel test document;
Test cell, for performing every test case successively according to the time flow relation defined in Excel test document;
Judging unit, for judging that test result is the most identical with the expected value in corresponding Excel test file, if phase
Same then this test case is passed through and marks, and otherwise this test case is not passed through and marks.
In some embodiments of the invention, described judging unit, it is additionally operable to:
Judge whether Excel test document every page has tested;
According to judged result, if every page of test completes, judge test result and the phase in corresponding Excel test file
Prestige value is the most identical, otherwise continues to perform every test case successively according to the time flow relation defined in Excel test document.
In some embodiments of the invention, described call unit, it is additionally operable to:
Automatically required Excel test document is called;
By importdata function importing Excel test document to work space, obtain test by length function
The number of pages of document Excel test document.
In some embodiments of the invention, described judging unit judges test result and corresponding Excel test file
In expected value the most identical, including:
Simulink is set and sets up the desired value of model, when setting up Excel and testing form, write input value and expection
Value;
The test result of output, after test, is written in Excel test form by the model that Simulink sets up;
Judge that the test result of output is the most identical with described desired value.
In some embodiments of the invention, also include:
Output unit, newly-built collects in the page for the test result of output write in Excel test document, and marks
Outpour the unsanctioned sequence of test to present.
From the above it can be seen that the present invention provide based on Matlab/Simulink model automatization method of testing
And device, by loading Simulink model and the parameter of demarcation of required test;Call Excel test document, according to Excel
Time flow relation defined in test document performs every test case successively;Judge that test result is tested with corresponding Excel
Expected value in document is the most identical.Thus, Matlab, Simulink can be integrated by the present invention, can quickly to
The algorithm that family is built carries out emulation testing, and emulation testing is reliable and stable, and generates test result report, then can save in a large number
Research staff develops the time of algorithm, and experimental situation is unrestricted.
Accompanying drawing explanation
Fig. 1 is model automated testing method schematic flow sheet in the embodiment of the present invention;
Fig. 2 is the diplex flow schematic diagram that in the embodiment of the present invention, input stimulus module realizes multiple excitation input signal;
Fig. 3 is the diplex flow signal that in the embodiment of the present invention, another input stimulus module realizes multiple excitation input signal
Figure;
Fig. 4 is the schematic flow sheet that in the embodiment of the present invention, module composition mechanism carries out test run;
Fig. 5 is the structural representation of model automatic test device in the embodiment of the present invention;
Fig. 6 is the structural representation of another embodiment of the present invention model automatization test device.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with specific embodiment, and reference
Accompanying drawing, the present invention is described in more detail.
It should be noted that the statement of all uses " first " and " second " is for distinguishing two in the embodiment of the present invention
The entity of individual same names non-equal or the parameter of non-equal, it is seen that " first " " second ", only for the convenience of statement, should not
Being interpreted as the restriction to the embodiment of the present invention, this is illustrated by subsequent embodiment the most one by one.
The present invention relates to a kind of for Matlab/Simulink translation and compiling environment, the Simulink model of User Exploitation be entered
Row high-speed simulation is tested, and generates corresponding Excel test result report file.Wherein, this method of testing or device can collect
Become in SIMULINK library file, i.e. when opening Matlab every time without again adding this method of testing or device extremely
Simulink storehouse.And, replace complicated input signal and output storage file, operation by brief input/output module
Simply.Further, in test process can needed for automatic loading user test model, and the calibrating parameters relevant to model, from
Dynamic loading User Defined Excel test case.Further, enter in strict accordance with User Defined Excel test case time stream
Row is tested one by one, and draws test result.It addition, need after test completes according to the desired knot of actual test result and user
Fruit contrasts, and writes the same form of Excel, writes PASS, otherwise write FALSE after the step that test is passed through.And
At the test result do not passed through, insert this form with yellow background, remind user alerting mode.Further, at test knot
Really the most newly-built " test collects " window of Excel, this window clearly demonstrates every page of test result situation, and marks test
Date, and this test result eventually through or failure.Further, MIL software data structure uses the one of M language definition
Dimension, two dimensional data structure, program calls each data base with the form that event triggers.
In a preferred embodiment, this method of testing or device are applicable to MATLAB 2015a/2015b and institute before
There is version.Computer software running environment: win7/win8/xp/windows 2000.Computer hardware running environment: 32/64.
Further, this method of testing or device are a kind of integrated plugins based on MATLAB, can be according to MATLAB version difference
Continuous updating.
As an embodiment, refering to shown in Fig. 1, in the embodiment of the present invention based on Matlab/Simulink model from
Dynamicization method of testing schematic flow sheet, described model automatization method of testing includes:
Step 101, loads Simulink model and the parameter of demarcation of required test.
In an embodiment, Simulink module is added to Simulink storehouse, be i.e. loaded with required test
Simulink model.It is preferred that described Simulink module can be self-defining.Preferably, self-defined Simulink storehouse
Modular manner and user's Simulink model slitless connection.Wherein, concrete enforcement includes: arrange the self-defined of write
The file name of Simulink module, such as: by blkStruct.Name function, blkStruct is standard library function, storehouse letter
Number is made up of title Name etc. plurality of kinds of contents.The self-defined Simulink library model title of write is set, such as
blkStruct.OpenFcn.Further, write is set and needs the title of display under Simulink library file, such as
blkStruct.MaskDisplay.It addition, the Simulink model opening required test in Simulink storehouse can pass through
Open_system function.
It addition, automatically load the parameter of associated calibration, specifically: by function run, calibrating parameters is loaded onto work empty
Between.Wherein, described demarcation is industry technical term, such as: accelerator pedal passes through sensor acquisition signal, when sky is stepped on when
Sensor voltage be 0.3V, 0.3V be not fixing value, different sensors, the parameter of different automobile types be all need to demarcate after
Can determine that.These calibration values would generally be written in m file, needs when testing these scalar quantities are also carried in work
Make space, participate in computing.Therefore, the parameter of demarcation generally includes tens, and these would generally provide empirical value, and MIL tests
Cheng Hou, according to development process, specifically demarcates in the real steering vectors stage.
Step 102, calls Excel test document.
It is preferred that use read-write Excel forms mode, first its list data is read in Matlab work space, then will
Mode in operational data write self-defining function realizes data and swaps with outside Excel.Preferably, routine nesting is used
Mode realizes calling mutually of intrinsic function.Concrete enforcement includes: automatically calls required Excel test document, passes through
Importdata function importing Excel test document, to work space, then obtains test document Excel by length function
Number of pages.
Step 103, performs every test case successively according to the time flow relation defined in Excel test document.
In an embodiment, during performing every test case, if a certain data in Excel test document
The form that not met is specified, can directly point out certain design parameter to make mistakes, facilitate user to check.It is preferred that can also be according to user
Particular demands, such as amendment Excel form, amendment input/output interface etc. adapt to user's request.Preferably, at test process
Middle test result is temporarily stored in a specific file.
Wherein, the pumping signal of input is automatically loaded according to the time flow relation of Excel definition.Specifically can arrange t is
Time timer in simulation process, i.e. pursues the test case time according to this parameter.Sys be output pumping signal, i.e. this
Signal is the input signal of model to be tested.Input1 is the pumping signal title inputing to MIL software test, and data is
Tested Excel list data, name is the title of all input signals of this test model.In this embodiment, MIL surveys
Examination is the data using Simulink to call Excel at all, if it is A+B=C that SIMULINK establishes a model.So
In Excel, need to define data, data include input variable i.e. A and B.Simulink model need input, input fixed
Justice is that the title in A and B, Simulink and Excel must keep consistent, and Simulink recalculates A+B's within the time of t
Value, as defined in EXCLE during t=0, A=1, B=2, then the result of MIL test is C=3, when the t=1 second, A=10, B=
0, then test result be the name definition of C=10, Excel be name, carry out MIL test time could by Excel with
Simulink joins together.
Further, test result output signal is automatically recorded according to the time flow relation of Excel definition.Specifically can set
Putting t is time timer in simulation process, i.e. pursues the test case time according to this parameter.U is the test result letter of output
Number, i.e. this signal is the output drive signal of model to be tested.Input1 is the pumping signal name inputting out MIL software test
Claim.Data is by being tested Excel form expected result data.Name is the title of all input signals of this test model.
Cvkl is the file temporarily storing test result.
Preferably, the present invention uses an input stimulus module to realize the multiplexing of multiple excitation input signal, such as Fig. 2 institute
Show.Specifically, whether the pumping signal first detecting input exists, if there is no this excitation in the Excel tested
Invalidating signal, exits this flow process.If there is then calculating this pumping signal location in Excel form, learn tool
Behind body position, it is judged that whether the test Excel form time terminates, and is, exits this flow process, otherwise this pumping signal will be along with
The time shaft of Excel form sequentially inputs to model to be measured.It can be seen that it is final according to pumping signal this stream of difference recursive call
Journey, thus realize reusing of an input stimulus module multiple pumping signal input.What deserves to be explained is, learn concrete position
Postponing, this pumping signal will sequentially input to can be by this pumping signal during model to be measured along with the time shaft of Excel form
Volatile data base (as shown in Figure 3) will be sequentially output along with the time shaft of Excel form.
Step 104, it is judged that whether Excel test document every page has tested, if tested, carries out step 105,
Otherwise return step 103.
Step 105, it is judged that test result is the most identical with the expected value in corresponding Excel test file, if identical,
Carrying out step 106, if differing, carrying out step 107.Concrete implementation process includes:
Step one: the desired value that C is the model that Simulink sets up is set, when setting up Excel form, write input
(input) value A and B, such as A=1, B=2.And write desired value C, such as C=3.
Step 2: the test result signal that u is output is set, surveys through MIL (Model in Loop model is in ring test)
During examination, u is written in EXCLE again.
Step 3: judge that Simulink desired value C in u with Excel that outputs test result is the most identical, if identical, carry out
Step 106, otherwise carries out step 107.
Also, it should be noted after once can testing computing, its result is written to the caching of S IMULINK
In space, finally result is all imported in Excel.
Step 106, this test case is passed through and marks, and carries out step 108.
Wherein it is possible to mark PASS at the last string of this test case, represent that this test case is passed through.
Step 107, this test case is not passed through and marks, carrying out step 108.
Wherein it is possible to the last string of this test case mark FALSE, and by this test case with yellow background
Mark.
Step 108, presents output the result newly-built collecting in the page in Excel test document.
Wherein, the result of output can include that this Excel test document is passed through and not by the essential information of test case,
And the testing time of every test case.
In an embodiment, the result of output is judged and test result is write in Excel test document newly-built
Collect in the page, and mark out the unsanctioned sequence of test with yellow.Specifically, first pass through function Stabc and determine Excel
On the concrete columns of storage in test document, i.e. the storage position according to test result input correspondence.Then, should corresponding
By function xlswrite input test result on the determination row of bar test case, wherein passing through function stm is with yellow flag
Error checking sequence.
In one preferably embodiment, the present invention uses block combiner mechanism to carry out test run.As shown in Figure 4, first
First, starting principal function, this process calls the data in the Excel test document of the required test of user automatically.Secondly, outside is called
Interface, reads Excel data to be tested.Afterwards, the list data in Excel test document is analyzed, preferably divides
Analysing whether its data meet basic format requirement (test data are the most complete), if being unsatisfactory for, exiting testing process.If meeting
Call input interface function and output interface function the most successively, institute's test model is carried out real-time testing.Finally, model running is treated
After completing, the data tested are judged, and by described judged result write Excel test document.It can be seen that
The most only need to start principal function and can complete whole control, there is not time-out or emergent stopping in midway.Wherein, during operation
Between the Simulink model complexity tested according to user and performed Excel test document together decide on, i.e. when
When there is a lot of input, output drive signal in the complicated or performed Excel test document of Simulink model, test process
The spent time is longer, otherwise the shortest.
In another aspect of this invention, additionally provide a kind of based on Matlab/Simulink model automatization test device,
As it is shown in figure 5, described model automatization test device include successively loading unit 501, call unit 502, test cell 503 with
And judging unit 504.Wherein, loading unit 501 loads Simulink model and the parameter of demarcation of required test, calls afterwards
Unit 502 calls Excel test document.Then, test cell 503 is according to the time flow relation defined in Excel test document
Perform every test case successively.Finally, it is judged that unit 504 judges test result and the phase in corresponding Excel test file
Prestige value is the most identical, if identical, this test case is passed through and marks, and otherwise this test case is not passed through and marks.
As an embodiment, Simulink module is added to Simulink storehouse, is i.e. loaded with institute by loading unit 501
The Simulink model that need to test.It is preferred that described Simulink module can be self-defining.Preferably, self-defined
Simulink library module mode and user's Simulink model slitless connection.Wherein, concrete enforcement includes: arrange write from
The file name of definition Simulink module, such as: by blkStruct.Name function, blkStruct is standard library function,
Built-in function is made up of title Name etc. plurality of kinds of contents.The self-defined Simulink library model title of write is set, such as
blkStruct.OpenFcn.Further, write is set and needs the title of display under SIMULINK library file, such as
blkStruct.MaskDisplay.It addition, open required test Simulink model in Simulink storehouse can pass through open_
System function.
It addition, automatically load the parameter of associated calibration, specifically: by function run, calibrating parameters is loaded onto work empty
Between.
As a preferably embodiment, call unit 502 can use read-write Excel forms mode, first by its table
Lattice data read in MATLAB work space, then the mode in self-defining function that operational data write realizes data with outside
Excel swaps.Preferably, routine nesting mode is used to realize calling mutually of intrinsic function.Concrete enforcement includes: from
Move and call required Excel test document, by importdata function importing Excel test document to work space, then
The number of pages of test document Excel is obtained by length function.
As another preferably embodiment, the time flow relation that test cell 503 defines according to Excel loads defeated automatically
The pumping signal entered.Specifically can arrange t is time timer in simulation process, when i.e. pursuing test case according to this parameter
Between.Sys is the pumping signal of output, i.e. this signal is the input signal of model to be tested.Input1 is soft for inputing to MIL
The pumping signal title of part test, data is by being tested Excel list data, and name is this test model all input stimulus letter
Number title.In this embodiment, MIL test is the data using Simulink to call EXCLE at all, if Simulink
Establishing a model is A+B=C.In EXCLE, so need to define data, data include input variable i.e. A and B.
The title needing input, input to be defined as in A and B, SIMULINK and EXCLE in Simulink model must keep consistent,
Simulink recalculates the value of A+B, as defined in EXCLE during t=0, A=1, B=2 within the time of t, then MIL tests
Result be C=3, when the t=1 second, A=10, B=0, then test result be the name definition of C=10, Excel be name,
Carry out could being joined together by EXCLE with S IMULINK during MIL test.
Further, test result output signal is automatically recorded according to the time flow relation of Excel definition.Specifically can set
Putting t is time timer in simulation process, i.e. pursues the test case time according to this parameter.U is the test result letter of output
Number, i.e. this signal is the output drive signal of model to be tested.Input1 is the pumping signal name inputting out MIL software test
Claim.Data is by being tested Excel form expected result data.Name is the title of all input signals of this test model.
Cvkl is the file temporarily storing test result.
Preferably, an input stimulus module can be used to realize the multiplexing of multiple excitation input signal, specifically: first
Whether the pumping signal first detecting input exists in the Excel tested, invalid if there is no this pumping signal, exits this
Flow process.If there is then calculating this pumping signal location in Excel form, after learning particular location, it is judged that survey
Whether the examination Excel form time terminates, and is to exit this flow process, and otherwise this pumping signal will be along with the time of Excel form
Axle sequentially inputs to model to be measured.It can be seen that final according to pumping signal this flow process of difference recursive call, thus realize one
Reusing of input stimulus module multiple pumping signal input.What deserves to be explained is, after learning particular location, this pumping signal
Will sequentially input to can will be along with Excel table by this pumping signal during model to be measured along with the time shaft of Excel form
The time shaft of lattice is sequentially output volatile data base.
In a preferred embodiment, it is judged that unit 504 judge test result with in corresponding Excel test file
Expected value is the most identical, and concrete implementation process includes:
Step one: the desired value that C is the model that Simulink sets up is set, when setting up EXCLE form, write input
(input) value A and B, such as A=1, B=2.And write desired value C, such as C=3.
Step 2: the test result signal that u is output is set, surveys through MIL (Model in Loop model is in ring test)
During examination, u is written in EXCLE again.
Step 3: judge that Simulink desired value C in u with Excel that outputs test result is the most identical, if identical, carry out
Step 106, otherwise carries out step 107.
Also, it should be noted after once can testing computing, its result is written to the caching of S IMULINK
In space, finally result is all imported in EXCLE.
In another embodiment of device of the present invention, as shown in Figure 6, described model automatization test device also may be used
To include output unit 505.Wherein, described output unit 505 is connected with judging unit 504, can be by the test knot of output
Newly-built collecting in the page in fruit write Excel test document, and mark out the unsanctioned sequence of test and present.It addition, output
Result can include this Excel test document by and not by the essential information of test case, and every test case
Testing time.
In an embodiment, the result of output is judged and test result is write in Excel test document newly-built
Collect in the page, and mark out the unsanctioned sequence of test with yellow.Specifically, first pass through function Stabc and determine Excel
On the concrete columns of storage in test document, i.e. the storage position according to test result input correspondence.Then, should corresponding
By function xlswrite input test result on the determination row of bar test case, wherein passing through function stm is with yellow flag
Error checking sequence.
It should be noted that at tool based on Matlab/Simulink model automatization test device of the present invention
Body implementation content, described above has been described in detail based in Matlab/Simulink model automatization method of testing,
Therefore no longer illustrate at this duplicate contents.
In sum, the present invention provide based on Matlab/Simulink model automatization method of testing and device, create
Property provide and be automatically performed the open loop of model, closed loop test according to User Defined test case, and automatically generate corresponding survey
Test result report, this report can clearly present test model by with the testing procedure not passed through;Meanwhile, the present invention has extensively
General, great dissemination;Finally, whole described model automatization method of testing and device are compact, it is easy to control.
Those of ordinary skill in the field are it is understood that the discussion of any of the above embodiment is exemplary only, not
It is intended to imply that the scope of the present disclosure (including claim) is limited to these examples;Under the thinking of the present invention, above example
Or can also be combined between the technical characteristic in different embodiments, step can realize with random order, and exists such as
Other change of the many of the different aspect of the upper described present invention, in order to concisely they do not provide in details.
It addition, for simplifying explanation and discussing, and in order to obscure the invention, can in the accompanying drawing provided
To illustrate or can not illustrate and integrated circuit (IC) chip and the known power supply/grounding connection of other parts.Furthermore, it is possible to
Device is shown in block diagram form, in order to avoid obscuring the invention, and this have also contemplated that following facts, i.e. about this
The details of the embodiment of a little block diagram arrangements be the platform that depends highly on and will implement the present invention (that is, these details should
In the range of being completely in the understanding of those skilled in the art).Elaborating that detail (such as, circuit) is to describe the present invention's
In the case of exemplary embodiment, it will be apparent to those skilled in the art that can there is no these details
In the case of or these details change in the case of implement the present invention.Therefore, these descriptions are considered as explanation
Property rather than restrictive.
Although invention has been described to have been incorporated with the specific embodiment of the present invention, but according to retouching above
Stating, a lot of replacements, amendment and the modification of these embodiments will be apparent from for those of ordinary skills.Example
As, other memory architecture (such as, dynamic ram (DRAM)) can use discussed embodiment.
Embodiments of the invention be intended to fall into all such replacement within the broad range of claims,
Amendment and modification.Therefore, all within the spirit and principles in the present invention, any omission of being made, amendment, equivalent, improvement
Deng, should be included within the scope of the present invention.
Claims (10)
1. a model automatization method of testing, it is characterised in that include step:
Load Simulink model and the parameter of demarcation of required test;
Call Excel test document, perform every test successively according to the time flow relation defined in Excel test document and use
Example;
Judge that test result is the most identical with the expected value in corresponding Excel test file, if identical, this test case
By and mark, otherwise this test case not by and mark.
Method the most according to claim 1, it is characterised in that also include:
Judge whether Excel test document every page has tested;
According to judged result, if every page of test completes, judge test result and the expected value in corresponding Excel test file
The most identical, otherwise continue to perform every test case successively according to the time flow relation defined in Excel test document.
Method the most according to claim 1 and 2, it is characterised in that described in call Excel test document, including:
Automatically required Excel test document is called;
By importdata function importing Excel test document to work space, obtain test document by length function
The number of pages of Excel test document.
Method the most according to claim 3, it is characterised in that judge test result with in corresponding Excel test file
Expected value the most identical, including:
Simulink is set and sets up the desired value of model, when setting up Excel and testing form, write input value and desired value;
The test result of output, after test, is written in EXCLE test form by the model that Simulink sets up;
Judge that the test result of output is the most identical with described desired value.
Method the most according to claim 1, it is characterised in that also include:
The test result of output write in Excel test document newly-built collects in the page, and it is unsanctioned to mark out test
Sequence presents.
6. a model automatization test device, it is characterised in that including:
Loading unit, for loading Simulink model and the parameter of demarcation of required test;
Call unit, is used for calling Excel test document;
Test cell, for performing every test case successively according to the time flow relation defined in Excel test document;
Judging unit, for judging that test result is the most identical with the expected value in corresponding Excel test file, if identical,
This test case is passed through and marks, and otherwise this test case is not passed through and marks.
Device the most according to claim 6, it is characterised in that described judging unit, is additionally operable to:
Judge whether Excel test document every page has tested;
According to judged result, if every page of test completes, judge test result and the expected value in corresponding Excel test file
The most identical, otherwise continue to perform every test case successively according to the time flow relation defined in Excel test document.
8., according to the device described in claim 6 or 7, it is characterised in that described call unit, it is additionally operable to:
Automatically required Excel test document is called;
By importdata function importing Excel test document to work space, obtain test document by length function
The number of pages of Excel test document.
Device the most according to claim 8, it is characterised in that described judging unit judges that test result is with corresponding
Expected value in Excel test file is the most identical, including:
Simulink is set and sets up the desired value of model, when setting up EXCLE and testing form, write input value and desired value;
The test result of output, after test, is written in EXCLE test form by the model that Simulink sets up;
Judge that the test result of output is the most identical with described desired value.
Device the most according to claim 6, it is characterised in that also include:
Output unit, newly-built collects in the page for the test result of output write in Excel test document, and marks out
Test unsanctioned sequence to present.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610571288.7A CN106201891A (en) | 2016-07-19 | 2016-07-19 | A kind of model automatization method of testing and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610571288.7A CN106201891A (en) | 2016-07-19 | 2016-07-19 | A kind of model automatization method of testing and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106201891A true CN106201891A (en) | 2016-12-07 |
Family
ID=57494514
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610571288.7A Pending CN106201891A (en) | 2016-07-19 | 2016-07-19 | A kind of model automatization method of testing and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106201891A (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106844203A (en) * | 2017-01-04 | 2017-06-13 | 重庆长安汽车股份有限公司 | A kind of prototype software test result analysis method and device |
CN106951606A (en) * | 2017-03-03 | 2017-07-14 | 浙江仕善汽车科技股份有限公司 | A kind of customized method of implementation model normalized checking |
CN106989939A (en) * | 2017-03-29 | 2017-07-28 | 江铃汽车股份有限公司 | A kind of method and system of suspension K&C test bed testing comparative analyses |
CN107064703A (en) * | 2016-12-23 | 2017-08-18 | 惠州市亿能电子有限公司 | A kind of high-voltaghe compartment automatic testing method and its system |
CN107357735A (en) * | 2017-07-20 | 2017-11-17 | 万帮充电设备有限公司 | Discount method of testing and device |
CN109165170A (en) * | 2018-10-16 | 2019-01-08 | 杭州安恒信息技术股份有限公司 | A kind of method and system automating request for test |
CN112084667A (en) * | 2020-09-14 | 2020-12-15 | 北京世冠金洋科技发展有限公司 | Test case generation method and device and electronic equipment |
CN112199297A (en) * | 2020-10-30 | 2021-01-08 | 久瓴(江苏)数字智能科技有限公司 | Data testing method and device, nonvolatile storage medium and processor |
CN112559326A (en) * | 2020-12-03 | 2021-03-26 | 北京车和家信息技术有限公司 | Testing method and device for fusion calibration, vehicle-mounted system and vehicle |
CN114076885A (en) * | 2020-08-11 | 2022-02-22 | 合肥本源量子计算科技有限责任公司 | Quantum chip testing method and device |
CN114817001A (en) * | 2022-03-31 | 2022-07-29 | 重庆长安新能源汽车科技有限公司 | Automatic testing tool and automatic testing method for Simulink model |
CN112559326B (en) * | 2020-12-03 | 2024-07-05 | 北京车和家信息技术有限公司 | Fusion calibration testing method and device, vehicle-mounted system and vehicle |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1947567A2 (en) * | 2006-12-20 | 2008-07-23 | Deutsche Telekom AG | Device and method for automatically testing model-based functions |
CN101739334A (en) * | 2008-11-21 | 2010-06-16 | 上海科梁信息工程有限公司 | Automatic testing method of embedded software |
CN101968770A (en) * | 2010-11-01 | 2011-02-09 | 北京航空航天大学 | Reusable embedded software testing and developing method and system |
CN102890499A (en) * | 2012-09-21 | 2013-01-23 | 北京智行鸿远汽车技术有限公司 | Method for loop testing of vehicle control unit software of pure electric automobile |
CN103034227A (en) * | 2012-09-20 | 2013-04-10 | 北京智行鸿远汽车技术有限公司 | Testing method in circuit of battery electric vehicle vehicle-control unit model |
CN104391791A (en) * | 2014-11-21 | 2015-03-04 | 北京经纬恒润科技有限公司 | Method and device for testing embedded control algorithm |
-
2016
- 2016-07-19 CN CN201610571288.7A patent/CN106201891A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1947567A2 (en) * | 2006-12-20 | 2008-07-23 | Deutsche Telekom AG | Device and method for automatically testing model-based functions |
CN101739334A (en) * | 2008-11-21 | 2010-06-16 | 上海科梁信息工程有限公司 | Automatic testing method of embedded software |
CN101968770A (en) * | 2010-11-01 | 2011-02-09 | 北京航空航天大学 | Reusable embedded software testing and developing method and system |
CN103034227A (en) * | 2012-09-20 | 2013-04-10 | 北京智行鸿远汽车技术有限公司 | Testing method in circuit of battery electric vehicle vehicle-control unit model |
CN102890499A (en) * | 2012-09-21 | 2013-01-23 | 北京智行鸿远汽车技术有限公司 | Method for loop testing of vehicle control unit software of pure electric automobile |
CN104391791A (en) * | 2014-11-21 | 2015-03-04 | 北京经纬恒润科技有限公司 | Method and device for testing embedded control algorithm |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107064703A (en) * | 2016-12-23 | 2017-08-18 | 惠州市亿能电子有限公司 | A kind of high-voltaghe compartment automatic testing method and its system |
CN106844203A (en) * | 2017-01-04 | 2017-06-13 | 重庆长安汽车股份有限公司 | A kind of prototype software test result analysis method and device |
CN106951606A (en) * | 2017-03-03 | 2017-07-14 | 浙江仕善汽车科技股份有限公司 | A kind of customized method of implementation model normalized checking |
CN106989939B (en) * | 2017-03-29 | 2019-11-19 | 江铃汽车股份有限公司 | A kind of method and system of suspension K & C test bed testing comparative analysis |
CN106989939A (en) * | 2017-03-29 | 2017-07-28 | 江铃汽车股份有限公司 | A kind of method and system of suspension K&C test bed testing comparative analyses |
CN107357735A (en) * | 2017-07-20 | 2017-11-17 | 万帮充电设备有限公司 | Discount method of testing and device |
CN109165170A (en) * | 2018-10-16 | 2019-01-08 | 杭州安恒信息技术股份有限公司 | A kind of method and system automating request for test |
CN109165170B (en) * | 2018-10-16 | 2022-03-11 | 杭州安恒信息技术股份有限公司 | Method and system for automatic request test |
CN114076885A (en) * | 2020-08-11 | 2022-02-22 | 合肥本源量子计算科技有限责任公司 | Quantum chip testing method and device |
CN114076885B (en) * | 2020-08-11 | 2023-12-12 | 本源量子计算科技(合肥)股份有限公司 | Quantum chip testing method and device |
CN112084667A (en) * | 2020-09-14 | 2020-12-15 | 北京世冠金洋科技发展有限公司 | Test case generation method and device and electronic equipment |
CN112199297A (en) * | 2020-10-30 | 2021-01-08 | 久瓴(江苏)数字智能科技有限公司 | Data testing method and device, nonvolatile storage medium and processor |
CN112559326A (en) * | 2020-12-03 | 2021-03-26 | 北京车和家信息技术有限公司 | Testing method and device for fusion calibration, vehicle-mounted system and vehicle |
CN112559326B (en) * | 2020-12-03 | 2024-07-05 | 北京车和家信息技术有限公司 | Fusion calibration testing method and device, vehicle-mounted system and vehicle |
CN114817001A (en) * | 2022-03-31 | 2022-07-29 | 重庆长安新能源汽车科技有限公司 | Automatic testing tool and automatic testing method for Simulink model |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106201891A (en) | A kind of model automatization method of testing and device | |
US8799875B2 (en) | Streamlining unit testing through hot code swapping | |
US9027002B2 (en) | Method of converting source code and source code conversion program | |
CN106649103B (en) | A kind of method and system of Android application program Automated Black Box Testing | |
DE69826659T2 (en) | CHEAP, EASY TO USE SOFTWARE FOR AN AUTOMATIC TEST SYSTEM | |
US7970601B2 (en) | Method of creating a requirement description for testing an embedded system | |
CN107797929A (en) | The statistical method and device of FPGA emulation testing function coverage | |
De Lucia et al. | An Eclipse plug-in for the detection of design pattern instances through static and dynamic analysis | |
CN105975269B (en) | A kind of requirements verification method based on procedural model | |
CN104239206B (en) | Webpage method of testing and device | |
CN104899141B (en) | A kind of test cases selection and extending method of network-oriented application system | |
CN107168879A (en) | The generation method and device of centralized configuration management System Test Report | |
CN104239219A (en) | Software defect positioning technology on-line evaluating and experimenting platform and method based on coverage | |
CN111680463A (en) | File checking method and device | |
CN103885341B (en) | Performance analysis system based on automotive performance simulator and method | |
CN106844221A (en) | A kind of method for realizing virtual checking system coverage rate analysis | |
García-Valls et al. | An extensible collaborative framework for monitoring software quality in critical systems | |
CN114185781A (en) | Logic test case automatic generation method and device based on control logic diagram | |
CN108595317A (en) | A kind of embedded automated testing method of safety computer of rail transit | |
Vimalaraj et al. | Automated programming assignment marking tool | |
CN111488723B (en) | Script-based automatic simulation verification method for SOC chip storage controller | |
Juhnke et al. | Challenges concerning test case specifications in automotive software testing | |
Albrecht et al. | Towards a framework for mining students' programming assignments | |
CN117371370A (en) | Power module testing method and device and storage medium | |
Schick | Realization of unit tests in the automotive sector |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20161207 |
|
RJ01 | Rejection of invention patent application after publication |