CN109857640B - Embedded code advanced verification method based on prototype design - Google Patents

Embedded code advanced verification method based on prototype design Download PDF

Info

Publication number
CN109857640B
CN109857640B CN201811627999.7A CN201811627999A CN109857640B CN 109857640 B CN109857640 B CN 109857640B CN 201811627999 A CN201811627999 A CN 201811627999A CN 109857640 B CN109857640 B CN 109857640B
Authority
CN
China
Prior art keywords
test
design
prototype design
compiling
prototype
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.)
Active
Application number
CN201811627999.7A
Other languages
Chinese (zh)
Other versions
CN109857640A (en
Inventor
蔡陈生
郑梦兴
李利亮
刘川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Aerospace Control Technology Institute
Original Assignee
Shanghai Aerospace Control Technology Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Aerospace Control Technology Institute filed Critical Shanghai Aerospace Control Technology Institute
Priority to CN201811627999.7A priority Critical patent/CN109857640B/en
Publication of CN109857640A publication Critical patent/CN109857640A/en
Application granted granted Critical
Publication of CN109857640B publication Critical patent/CN109857640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to an embedded code advanced verification method based on prototype design, which comprises the following steps: (1) configuring a compiling unit, (2) intelligently analyzing and inputting by a management unit, (3) intelligently screening out an optimal capacity local environment, (4) generating a test driving script, (5) compiling to generate an executable file, (6) embedding the executable file in SFUNCTION, and comparing and judging with a prototype design result, wherein if the result is consistent, the functional design is correct, otherwise, the functional design is wrong. The method enriches the means of embedded software functional verification, reduces the dependence of the embedded software functional verification on hardware, leads the embedded software verification work to be advanced to the scheme stage, screens out the optimal capacity compiling environment through the design of a restrictive interface and intellectualization, and improves the software testing efficiency.

Description

Embedded code advanced verification method based on prototype design
Technical Field
The invention relates to a prototype design-based embedded code advanced verification method, and belongs to the technical field of functional verification of embedded software of an application layer of satellite attitude and orbit control software.
Background
In the design process of the satellite model attitude and orbit control subsystem scheme, a scheme designer generally builds a control law module and a dynamics model by using a SIMULINK tool of the scheme designer under an MATLAB software environment, performs simulation verification work, and formulates and compiles a corresponding software task book according to the requirements of the control law module after meeting corresponding control indexes. The satellite-borne software designer analyzes and designs software requirements according to the software task book, writes corresponding embedded software codes by using relevant high-level languages (usually Ada, C language and the like), and further performs corresponding test work. The existing software test comprises a unit assembly test, a confirmation test and a system joint test, wherein the unit assembly test generally only detects related indexes such as statement coverage, branch coverage and the like of software; and confirming the test and the system joint test, and performing system test verification on the functionality of the software code.
In the software requirement analysis stage, software implementation is inconsistent with a software task book because software personnel and system scheme designers are easy to deviate in communication or understanding. Such errors often bring about functional errors, and need to be found in a software confirmation test or a system joint test stage, that is, need to wait for a real-time simulation or a semi-physical simulation test, and at this time, more efforts are often required to be invested to find problems, and the modification work brought about accordingly is also increased.
Disclosure of Invention
The technical problems to be solved by the invention are as follows:
in order to overcome the defects of the prior art, the invention provides an embedded code advanced verification method based on prototype design, which is used for verifying the functionality of software in a prototype environment so as to quickly locate the functional design defect of the software and improve the development efficiency of the satellite-borne software of the attitude and orbit control subsystem.
The technical solution of the invention is as follows:
a test tool comprises a management unit, an intelligent screening unit and an API interface design unit, and the method comprises the following steps:
(1) configuring a compiling unit: a compiler consistent with an embedded code language and engineering compilation thereof is configured and installed under WINDOWS to obtain a dynamic link library file of the compiler under a system, and link library script configuration is carried out under MATLAB to realize cross compilation and calling in the MATLAB;
(2) intelligent analysis and input of a management unit: analyzing the module to be verified through the management unit, automatically identifying the input and output attributes of the form parameters and the global variables, and realizing the input of user test script setting data;
(3) intelligently screening out the local environment with the optimal capacity: the intelligent screening unit traverses the reference relation of the module to be verified, screens files related to the module to be verified, and forms a reference tree list and an optimal capacity compiling local environment;
(4) generating a test driving script: the API interface design unit predefines a test drive script template, combines the information input by the management unit and automatically refers to the tree list to form a final test drive script;
(5) compiling to generate an executable file: compiling the test driving scripts in the step (3) and the step (4) under MATLAB to generate a cross-compilation executable file;
(6) embedding executable files in SFUNCTION: and (4) adding an S-FUNCTION self-defining FUNCTION in the MATLAB prototype design data packet, calling the cross compiling executable file in the step (5), comparing and judging with a prototype design result, if the result is consistent, indicating that the functional design is correct, otherwise, representing that the functional design is wrong.
And (2) inputting data set by the user test script in the step (2) comprises inputting and outputting attribute information of the oscilloscope port input and output by the user.
And (6) adding an S-FUNCTION self-defining FUNCTION in the MATLAB prototype design data packet, calling the cross compiling executable file in the step (5) to replace the module to be verified in the prototype design data packet, using the test input and environment the same as those of the prototype design, and comparing and judging the data result with the simulation result of the prototype design process after simulation operation.
And (2) the compiling unit in the step (1) selects and configures according to the compiler used by the tested software to ensure that the compiler used by the test tool is consistent with the compiler used by the tested software.
And (3) the management unit in the step (2) provides an interface port, restrains the information input by the user and intelligently prompts the information to be input.
And (3) intelligently screening the reference associated files of the module to be verified, annotating irrelevant files and variables, ensuring the optimal capacity of the cross compiling executable files, and forming a reference relation tree list and an optimal capacity compiling local environment.
The test driving script template in the step (4) can not be changed by self definition, and has no redundant code, so that the compilability of the back end is ensured.
And (6) replacing the functional module to be verified in the prototype design data packet by using the test environment, the test case, the test method and the test result of the prototype design data packet, using the test input and the environment which are the same as those of the prototype design, comparing and judging the data result and the simulation result of the prototype design process after the simulation operation, and if the results are consistent, indicating that the functional design is correct, otherwise, indicating that the functional design is wrong.
Compared with the prior art, the invention has the following advantages:
(1) the method enriches the means of embedded software functional verification, reduces the dependency of the embedded software functional verification on hardware, and leads the embedded software verification work to be advanced to the scheme stage;
(2) according to the invention, the optimal capacity compiling environment is screened out through the design of a restrictive interface and intellectualization, so that the software testing efficiency is improved;
(3) the invention fully utilizes the data packets of prototype environment, prototype use case, prototype simulation result and the like of the prototype design, can quickly locate the functional design defect of the software, and obviously improves the development efficiency of the satellite-borne software of the attitude and orbit control subsystem.
Drawings
FIG. 1 is a flow chart of the overall scheme of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
A test tool comprises a management unit, an intelligent screening unit and an API interface design unit, and the specific steps are as shown in figure 1:
(1) configuring a compiling unit: a compiler consistent with an embedded code language and engineering compilation thereof is configured and installed under WINDOWS to obtain a dynamic link library file of the compiler under a system, and link library script configuration is carried out under MATLAB to realize cross compilation and calling in the MATLAB; the compiling unit selects and configures according to a compiler used by the tested software to ensure that the compiler used by the test tool is consistent with the compiler used by the tested software;
(2) intelligent analysis and input of a management unit: analyzing the module to be verified through the management unit, automatically identifying the input and output attributes of the form parameter and the global variable, and realizing the input of user test script setting data, wherein the input of the user test script setting data comprises input and output input and attribute information of an oscilloscope port; the management unit provides an interface port, restrains the information input by the user and intelligently prompts the information to be input;
(3) intelligently screening out the local environment with the optimal capacity: the intelligent screening unit traverses the reference relation of the module to be verified, notes irrelevant files and variables, screens files relevant to the module to be verified, ensures the optimal capacity of the cross compiling executable file, and forms a reference tree list and an optimal capacity compiling local environment;
(4) generating a test driving script: the API interface design unit predefines a test drive script template, the test drive script template can not be changed by self and has no redundant code, and the compilability of the back end is ensured; combining the information input by the management unit, and automatically referring to the tree list to form a final test driving script;
(5) compiling to generate an executable file: compiling the test driving scripts in the step (3) and the step (4) under MATLAB to generate a cross-compilation executable file;
(6) embedding executable files in SFUNCTION: and (4) adding an S-FUNCTION self-defining FUNCTION in the MATLAB prototype design data packet, calling the cross compiling executable file in the step (5), comparing and judging with a prototype design result, if the result is consistent, indicating that the functional design is correct, otherwise, representing that the functional design is wrong.
And (6) replacing the functional module to be verified in the prototype design data packet by using the test environment, the test case, the test method and the test result of the prototype design data packet, using the test input and the environment which are the same as those of the prototype design, comparing and judging the data result and the simulation result of the prototype design process after the simulation operation, and if the results are consistent, indicating that the functional design is correct, otherwise, indicating that the functional design is wrong.
Examples
As shown in fig. 1: in order to emphatically show the effectiveness of the verification technology, a testing simulation module is set up by taking a geomagnetic field table look-up table satellite-borne software functional module written in ADA as an example.
(1) Configuring a compiling unit
And configuring and installing an ADA language compiler under WINDOWS to obtain a dynamic link library file of the compiler under a system, and performing link library script configuration under MATLAB to realize a cross compiling function through a command line in the MATLAB.
(2) Intelligent analysis and input of management unit
Selecting a to-be-verified software module Mg _ Cb _ Cal, intelligently analyzing input and output attributes of form parameters and global variables under the software module by a management unit, simultaneously providing a GUI port, and inputting the attribute information of input, output and oscilloscope ports by a user.
(3) Intelligent screening of optimal capacity local environment
The intelligent screening unit traverses the reference relation of the module to be verified, screens the files related to the module to be verified, and intensively stores the files in a new folder Mg _ Cb _ Cal _ Demo.
(4) Generating test driver scripts
And (3) a Test driving template file is built in, the last step of user input information is merged into the template file, an internal reference relation tree list is automatically referred, header file calling is carried out, and a final Test driving script Mg _ Cb _ Cal _ Test is formed and is stored in a folder Mg _ Cb _ Cal _ Demo.
(5) Compiling to generate executable files
And (4) by a compiling command, starting MATLAB, compiling the program of the Mg _ Cb _ Cal _ Demo, and generating an Mg _ Cb _ Cal _ test.mex32 executable file.
(6) Embedding executable files in SFUNCTION
A magnetic field table look-up algorithm of an original scheme design is stored in an M language for compiling an MATLAB function, an S function which links an Mg _ Cb _ Cal _ test.mex32 executable file is embedded into a simulation model of the scheme design and is directly subjected to simulation comparison with the prototype design, the characteristics of the S function, a scheme prototype design interface and the like are consistent, an orbit clock which is output by an orbit recursion module is input, the output is the magnetic field intensity of a satellite under an orbit system, a data result and a simulation result of the prototype design process are compared and judged, if the results are consistent, the functional design is correct, and otherwise, the functional design is wrong.
The method enriches the means of embedded software functional verification, reduces the dependence of the embedded software functional verification on hardware, and leads the embedded software verification work to be advanced to the scheme stage; the optimal capacity compiling environment is screened out intelligently through the design of a restrictive interface, and the software testing efficiency is improved.
While the present invention has been described in detail with reference to the preferred embodiments, it should be understood that the above description should not be taken as limiting the invention. Various modifications and alterations to this invention will become apparent to those skilled in the art upon reading the foregoing description. Accordingly, the scope of the invention should be determined from the following claims.

Claims (6)

1. A test tool comprises a management unit, an intelligent screening unit and an API interface design unit, and is characterized in that the method comprises the following specific steps:
(1) configuring a compiling unit: a compiler consistent with an embedded code language and engineering compilation thereof is configured and installed under WINDOWS, a dynamic link library file of the compiler under a system is obtained, and link library script configuration is carried out under MATLAB, so that cross compilation calling is realized in the MATLAB;
(2) intelligent analysis and input of a management unit: analyzing the module to be verified through the management unit, automatically identifying the input and output attributes of the form parameters and the global variables, and realizing the input of user test script setting data;
(3) intelligently screening out the local environment with the optimal capacity: the intelligent screening unit traverses the reference relation of the module to be verified, screens files related to the module to be verified, and forms a reference tree list and an optimal capacity compiling local environment;
(4) generating a test driving script: the API interface design unit predefines a test drive script template, combines the information input by the management unit and automatically refers to the tree list to form a final test drive script;
(5) compiling to generate an executable file: compiling the test driving scripts in the step (3) and the step (4) under MATLAB to generate a cross-compilation executable file;
(6) embedding executable files in SFUNCTION: adding an S-FUNCTION custom FUNCTION in an MATLAB prototype design data packet, calling the cross compiling executable file in the step (5), comparing and judging with a prototype design result, if the result is consistent, indicating that the functional design is correct, otherwise, representing that the functional design is wrong;
in the step (6), adding an S-FUNCTION self-defining FUNCTION in an MATLAB prototype design data packet, calling the cross compiling executable file in the step (5) to replace a module to be verified in the prototype design data packet, using the test input and environment the same as those of prototype design, and after simulation operation, comparing and judging the data result with the simulation result of the prototype design process;
and (6) replacing the functional module to be verified in the prototype design data packet by using the test environment, the test case, the test method and the test result of the prototype design data packet, using the test input and environment which are the same as those of the prototype design, comparing and judging the data result and the simulation result of the prototype design process after simulation operation, and if the results are consistent, indicating that the functional design is correct, otherwise, indicating that the functional design is wrong.
2. A method for embedded code advanced verification based on prototype design according to claim 1, wherein the entry of user test script setup data in step (2) comprises user entry of input, output and attribute information of oscilloscope ports.
3. The method for verifying embedded code based on prototype design in advance as claimed in claim 1, wherein the compiling unit in step (1) is selectively configured according to the compiler used by the software under test to ensure that the compiler used by the test tool is consistent with the compiler used by the software under test.
4. A method for verifying embedded codes in advance based on prototype design according to claim 1, wherein the management unit in step (2) provides an interface port, constrains the information entered by the user, and intelligently prompts the information to be entered.
5. The method for embedded code advanced verification based on prototype design according to claim 1, wherein in step (3), reference associated files of the module to be verified are intelligently screened, irrelevant files and variables are annotated, the optimal capacity of the cross-compilation executable files is ensured, and a reference relationship tree list and an optimal capacity compilation local environment are formed.
6. The method for verifying embedded code based on prototype design in advance as claimed in claim 1, wherein the test driver script template in step (4) is not self-defined and can be changed without redundant code, thereby ensuring the compilability of the back end.
CN201811627999.7A 2018-12-28 2018-12-28 Embedded code advanced verification method based on prototype design Active CN109857640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811627999.7A CN109857640B (en) 2018-12-28 2018-12-28 Embedded code advanced verification method based on prototype design

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811627999.7A CN109857640B (en) 2018-12-28 2018-12-28 Embedded code advanced verification method based on prototype design

Publications (2)

Publication Number Publication Date
CN109857640A CN109857640A (en) 2019-06-07
CN109857640B true CN109857640B (en) 2022-05-24

Family

ID=66893085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811627999.7A Active CN109857640B (en) 2018-12-28 2018-12-28 Embedded code advanced verification method based on prototype design

Country Status (1)

Country Link
CN (1) CN109857640B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110516334B (en) * 2019-08-16 2021-12-03 浪潮电子信息产业股份有限公司 Convolution calculation simulation test method and device based on hardware environment and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013368A (en) * 2007-02-02 2007-08-08 浙江大学 Performance optimal design method for graph library of embedded system development platform
CN101286182A (en) * 2008-05-16 2008-10-15 浙江大学 Dynamic simulation platform method for embedded processor function verification
CN104391791A (en) * 2014-11-21 2015-03-04 北京经纬恒润科技有限公司 Method and device for testing embedded control algorithm
CN108228467A (en) * 2018-01-30 2018-06-29 北京航天长征飞行器研究所 A kind of embedded flying-controlled box algorithm fast verification method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9563415B2 (en) * 2013-05-28 2017-02-07 Sap Se Generating visually encoded dynamic codes for remote launching of applications

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013368A (en) * 2007-02-02 2007-08-08 浙江大学 Performance optimal design method for graph library of embedded system development platform
CN101286182A (en) * 2008-05-16 2008-10-15 浙江大学 Dynamic simulation platform method for embedded processor function verification
CN104391791A (en) * 2014-11-21 2015-03-04 北京经纬恒润科技有限公司 Method and device for testing embedded control algorithm
CN108228467A (en) * 2018-01-30 2018-06-29 北京航天长征飞行器研究所 A kind of embedded flying-controlled box algorithm fast verification method and system

Also Published As

Publication number Publication date
CN109857640A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
Ammann et al. Using formal methods to derive test frames in category-partition testing
EP1089172A2 (en) Compiler and method for compiling specification language into implementation language
US7895575B2 (en) Apparatus and method for generating test driver
KR100709664B1 (en) Methods and systems for automated test-case generation
KR20210149045A (en) artificial intelligence chip verification
CN105117215B (en) The development approach and device of automobile function
CN109189479B (en) Parallel automatic verification method for processor instruction set
US20080276221A1 (en) Method and apparatus for relations planning and validation
CN106155903B (en) Apparatus and method for system design verification
CN103699385A (en) Continuous code integration method
CN112131116B (en) Automatic regression testing method for embedded software
CN103605556A (en) Virtual test subject integrally-constructing system and method
CN109857640B (en) Embedded code advanced verification method based on prototype design
US20090112554A1 (en) Test Bench, Method, and Computer Program Product for Performing a Test Case on an Integrated Circuit
CN110069414B (en) Regression testing method and system
CN101673200B (en) The detection method of user input model and device
Naslavsky et al. Towards traceability of model-based testing artifacts
CN110955605A (en) Method for verifying single step dynamic execution by CPU
Hartmann et al. UML-based test generation and execution
KR100777103B1 (en) Apparatus and method for generation of test driver
CN114239459B (en) Processing method, device, equipment and medium for FPGA prototype design file
CN115034165A (en) Chip simulation verification method, system, equipment and storage medium
CN109144849A (en) A kind of embedded software adjusting, measuring method
CN114692539A (en) Method for realizing parallel verification of SOC (System on chip) chip verification architecture
CN112230848A (en) NVM automatic configuration method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant