CN114090365A - Method, device and equipment for performing function test by using dynamic link library - Google Patents

Method, device and equipment for performing function test by using dynamic link library Download PDF

Info

Publication number
CN114090365A
CN114090365A CN202111477591.8A CN202111477591A CN114090365A CN 114090365 A CN114090365 A CN 114090365A CN 202111477591 A CN202111477591 A CN 202111477591A CN 114090365 A CN114090365 A CN 114090365A
Authority
CN
China
Prior art keywords
test
test step
attribute
dynamic link
link library
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111477591.8A
Other languages
Chinese (zh)
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.)
Daotech Technology Co ltd
Original Assignee
Daotech Technology Co ltd
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 Daotech Technology Co ltd filed Critical Daotech Technology Co ltd
Priority to CN202111477591.8A priority Critical patent/CN114090365A/en
Publication of CN114090365A publication Critical patent/CN114090365A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/263Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/4492Inheritance

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present disclosure provides a method, an apparatus and a device for performing a function test using a dynamic link library, wherein the method includes: acquiring a test configuration file corresponding to a test, wherein the test configuration file predefines an execution sequence between test steps and test steps contained in the test, each test step is determined based on a step template, each test step comprises a template identifier and attribute configuration, and each test step is realized by a dynamic link library corresponding to the template identifier; analyzing the test configuration file, determining a dynamic link library corresponding to the test step according to the template identification of the test step for each test step contained in the test, calling a derivation function of the dynamic link library corresponding to the test step, and establishing a test step object according to the attribute configuration of the test step by the derivation function; and calling a method for testing a test step object corresponding to the test step included in the test according to the execution sequence so as to execute the function of the corresponding test step. By the aid of the test code recycling method and the test code recycling device, the test codes can be recycled.

Description

Method, device and equipment for performing function test by using dynamic link library
Technical Field
The present disclosure relates to the field of test technologies, and in particular, to a method, an apparatus, and a device for performing a function test using a dynamic link library.
Background
The test equipment and the tested equipment are communicated usually through Ethernet, serial ports, 1553 or GLink and other modes, so that a plurality of test items initiated by the test equipment to the tested equipment are completed.
In the related art, each test item needs to be written with software codes, and the test logic and the test execution are coupled, so that the test logic and the test codes cannot be reused, and the test cost is high.
Disclosure of Invention
The present disclosure provides a method, an apparatus, and a device for performing a function test using a dynamic link library, so as to solve at least the problem of high test cost in the related art.
According to an aspect of the present disclosure, there is provided a method for functional testing using a dynamic link library, including: acquiring a test configuration file corresponding to a test, wherein the test configuration file predefines an execution sequence between test steps and test steps contained in the test, each test step is determined based on a step template, each test step comprises a template identifier and attribute configuration, and each test step is realized by a dynamic link library corresponding to the template identifier; analyzing the test configuration file, determining a dynamic link library corresponding to the test step according to the template identification of the test step for each test step contained in the test, calling a derivation function of the dynamic link library corresponding to the test step, and establishing a test step object according to the attribute configuration of the test step by the derivation function; and calling a method for testing a test step object corresponding to the test step included in the test according to the execution sequence so as to execute the function of the corresponding test step.
According to another aspect of the present disclosure, there is provided an apparatus for performing a function test using a dynamic link library, including: the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a test configuration file corresponding to a test, the test configuration file predefines the execution sequence between the test steps and the test steps contained in the test, each test step is determined based on a step template, each test step comprises a template identifier and attribute configuration, and each test step is realized by a dynamic link library corresponding to the template identifier; the first calling module is used for analyzing the test configuration file, determining a dynamic link library corresponding to the test step according to the template identification of the test step for each test step contained in the test, calling a derivation function of the dynamic link library corresponding to the test step, and establishing a test step object according to the attribute configuration of the test step by the derivation function; and the second calling module is used for calling the method for testing the test step object corresponding to the test step included in the test according to the execution sequence so as to execute the function of the corresponding test step.
According to still another aspect of the present disclosure, there is provided an electronic device including: a processor; and a memory storing a program, wherein the program comprises instructions that, when executed by the processor, cause the processor to perform the methods of the present disclosure.
According to yet another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of the present disclosure.
According to one or more technical schemes provided in the embodiment of the disclosure, a plurality of step templates are set, each step template is provided with a corresponding dynamic link library, a test step is set based on the step templates, the function of the test step is realized by the dynamic link libraries, the step templates and the dynamic link libraries can be used for different tests, the test steps included in the tests are predefined in a test configuration file, the attributes of the test steps are configured, the test logic can be simply and clearly set, the test steps are realized by the corresponding dynamic link libraries, and the implementation details are not required to be paid attention to in the test logic. In addition, the test steps included in the test are executed based on the test configuration file, the problem of repeatedly compiling the source code is avoided, and the test steps use the corresponding dynamic link library to realize easy version management and filing.
Drawings
Further details, features and advantages of the disclosure are disclosed in the following description of exemplary embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 illustrates a flow chart of a method for functional testing using a dynamic link library according to an exemplary embodiment of the present disclosure;
FIG. 2 illustrates a block diagram of an apparatus for functional testing using a dynamic link library, according to an exemplary implementation of the present disclosure;
FIG. 3 shows a schematic block diagram of a system for functional testing using a dynamic link library, according to an example embodiment of the present disclosure;
FIG. 4 shows a schematic diagram of a configuration user interface according to an example embodiment of the present disclosure;
FIG. 5 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description. It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Fig. 1 is a flowchart illustrating a method of performing a functional test using a dynamic link library according to an exemplary embodiment of the present disclosure, and as shown in fig. 1, the method includes steps S101 to S103.
Step S101, the test equipment obtains a test configuration file corresponding to the test.
In exemplary embodiments of the present disclosure, a plurality of step templates may be predefined, a step template being an abstraction of a test step. Each step template includes a template identification and one or more attributes. The template identification is used as the unique identification of the step template and is used for distinguishing different step templates. Each step template corresponds to a dynamic link library, and the dynamic link library realizes the function corresponding to the step template. One or more attributes of the step template may be configured to form the actual testing step, which includes the template identification and attribute configuration. The corresponding relationship between the template identifier and the dynamic link library can be established so as to determine the dynamic link library corresponding to the testing step based on the template identifier. In one embodiment, the template identifier of the step template is a step template name, and a name of a dynamic link library corresponding to the step template may be set as the step template name.
In some embodiments, when creating a dynamic link library corresponding to a step template, a step subclass is defined by using a preset class as a parent class through an inheritance mechanism of object-oriented programming (e.g., C + +). The step subclass inherits the general attributes and methods of the parent class, and some specific attributes and methods can be added according to specific requirements. A derivation function is implemented in the form of a dynamically linked library global derivation. And compiling the codes into a dynamic link library. When the dynamic link library is used, the step subclass object (i.e. the test step object) is created by the export function, and then the attributes and methods on the test step object can be used to realize the functions of the corresponding test step.
In step S101, each test step is determined based on a step template, each test step includes a template identifier and an attribute configuration, and each test step is implemented by a dynamic link library corresponding to the template identifier. In one embodiment, the attribute configuration includes an attribute name and an attribute value. As an example, the attribute of the test procedure for the Delay time may include a Delay time length and a Delay Unit, the attribute name corresponding to the Delay time length may be defined as "Delay", the attribute value may be set to a natural number (e.g., 200), the attribute name corresponding to the Delay Unit may be defined as "Unit", and the attribute value may be set to a time Unit such as millisecond, second, etc.
In some embodiments, each test step may further include one or more other information, which is not limited by the embodiments of the present disclosure, for example, a test step description may be provided for explaining the function of the test step.
In the exemplary embodiment of the present disclosure, the test configuration file may use various Markup languages, such as XML (EXtensible Markup Language), JSON (JavaScript Object Notation), and the like, which are not described in detail in the embodiment of the present disclosure.
In step S101, the test profile predefines test steps involved in the test and the execution order between the test steps. In some embodiments, the execution order between the test steps in the test configuration file is determined based on the location of the test steps in the configuration file, which is a tree structure by parsing the XML file, for example. In other embodiments, the test configuration file may include serial numbers of the test steps, and the sequencing between the test steps may be determined based on the serial numbers of the test steps. As one embodiment, the sequence number of the test step is generated when the test configuration file is generated.
Step S102, the test equipment analyzes the test configuration file, for each test step included in the test, the dynamic link library corresponding to the test step is determined according to the template identification of the test step, the export function of the dynamic link library corresponding to the test step is called, and the export function configures and creates a test step object according to the attribute of the test step.
In step S102, as an embodiment, the testing device traverses the test configuration file, acquires a template identifier (e.g., a predefined step template name) when traversing to each testing step, queries and loads a corresponding dynamic link library (e.g., a dynamic link library having the same name as the step template name) based on the template identifier, and then calls a derivation function of the dynamic link library. As an example, in the test configuration file, each test step includes a start tag and an end tag, the template identification and attribute configuration is located between the start tag and the end tag, and the test step is located based on the start tag and the end tag.
In some embodiments, in step S102, the main program of the test device determines the dynamic link library corresponding to the test step according to the template identifier of the test step, loads the dynamic link library corresponding to the test step, calls the derivation function therein, creates a corresponding test step object according to the attribute configuration of the test step by using the derivation function, and returns the pointer of the test step object to the main program for use.
As an implementation manner, when a dynamic link library corresponding to a step template is developed, a test step corresponding to a predefined step template includes attributes of "a" and "B", so that two member variables of "a" and "B" are added to a corresponding test step class, an export function searches for a label of "a" and "B" in the attribute configuration of a test configuration file, obtains the value of the label, then allocates a memory space to construct a test step object, stores the label value in the corresponding member variable, and completes the corresponding creation of the test step.
Taking a Delay step as an example, when a dynamic link library corresponding to a template in the step is developed, a code is written under the condition that attributes of "Delay" and "Unit" are known to exist, so that two member variables of "Delay" and "Unit" are added in a corresponding class, a function code is derived, a label of "Delay" and "Unit" is searched in attribute configuration of a corresponding test step, a value of the label is obtained, attribute values of the attributes of "Delay" and "Unit" are obtained (for example, the value of "Delay" in the attribute configuration is set to 2000, the value of "Unit" is set to "ms", a test Delay step represents Delay of 2000 milliseconds), then a memory space is allocated to construct a Delay step object, the value of the label is stored in the corresponding member variable, and corresponding creation of the Delay step is completed.
Step S103, the test equipment calls the method of the test step object corresponding to the test step included in the test according to the execution sequence among the test steps to execute the function of each test step.
In some embodiments, in step S102, invoking a method of the test step object corresponding to each test step to perform the function of each test step includes: and calling a first preset method of the test step object corresponding to each test step, and calling one or more second preset methods of the test step object by using the first preset method. The first preset method is used as an interface called by the test equipment, the function of the test step is executed by calling the first preset method, the first preset method calls one or more second preset methods, and the function of the test step is realized by the first preset method and the called second preset method. Therefore, the complexity of calling the dynamic link library is reduced, and the main program does not need to pay attention to the specific implementation of the test step.
In some embodiments, the attribute configuration includes a hardware type and a control parameter, and the second preset method includes a hardware control method configured to call a driver and a library function of the corresponding hardware device based on the hardware type and the control parameter to implement control of the hardware device. Therefore, the hardware equipment and the test logic are separated, and when the test logic is set, the hardware equipment does not need to be concerned, so that the test logic can be suitable for different hardware equipment of different hardware types. As one example, the control parameters include a hardware channel number, and the like.
In some embodiments, the one or more second predetermined methods include an attribute output method configured to insert the predetermined attributes of the test step object into the output attribute set of the test step object for use by other test steps. Thus, the reference between test steps may be implemented such that a subsequent test step may reference the attribute values of a previous test step. In one embodiment, the output attribute set is implemented in the form of a map container, and the output attribute set includes key-value pairs composed of attribute names and attribute values.
In some embodiments, the attribute configuration comprises a reference configuration of the attribute, the reference configuration comprising location information and an attribute name, wherein creating the test step object by the export function from the attribute configuration of the test step comprises: determining location information and an attribute name of the attribute based on the reference configuration; the referenced test step object is determined based on the location information to read an attribute value of the attribute name from the output attribute set of the referenced test step object as the attribute value of the attribute when the attribute is used. As one embodiment, the testing step includes an indication of whether the reference is included, which is set to "yes" (true) when the reference is included, and set to "no" (false) when the reference is not included.
In some embodiments, the Test configuration file further predefines a Test Procedure (Test Procedure) and a Test Case (Test Case) that the Test contains, the Test Procedure including one or more Test cases, each Test Case including one or more Test steps.
In some embodiments, the location information includes a sequence number of a test procedure, a sequence number of a test case, and a sequence number of a test step. As an example, the test procedure has a serial number of "134", the test case has a serial number of "5308", the referenced test step has a serial number of "220691", and the location information may be represented as "! 134@5308#220691 ". When the attribute value corresponding to the attribute name is an array, the attribute name further includes an array element identifier, for example, "data [0 ]", indicating the value of the first element of the attribute "data".
In some embodiments, the one or more second preset methods include: the method comprises a method for acquiring an operation result of a test step and a method for outputting test information of the test step.
In some embodiments, the execution status of the test step under each test case (e.g., whether the test is completed, whether the test data is correct, and the dynamic link library) is determined, and the execution result of the test case is generated.
In some embodiments, the relevant test information is printed on the user interface before and after each test step is performed, and a test log is saved.
The use of a dynamically linked library for functional testing is described below in connection with an example.
The example test process includes an example test case, and the testing of the example test case includes: the method comprises a switch closing step, a time delay step, a BU153 step, a judging step and a switch opening step. Wherein the switch closing step and the switch opening step are configured based on a "switch connect" step template. And executing a switch closing step: the first channel (channel number = 1) of the first block (board number = 0) CPCI _ OEM64F board is closed. And a time delay step is executed: the current test Delay is 200 (Delay = 200) milliseconds (Unit = ms). The BU153 step is executed: the first Channel (Channel = 0) exchanges data in BC (WorkMode = BC) mode (ExMode = EXCH). Executing a judging step: v refers to the first element value of the Data array attribute in the last BU153 step, and determines whether the value is greater than 0 (judgcalc = v > 0). And executing a switch disconnection step: the first channel (channel number = 1) of the first block (board number = 0) CPCI _ OEM64F board is disconnected.
Fig. 2 is a block diagram illustrating a structure of an apparatus for performing a functional test using a dynamic link library according to an exemplary embodiment of the present disclosure, as shown in fig. 2, the apparatus including: an acquisition module 210, a first calling module 220, and a second calling module 230.
The obtaining module 210 is configured to obtain a test configuration file corresponding to a test.
The method comprises the steps of pre-defining a test sequence between test steps and test steps contained in the test by a test configuration file, determining each test step based on a step template, configuring each test step by a template identifier and attributes, and realizing each test step by a dynamic link library corresponding to the template identifier.
The first calling module 220 is connected to the obtaining module 210, and is configured to parse the test configuration file, determine, for each test step included in the test, a dynamic link library corresponding to the test step according to the template identifier of the test step, call a derivation function of the dynamic link library corresponding to the test step, and configure, by the derivation function, a test step object according to the attribute of the test step.
And the second calling module 230 is connected to the first calling module 220, and is configured to call a method for testing a test step object corresponding to a test step included in the test according to the execution sequence, so as to execute a function of each test step.
In some embodiments, the second invoking module 230 is configured to invoke a first preset method of a test step object corresponding to the test step, and invoke one or more second preset methods of the test step object by the first preset method.
Fig. 3 shows a schematic block diagram of a system for functional testing using a dynamic link library according to an exemplary embodiment of the present disclosure, and referring to fig. 3, the system includes: a configuration device 310, a step template library 320, and a software package 330 and a testing device 340.
Referring to fig. 3, the step template library 320 includes step templates 321A to 321N, each of the step templates 321A to 321N including a template identification and one or more attributes. Each of the step templates 321A to 321N may be configured as an actual testing step, and the testing steps determined by the step templates may constitute a testing process, and the testing process is performed by the testing steps in sequence to realize the testing.
Referring to fig. 3, the configuration device 310 includes a configuration user interface 311, and the configuration device 310 may load and display step templates in the step template library 320 in the configuration user interface 311, receive a user selection of a displayed step template, add the selected step template to the test, and receive a user input of one or more attributes in the step template, and generate an attribute configuration. And obtaining a test step comprising template identification and attribute configuration. After the testing steps included in the configuration test, a test configuration file 322 corresponding to the test is generated. Test configuration file 322 defines the test steps and the execution order between the test steps that the test contains, each test step is determined based on a step template, and each test step includes a template identification and an attribute configuration. Illustratively, test configuration file 322 is stored in XML format, but is not so limited.
As an example, fig. 4 shows a schematic diagram of a configuration user interface according to an exemplary embodiment of the present disclosure, as shown in fig. 4, the configuration user interface 311 includes a first area 311A, a second area 311B, and a third area 311C, the first area 311A is configured to display step templates in the step template library 320, and the second area 311B is configured to display flow steps involved in testing. The first area 311A is configured to receive a selection of a step template from a user, and add the step template to the second area 311B to add a corresponding test step in a test, for example, receive a drag operation to drag the corresponding step template to the second area 311B, and complete the addition of the test step. The second area 311B is configured to receive an operation on a test step included in the test, such as adjusting the order relationship of the test step, deleting the test step, copying the test step, and the like. The second area 311B receives the selection of the test procedure, displays the attribute of the procedure template corresponding to the test procedure in the third area 311C, and receives the editing of the attribute to form the attribute configuration.
As further shown in FIG. 3, software package 330 includes dynamically linked libraries 331A through 331N. Each of the dynamic link libraries 331A to 331N is associated with a corresponding step template 321A to 321N, and the dynamic link library implements a function of a test step determined based on the step template.
The testing device 340 is configured to obtain a test configuration file corresponding to the test, analyze the test configuration file, determine, for each test step included in the test, a dynamic link library corresponding to the test step according to a template identifier of the test step, call a derivation function of the dynamic link library corresponding to the test step, and create a test step object by the derivation function according to attribute configuration of the test step; and calling a method for testing a test step object corresponding to the test step included in the test according to the execution sequence of the test step so as to execute the function of the corresponding test step.
In some embodiments, the testing device 340 calls a method of the test step object corresponding to each test step to perform the function of each test step, including: and calling a first preset method of the test step object corresponding to each test step, and calling one or more second preset methods of the test step object by using the first preset method. The first preset method is used as an interface called by the test equipment, the function of the test step is executed by calling the first preset method, the first preset method calls one or more second preset methods, and the function of the test step is realized by the first preset method and the called second preset method. Therefore, the complexity of calling the dynamic link library is reduced, and the main program does not need to pay attention to the specific implementation of the test step.
In some embodiments, the attribute configuration includes a hardware type and a control parameter, and the second preset method of the dynamic link library includes a hardware control method configured to call a driver and a library function of the corresponding hardware device based on the hardware type and the control parameter to implement control of the hardware device. Therefore, the hardware equipment and the test logic are separated, and when the test logic is set, the hardware equipment does not need to be concerned, so that the test logic can be suitable for different hardware equipment of different hardware types. As one example, the control parameters include a hardware channel number, and the like.
In some embodiments, the second predetermined method of the dynamic link library comprises an attribute output method configured to insert the predetermined attributes of the test step object into the output attribute set of the test step object for use by other test steps. Thus, the reference between test steps may be implemented such that a subsequent test step may reference the attribute values of a previous test step. In one embodiment, the output attribute set is implemented in the form of a map container, and the output attribute set includes key-value pairs composed of attribute names and attribute values.
In some embodiments, the second preset method of dynamically linking the library comprises: the method comprises a method for acquiring an operation result of a test step and a method for outputting test information of the test step. The testing device 340 comprises a testing user interface 341 for displaying
In some embodiments, the attribute configuration comprises a reference configuration of the attribute, the reference configuration comprising location information and an attribute name, wherein creating the test step object by the export function from the attribute configuration of the test step comprises: determining location information and an attribute name of the attribute based on the reference configuration; the referenced test step object is determined based on the location information to read an attribute value of the attribute name from the output attribute set of the referenced test step object as the attribute value of the attribute when the attribute is used.
In some embodiments, the test configuration file further predefines test procedures and test cases contained in the test, the test procedures including one or more test cases, each test case including one or more of said test steps.
In some embodiments, the location information includes a sequence number of a test procedure, a sequence number of a test case, and a sequence number of a test step.
In some embodiments, the testing device 340 determines the execution status of the testing step under each test case (e.g., whether the testing step is completed, whether the testing data is correct, and a dynamic link library), and generates the execution result of the test case.
In some embodiments, the testing device 340 prints relevant test information to the user interface before and after each testing step is performed, and saves a test log.
As an embodiment, the configuration device 310 is implemented by an ADE (Application Development Environment) module. The user combines the required test steps into a test flow tree in an interface dragging mode, and the ADE module generates a corresponding test configuration file (such as a file in an XML format) according to the test flow tree.
As an embodiment, the testing device 340 is implemented by a RTE (Program Runtime Engine) module. And acquiring a test execution test step by analyzing the test configuration file during running, and executing a derived function in the dynamic link library corresponding to the test step. Taking the test configuration file in the XML format as an example, the corresponding XML file is analyzed and tested, the required dynamic link library is loaded, and the test step object is distributed in the memory. And sequentially executing the method of each test step object according to the sequence relation in the XML file.
An exemplary embodiment of the present disclosure also provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, is for causing the electronic device to perform a method according to an embodiment of the disclosure.
The disclosed exemplary embodiments also provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is adapted to cause the computer to perform a method according to an embodiment of the present disclosure.
The exemplary embodiments of the present disclosure also provide a computer program product comprising a computer program, wherein the computer program, when executed by a processor of a computer, is adapted to cause the computer to perform a method according to an embodiment of the present disclosure.
Referring to fig. 5, a block diagram of a structure of an electronic device 500, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the electronic device 500 are connected to the I/O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 may be any type of device capable of inputting information to the electronic device 500, and the input unit 506 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device. Output unit 507 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. Storage unit 504 may include, but is not limited to, magnetic or optical disks. The communication unit 509 allows the electronic device 500 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 501 performs the respective methods and processes described above. For example, in some embodiments, the methods described above may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 500 via the ROM 502 and/or the communication unit 509. In some embodiments, the computing unit 501 may be configured to perform the above-described methods in any other suitable manner (e.g., by means of firmware).
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

Claims (10)

1. A method for functional testing using a dynamic link library, comprising:
acquiring a test configuration file corresponding to a test, wherein the test configuration file predefines an execution sequence between test steps and test steps contained in the test, each test step is determined based on a step template, each test step comprises a template identifier and attribute configuration, and each test step is realized by a dynamic link library corresponding to the template identifier;
analyzing the test configuration file, determining a dynamic link library corresponding to the test step according to the template identification of the test step for each test step contained in the test, calling a derivation function of the dynamic link library corresponding to the test step, and configuring and creating a test step object by the derivation function according to the attribute of the test step;
and calling the method of the test step object corresponding to the test step included in the test according to the execution sequence so as to execute the function of the corresponding test step.
2. The method of claim 1, wherein invoking the method of the test step object corresponding to the test step included in the test to perform the function of the corresponding test step comprises: and calling a first preset method of the test step object corresponding to the test step, and calling one or more second preset methods of the test step object by the first preset method so as to execute the function of the corresponding test step.
3. The method of claim 2, wherein the attribute configuration includes a hardware type and a control parameter, and the one or more second preset methods include a hardware control method configured to call a driver and a library function of a corresponding hardware device based on the hardware type and the control parameter to implement control of the hardware device.
4. The method of claim 2, wherein the one or more second predetermined methods include an attribute output method configured to insert predetermined attributes of the test step object into the set of output attributes of the test step object for use by other test steps.
5. The method of claim 4, wherein the attribute configuration comprises a reference configuration of attributes, the reference configuration comprising location information and an attribute name, wherein creating, by the export function, a test step object from the attribute configuration of the test step comprises:
determining location information and an attribute name of an attribute based on the referencing configuration;
determining a referenced test step object based on the location information to read an attribute value of the attribute name from an output attribute set of the referenced test step object as an attribute value of the attribute when the attribute is used.
6. The method of claim 5, wherein the test configuration file further predefines test procedures and test cases contained by the test, the test procedures including one or more test cases, each test case including one or more of the test steps; the position information comprises a serial number of the test process, a serial number of the test case and a serial number of the test step.
7. An apparatus for functional testing using a dynamic link library, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a test configuration file corresponding to a test, the test configuration file predefines an execution sequence between test steps and test steps contained in the test, each test step is determined based on a step template, each test step comprises a template identifier and attribute configuration, and each test step is realized by a dynamic link library corresponding to the template identifier;
the first calling module is used for analyzing the test configuration file, determining a dynamic link library corresponding to the test step according to the template identifier of the test step for each test step contained in the test, calling a derived function of the dynamic link library corresponding to the test step, and establishing a test step object according to the attribute configuration of the test step by the derived function;
and the second calling module is used for calling the method of the test step object corresponding to the test step included in the test according to the execution sequence so as to execute the function of the corresponding test step.
8. The apparatus of claim 7, wherein the second invoking module is configured to invoke a first preset method of the test procedure object corresponding to the test procedure, and invoke one or more second preset methods of the test procedure object by the first preset method to execute the function of the corresponding test procedure.
9. An electronic device, comprising:
a processor; and
a memory for storing a program, wherein the program is stored in the memory,
wherein the program comprises instructions which, when executed by the processor, cause the processor to carry out the method according to any one of claims 1-6.
10. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
CN202111477591.8A 2021-12-06 2021-12-06 Method, device and equipment for performing function test by using dynamic link library Pending CN114090365A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111477591.8A CN114090365A (en) 2021-12-06 2021-12-06 Method, device and equipment for performing function test by using dynamic link library

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111477591.8A CN114090365A (en) 2021-12-06 2021-12-06 Method, device and equipment for performing function test by using dynamic link library

Publications (1)

Publication Number Publication Date
CN114090365A true CN114090365A (en) 2022-02-25

Family

ID=80306627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111477591.8A Pending CN114090365A (en) 2021-12-06 2021-12-06 Method, device and equipment for performing function test by using dynamic link library

Country Status (1)

Country Link
CN (1) CN114090365A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860516A (en) * 2022-03-30 2022-08-05 中国人民解放军军事科学院国防科技创新研究院 RISC-V processor function verification-oriented random pressure testing method and device
CN117407048A (en) * 2023-12-14 2024-01-16 江西飞尚科技有限公司 Flow configuration method and system of plug-in data processing software

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860516A (en) * 2022-03-30 2022-08-05 中国人民解放军军事科学院国防科技创新研究院 RISC-V processor function verification-oriented random pressure testing method and device
CN117407048A (en) * 2023-12-14 2024-01-16 江西飞尚科技有限公司 Flow configuration method and system of plug-in data processing software
CN117407048B (en) * 2023-12-14 2024-03-12 江西飞尚科技有限公司 Flow configuration method and system of plug-in data processing software

Similar Documents

Publication Publication Date Title
CN107273286B (en) Scene automatic test platform and method for task application
CN108108297B (en) Method and device for automatic testing
CN114090365A (en) Method, device and equipment for performing function test by using dynamic link library
CN111026670B (en) Test case generation method, test case generation device and storage medium
CN109977012B (en) Joint debugging test method, device, equipment and computer readable storage medium of system
CN112463256A (en) Method, system, electronic device and storage medium for determining configuration file
CN112965794A (en) Algorithm calling method, electronic device and storage medium
CN111797020A (en) Mock data method and device based on dynamic bytecode
CN115509522A (en) Interface arranging method and system for low-code scene and electronic equipment
CN112181477A (en) Complex event processing method and device and terminal equipment
CA3149711A1 (en) Method of and device for tracing logical node in automation testing, program and medium
CN112925583B (en) Host application capability extension method, device, equipment and storage medium
CN113778849A (en) Method, apparatus, device and storage medium for testing code
CN112925522A (en) Dependency graph generation method, dependency graph generation device, dependency graph generation apparatus, storage medium, and program product
CN113778515B (en) Method and device for determining program package change information
KR20040103497A (en) Method and apparatus for generating a graphical user interface
CN114661402A (en) Interface rendering method and device, electronic equipment and computer readable medium
CN114579120A (en) Application code processing method and device, electronic equipment and storage medium
CN113342553A (en) Data acquisition method and device, electronic equipment and storage medium
CN113760356B (en) Differential configuration method, device, equipment and medium of program product
CN116257286B (en) File processing method and device, electronic equipment and storage medium
CN115729560B (en) Program code processing method and device
CN116431108B (en) Object type processing method and device, electronic equipment and storage medium
CN114487758B (en) Test method and test system for semiconductor equipment
EP4227796A1 (en) Service deployment processing method and apparatus, electronic device, and storage medium

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