CN116822040A - Unit test framework construction method of aircraft simulation model based on virtual function - Google Patents

Unit test framework construction method of aircraft simulation model based on virtual function Download PDF

Info

Publication number
CN116822040A
CN116822040A CN202310263217.0A CN202310263217A CN116822040A CN 116822040 A CN116822040 A CN 116822040A CN 202310263217 A CN202310263217 A CN 202310263217A CN 116822040 A CN116822040 A CN 116822040A
Authority
CN
China
Prior art keywords
unit test
class
function
unit
constructing
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.)
Granted
Application number
CN202310263217.0A
Other languages
Chinese (zh)
Other versions
CN116822040B (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.)
UNIT 63620 OF PLA
Original Assignee
UNIT 63620 OF PLA
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 UNIT 63620 OF PLA filed Critical UNIT 63620 OF PLA
Priority to CN202310263217.0A priority Critical patent/CN116822040B/en
Publication of CN116822040A publication Critical patent/CN116822040A/en
Application granted granted Critical
Publication of CN116822040B publication Critical patent/CN116822040B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/15Vehicle, aircraft or watercraft design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T90/00Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Automation & Control Theory (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses a unit test framework construction method of an aircraft simulation model based on a virtual function. The method comprises the following steps: constructing a C++ class system of an aircraft simulation model; constructing a virtual function system for unit test according to the C++ class system; constructing a tree-shaped calling frame of the unit test function according to the virtual function system; when a new aircraft simulation model is added, adding a unit test function according to the C++ class system and the tree-shaped calling framework; constructing a unit test subset; the unit test function is instantiated using the subset of unit tests. By implementing the method of the embodiment of the invention, the unit test framework of the aircraft simulation model can be constructed by considering the specific characteristics of the aircraft simulation model, the code quality and the test efficiency of unit test are improved, omission of unit test functions is effectively avoided, and the learning cost and the economic cost brought by using commercial unit test tool software are avoided.

Description

Unit test framework construction method of aircraft simulation model based on virtual function
Technical Field
The invention relates to unit testing, in particular to a method for constructing a unit testing framework of an aircraft simulation model based on a virtual function.
Background
Software testing is divided into unit testing, system testing, integration testing, acceptance testing, and the like. And writing an excellent unit test program, so that the bug can be positioned quickly, and the programming speed and the code quality are improved. In software development, errors are found as early as possible, so the cost of error correction is lower, and therefore, the programmer performs at least one unit test every time he modifies the program. Because cell testing requires details of internal programming and coding, cell testing is typically done by a programmer.
There are various unit test tool software on the market that assist software developers in writing and running unit tests. The most popular unit testing tools are xUnit class frameworks, which are commonly used according to different languages and classified into Junit, cppUnit, DUnit, nunit, phpUnit. However, the use of commercial software can result in additional learning costs, environmental setup costs, and even economic costs. When the C++ language is used for developing the aircraft simulation model, one aircraft simulation model often contains hundreds of C++ classes, unit testing of the C++ classes is a huge and important work, and the building method of the unit testing framework directly determines the development efficiency of the simulation model.
For the building of the unit test framework, there are three schemes currently, the first is to develop several unit test functions for each c++ class, these unit test functions are not member functions of the class, but global functions, and then call all the unit test functions one by one in the program. However, the scheme has a large number of repeated test codes, the C++ classes forming the simulation model of the aircraft have hundreds, inheritance relations exist among a plurality of C++ classes, and a plurality of identical test codes exist among the C++ classes with inheritance relations, so that the repeated writing of a large number of test codes is caused, the programming time is wasted, and the maintenance and the expansion of the codes are not easy; if an aircraft simulation model has hundreds of C++ classes, at least hundreds of unit test functions need to be called one by one, and a certain C++ class or a certain unit test function is inevitably missed, so that the effect of unit test is reduced, and the calling of the unit test function is easy to miss; each unit test function constituting the unit test subset needs to be specified one by one, and the unit test subset is troublesome to construct; the unit test function is not a member function of the c++ class under test, and therefore, is located away from the c++ class under test, and in order to facilitate finding an object to be tested by the unit test function, a specific method needs to be used to identify a relationship between the unit test function and the object under test, for example, a relationship between the unit test function and the c++ class under test is not tight enough with a name of the class as a beginning of a name of the unit test function. The second solution is to develop several unit test functions for each c++ class, which are member functions of the class, and then call all the unit test functions one by one. There is also a problem with the first approach; the third approach is to employ commercial unit test tools such as Visual CppUnit, cppUTest, google Mock, boost. Test, etc. These tools are developed for general programs and have a certain versatility. But this solution requires additional learning and even economic costs. By adopting the commercial unit testing tool software, not only is the software installed and the running environment set up and debugged, but also the grammar rules of the tools are learned, and certain learning cost and even economic cost are required to be paid; and the calling of the unit test function is easy to generate omission, and the construction of the unit test subset is troublesome. Moreover, all three schemes are general unit test framework construction methods aiming at general software, and specific characteristics of the aircraft simulation model are not considered.
Therefore, it is necessary to design a method to construct a unit test framework of the aircraft simulation model in consideration of specific characteristics of the aircraft simulation model, improve code quality and test efficiency of unit test, effectively avoid omission of unit test functions, and avoid learning cost and economic cost caused by using commercial unit test tool software.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a unit test framework construction method of an aircraft simulation model based on a virtual function.
In order to achieve the above purpose, the present invention adopts the following technical scheme: the method for constructing the unit test framework of the aircraft simulation model based on the virtual function is characterized by comprising the following steps of:
constructing a C++ class system of an aircraft simulation model;
constructing a virtual function system for unit test according to the C++ class system;
constructing a tree-shaped calling frame of the unit test function according to the virtual function system;
when a new aircraft simulation model is added, adding a unit test function according to the C++ class system and the tree-shaped calling framework;
constructing a unit test subset;
the unit test function is instantiated using the subset of unit tests.
The further technical scheme is as follows: the virtual function system tested according to the C++ class system building unit comprises:
declaring a unit test function in the definition of the C++ class system;
writing a unit test function in the implementation of the C++ class system to form a virtual function system of unit test.
The further technical scheme is as follows: writing a unit test function in the implementation of the C++ class system to form a virtual function system of unit test, wherein the virtual function system comprises:
writing unit test functions of a base class in the implementation of the C++ class system;
writing a unit test function of a derived class or a unit test function of a directly inherited base class in the implementation of the C++ class system to obtain the unit test function of the derived class;
and splitting the test codes of the unit test functions of the base class and the unit test functions of the derivative class into private member functions of the class to obtain a virtual function system of the unit test.
The further technical scheme is as follows: the tree-shaped calling framework for constructing the unit test function according to the virtual function system comprises the following steps:
and constructing a tree-shaped calling framework of the unit test function according to the inheritance relationship and the containing relationship among the classes of the virtual function system.
The further technical scheme is as follows: the tree-shaped calling framework for constructing unit test functions according to inheritance relations among classes and containing relations of the virtual function system comprises the following steps:
according to the virtual function system, the containing relation among the classes is realized through pointers, so that relation content is obtained;
and calling the unit test function of the C++ class contained in the relation content through a pointer to obtain a tree-shaped calling framework of the unit test function.
The further technical scheme is as follows: the implementation of the inclusion relationship between classes through pointers according to the virtual function system to obtain relationship contents comprises the following steps:
determining inclusion relationships among various C++ classes of the virtual function system according to the inclusion relationships in the real world;
in the declaration of the classes of the virtual function system, pointer variables are used for representing the inclusion relations among various C++ classes;
objects of the leaf classes that are included are generated in a constructor of the leaf class according to inclusion relationships between the various c++ classes, and pointers are pointed to the objects to obtain relationship contents.
The further technical scheme is as follows: the instantiating the unit test function with the subset of unit tests includes:
Declaring the unit test function as a common member function;
realizing an instantiated C++ class unit test function for the common member function;
calling an instantiated C++ class unit test function;
in the total test function, the call of the unit test function of the instantiated C++ class is added.
The invention also provides a device for constructing the test frame of the simulation model unit of the aircraft, which comprises the following components:
the first building unit is used for building a C++ class system of the aircraft simulation model;
the second construction unit is used for constructing a virtual function system tested by the unit according to the C++ class system;
the third construction unit is used for constructing a tree-shaped calling frame of the unit test function according to the virtual function system;
the calling unit is used for adding a unit test function according to the C++ class system and the tree-shaped calling frame when a new aircraft simulation model is added;
a fourth building unit for building a test subset of units;
an instantiation unit for instantiating the unit test function using the subset of unit tests.
The invention also provides a computer device which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the method when executing the computer program.
The present invention also provides a storage medium storing a computer program which, when executed by a processor, performs the above-described method.
Compared with the prior art, the invention has the beneficial effects that: according to the invention, through constructing the C++ class system, the virtual function system and the tree-shaped calling frame of the unit test function of the aircraft simulation model, when a new aircraft simulation model is added, the unit test function is added and instantiated, so that the unit test frame of the aircraft simulation model is constructed by considering the specific characteristics of the aircraft simulation model, the code quality and the test efficiency of unit test are improved, omission of the unit test function is effectively avoided, and the learning cost and the economic cost brought by using commercial unit test tool software are avoided.
The invention is further described below with reference to the drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to an embodiment of the present invention;
FIG. 2 is a schematic sub-flowchart of a method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to an embodiment of the present invention;
FIG. 3 is a schematic sub-flowchart of a method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to an embodiment of the present invention;
FIG. 4 is a schematic sub-flowchart of a method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to an embodiment of the present invention;
FIG. 5 is a schematic sub-flowchart of a method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to an embodiment of the present invention;
FIG. 6 is a schematic sub-flowchart of a method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a C++ class architecture for an aircraft according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a C++ class system of an engine according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a ballistic C++ class system provided by an embodiment of the present invention;
FIG. 10 is a schematic diagram of a unit test function of a derived class directly inheriting a base class according to an embodiment of the present invention;
FIG. 11 is a schematic illustration of inclusion relationships between aircraft classes and other classes provided by an embodiment of the present invention;
FIG. 12 is a schematic diagram of inclusion relationships between engine classes and other classes provided by an embodiment of the present invention;
FIG. 13 is a schematic diagram of a call unit test function provided by an embodiment of the present invention;
FIG. 14 is a schematic view of deriving a rocket type D from a rocket type according to an embodiment of the present invention;
FIG. 15 is a schematic block diagram of an aircraft simulation model unit test frame construction apparatus provided by an embodiment of the present invention;
fig. 16 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1, fig. 1 is a schematic flowchart of a method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to an embodiment of the present invention. The unit test framework construction method of the aircraft simulation model based on the virtual function is applied to a server. According to inheritance or inclusion relation existing between C++ classes contained in the aircraft simulation model, a tree-shaped unit test framework is constructed by using the most basic C++ grammar (virtual function and pointer of C++ language), so that the unit test codes are reused, the unit test calling codes are reused, omission of unit test function calling is effectively avoided, a unit test subset can be quickly and reasonably constructed, the code quality and test efficiency of unit test are improved, extra cost caused by using commercial unit test tool software is avoided, and further the development efficiency of the aircraft simulation model is remarkably improved.
Fig. 1 is a flow chart of a method for constructing a unit test framework of an aircraft simulation model based on a virtual function according to an embodiment of the present invention. As shown in fig. 1, the method includes the following steps S110 to S160.
S110, constructing a C++ class system of the aircraft simulation model.
In this embodiment, the c++ class system of the aircraft simulation model includes a c++ class system of the aircraft, a c++ class system of the engine, and a c++ class system of the trajectory. The C++ class architecture for an aircraft may be designed as shown in FIG. 7, where leaf subclasses are identified by a gray-base map. The C++ class system of the engine can be designed as shown in fig. 8, wherein leaf subclasses are marked by a gray bottom graph. The C++ class system of flight trajectory can be designed as shown in FIG. 9, in which leaf subclasses are identified by gray bottom maps.
S120, constructing a virtual function system tested by the unit according to the C++ class system.
In this embodiment, the virtual function system refers to a unit test function.
In one embodiment, referring to fig. 2, the step S120 may include steps S121 to S122.
S121, declaring a unit test function in the definition of the C++ class system.
In this embodiment, the unit test function is declared in the definition of the c++ class of the aircraft simulation model (in the h file). To use the virtual function inheritance mechanism, all unit test functions use the same function declaration:
virtual void Test () const; wherein "virtual" means that the function is a virtual function; "void" indicates that the return value of the function is null; "Test" is the name of the function; "()" indicates that the parameters of the function are null, i.e., the call unit test function does not require any parameters to be used; "const" is a key word of the c++ program language, and when it is used to modify a function, it can be forced to ensure that the operation of the function will not modify the state of a class, and if a programmer carelessly changes a certain variable of a class, then "const" can ensure that a compiler will report errors, and remind the programmer to modify the code. The test is only used to ensure that the code is correct, it should not have any substantial action, and the state of the class being tested will not change any as a result of the test being performed. Thus, using "const" to modify a unit test function indicates that the unit test function does not modify the state of the class, i.e., the state of the class is the same before and after testing.
To facilitate invocation, the unit test function is declared as a public member function of the class.
For example, the declaration of the unit test function of the C++ class architecture of an aircraft (see FIG. 1) is as follows: .
Aircraft class
{
public:
virtual void Test () const; statement of the test function of the unit
……
};
Rocket type public aircraft type
{
public:
virtual void Test () const; statement of the test function of the unit
……
};
Rocket A type is public rocket
{
public:
virtual void Test () const; statement of the test function of the unit
……
};
The declaration of the unit test function of the C++ class system of the engine is as follows:
engines and the like
{
public:
virtual void Test () const; statement of the test function of the unit
……
};
Solid engines, public engines
{
public:
virtual void Test () const; statement of the test function of the unit
……
};
Liquid engines, public engines
{
public:
virtual void Test () const; statement of the test function of the unit
……
}。
S122, writing a unit test function in the implementation of the C++ class system to form a virtual function system of unit test.
In one embodiment, referring to fig. 3, the step S122 may include steps S1221 to S1223.
S1221, writing a unit test function of a base class in the implementation of the C++ class system.
In this embodiment, if the c++ class is a base class, the unit test function is directly written as follows:
void aircraft class:: test () const
{
Testing codes;
};
the void engine class:: test () const
{
Testing codes;
}。
wherein both the aircraft class and the engine class are the base class.
S1222, writing a unit test function of a derived class or a unit test function of a directly inherited base class in the implementation of the C++ class system to obtain the unit test function of the derived class.
In this embodiment, if the c++ class is a derived class, the unit test function needs to call the unit test function of the base class, and then the proprietary test code of the base class is rewritten. For example, a "rocket class" is a derivative of an "aircraft class" and a "rocket type a" is a derivative of a "rocket class" whose unit test functions are implemented as follows:
vold rocket class:: test () const
{
Aircraft class: : test (); unit test function for a class of/(and/or calling base
Proprietary test code;
};
model A of the void rocket is Test () const
{
Rocket type: : test (); unit test function for a class of/(and/or calling base
Proprietary test code;
}。
the "solid engine class" is a derivative class of the "engine class" and the unit test function of the "solid engine class" is implemented as follows:
void solid engines class:: test () const
{
The engine class is Test (); test function for// calling base class
Proprietary test code;
}。
if the derived class has no proprietary test code, i.e., the unit test method of the derived class is the same as the unit test method of the base class, the derived class can directly inherit the unit test function of the base class. At this time, according to the virtual function inheritance mechanism of the c++ language, the derived class does not need to declare and write the unit test function any more, and the step S1221 and writing the unit test function of the derived class are omitted, so that the unit test function of the base class can be inherited automatically. Taking the class hierarchy of engines as an example, the "gas engine class" has no new test items, so there is no need to declare and implement unit test functions, as shown in FIG. 10.
Gaseous engines, public engines
{
public:
virtual void Test () const; element test function/don't need to be declared
……
}。
S1223, splitting the test codes of the unit test functions of the base class and the unit test functions of the derivative class into private member functions of the class to obtain a virtual function system of the unit test.
In this embodiment, if a certain c++ class has more test codes, in order to improve the cleanliness of the codes, the codes may be split into multiple unit test functions as private member functions of the class.
void aircraft class:: test () const
{
TestFun1 (); private membership function
TestFun2 (); private membership function
……
}。
S130, constructing a tree-shaped calling frame of the unit test function according to the virtual function system.
In this embodiment, the tree call framework refers to a tree framework for calling the unit test function.
Specifically, a tree-shaped calling framework of the unit test function is constructed according to the inheritance relationship and the inclusion relationship among the classes of the virtual function system.
In one embodiment, referring to fig. 4, the step S130 may include steps S131 to S132.
S131, according to the virtual function system, the containing relation among the classes is realized through pointers, so that relation content is obtained.
In the present embodiment, the relationship content refers to an inclusion relationship between classes.
In one embodiment, referring to fig. 5, the step S131 may include steps S1311 to S1313.
S1311, determining inclusion relations among various C++ classes of the virtual function system according to the inclusion relations in the real world.
In this embodiment, the inclusion relationship between the various c++ classes of the virtual function system means that the inclusion relationship between the various c++ classes is identical to the inclusion relationship in reality.
For example: typical aircraft contain engines, and thus "aircraft class" includes "engine class"; the aircraft generates a flight trajectory during the flight, so that the "aircraft class" includes the "trajectory class", as shown in fig. 11, in which the classes included are the engine class and the trajectory class, and the leaf class is the rocket type a class, the missile type B class, and the kinetic energy interceptor type C class.
As another example: in the real world, all engines contain nozzles, so "engines" include "nozzles"; the solid engine comprises a combustion chamber, and thus "solid engine class" comprises "combustion chamber class"; the combustion chamber is filled with a solid propellant, so that the combustion chamber comprises the solid propellant; the liquid engine includes a tank, and thus, the "liquid engine class" includes the "tank class"; the reservoir is filled with a liquid propellant, so that the reservoir contains a liquid propellant; the gas engine includes a gas cylinder, so that the "gas engine class" includes "gas cylinder class"; the gas cylinder is filled with gas, so that the "gas cylinder" includes "gas". As shown in fig. 12, the included types of c++ are a nozzle type, a tank type, a liquid propellant type, a combustion chamber type, a solid propellant type, a gas cylinder type, a gas type, a liquid engine rocket type a type, a solid transmitter missile type B type, and a gas engine kinetic energy interceptor type C type in fig. 12.
S1312, in the declaration of the classes of the virtual function system, indicating the inclusion relation among various C++ classes by pointer variables.
In this embodiment, according to the inclusion relationship between classes of fig. 11, the declaration of the aircraft class is as follows:
aircraft class
The expression "aircraft class" includes both "engine class" and "ballistic class" by means of pointers.
According to the inclusion relationship between classes of fig. 12, the statement of the liquid engine class is as follows:
liquid engines: public engines
The pointer indicates that the "liquid engine class" includes the "tank class".
The declaration of the tank class is as follows:
storage tanks
The expression "reservoir class" includes "liquid propellant class" by means of a pointer.
S1313, generating an object of the contained leaf class in a construction function of the leaf class according to the contained relation among various C++ classes, and pointing a pointer to the object to obtain relation content.
In this embodiment, the pointer is initialized to a null pointer in the constructor of the class.
Statement regarding inclusion relationship for the above class, the constructor of the class is as follows:
the "rocket type A class" is a leaf subclass in the aircraft C++ class system, as shown in FIG. 1. In the real world, rocket type a contains an engine specific to that type, namely "liquid engine rocket type a", which corresponds to the leafy class "liquid engine rocket type a" of the engine class system. Thus, in the constructor of the leaf class "rocket type A", the leaf class "liquid rocket engine type A" is created and the pointer is pointed to the leaf class as follows:
Rocket A type is the rocket A type ()
Similarly, a leaf class "ballistic rocket type A class" of the ballistic C++ class system is created and directed.
S132, calling the unit test function of the C++ class contained in the relation content through a pointer to obtain a tree-shaped calling frame of the unit test function.
In this embodiment, if a certain c++ class includes other c++ classes, in the unit test functions of the class, the unit test functions of the included c++ class are called by the pointer.
For example, "aircraft class" includes "engine class" and "ballistic class". Then the unit test function of the "aircraft class" needs to call the unit test function of the class it contains by means of a pointer;
before the call, it is determined whether the pointer is empty, and if not, the unit test function is called, as not necessarily all aircraft contain engines, e.g. the warhead of a freely flying ballistic missile, which is an aircraft, but it does not contain any engines.
Establishing a total test function of software, and calling unit test functions of all aircraft simulation models; a total test function is established, and unit test functions of all aircrafts in the whole software are called. For example, suppose 3 aircraft simulation models are created in software: the total test function is as follows:
For the simulation model of "rocket A model", although only one line of calling codes is written, according to the calling framework constructed herein, all the unit test functions of the C++ class related to the "rocket A model" are automatically called, as shown in FIG. 13, the unit test functions of the C++ class of each line are automatically called through the inheritance relation of virtual functions, the C++ related to the actual program is more, and therefore, in the figure, the omitted C++ class is denoted by … ….
And S140, adding a unit test function according to the C++ class system and the tree-shaped calling framework when adding a new aircraft simulation model.
In this embodiment, a new c++ class of the aircraft simulation model is derived from the existing c++ class system, specifically, a "rocket D model" aircraft simulation model is added to software, so that a "rocket D model class" can be derived from the existing "rocket class", as shown in fig. 14, and the newly added c++ class is identified by a red base map. Adding a C++ class unit test function of a new aircraft simulation model; if the rocket D model class has a new test code, then in the declaration of the rocket D model class, a declaration of the unit test function is added as follows:
class D class of class of class D rocket
{
public:
virtual void Test()const;
…….
}。
And writing unit test functions in the class implementation as follows:
the model D of the void rocket is Test () const
{
Rocket type: : test (); unit test function for a class of/(and/or calling base
Proprietary test code;
}。
if the "rocket D model class" does not have new test code, declaration and implementation of the unit test function is no longer required, and the compiler defaults to test it using the unit test function of the "rocket class" (base class).
And adding the call of the unit test function of the new aircraft simulation model into the software total test function.
For example, in the software total test function, a call of a unit test function of "rocket type D" is added as follows:
void TestAll()
{
m_p rocket type a- > Test ();
m_p missile type B- > Test ();
m_p kinetic energy interceptor model C- > Test ();
m_p rocket D model- > Test (); unit test function for invoking rocket D model
}。
S150, constructing a unit test subset.
In this embodiment, if the software runs a unit test for a longer time, then a subset of the set of unit tests is selectively run in order to save unit test time. The construction of the subset is herein achieved by annotating the call statements of the unit test functions of the aircraft simulation model in the total test function as follows:
By annotating the call statement of the unit test function of the 2 aircraft simulation models, the call of the unit tests of only 1 kinetic energy interceptor is realized, i.e. the unit test subset is composed of all the C++ class unit tests related to the 1 kinetic energy interceptor simulation models.
S160, instantiating the unit test function by using the unit test subset.
In the simulation process, some simpler c++ classes have a large number of examples (objects), for example, vector class cvectors consist of 3 numerical variables, and in 1 aircraft simulation model, cvectors are used to store the positions and speeds of the aircraft, and the number of objects is hundreds of thousands. For these heavily instantiated c++ classes, it is no longer appropriate to use virtual functions to implement automatic testing. The reason is that: a lot of memory space is wasted. In a C++ program, declarations of classes do not occupy memory space, but objects of classes occupy memory space. In order to save memory space, the definition of the C++ class with a large number of objects does not have any virtual function, so that a virtual function table is not available, if the unit test functions of the C++ class use a virtual function form, the class has only 1 virtual function, so that the virtual function table needs to be added, 1 pointer pointing to the virtual function table needs to be added in the memory space of each object, and the 1 pointer occupies 4 bytes of memory space, and if the number of objects is 100000, the memory space occupied by a simulation model is increased by 100000 by 4 bytes, so that a large amount of memory space is wasted. This is only due to the use of virtual functions by the unit test function, and thus is not suitable for implementing unit tests using virtual functions for a large number of instantiated c++ classes. A lot of test time is wasted.
In the method for realizing unit test based on virtual functions, 1 test function is called in each object of the C++ class, and if a plurality of objects are generated by the C++ class, the same test function is operated for a plurality of times. For example, the vector class generates 100000 objects in a simulation model, and if the unit test function adopts a virtual function, the test function will run 100000 times, which wastes a lot of test time. Thus, for a large number of instantiated c++ classes, unit testing cannot use the virtual function method, but rather requires 1 test alone.
In one embodiment, referring to fig. 6, the step S160 may include steps S161 to S164.
S161, declaring the unit test function as a common member function.
Taking the declaration of vector classes as an example, the declaration of the classes is as follows:
s162, realizing the instantiated C++ class unit test function for the common member function.
Implementation of the vector class unit test function:
void CVector::Test()const
{
the code is tested.
}
S163, calling the unit test function of the instantiated C++ class.
In this embodiment, a function is used to test a large number of instantiated c++ classes, i.e., 1 object is generated, and then 1 test function is called.
For example, call code for a number of instantiated c++ classes using TestAllData () functions on vector classes, quaternion classes, etc. is as follows:
/>
s164, adding the call of the unit test function of the instantiated C++ class into the total test function.
In this embodiment, in the total test functions of the software, the calls of the unit test functions of the added and massive instantiated c++ class are as follows:
the method of the present embodiment declares the unit test functions of all c++ classes (except for the large number of instantiated c++ classes) through virtual functions. For example, declarations of unit test functions of classes all use "virtual void Test () const; if the C++ class is a derived class, the unit test function of the class needs to call the unit test function of the base class, and then the special test code of the class is written; realizing the inclusion relation among the classes through pointers; calling the unit test function of the C++ class contained in the unit test function through the pointer; establishing a total test function of software, and calling unit test functions of all aircraft simulation models; dividing a unit test subset by taking the aircraft simulation model as a unit; the declaration of the unit test functions of a large number of instantiated C++ classes is a common member function, and only 1 call is made.
The aircraft simulation model is not only a complex system, but also has special logic that a great deal of inheritance or inclusion relation exists between C++ classes contained in the aircraft simulation model.
The method of the embodiment utilizes inheritance or inclusion relation existing between C++ classes contained in the aircraft simulation model, and uses the most basic C++ grammar to construct a unit test framework of the aircraft simulation model, so that the code quality and test efficiency of unit test are improved.
Only the most basic C++ grammar is used, so that the learning cost and the economic cost brought by using the commercial unit testing tool software are avoided; the repeated use of the unit test code and the calling code is realized, and the quality and the programming efficiency of the test code are improved; the tree-shaped calling frame of the unit test function is constructed, so that omission of the unit test function is effectively avoided; and the unit test subset is built by taking the aircraft simulation model as a unit, so that the method is faster and more reasonable.
According to the method for constructing the unit test framework of the aircraft simulation model based on the virtual function, the C++ class system, the virtual function system and the tree-shaped calling framework of the unit test function of the aircraft simulation model are built, when a new aircraft simulation model is added, the unit test function is added, instantiation is carried out, the specific characteristics of the aircraft simulation model are considered, the unit test framework of the aircraft simulation model is built, the code quality and the test efficiency of unit test are improved, omission of the unit test function is effectively avoided, and learning cost and economic cost caused by using commercial unit test tool software are avoided.
Fig. 15 is a schematic block diagram of an aircraft simulation model unit test framework construction apparatus 300 provided in an embodiment of the invention. As shown in fig. 15, the present invention further provides an aircraft simulation model unit test frame construction device 300 corresponding to the above unit test frame construction method of the aircraft simulation model based on the virtual function. The aircraft simulation model unit test framework construction apparatus 300, which includes units for performing the above-described unit test framework construction method of the virtual function-based aircraft simulation model, may be configured in a server. Specifically, referring to fig. 15, the aircraft simulation model unit test frame construction apparatus 300 includes a first construction unit 301, a second construction unit 302, a third construction unit 303, a calling unit 304, a fourth construction unit 305, and an instantiation unit 306.
A first building unit 301, configured to build a c++ class system of an aircraft simulation model; a second construction unit 302, configured to construct a virtual function system tested by the unit according to the c++ class system; a third construction unit 303, configured to construct a tree-shaped calling framework of a unit test function according to the virtual function system; a calling unit 304, configured to add a unit test function according to the c++ class system and the tree-form calling framework when adding a new aircraft simulation model; a fourth building unit 305 for building a subset of unit tests; an instantiation unit 306 for instantiating the unit test function using the subset of unit tests.
In an embodiment, the first building unit 301 includes a first declaration subunit and a first writing subunit.
A first declaration subunit, configured to declare a unit test function in a definition of the c++ class system; and the first writing subunit is used for writing the unit test function in the implementation of the C++ class system to form a virtual function system of unit test.
In an embodiment, the first writing subunit includes a base class writing module, a derived class generating module, and a splitting module.
The base class writing module is used for writing unit test functions of the base class in the implementation of the C++ class system; the derivative class generating module is used for writing a unit test function of a derivative class or directly inheriting a unit test function of a base class in the implementation of the C++ class system so as to obtain the unit test function of the derivative class; and the splitting module is used for splitting the test codes of the unit test functions of the base class and the unit test functions of the derivative class into private member functions of the class so as to obtain a virtual function system of the unit test.
In an embodiment, the second building unit 302 is configured to build a tree-like call framework of the unit test function according to the inheritance relationship between classes and the containing relationship of the virtual function system.
In one embodiment, the second building unit 302 includes a relationship implementation subunit and a pointer invoking subunit.
A relationship realization subunit, configured to realize, according to the virtual function system, a relationship between classes through pointers, so as to obtain relationship content; and the pointer calling subunit is used for calling the unit test function of the C++ class contained in the relation content through the pointer so as to obtain a tree-shaped calling framework of the unit test function.
In one embodiment, the relationship-implementing subunit includes a relationship determination module, a representation module, and a pointing module.
The relation determining module is used for determining the inclusion relation among various C++ classes of the virtual function system according to the inclusion relation of the real world; the representation module is used for representing inclusion relations among various C++ classes by pointer variables in the declaration of the classes of the virtual function system; and the pointing module is used for generating the object of the contained leaf class in the construction function of the leaf class according to the contained relation among various C++ classes and pointing the pointer to the object so as to obtain the relation content.
In one embodiment, the instantiation unit 306 includes a function sound subunit, a function implementation subunit, a function call subunit, and an add subunit.
A function declaration subunit for declaring the unit test function as a normal member function; a function implementation subunit, configured to implement an instantiated c++ class unit test function for the generic member function; a function calling subunit, configured to call an instantiated unit test function of the c++ class; and the adding subunit is used for adding the call of the unit test function of the instantiated C++ class in the total test function.
It should be noted that, as will be clearly understood by those skilled in the art, the specific implementation process of the above-mentioned device 300 for constructing an aircraft simulation model unit test frame and each unit may refer to the corresponding description in the foregoing method embodiments, and for convenience and brevity of description, the description is omitted here.
The above-described aircraft simulation model unit test framework construction apparatus 300 may be implemented in the form of a computer program which can be run on a computer device as shown in fig. 16.
Referring to fig. 16, fig. 16 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a server, where the server may be a stand-alone server or may be a server cluster formed by a plurality of servers.
With reference to FIG. 16, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a virtual function based unit test frame construction method for an aircraft simulation model.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a virtual function based unit test frame construction method for an aircraft simulation model.
The network interface 505 is used for network communication with other devices. It will be appreciated by those skilled in the art that the structure shown in FIG. 16 is merely a block diagram of some of the structures associated with the present inventive arrangements and does not constitute a limitation of the computer device 500 to which the present inventive arrangements may be applied, and that a particular computer device 500 may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to implement the steps of:
constructing a C++ class system of an aircraft simulation model; constructing a virtual function system for unit test according to the C++ class system; constructing a tree-shaped calling frame of the unit test function according to the virtual function system; when a new aircraft simulation model is added, adding a unit test function according to the C++ class system and the tree-shaped calling framework; constructing a unit test subset; the unit test function is instantiated using the subset of unit tests.
In one embodiment, when implementing the virtual function system step according to the c++ class system building unit test, the processor 502 specifically implements the following steps:
declaring a unit test function in the definition of the C++ class system; writing a unit test function in the implementation of the C++ class system to form a virtual function system of unit test.
In one embodiment, when the processor 502 writes the unit test function in the implementation of the c++ class system to form the virtual function system of the unit test, the following steps are specifically implemented:
writing unit test functions of a base class in the implementation of the C++ class system; writing a unit test function of a derived class or a unit test function of a directly inherited base class in the implementation of the C++ class system to obtain the unit test function of the derived class; and splitting the test codes of the unit test functions of the base class and the unit test functions of the derivative class into private member functions of the class to obtain a virtual function system of the unit test.
In one embodiment, when implementing the step of building a tree call framework of unit test functions according to the virtual function system, the processor 502 specifically implements the following steps:
and constructing a tree-shaped calling framework of the unit test function according to the inheritance relationship and the containing relationship among the classes of the virtual function system.
In one embodiment, when implementing the step of building a tree-like call framework of unit test functions according to the inheritance relationships between classes and the containing relationships of the virtual function system, the processor 502 specifically implements the following steps:
according to the virtual function system, the containing relation among the classes is realized through pointers, so that relation content is obtained; and calling the unit test function of the C++ class contained in the relation content through a pointer to obtain a tree-shaped calling framework of the unit test function.
In one embodiment, when the processor 502 implements the step of obtaining the relationship content by implementing the inclusion relationship between classes through pointers according to the virtual function system, the following steps are specifically implemented:
determining inclusion relationships among various C++ classes of the virtual function system according to the inclusion relationships in the real world; in the declaration of the classes of the virtual function system, pointer variables are used for representing the inclusion relations among various C++ classes; objects of the leaf classes that are included are generated in a constructor of the leaf class according to inclusion relationships between the various c++ classes, and pointers are pointed to the objects to obtain relationship contents.
In one embodiment, when the step of instantiating the unit test function using the unit test subset is implemented by the processor 502, the following steps are specifically implemented:
declaring the unit test function as a common member function; realizing an instantiated C++ class unit test function for the common member function; calling an instantiated C++ class unit test function; in the total test function, the call of the unit test function of the instantiated C++ class is added.
It should be appreciated that in an embodiment of the application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program comprises program instructions, and the computer program can be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program which, when executed by a processor, causes the processor to perform the steps of:
constructing a C++ class system of an aircraft simulation model; constructing a virtual function system for unit test according to the C++ class system; constructing a tree-shaped calling frame of the unit test function according to the virtual function system; when a new aircraft simulation model is added, adding a unit test function according to the C++ class system and the tree-shaped calling framework; constructing a unit test subset; the unit test function is instantiated using the subset of unit tests.
In one embodiment, when the processor executes the computer program to implement the virtual function system step according to the c++ class system building unit test, the processor specifically implements the following steps:
declaring a unit test function in the definition of the C++ class system; writing a unit test function in the implementation of the C++ class system to form a virtual function system of unit test.
In one embodiment, when the processor executes the computer program to implement the step of writing the unit test function in the implementation of the c++ class system to form a virtual function system of unit test, the steps are specifically implemented as follows:
Writing unit test functions of a base class in the implementation of the C++ class system; writing a unit test function of a derived class or a unit test function of a directly inherited base class in the implementation of the C++ class system to obtain the unit test function of the derived class; and splitting the test codes of the unit test functions of the base class and the unit test functions of the derivative class into private member functions of the class to obtain a virtual function system of the unit test.
In one embodiment, when the processor executes the computer program to implement the step of building a tree-like calling framework of unit test functions according to the virtual function system, the processor specifically implements the following steps:
and constructing a tree-shaped calling framework of the unit test function according to the inheritance relationship and the containing relationship among the classes of the virtual function system.
In one embodiment, when the processor executes the computer program to implement the step of building a tree-like call framework of unit test functions according to inheritance relationships among classes and containing relationships according to the virtual function system, the steps are specifically implemented as follows:
according to the virtual function system, the containing relation among the classes is realized through pointers, so that relation content is obtained; and calling the unit test function of the C++ class contained in the relation content through a pointer to obtain a tree-shaped calling framework of the unit test function.
In one embodiment, when the processor executes the computer program to implement the step of obtaining the relationship content by implementing the inclusion relationship between classes through pointers according to the virtual function system, the steps are specifically implemented as follows:
determining inclusion relationships among various C++ classes of the virtual function system according to the inclusion relationships in the real world; in the declaration of the classes of the virtual function system, pointer variables are used for representing the inclusion relations among various C++ classes; objects of the leaf classes that are included are generated in a constructor of the leaf class according to inclusion relationships between the various c++ classes, and pointers are pointed to the objects to obtain relationship contents.
In one embodiment, when the processor executes the computer program to implement the step of instantiating the unit test function using the subset of unit tests, the processor specifically implements the steps of:
declaring the unit test function as a common member function; realizing an instantiated C++ class unit test function for the common member function; calling an instantiated C++ class unit test function; in the total test function, the call of the unit test function of the instantiated C++ class is added.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. A method for constructing a unit test framework of an aircraft simulation model based on a virtual function is characterized in that,
comprising the following steps:
constructing a C++ class system of an aircraft simulation model;
constructing a virtual function system for unit test according to the C++ class system;
constructing a tree-shaped calling frame of the unit test function according to the virtual function system;
when a new aircraft simulation model is added, adding a unit test function according to the C++ class system and the tree-shaped calling framework;
constructing a unit test subset;
the unit test function is instantiated using the subset of unit tests.
2. The method for constructing a virtual function system according to claim 1, wherein the constructing a virtual function system for unit testing according to the c++ class system comprises:
declaring a unit test function in the definition of the C++ class system;
writing a unit test function in the implementation of the C++ class system to form a virtual function system of unit test.
3. The method for constructing a virtual function-based unit test framework of an aircraft simulation model according to claim 2, wherein writing unit test functions in the implementation of the c++ class system to form a virtual function system of unit tests comprises:
Writing unit test functions of a base class in the implementation of the C++ class system;
writing a unit test function of a derived class or a unit test function of a directly inherited base class in the implementation of the C++ class system to obtain the unit test function of the derived class;
and splitting the test codes of the unit test functions of the base class and the unit test functions of the derivative class into private member functions of the class to obtain a virtual function system of the unit test.
4. The method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to claim 1, wherein the constructing a tree-like call framework of unit test functions according to the virtual function system comprises:
and constructing a tree-shaped calling framework of the unit test function according to the inheritance relationship and the containing relationship among the classes of the virtual function system.
5. The method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to claim 4, wherein the constructing a tree-like call framework of unit test functions from the virtual function system through inheritance relationships between classes and inclusion relationships comprises:
according to the virtual function system, the containing relation among the classes is realized through pointers, so that relation content is obtained;
And calling the unit test function of the C++ class contained in the relation content through a pointer to obtain a tree-shaped calling framework of the unit test function.
6. The method for constructing a unit test framework of an aircraft simulation model based on virtual functions according to claim 1, wherein the implementation of the inclusion relationship between classes by pointers according to the virtual function system to obtain relationship contents comprises:
determining inclusion relationships among various C++ classes of the virtual function system according to the inclusion relationships in the real world;
in the declaration of the classes of the virtual function system, pointer variables are used for representing the inclusion relations among various C++ classes;
objects of the leaf classes that are included are generated in a constructor of the leaf class according to inclusion relationships between the various c++ classes, and pointers are pointed to the objects to obtain relationship contents.
7. The method for building a unit test framework for a virtual function-based aircraft simulation model of claim 1, wherein instantiating the unit test function using the subset of unit tests comprises:
declaring the unit test function as a common member function;
realizing an instantiated C++ class unit test function for the common member function;
Calling an instantiated C++ class unit test function;
in the total test function, the call of the unit test function of the instantiated C++ class is added.
8. The device for constructing the test frame of the simulation model unit of the aircraft is characterized by comprising the following components:
the first building unit is used for building a C++ class system of the aircraft simulation model;
the second construction unit is used for constructing a virtual function system tested by the unit according to the C++ class system;
the third construction unit is used for constructing a tree-shaped calling frame of the unit test function according to the virtual function system;
the calling unit is used for adding a unit test function according to the C++ class system and the tree-shaped calling frame when a new aircraft simulation model is added;
a fourth building unit for building a test subset of units;
an instantiation unit for instantiating the unit test function using the subset of unit tests.
9. A computer device, characterized in that it comprises a memory on which a computer program is stored and a processor which, when executing the computer program, implements the method according to any of claims 1-7.
10. A storage medium storing a computer program which, when executed by a processor, performs the method of any one of claims 1 to 7.
CN202310263217.0A 2023-03-17 2023-03-17 Unit test framework construction method of aircraft simulation model based on virtual function Active CN116822040B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310263217.0A CN116822040B (en) 2023-03-17 2023-03-17 Unit test framework construction method of aircraft simulation model based on virtual function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310263217.0A CN116822040B (en) 2023-03-17 2023-03-17 Unit test framework construction method of aircraft simulation model based on virtual function

Publications (2)

Publication Number Publication Date
CN116822040A true CN116822040A (en) 2023-09-29
CN116822040B CN116822040B (en) 2024-06-14

Family

ID=88111572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310263217.0A Active CN116822040B (en) 2023-03-17 2023-03-17 Unit test framework construction method of aircraft simulation model based on virtual function

Country Status (1)

Country Link
CN (1) CN116822040B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5737609A (en) * 1994-10-18 1998-04-07 Marcam Corporation Method and apparatus for testing object-oriented programming constructs
US20040143819A1 (en) * 2003-01-10 2004-07-22 National Cheng Kung University Generic software testing system and mechanism
US20110321013A1 (en) * 2010-06-23 2011-12-29 Quickunit Ltd Interactive environment for test case generation associated with a computer code
CN103617120A (en) * 2013-12-05 2014-03-05 北京奇虎科技有限公司 Unit testing method and device
US9043759B1 (en) * 2011-01-27 2015-05-26 Trimble Navigation Limited System and method for generating software unit tests simultaneously with API documentation
CN106095668A (en) * 2016-06-02 2016-11-09 上海科梁信息工程股份有限公司 Generation method based on the C++ test case of event and action
CN111008153A (en) * 2019-12-29 2020-04-14 合肥工大高科信息科技股份有限公司 Unit testing method and system
US20200210325A1 (en) * 2018-12-28 2020-07-02 Paypal, Inc. Streamlined creation of integration tests

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5737609A (en) * 1994-10-18 1998-04-07 Marcam Corporation Method and apparatus for testing object-oriented programming constructs
US20040143819A1 (en) * 2003-01-10 2004-07-22 National Cheng Kung University Generic software testing system and mechanism
US20110321013A1 (en) * 2010-06-23 2011-12-29 Quickunit Ltd Interactive environment for test case generation associated with a computer code
US9043759B1 (en) * 2011-01-27 2015-05-26 Trimble Navigation Limited System and method for generating software unit tests simultaneously with API documentation
CN103617120A (en) * 2013-12-05 2014-03-05 北京奇虎科技有限公司 Unit testing method and device
CN106095668A (en) * 2016-06-02 2016-11-09 上海科梁信息工程股份有限公司 Generation method based on the C++ test case of event and action
US20200210325A1 (en) * 2018-12-28 2020-07-02 Paypal, Inc. Streamlined creation of integration tests
CN111008153A (en) * 2019-12-29 2020-04-14 合肥工大高科信息科技股份有限公司 Unit testing method and system

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
KFGGWW: "linux环境编程(1): 实现一个单元测试框架-1", Retrieved from the Internet <URL:https://www.cnblogs.com/kfggww/p/17064038.html> *
刘艳平;费琪;陈伟;: "单元测试框架GTest的自动调用机制分析", 微型电脑应用, no. 05, 16 May 2019 (2019-05-16), pages 96 - 98 *
姜文;缪淮扣;刘玲;: "一个自动构造类测试驱动程序的框架", 计算机科学, no. 03, 31 December 2015 (2015-12-31), pages 159 - 161 *
李言平;晏海华;柳永坡;: "一种C++单元测试支持工具的研究与设计", 计算机与数字工程, no. 10, 20 October 2006 (2006-10-20), pages 172 - 175 *
特立独行的猫A: "浅谈c++单元测试", Retrieved from the Internet <URL:https://blog.csdn.net/yyz_1987/article/details/126114947> *
翁燕: "基于NUnit测试框架的应用与改进", 万方学位论文, 1 April 2017 (2017-04-01), pages 1 - 76 *
贾长伟;廖建;焉宁;张丽晔;赵雯;: "基于CppUnit的虚拟试验单元测试研究", 计算机测量与控制, no. 04, 25 April 2015 (2015-04-25), pages 1155 - 1160 *

Also Published As

Publication number Publication date
CN116822040B (en) 2024-06-14

Similar Documents

Publication Publication Date Title
CN108376221B (en) Software system security verification and evaluation method based on AADL (architecture analysis and design language) model extension
US8799875B2 (en) Streamlining unit testing through hot code swapping
CN102667730B (en) Design time debugging
US20070204261A1 (en) Robust software library wrapper method and apparatus
CN110262976B (en) Game resource file analysis method, device, equipment and storage medium
US8935672B1 (en) Lazy evaluation of geometric definitions of objects within procedural programming environments
CN102207903A (en) Automatically redirecting method calls for unit testing
US20130024844A1 (en) Continuous evaluation of program code and saving state information associated with program code
US9645915B2 (en) Continuous evaluation of program code and saving state information associated with program code
US5680584A (en) Simulator system for code execution and debugging within a multi-architecture environment
US11263150B2 (en) Testing address translation cache
CN110598855A (en) Deep learning model generation method, device, equipment and storage medium
US20050060685A1 (en) Program generator
US20090119310A1 (en) Saving and restarting discrete event simulations
US20060026584A1 (en) Explicit linking of dynamic link libraries
CN116822040B (en) Unit test framework construction method of aircraft simulation model based on virtual function
US20130173887A1 (en) Processor simulation environment
US6226406B1 (en) Method and apparatus for hybrid sampling image verification
CN110765008A (en) Data processing method and device
CN116663489A (en) RTL module resetting method and device, electronic equipment and storage medium
CN108205596B (en) Method for realizing simulation function of serious accident analysis and calculation program of nuclear power plant
US6886125B2 (en) Testing a processor using a random code generator
US7546589B2 (en) Semi-automated desk checking system and method
CN105589766B (en) A kind of VxWorks start-up course task exception detection method
Andersson Glass μSPL-Proprietary Graphics Language Transpiler: Asserting translation correctness using runtime verification

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