CN114510421A - Test method, test device, chip and module equipment - Google Patents

Test method, test device, chip and module equipment Download PDF

Info

Publication number
CN114510421A
CN114510421A CN202210109157.2A CN202210109157A CN114510421A CN 114510421 A CN114510421 A CN 114510421A CN 202210109157 A CN202210109157 A CN 202210109157A CN 114510421 A CN114510421 A CN 114510421A
Authority
CN
China
Prior art keywords
code
test
module
attribute
processing mode
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
CN202210109157.2A
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.)
Unisoc Chongqing Technology Co Ltd
Original Assignee
Unisoc Chongqing 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 Unisoc Chongqing Technology Co Ltd filed Critical Unisoc Chongqing Technology Co Ltd
Priority to CN202210109157.2A priority Critical patent/CN114510421A/en
Publication of CN114510421A publication Critical patent/CN114510421A/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/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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a test method, a test device, a chip and module equipment, wherein the method comprises the following steps: acquiring corresponding element information and attribute information in a test file, wherein the element information corresponds to a processing mode of an element, and the attribute information corresponds to a processing mode of an attribute; testing the first tested code based on the element information and the element processing mode and the attribute information and attribute processing mode to obtain a test result; and outputting a test result. By adopting the method described in the application, the working efficiency of developers can be improved.

Description

Test method, test device, chip and module equipment
Technical Field
The present invention relates to the field of communications, and in particular, to a test method, device, chip, and module apparatus.
Background
When a tester develops a plurality of test cases of communication system software, each test case needs to write a different test case configuration file or write common codes for certain fixed test steps. A great deal of repetitive work causes the workload of developers to be larger and the working efficiency to be lower.
Disclosure of Invention
The application provides a test method, a test device, a chip and module equipment, which are beneficial to improving the working efficiency of developers.
In a first aspect, the present application provides a method of testing, the method comprising: acquiring corresponding element information and attribute information in a test file, wherein the element information corresponds to a processing mode of an element, and the attribute information corresponds to a processing mode of an attribute; testing the first tested code based on the element information and the element processing mode and the attribute information and attribute processing mode to obtain a test result; and outputting a test result.
In a possible implementation manner, the element information and the attribute information corresponding to the test file are obtained, and the specific implementation manner is as follows: determining elements and attributes in the test file; and preprocessing the elements and the attributes to obtain element information and attribute information, wherein the data formats of the element information and the attribute information are preset formats.
In a possible implementation manner, the first code under test is tested based on the element information and the processing manner of the element, and the attribute information and the processing manner of the attribute, so as to obtain a test result, and a specific implementation manner may be: calling an external interface simulation module and/or a hardware simulation module to test the tested code based on the element information and the element processing mode and the attribute information and attribute processing mode to obtain a test result; the external interface simulation module is used for feeding back a preset output value corresponding to a second tested code when the first tested code calls the second tested code, the first tested code and the second tested code are codes of different modules forming the same system code, and the hardware simulation module is used for providing a hardware environment required by the tested code during testing.
In one possible implementation, the method further comprises: comparing the test result with a preset expected result to determine a comparison result; and outputting a comparison result.
In one possible implementation, the method further includes: calling a code covering module to monitor the execution condition of each code in the first tested code; and outputting a coverage rate report of the tested codes, wherein the coverage rate report is used for indicating whether each code in the first tested codes is executed or not.
In one possible implementation, the format of the test file is an XML file format.
In a possible implementation manner, the first code to be tested is tested based on the element information and the processing manner of the element, and the attribute information and the processing manner of the attribute, and the specific implementation manner is as follows: and testing the first code to be tested based on the test code, the element information, the element processing mode, the attribute information and the attribute processing mode, wherein the test code is used for providing a plurality of thread priority mechanisms required by the first code to be tested during testing.
In a possible implementation manner, the first code to be tested corresponds to a control code, the control code is used for determining message data required by the first code to be tested and an interaction sequence corresponding to the message data, and the test file includes the message data and the interaction sequence corresponding to the message data; the first code to be tested is tested based on the element and the element processing mode, the attribute and the attribute processing mode, and the specific implementation mode is as follows: and testing the first tested code based on the element information and element processing mode, the attribute information and attribute processing mode and the interaction sequence corresponding to the message data and the message data, wherein the message data is data transmitted in the communication system simulated by the first tested code.
In a second aspect, the present application provides a test apparatus comprising: the acquisition unit is used for acquiring corresponding element information and attribute information in the test file, wherein the element information corresponds to a processing mode of an element, and the attribute information corresponds to a processing mode of an attribute; the test unit is used for testing the first tested code based on the element information and the processing mode of the element, the attribute information and the processing mode of the attribute to obtain a test result; and the output unit is used for outputting the test result.
In a third aspect, the present application provides a chip comprising a processor and a communication interface, the processor being configured to cause the chip to perform the method as described in the first aspect and any one of its possible implementations.
In a fourth aspect, the present application provides a module device, which includes a communication module, a power module, a storage module and a chip, wherein: the power supply module is used for providing electric energy for the module equipment; the storage module is used for storing data and instructions; the communication module is used for carrying out internal communication of the module equipment or is used for carrying out communication between the module equipment and external equipment; the chip is adapted to perform the method as described in the first aspect and any one of its possible implementations.
In a fifth aspect, the present application provides a testing apparatus comprising a memory for storing a computer program comprising program instructions and a processor configured to invoke the program instructions to cause the testing apparatus to perform the method as described in the first aspect and any one of its possible implementations,
in a sixth aspect, the present application provides a computer-readable storage medium, wherein computer-readable instructions are stored in the computer-readable storage medium, and when the computer-readable instructions are executed on a testing apparatus, the testing apparatus is caused to execute the method described in the first aspect and any one of the possible implementations thereof.
In a seventh aspect, the present application provides a computer program or a computer program product comprising code or instructions which, when run on a computer, cause the computer to perform the method as in the first aspect or any one of its possible implementations.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a schematic diagram of a test case configuration file and a test case script file provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart of a testing method provided in an embodiment of the present application;
fig. 3a is a schematic diagram of a software structure of a baseband communication system according to an embodiment of the present application;
FIG. 3b is a diagram of test protocol stack software provided by an embodiment of the present application;
FIG. 4 is a system framework diagram of a test platform according to an embodiment of the present disclosure
FIG. 5 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a module apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the following examples of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the listed items.
It should be noted that the terms "first," "second," "third," and the like in the description and claims of the present application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than described or illustrated herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For a better understanding of the embodiments of the present application, the background to which the embodiments of the present application relate will be described first.
Software testing refers to the process of running or testing a system of software products using manual or automated means for the purpose of verifying that specified requirements are met or to make clear the expected results from the actual results.
The communication system software test can be used for simulating and testing a communication system, for example, simulating two devices to perform data interaction based on a preset communication protocol, so as to test whether the preset communication protocol can improve the transmission efficiency between data, and the like. The communication system software test relates to two aspects of test platform development and test case construction. Generally, the quality of a test platform has a great influence on the test effect, and the good test platform can reduce the complexity and flexibility of test case construction.
The test case generally consists of two types of files: a test case configuration file and a test case script file. And configuring various messages required to be used in the test case execution process in the test case configuration file. The test case script file processes (e.g., receives, sends, compares) the messages according to the test case design requirements. As different requirements may exist in the process of designing each test case, as shown in fig. 1, a test case developer needs to develop a test case configuration file and a test case script file corresponding to each test case when developing each test case, and as each test case needs to write a different test case configuration file or write a common code for some fixed test steps, the workload of the developer is large.
In order to reduce the workload of developers, the embodiment of the invention provides a test method. The method comprises the following steps: acquiring corresponding element information and attribute information in a test file, wherein the element information corresponds to a processing mode of an element, and the attribute information corresponds to a processing mode of an attribute; testing the first tested code based on the element information and the element processing mode and the attribute information and attribute processing mode to obtain a test result; and outputting a test result. Based on the method, the corresponding processing mode can be defined through the elements and the attributes in the repeated or general test steps, developers only need to configure the required elements and the attributes in the test file, and the electronic equipment can test the first tested code based on the configured elements and the attributes, so that the workload of the developers is reduced.
The method can be applied to electronic equipment, and the electronic equipment has a data processing function and can process the acquired data. The electronic device may be a mobile phone (mobile phone), a Personal Computer (PC), a wireless terminal in industrial control (industrial control), a vehicle-mounted terminal device, a wireless terminal in self driving (self driving), a wireless terminal in smart grid (smart grid), a wearable terminal device, and the like. The embodiments of the present application do not limit the application scenarios. A terminal may also be referred to as a terminal device, User Equipment (UE), access terminal device, in-vehicle terminal, industrial control terminal, UE unit, UE station, mobile station, remote terminal device, mobile device, UE terminal device, wireless communication device, UE agent, or UE device, among others. The electronic device may also be a server, specifically, an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform.
In the embodiment of the present application, the apparatus for implementing the function of the electronic device may be an electronic device, or may be an apparatus capable of supporting the electronic device to implement the function, such as a chip system or a combined device and a component capable of implementing the function of the electronic device, and the apparatus may be installed in the electronic device.
In order to improve the working efficiency of software test developers, the application provides a test method, a test device, a chip and module equipment. The following further describes the test method, device, chip and module device provided in the embodiments of the present application in detail.
Fig. 2 is a schematic flowchart of a testing method according to an embodiment of the present application. As shown in fig. 2, the testing method includes the following steps 201 to 203. The method execution body shown in fig. 2 may be an electronic device. Alternatively, the method execution body shown in fig. 2 may be a chip in an electronic device. Fig. 2 illustrates an electronic device as an example of an execution subject of the method.
201. The electronic equipment acquires corresponding element information and attribute information in the test file, wherein the element information corresponds to a processing mode of an element, and the attribute information corresponds to a processing mode of an attribute.
In the embodiment of the present application, the test file may include one or more test case configuration files, that is, the method proposed in the present application may process a plurality of test cases at one time. Each test configuration file includes one or more elements, and one or more attributes.
Where an element refers to the portion from (and including) the beginning tag until (and including) the ending tag. The elements may include other elements, text, or a mixture of both. An element may also possess one or more attributes that are used to provide additional (additional) information about the element.
Alternatively, the format of the test file may be an Extensible Markup Language (XML) format.
The following XML-formatted document code is an example:
Figure BDA0003494509560000061
the < bookmark > element, < book > element, and < title > element are included in the above document code. In the document code, only the < book > element further includes an attribute (category ═ CHILDREN), and none of the other elements includes an attribute.
It should be noted that, a developer writes general codes for fixed test steps, and the configuration file corresponding to each test case includes these general codes, which is very redundant. Based on the method described in the embodiment of the application, the processing modes respectively corresponding to the elements and the attributes can be repeated or general testing steps in the communication software test, and developers only need to input simple symbol labels for configuring the elements and the attributes without inputting a large section of codes. After the required elements and attributes are configured in the test file, the electronic equipment can test the first tested code based on the configured elements and attributes, so that the workload of developers is reduced, and the test efficiency is improved.
In one possible implementation manner, the specific implementation manner of step 201 may be as follows: the electronic equipment determines elements and attributes in the test file; the electronic equipment preprocesses the elements and the attributes to obtain element information and attribute information, wherein the data format of the element information and the data format of the attribute information are both preset formats. The preprocessing refers to converting a data format corresponding to elements and attributes in the test file into a preset format, and the data in the preset format can be more suitable for the processing mode of the electronic equipment, so that the test efficiency can be improved.
202. The electronic equipment tests the first tested code based on the element information and the element processing mode and the attribute information and attribute processing mode to obtain a test result.
In one possible implementation, the specific implementation of step 202 may be as follows: the electronic equipment calls an external interface simulation module and/or a hardware simulation module to test the tested code based on the element information and the element processing mode and the attribute information and attribute processing mode to obtain a test result; the external interface simulation module is used for feeding back a preset output value corresponding to a second tested code when the first tested code calls the second tested code, the first tested code and the second tested code are codes of different modules forming the same system code, and the hardware simulation module is used for providing a hardware environment required by the tested code during testing.
It should be noted that, in the process of parallel development of a system code by multiple groups, the development progress of each group is different, and if a complete module integration test is to be performed, the test can be performed only after the development of all groups is completed, which may cause the test completion time of the whole system to be delayed, and the development progress to be prolonged.
Illustratively, assume that a first code under test of a first subset is written to completion, but a second code under test of a second subset is not written to completion. Because the first code to be tested runs, the second code to be tested needs to be called to obtain a corresponding output value, and therefore the first code to be tested cannot be tested. However, if the output value fed back by the second tested code of the external interface simulation module is adopted, the first tested code can be tested under the condition that the second tested code is not written. Based on the method, the working efficiency of developers can be effectively improved.
As shown in fig. 3a, the communication system software is generally composed of a plurality of subsystems, and for example, the mobile phone terminal baseband communication system software is assumed that the first tested code is a protocol software code, the second tested code is a code of physical layer software, the physical layer software code is scheduled and controlled by upper layer protocol software, and the test of the physical layer software code requires that the protocol stack software code is developed and then tested. Meanwhile, the testing of the protocol stack software code also requires the physical layer software to feed back necessary information so as to ensure that the subsequent code flow can be executed correctly. As shown in fig. 3b, if the simulated physical layer software code is written to test the protocol layer software code, the simulated physical layer software code will raise higher requirements for developers to some extent, and also increase the workload of developers, and at the same time, the written simulated code itself may introduce some defects, and there is overlap with the real code developed by the software. By adopting the method provided by the application, the tested code can be decoupled with all external interfaces through the output value fed back by the external interface simulation module, the physical layer software code can be tested before the development of the protocol stack software is completed, or the protocol stack software code can be tested before the development of the physical layer software is completed, and the working efficiency of developers is effectively improved.
It should be noted that, in the development process of a communication system, it is often necessary to implement some operations in the code under test through a hardware device. However, in general, hardware devices are expensive, and developers do not have the condition for testing the hardware devices. And the hardware simulation module can provide a hardware environment required by the tested code during testing. Typically, the hardware behaviors that need to be simulated include: the method comprises the following steps of a behavior of generating an interrupt after the hardware runs for a period of time, a behavior of outputting a result after the hardware runs, and a behavior of configuring hardware input parameters. Based on the implementation mode, the cost of the tester can be reduced.
In one possible implementation, the specific implementation of step 202 may be as follows: the electronic equipment tests the first code to be tested based on the test code, the element information, the element processing mode, the attribute information and the attribute processing mode, wherein the test code is used for providing a plurality of thread priority mechanisms required by the first code to be tested during testing.
It should be noted that, communication system software is usually tested in a Windows (Windows) environment, but because the thread priority provided in the Windows environment is limited, in a multitask communication system, the thread priority provided in the Windows environment cannot truly simulate the true priority of all tasks, which will affect the testing effect. For example, it is assumed that the first code to be tested includes N tasks, the N tasks correspond to N priorities, the first code to be tested needs to be executed according to the priority order of each task when running, if the test platform can only provide M priority mechanisms, and M is smaller than N, the actual application effect of the first code to be tested cannot be simulated, and the test result will be influenced to a certain extent. Based on the method provided by the application, when the first code to be tested is tested, the test code is called to carry out testing, the thread priority provided by the test code is greater than the priority of a plurality of threads required by the first code to be tested, and based on the method, the testing accuracy can be improved. Alternatively, the test code may be Windows-based simulation code provided by a mini real-time operating (FreeRTOS) system.
In a possible implementation manner, the specific implementation manner of step 202 may be: the electronic equipment tests the first tested code based on the element information and the element processing mode, the attribute information and the attribute processing mode, and the message data and the interaction sequence corresponding to the message data. The first code to be tested corresponds to a control code, the control code is used for determining message data required by the first code to be tested and an interaction sequence corresponding to the message data, the test file comprises the message data and the interaction sequence corresponding to the message data, and the message data is data transmitted in a communication system simulated by the first code to be tested.
It should be noted that the communication system software test may be used to simulate and test the communication system, for example, simulate two devices to perform data interaction based on a preset communication protocol, so as to test whether the preset communication protocol can improve the transmission efficiency between data. The message data is transmitted between the two devices, and the interaction sequence corresponding to the message data is the transmission sequence of the message data. Illustratively, the first code under test simulates data interaction between the device a and the device B based on a preset communication protocol, for example, the device a sends message data 1 to the device B; after receiving the message data 1, the device B sends message data 2 to the device a; after receiving the message data 2, the device a sends message data 3 to the device B. The corresponding interaction order of the message data may help device a and device B determine when to send the message data. In the running process of the first tested code, the message data and the transmission sequence of the message data need to be determined based on the control code, however, as the development progress of each group is different, the situation that the control code is not written yet may exist. Therefore, the message data and the set interaction sequence corresponding to the message data can be stored in the test file in advance, the first code to be tested does not need to determine the message data through the control code in the running process, and the message data in the test file can be directly used for simulation and the interaction sequence corresponding to the message data can be determined. Based on the method, the testing efficiency can be improved.
203. And the electronic equipment outputs the test result.
In one possible implementation, the method further includes: the electronic equipment compares the test result with a preset expected result to determine a comparison result; and the electronic equipment outputs the comparison result. Based on the implementation mode, a developer can intuitively determine whether the test result of the test is an expected test result, so that whether the tested code needs to be adjusted or the test needs to be carried out again is determined, and the test efficiency is improved.
In one possible implementation, the method further includes: the electronic equipment calls a code covering module to monitor the execution condition of each code in the first tested code; the electronic device outputs a coverage report of the code under test, the coverage report indicating whether each code in the first code under test is executed. Illustratively, the first code under test includes 1000 lines of code, where the first 100 lines of code are a backbone, the 200 th line of code to the 599 th line of code are a first branch, the 600 th line of code to the 1000 th line of code are a second branch, and the test case included in the current test file enables the first code under test to execute only the code on the backbone and the code corresponding to the first branch, that is, the first 599 lines of code, and the subsequent 600 th line of code to the 1000 th line of code are not executed, and the execution condition of the code can be intuitively reflected through a coverage rate report, so as to determine whether the test case needs to be added and the first code under test needs to be retested. Based on this implementation, be favorable to improving efficiency of software testing.
Based on the above described method, the present application also provides a system framework of a test platform, and the electronic device can implement the method provided by the present application based on the system framework of the test platform, as shown in fig. 4, the test platform includes two processes, one is a test sending end process, and the other is a test receiving end process. By dividing the two processes, the structure of the test platform can be clearer, excessive coupled test codes can not be generated in the tested codes, and the maintainability of the codes is improved.
Wherein, the process of the test sending end comprises the following steps: an adaptation (Adapter) module, a test case control (CaseContrl) module, a general processing (Element Handle) module, an XML interface module and a tracking module. The process of the test receiving end comprises the following steps: the device comprises a Code Integration (Code Integration) module, an external interface simulation module, a hardware simulation module, an Adapter module, a Trace module and a Windows real-time operating system (RTOS-Win) module. The adaptation modules of the two processes are connected through a Test Framework (Test frame) module, and besides, the platform can also comprise a Code Coverage (Code Coverage) module.
The process of the test sending end is a set of the test code functional modules, and the process of the test receiving end is a set of the tested code functional modules. The specific functions of the modules are as follows:
the test case control module is used for analyzing the test file. The module is responsible for reading the test file, calling the XML interface module to determine elements and attributes in the test file, and calling the general processing module to determine a corresponding processing mode. Based on the test case control module, a user does not need to separately develop the test script file corresponding to each test case according to the scene designed by each test case, but can define different attributes for each element in the test file according to the requirements of the test case scene, so that the development workload of the user is greatly reduced.
The XML interface module comprises various elements and attributes in the XML file and provides a method for accessing the various elements and attributes in the XML file for the test case control module. Which may be implemented by referencing various open source XML files, such as tinyXML files.
The general processing module is used for determining the processing mode corresponding to the element and the attribute. The general processing module is pre-stored with processing modes corresponding to the elements and the attributes.
The adaptation module is used for converting the elements and the attributes into element information and attribute information, the formats of the element information and the attribute information are preset formats, and data in the preset formats can be more adapted to the processing mode of the electronic equipment, so that the test efficiency can be improved. That is, the adaptation module provides a support function for the test platform. Optionally, the adaptation module may also provide functions such as interface adaptation of a bottom-layer real-time operating system for the test platform.
The test framework module provides a communication mechanism for the two processes, so that the test sending end process and the test receiving end process can perform data transmission.
The code integration module comprises a tested code.
The external interface simulation module is used for simulating a preset output value corresponding to the external interface code fed back when the tested code is tested. If the external interface module is ready when the test platform project is constructed, the module is not needed, and the real code of the external interface can be directly integrated; otherwise, in order to perform independent test and development without being influenced by the development progress of an external system, the module needs to be constructed to simulate the behavior of the external interface, and a user only needs to simply simulate the output of the function of the external interface and does not need to simulate the specific implementation of the internal interface. The output may be a fixed value in the stub function or may be flexibly configurable via a message.
The hardware simulation module is used for providing a hardware environment required by the tested code during testing. For communication system software, hardware is often required to operate, and in a windows environment, the behavior of the hardware can be realized only in an analog mode. In general, hardware behaviors that need to be simulated include: the method comprises the following steps of a behavior of generating an interrupt after the hardware runs for a period of time, a behavior of outputting a result after the hardware runs, and a behavior of configuring hardware input parameters.
The code coverage module is used for monitoring the execution condition of the tested code in the process of the testing receiving end and outputting a coverage rate report, wherein the coverage rate report indicates whether each code in the tested code is executed or not.
The tracing module is used for providing the functions of printing and storing tracing information for the whole system and providing a code defect debugging means for a user.
The Windows real-time operating system module is used for simulating a task scheduling mechanism of an embedded real-time operating system under a Windows environment, comprises the functions of task scheduling, interrupt control, timer maintenance and the like, and can be realized by introducing various open-source real-time operating system simulation modules, such as a Windows simulation framework provided by a FreeRTOS.
The test sending end process and the test receiving end process can respectively generate two independent executable files (a test receiving end executable file and a test sending end executable file) through an Integrated Development Environment (IDE), and a user can use the test platform through the two executable files. In addition, the visual interface of the test platform can be managed through the visual module, so that a more visual operation mode is provided for a user.
It should be noted that, in an actual application scenario, the test platform may include more or fewer modules, and a user may configure the corresponding module according to an actual requirement, which is not limited in the present application.
Based on the above-described testing platform, the following describes the execution process of testing the code under test by the testing platform by a complete example.
Step 1: the electronic equipment calls the XML interface module to analyze the test file through the test case control module, determines elements and attributes in the test file, and then calls the general processing module to determine the processing mode corresponding to the elements and the processing mode corresponding to the attributes.
Step 2: the electronic equipment preprocesses the elements and the attributes through the adaptation module to obtain element information and attribute information, wherein the data format of the element information and the data format of the attribute information are both preset formats.
And step 3: the electronic equipment transmits the element information and the attribute information from the test sending end process to the adaptation module of the test receiving end process through the test framework module.
And 4, step 4: the electronic equipment tests the tested code in the code integration module according to the element information and the attribute information, an external interface simulation module and a hardware module are called to simulate a test environment in the test process, and meanwhile, the electronic equipment calls a code covering module to monitor the execution condition of the tested code.
And 5: after the test is finished, the electronic equipment transmits the test result back to the process of the test sending end, compares the test result according to a preset result prestored in the test file, outputs the comparison result and outputs a code coverage rate report through the code coverage rate module.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a testing apparatus according to an embodiment of the present invention, where the testing apparatus may be an electronic device or an apparatus (e.g., a chip) having functions of an electronic device. Specifically, as shown in fig. 5, the testing apparatus 500 may include:
an obtaining unit 501, configured to obtain corresponding element information and attribute information in a test file, where the element information corresponds to a processing mode of an element, and the attribute information corresponds to a processing mode of an attribute; a testing unit 502, configured to test the first code under test based on the element information and the processing manner of the element, the attribute information, and the processing manner of the attribute, and obtain a test result; and an output unit 503, configured to output the test result.
In a possible implementation manner, when the obtaining unit 501 is used to test element information and attribute information corresponding to a file, the obtaining unit is specifically configured to: determining elements and attributes in the test file; and preprocessing the elements and the attributes to obtain element information and attribute information, wherein the data formats of the element information and the attribute information are preset formats.
In a possible implementation manner, the testing unit 502 tests the first code under test based on the element information and the processing manner of the element, the attribute information, and the processing manner of the attribute, and when obtaining the test result, is specifically configured to: calling an external interface simulation module and/or a hardware simulation module to test a tested code based on the element information and the element processing mode and the attribute information and attribute processing mode to obtain a test result; the external interface simulation module is used for feeding back a preset output value corresponding to a second tested code when the first tested code calls the second tested code, the first tested code and the second tested code are codes of different modules forming the same system code, and the hardware simulation module is used for providing a hardware environment required by the tested code during testing.
In a possible implementation manner, the testing apparatus further includes a comparing unit 504, where the comparing unit 504 is configured to compare the testing result with a preset expected result, and determine a comparison result; the output unit 503 is further configured to output the comparison result.
In a possible implementation manner, the test apparatus further includes a monitoring unit 505, where the monitoring unit 505 is configured to invoke a code coverage module to monitor execution conditions of each code in the first code under test; the output unit 503 is further configured to output a coverage report of the codes under test, where the coverage report is used to indicate whether each code in the first code under test is executed.
In one possible implementation, the format of the test file is an XML file format.
In a possible implementation manner, when the testing unit 502 tests the first code under test based on the element information and the processing manner of the element, the attribute information and the processing manner of the attribute, the testing unit is specifically configured to: and testing the first code to be tested based on the test code, the element information, the element processing mode, the attribute information and the attribute processing mode, wherein the test code is used for providing a plurality of thread priority mechanisms required by the first code to be tested during testing.
In a possible implementation manner, the first code to be tested corresponds to a control code, the control code is used to determine message data required by the first code to be tested and an interaction sequence corresponding to the message data, the test file includes the message data and the interaction sequence corresponding to the message data, and the message data is data transmitted in a communication system simulated by the first code to be tested. When the testing unit 502 tests the first code under test based on the element and the processing manner of the element, the attribute, and the processing manner of the attribute, the testing unit is specifically configured to: and testing the first tested code based on the element information and element processing mode, the attribute information and attribute processing mode and the message data and the interaction sequence corresponding to the message data.
The embodiment of the application also provides a chip, and the chip can execute the relevant steps of the electronic equipment in the embodiment of the method. The chip, including a processor and a communication interface, the processor configured to cause the chip to perform the operations of: acquiring corresponding element information and attribute information in a test file, wherein the element information corresponds to a processing mode of an element, and the attribute information corresponds to a processing mode of an attribute; testing the first tested code based on the element information and the element processing mode and the attribute information and attribute processing mode to obtain a test result; and outputting a test result.
In one possible implementation manner, the processor is configured to, when the element information and the attribute information corresponding to the chip test file are used, perform the following operations: determining elements and attributes in the test file; and preprocessing the elements and the attributes to obtain element information and attribute information, wherein the data formats of the element information and the attribute information are preset formats.
In one possible implementation manner, the processor is configured to, when the element information and the attribute information corresponding to the chip test file are used, perform the following operations: testing the first code to be tested based on the element information and the element processing mode, the attribute information and the attribute processing mode, and when obtaining the test result, specifically: calling an external interface simulation module and/or a hardware simulation module to test a tested code based on the element information and the element processing mode and the attribute information and attribute processing mode to obtain a test result; the external interface simulation module is used for feeding back a preset output value corresponding to a second tested code when the first tested code calls the second tested code, the first tested code and the second tested code are codes of different modules forming the same system code, and the hardware simulation module is used for providing a hardware environment required by the tested code during testing.
In one possible implementation, the processor is configured to cause the chip to perform the following operations: comparing the test result with a preset expected result to determine a comparison result; and outputting a comparison result.
In one possible implementation, the processor is configured to cause the chip to perform the following operations: calling a code covering module to monitor the execution condition of each code in the first tested code; and outputting a coverage rate report of the tested codes, wherein the coverage rate report is used for indicating whether each code in the first tested codes is executed or not.
In one possible implementation, the format of the test file is an XML file format.
In one possible implementation manner, the processor is configured to, when the element information and the attribute information corresponding to the chip test file are used, perform the following operations: when testing the first code under test based on the element information and the processing manner of the element, and the processing manner of the attribute information and the attribute, the method is specifically configured to: and testing the first code to be tested based on the test code, the element information, the element processing mode, the attribute information and the attribute processing mode, wherein the test code is used for providing a plurality of thread priority mechanisms required by the first code to be tested during testing.
In a possible implementation manner, the first code to be tested corresponds to a control code, the control code is used for determining message data required by the first code to be tested and an interaction sequence corresponding to the message data, the test file includes the message data and the interaction sequence corresponding to the message data, and the message data is data transmitted in a communication system simulated by the first code to be tested; the processor is configured to, when the element information and the attribute information corresponding to the chip test file are used, perform the following operations: when testing the first code under test based on the element and the processing manner, the attribute, and the processing manner of the attribute of the element, the method is specifically configured to: and testing the first tested code based on the element information and element processing mode, the attribute information and attribute processing mode and the message data and the interaction sequence corresponding to the message data.
In a possible implementation, the chip includes at least one processor, at least one first memory, and at least one second memory; the at least one first memory and the at least one processor are interconnected through a line, and instructions are stored in the first memory; the at least one second memory and the at least one processor are interconnected through a line, and the second memory stores the data required to be stored in the method embodiment.
For each device and product applied to or integrated in the chip, each module included in the device and product may be implemented by hardware such as a circuit, or at least a part of the modules may be implemented by a software program running on a processor integrated in the chip, and the rest (if any) part of the modules may be implemented by hardware such as a circuit.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a testing apparatus according to an embodiment of the present invention. The direct communication apparatus 600 may include a memory 601 and a processor 602. Optionally, a communication interface 603 is also included. The memory 601, processor 602, and communication interface 603 are connected by one or more communication buses. Wherein the communication interface 603 is controlled by the processor 602 for transmitting and receiving information.
Memory 601 may include both read-only memory and random-access memory, and provides instructions and data to processor 602. A portion of the memory 601 may also include non-volatile random access memory.
The communication interface 603 is used for receiving or transmitting data.
The processor 602 may be a Central Processing Unit (CPU), and the processor 602 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor, but in the alternative, the processor 602 may be any conventional processor or the like. Wherein:
a memory 601 for storing program instructions.
A processor 602 for calling program instructions stored in the memory 601.
The processor 602 calls the program instructions stored in the memory 601 to make the direct communication apparatus 600 execute the method executed by the electronic device in the above-mentioned method embodiment.
As shown in fig. 7, fig. 7 is a schematic structural diagram of a module device according to an embodiment of the present disclosure. The module apparatus 700 can perform the steps related to the electronic apparatus in the foregoing method embodiments, and the module apparatus 700 includes: a communication module 701, a power module 702, a memory module 703 and a chip 704.
The power module 702 is used for providing power for the module device; the storage module 703 is used for storing data and instructions; the communication module 701 is used for performing internal communication of the module equipment or performing communication between the module equipment and external equipment; the chip 704 is used for executing the method executed by the electronic device in the method embodiment described above.
Embodiments of the present application further provide a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is executed on a processor, the method flow of the above method embodiments is implemented.
Embodiments of the present application further provide a computer program product, where when the computer program product runs on a processor, the method flow of the above method embodiments is implemented.
Each module/unit included in each apparatus and product described in the above embodiments may be a software module/unit, or may also be a hardware module/unit, or may also be a part of a software module/unit and a part of a hardware module/unit. For example, each module/unit included in each apparatus or product applied to or integrated in a chip may all be implemented by hardware such as a circuit, or at least a part of the modules/units may be implemented by a software program running on an integrated processor inside the chip, and the rest (if any) part of the modules/units may be implemented by hardware such as a circuit; for each device and product applied to or integrated with the chip module, each module/unit included in the device and product may be implemented by hardware such as a circuit, and different modules/units may be located in the same piece (for example, a chip, a circuit module, etc.) or different components of the chip module, or at least part of the modules/units may be implemented by a software program running on a processor integrated inside the chip module, and the rest (if any) part of the modules/units may be implemented by hardware such as a circuit; for each device or product applied to or integrated in the terminal, the modules/units included in the device or product may all be implemented by hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components in the terminal, or at least some of the modules/units may be implemented by software programs running on a processor integrated in the terminal, and the rest (if any) of the modules/units may be implemented by hardware such as a circuit.
It should be noted that for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some acts may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
The descriptions of the embodiments provided in the present application may be referred to each other, and the descriptions of the embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments. For convenience and brevity of description, for example, the functions and operations performed by the devices and apparatuses provided in the embodiments of the present application may refer to the related descriptions of the method embodiments of the present application, and may also be referred to, combined with or cited among the method embodiments and the device embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (13)

1. A method of testing, the method comprising:
acquiring corresponding element information and attribute information in a test file, wherein the element information corresponds to a processing mode of an element, and the attribute information corresponds to a processing mode of an attribute;
testing a first tested code based on the element information and the element processing mode, the attribute information and the attribute processing mode to obtain a test result;
and outputting the test result.
2. The method according to claim 1, wherein the obtaining element information and attribute information corresponding to the test file comprises:
determining elements and attributes in the test file;
and preprocessing the element and the attribute to obtain the element information and the attribute information, wherein the data format of the element information and the data format of the attribute information are both preset formats.
3. The method according to claim 1 or 2, wherein testing the first code under test based on the element information and the processing manner of the element, and the attribute information and the processing manner of the attribute, and obtaining a test result comprises:
calling an external interface simulation module and/or a hardware simulation module to test a tested code based on the element information and the element processing mode and the attribute information and the attribute processing mode to obtain a test result;
the external interface simulation module is used for feeding back a preset output value corresponding to a second tested code when the first tested code calls the second tested code, the first tested code and the second tested code are codes of different modules forming the same system code, and the hardware simulation module is used for providing a hardware environment required by the tested code during testing.
4. The method according to any one of claims 1 to 3, further comprising:
comparing the test result with a preset expected result to determine a comparison result;
and outputting the comparison result.
5. The method according to any one of claims 1 to 4, further comprising:
calling a code covering module to monitor the execution condition of each code in the first tested code;
outputting a coverage report of the code under test, the coverage report indicating whether each code in the first code under test is executed.
6. The method according to any one of claims 1 to 5, wherein the format of the test file is an XML file format.
7. The method according to any one of claims 1 to 6, wherein testing the first code under test based on the element information and the processing mode of the element, and the attribute information and the processing mode of the attribute comprises:
and testing a first code to be tested based on the test code, the element information, the element processing mode and the attribute information, wherein the test code is used for providing a plurality of thread priority mechanisms required by the first code to be tested during testing.
8. The method according to any one of claims 1 to 7, wherein the first code under test corresponds to a control code, the control code is used for determining message data required by the first code under test and an interaction sequence corresponding to the message data, the test file includes the message data and the interaction sequence corresponding to the message data, and the message data is data transmitted in a communication system simulated by the first code under test;
testing a first code under test based on the element and the processing mode of the element, the attribute and the processing mode of the attribute, comprising:
and testing a first tested code based on the element information and the element processing mode, the attribute information and the attribute processing mode, and the message data and the interaction sequence corresponding to the message data.
9. A test apparatus, characterized in that the test apparatus comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring corresponding element information and attribute information in a test file, the element information corresponds to a processing mode of an element, and the attribute information corresponds to a processing mode of an attribute;
the test unit is used for testing a first tested code based on the element information, the element processing mode and the attribute information to obtain a test result;
and the output unit is used for outputting the test result.
10. A chip comprising a processor and a communication interface, the processor being configured to cause the chip to perform the method of any of claims 1 to 8.
11. The utility model provides a module equipment, its characterized in that, module equipment includes communication module, power module, storage module and chip, wherein:
the power supply module is used for providing electric energy for the module equipment;
the storage module is used for storing data and instructions;
the communication module is used for carrying out internal communication of module equipment or is used for carrying out communication between the module equipment and external equipment;
the chip is used for executing the method of any one of claims 1-8.
12. A test apparatus comprising a memory for storing a computer program comprising program instructions and a processor configured to invoke the program instructions to cause the test apparatus to perform the method of any one of claims 1 to 8.
13. A computer readable storage medium having computer readable instructions stored thereon which, when run on a test apparatus, cause the test apparatus to perform the method of any of claims 1-8.
CN202210109157.2A 2022-01-28 2022-01-28 Test method, test device, chip and module equipment Pending CN114510421A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210109157.2A CN114510421A (en) 2022-01-28 2022-01-28 Test method, test device, chip and module equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210109157.2A CN114510421A (en) 2022-01-28 2022-01-28 Test method, test device, chip and module equipment

Publications (1)

Publication Number Publication Date
CN114510421A true CN114510421A (en) 2022-05-17

Family

ID=81551671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210109157.2A Pending CN114510421A (en) 2022-01-28 2022-01-28 Test method, test device, chip and module equipment

Country Status (1)

Country Link
CN (1) CN114510421A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037787A (en) * 2022-06-09 2022-09-09 上海禾骋科技有限公司 Method, system and device for testing automobile network communication
CN116719684A (en) * 2023-08-11 2023-09-08 中诚华隆计算机技术有限公司 3D packaged chip test system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037787A (en) * 2022-06-09 2022-09-09 上海禾骋科技有限公司 Method, system and device for testing automobile network communication
CN116719684A (en) * 2023-08-11 2023-09-08 中诚华隆计算机技术有限公司 3D packaged chip test system
CN116719684B (en) * 2023-08-11 2023-10-20 中诚华隆计算机技术有限公司 3D packaged chip test system

Similar Documents

Publication Publication Date Title
CN105335293B (en) A kind of automatization test system and method based on interface concurrent
CN107608901B (en) Jmeter-based testing method and device, storage medium and electronic equipment
CN112270149B (en) Verification platform automatic integration method and system, electronic equipment and storage medium
CN114510421A (en) Test method, test device, chip and module equipment
CN105302722B (en) CTS automatic testing method and device
US12032477B2 (en) Method and apparatus for generating and applying deep learning model based on deep learning framework
CN111694550B (en) Page display control method, device and system
CN116501315A (en) Low-code software development system, method and equipment based on DevOps domain
CN113204495A (en) Automatic testing method and device based on B/S architecture, storage medium and equipment
CN114064503A (en) UI automation test method and device, electronic equipment and storage medium
CN107590062B (en) Multi-client interaction testing method and device
CN117235527A (en) End-to-end containerized big data model construction method, device, equipment and medium
CN111949510B (en) Test processing method, device, electronic equipment and readable storage medium
CN109739754B (en) Automatic testing method and system for application program based on WeChat development
CN115934559A (en) Testing method of intelligent form testing system
CN114546850A (en) Automatic testing method, system and device for embedded point and storage medium
CN113961864A (en) System inspection method and device, storage medium and electronic equipment
CN112380118A (en) Unit testing method, unit testing device, medium and electronic equipment
CN111881025A (en) Automatic test task scheduling method, device and system
CN115729218B (en) Model test method, device, equipment and medium for various gear shifting modes
CN112035335B (en) Method, device, equipment and medium for automatic test
CN116166545A (en) Test environment creation method, test environment creation device, medium and electronic device
Lima et al. Towards the Network Test Automation on Android Devices using ALAF Architecture An Experience Report
CN116820926A (en) Automatic testing method based on pytest+jenkins
CN114936148A (en) Page testing method and device, electronic equipment and readable 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