CN116185880A - Automatic test method, device, equipment and medium for embedded system - Google Patents

Automatic test method, device, equipment and medium for embedded system Download PDF

Info

Publication number
CN116185880A
CN116185880A CN202310465094.9A CN202310465094A CN116185880A CN 116185880 A CN116185880 A CN 116185880A CN 202310465094 A CN202310465094 A CN 202310465094A CN 116185880 A CN116185880 A CN 116185880A
Authority
CN
China
Prior art keywords
tested
test case
target test
embedded
target
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
CN202310465094.9A
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.)
Beijing Acoinfo Technology Co ltd
Original Assignee
Beijing Acoinfo 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 Beijing Acoinfo Technology Co ltd filed Critical Beijing Acoinfo Technology Co ltd
Priority to CN202310465094.9A priority Critical patent/CN116185880A/en
Publication of CN116185880A publication Critical patent/CN116185880A/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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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)
  • Testing Electric Properties And Detecting Electric Faults (AREA)

Abstract

The embodiment of the invention discloses an automatic test method, device, equipment and medium of an embedded system. The method is applied to an upper computer, wherein the upper computer is used for running a test script and storing test cases, and the upper computer is connected with the embedded equipment to be tested in advance through a network; the method comprises the following steps: if an automatic test instruction is detected, acquiring a command line interpreter of the embedded equipment to be tested; determining a test case from the candidate test cases as a target test case, and uploading the target test case to the embedded equipment to be tested; and controlling the operation of the target test case in the embedded equipment to be tested through the command line interpreter to obtain the target test information of the target test case. According to the technical scheme, the command line interpreter of the embedded device to be tested can be controlled by the upper computer to acquire real-time test information, so that technicians can check and process errors in the test process in time, and the automatic test efficiency of the embedded system can be improved.

Description

Automatic test method, device, equipment and medium for embedded system
Technical Field
The present invention relates to the field of automated testing technologies, and in particular, to an automated testing method, apparatus, device, and medium for an embedded system.
Background
In the automatic test of an embedded system, a plurality of test cases are generally tested in a unified manner after the test cases are loaded on the tested device in batches. In this case, after all the loaded test cases are tested, the real-time test information of the test cases can be obtained through the third party tool. In the manual test of the embedded system, the real-time test information of each test case on the tested equipment can be obtained by manual copying, screenshot and other methods, but the efficiency of the manual mode is low, and the test efficiency is also affected.
Disclosure of Invention
The invention provides an automatic test method, device, equipment and medium for an embedded system, which can control a command line interpreter of the embedded equipment to be tested through an upper computer to acquire real-time test information so as to facilitate technicians to check and process errors in the test process in time and facilitate the improvement of the automatic test efficiency of the embedded system.
According to one aspect of the invention, an automatic test method of an embedded system is provided, the method is applied to an upper computer, the upper computer is used for running test scripts and storing test cases, and the upper computer is connected with embedded equipment to be tested in advance through a network; the method comprises the following steps:
if an automatic test instruction is detected, acquiring a command line interpreter of the embedded equipment to be tested;
determining a test case from candidate test cases as a target test case, and uploading the target test case to the embedded equipment to be tested;
and controlling the operation of the target test case in the embedded device to be tested through the command line interpreter to obtain target test information of the target test case.
According to another aspect of the present invention, an automatic test device for an embedded system is provided, where the device is configured on an upper computer, the upper computer is used for running a test script and storing a test case, and the upper computer is connected with an embedded device to be tested in advance through a network; the device comprises:
the command line interpreter acquisition module is used for acquiring the command line interpreter of the embedded device to be tested if the automatic test instruction is detected;
the target test case uploading module is used for determining a test case from the candidate test cases as a target test case and uploading the target test case to the embedded equipment to be tested;
and the target test information determining module is used for controlling the operation of the target test case in the embedded equipment to be tested through the command line interpreter to obtain the target test information of the target test case.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the automated test method of an embedded system of any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute an automated test method for an embedded system according to any of the embodiments of the present invention.
According to the technical scheme, if an automatic test instruction is detected, a command line interpreter of the embedded equipment to be tested is obtained; determining a test case from the candidate test cases as a target test case, and uploading the target test case to the embedded equipment to be tested; and controlling the operation of the target test case in the embedded equipment to be tested through the command line interpreter to obtain the target test information of the target test case. According to the technical scheme, the command line interpreter of the embedded device to be tested can be controlled by the upper computer to acquire real-time test information, so that technicians can check and process errors in the test process in time, and the automatic test efficiency of the embedded system can be improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an automated testing method for an embedded system according to a first embodiment of the present invention;
FIG. 2 is a flow chart of an automated testing method for an embedded system according to a second embodiment of the present invention;
FIG. 3 is a flow chart of an automated testing method for an embedded system according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an automated testing apparatus of an embedded system according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing an automated test method for an embedded system according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," "target," and the like in the description and claims of the present invention and in the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus 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.
Example 1
Fig. 1 is a flowchart of an automatic test method for an embedded system according to an embodiment of the present invention, where the method may be performed by an automatic test device of the embedded system, the automatic test device of the embedded system may be implemented in hardware and/or software, and the automatic test device of the embedded system may be configured in an electronic device with data processing capability. As shown in fig. 1, the method includes:
s110, if the automatic test instruction is detected, acquiring a command line interpreter of the embedded device to be tested.
The technical scheme of the embodiment can be applied to an upper computer, wherein the upper computer can be used for running test scripts and storing test cases, and the upper computer is connected with the embedded equipment to be tested in advance through a network. The host computer may be a linux host, and the embedded device to be tested may be an embedded board card.
The automatic test instruction may be a command for indicating to start an automatic test of the embedded system. The command line interpreter (namely shell) is at the outermost layer of the operating system and is responsible for directly carrying out dialogue with a user, and can transmit command interpretation input by the user to the operating system and feed back the output result of the operating system to the user. In brief, a command line interpreter may translate a user input command into a language recognizable by an operating system and return an execution result to a user.
In this embodiment, when the upper computer detects an automatic test instruction input by a user, the command line interpreter of the embedded device to be tested is first obtained. Optionally, the test script is a python script; correspondingly, acquiring a command line interpreter of the embedded device to be tested, including: acquiring a command line interpreter of the embedded equipment to be tested through a preset control program in the upper computer; the preset control programs comprise telnet and pexpect.
The preset control program may be preset and stored in the upper computer, and is used to obtain the control program of the shell of the embedded device to be tested. When the test script is a python script, the upper computer can acquire and control the embedded device shell to be tested by running the automatic control test script and utilizing a python open source module telnet and a pexpect.
S120, determining a test case from the candidate test cases as a target test case, and uploading the target test case to the embedded equipment to be tested.
The candidate test cases may be test cases stored in the host computer in advance and used for performing automation test of the embedded system. To improve the reliability of automated test results, a greater number of candidate test cases are typically set for automated testing. The target test case may refer to one test case determined from the candidate test cases to be subjected to an automated test. For example, when determining the target test case, one test case may be selected as the target test case in a recursive traversal manner sequentially from among the candidate test cases.
In this embodiment, after determining a target test case from the candidate test cases, the target test case needs to be uploaded to the embedded device to be tested. Optionally, the test script is a python script; correspondingly, uploading the target test case to the embedded device to be tested comprises: and uploading the target test case to the embedded device to be tested through the ftplib module in python. In this embodiment, when the test script is a python script, the target test case may be uploaded to the embedded device to be tested by using the ftp function of the python open source module ftplib through the upper computer.
S130, controlling the operation of the target test case in the embedded device to be tested through the command line interpreter to obtain target test information of the target test case.
The target test information may refer to real-time test information output to the shell during the running of the target test case, and may specifically include test result information and error prompt information.
In this embodiment, the upper computer may control the to-be-tested embedded device to run the target test case through the command line interpreter, and return the obtained target test information to the upper computer, so that the real-time test information may be obtained, so that a technician may check and process the error in time. The real-time test information can be displayed on a monitoring screen or stored in a log form; and a third-party tool is not required to be accessed, and a manual screen capture mode is not required, so that a technician can check the real-time condition of the test, and the automatic test efficiency of the embedded system is improved.
According to the technical scheme, if an automatic test instruction is detected, a command line interpreter of the embedded equipment to be tested is obtained, one test case is determined from candidate test cases to serve as a target test case, and the target test case is uploaded to the embedded equipment to be tested; and controlling the operation of the target test case in the embedded equipment to be tested through the command line interpreter to obtain the target test information of the target test case. According to the technical scheme, the command line interpreter of the embedded device to be tested can be controlled by the upper computer to acquire real-time test information, so that technicians can check and process errors in the test process in time, and the automatic test efficiency of the embedded system can be improved.
In this embodiment, optionally, after acquiring the command line interpreter of the to-be-tested embedded device, the method further includes: determining whether a command line interpreter of the embedded device to be tested is successful; if yes, determining a test case from the candidate test cases as a target test case, and uploading the target test case to the embedded equipment to be tested; otherwise, the command line interpreter of the embedded device to be tested is acquired again.
In this embodiment, when the test script is a python script, after the command line interpreter of the embedded device to be tested is obtained, whether the command line interpreter of the embedded device to be tested is successfully obtained may be determined by the return value of pexpect. If the acquisition is successful, a test case is further determined from the candidate test cases to serve as a target test case, and the target test case is uploaded to the embedded equipment to be tested; if the acquisition fails, the command line interpreter of the embedded device to be tested needs to be re-acquired. Therefore, the automatic test efficiency of the embedded system can be further improved.
Example two
Fig. 2 is a flowchart of an automatic testing method for an embedded system according to a second embodiment of the present invention, where the present embodiment is optimized based on the foregoing embodiment. The concrete optimization is as follows: after obtaining the target test information of the target test case, the method further comprises: determining whether the target test case in the embedded device to be tested is completed; if yes, the target test case is controlled to be deleted from the embedded device to be tested through the command line interpreter; otherwise, the target test case is controlled to continue to run through the command line interpreter.
As shown in fig. 2, the method of this embodiment specifically includes the following steps:
s210, if an automatic test instruction is detected, acquiring a command line interpreter of the embedded device to be tested.
S220, determining a test case from the candidate test cases as a target test case, and uploading the target test case to the embedded equipment to be tested.
S230, controlling the operation of the target test case in the embedded device to be tested through the command line interpreter to obtain target test information of the target test case.
The specific implementation of S210-S230 may be referred to in the detailed description of S110-S130, and will not be described herein.
S240, determining whether the operation of the target test case in the embedded device to be tested is completed, if yes, executing S250, otherwise, executing S260.
It should be noted that, in the process of automatic testing of an embedded device, there is often a contradiction between the memory size of the embedded device and the number of test cases. Specifically, since the memory of the embedded system is generally smaller, when the number of test cases is larger, the memory occupied by the embedded system is larger, so that the compiled test case package cannot be loaded onto the embedded device for running all at once. At this time, the test case package needs to be split into a plurality of test case packages by manual intervention, and the test case needs to be loaded manually for a plurality of times and whether the current test is finished or not is observed, and the next test case package is uploaded manually after the previous test case package is tested, so that the automatic test efficiency is reduced. Aiming at the problems, the method of uploading and testing the test cases one by one and deleting the test cases immediately after the test of the single test case is completed is adopted in the embodiment, so that the automatic test efficiency is improved.
S250, the target test case is controlled to be deleted from the embedded device to be tested through the command line interpreter.
In this embodiment, if it is determined that the operation of the target test case in the to-be-tested embedded device is completed, the upper computer may control the deletion of the target test case from the to-be-tested embedded device through the command line interpreter, so as to ensure that the memory of the to-be-tested embedded device is no longer occupied by the target test case after the operation is completed.
S260, controlling the target test case to continue to run through the command line interpreter.
In this embodiment, if it is determined that the operation of the target test case in the to-be-tested embedded device is not completed, the host computer is required to control the to-be-tested embedded device to continue to operate the target test case through the command line interpreter until the operation of the target test case is completed, and then delete the target test case from the to-be-tested embedded device.
According to the technical scheme, after target test information of the target test case is obtained, whether the target test case in the embedded equipment to be tested is operated is determined; if yes, the target test case is controlled to be deleted from the embedded device to be tested through the command line interpreter; otherwise, the target test case is controlled to continue to run through the command line interpreter. According to the technical scheme, the command line interpreter of the embedded device to be tested can be controlled by the upper computer to acquire real-time test information, so that technicians can check and process errors in the test process in time, meanwhile, the memory of the embedded device to be tested can be released in time after the operation of the target test case is completed, the contradiction between the memory size of the embedded device and the number of the test cases is effectively solved, and the automatic test efficiency of the embedded system is further improved.
In this embodiment, optionally, after the target test case is controlled by the command line interpreter to be deleted from the to-be-tested embedded device, the method further includes: determining whether all the candidate test cases are tested; if so, generating a target log file according to the target test information, and storing the target log file in an upper computer; otherwise, re-determining a test case from the candidate test cases as a target test case, uploading the target test case to the embedded equipment to be tested, and controlling the target test case in the embedded equipment to be tested to run through the command line interpreter.
Wherein the target log file may be used to record target test information. In general, the entire automated test procedure can be completed only if the test on all candidate test cases needs to be completed. Therefore, in this embodiment, after the target test case is controlled by the command line interpreter to be deleted from the embedded device to be tested, it is further determined whether all the test of the candidate test cases is completed. If all the tests are completed, a target log file can be generated according to the target test information and stored in the upper computer so as to record the target test information. If the candidate test cases are not completely executed, a test case needs to be redetermined from the unexecuted candidate test cases to serve as a target test case, the target test case is uploaded to the embedded equipment to be tested, and then the upper computer controls the embedded equipment to be tested to run the target test case through the command line interpreter.
Through the arrangement, the candidate test cases can be ensured to be executed completely, and the condition that the test cases are omitted in the test process can be effectively avoided.
Example III
Fig. 3 is a flowchart of an automatic testing method for an embedded system according to a third embodiment of the present invention, where the method is optimized based on the foregoing embodiment. As shown in fig. 3, the method of this embodiment specifically includes the following steps:
s310, if the automatic test instruction is detected, acquiring a command line interpreter of the embedded device to be tested through a preset control program in the upper computer.
If the test script is a python script, the preset control program may include telnet and pexpect.
S320, determining whether the command line interpreter of the embedded device to be tested is successfully obtained, if yes, executing S330, otherwise returning to S310, and re-obtaining the command line interpreter of the embedded device to be tested through a preset control program in the upper computer.
S330, determining a test case from the candidate test cases as a target test case, and uploading the target test case to the embedded device to be tested through the ftplib module in python.
S340, controlling the operation of the target test case in the embedded device to be tested through the command line interpreter to obtain target test information of the target test case.
S350, determining whether the operation of the target test case in the embedded device to be tested is completed, if yes, executing S360, otherwise returning to S340.
S360, the target test case is controlled to be deleted from the embedded device to be tested through the command line interpreter.
S370, determining whether all the candidate test cases are tested, if yes, executing S380, otherwise returning to S330.
And S380, generating a target log file according to the target test information, and storing the target log file in the upper computer.
According to the technical scheme, the test cases can be uploaded to the embedded device to be tested one by one through the upper computer, the command line interpreter of the embedded device to be tested is controlled to control the embedded device to be tested to run the test cases, acquire real-time test information and delete the test cases with the completed test, the steps are continuously repeated until all test case execution tasks are completed, and the real-time test information is permanently recorded in a log file mode after the test tasks are completed, so that technicians can timely check and process errors occurring in the test process through the real-time test information. According to the technical scheme, after the operation of the target test case is completed, the memory of the embedded device to be tested is released by deleting the target test case in time, so that the contradiction between the memory size of the embedded device and the number of the test cases is effectively solved, and the automatic test efficiency of the embedded system is further improved.
Example IV
Fig. 4 is a schematic structural diagram of an automatic testing device for an embedded system according to a fourth embodiment of the present invention, where the device is configured on an upper computer, the upper computer is used for running a test script and storing test cases, and the upper computer is connected with an embedded device to be tested in advance through a network. The device can execute the automatic test method of the embedded system provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. As shown in fig. 4, the apparatus includes:
a command line interpreter acquisition module 410, configured to acquire a command line interpreter of the to-be-tested embedded device if an automatic test instruction is detected;
the target test case uploading module 420 is configured to determine a test case from the candidate test cases as a target test case, and upload the target test case to the to-be-tested embedded device;
and the target test information determining module 430 is configured to control, by using the command line interpreter, operation of a target test case in the to-be-tested embedded device, so as to obtain target test information of the target test case.
Optionally, the apparatus further includes:
the acquisition success judging module is used for determining whether the command line interpreter of the embedded device to be tested is successful or not after the command line interpreter of the embedded device to be tested is acquired;
the acquisition success processing module is used for determining a test case from the candidate test cases as a target test case and uploading the target test case to the embedded equipment to be tested if the test case is the target test case;
and the acquisition failure processing module is used for acquiring the command line interpreter of the embedded device to be tested again if not.
Optionally, the apparatus further includes:
the operation completion judging module is used for determining whether the target test case in the embedded device to be tested is completed or not after the target test information of the target test case is obtained;
the operation completion processing module is used for controlling the target test case to be deleted from the embedded device to be tested through the command line interpreter if the target test case is detected;
and the operation incomplete processing module is used for controlling the target test case to continue to operate through the command line interpreter if not.
Optionally, the apparatus further includes:
the test completion judging module is used for determining whether all the candidate test cases are tested after the target test cases are controlled to be deleted from the embedded equipment to be tested through the command line interpreter;
the test completion processing module generates a target log file according to the target test information, and stores the target log file in the upper computer;
and the test completion processing module is used for determining a test case from the candidate test cases as a target test case, uploading the target test case to the embedded equipment to be tested, and controlling the target test case in the embedded equipment to be tested to run through the command line interpreter.
Optionally, the test script is a python script;
accordingly, the command line interpreter acquisition module 410 is specifically configured to:
acquiring a command line interpreter of the embedded device to be tested through a preset control program in the upper computer; the preset control programs comprise telnet and pexpect.
Optionally, the test script is a python script;
correspondingly, the target test case uploading module 420 is specifically configured to:
and uploading the target test case to the embedded device to be tested through a ftplib module in python.
The automatic testing device of the embedded system provided by the embodiment of the invention can execute the automatic testing method of the embedded system provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example five
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as automated testing methods of embedded systems.
In some embodiments, the automated testing method of an embedded system may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the automated test method for embedded systems described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the automated test method of the embedded system in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems-on-chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program 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 the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage 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. Alternatively, the computer readable storage medium may be a machine readable signal medium. 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device 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) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically 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. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. The automatic test method of the embedded system is characterized in that the method is applied to an upper computer, the upper computer is used for running a test script and storing test cases, and the upper computer is connected with the embedded device to be tested in advance through a network; the method comprises the following steps:
if an automatic test instruction is detected, acquiring a command line interpreter of the embedded equipment to be tested;
determining a test case from candidate test cases as a target test case, and uploading the target test case to the embedded equipment to be tested;
and controlling the operation of the target test case in the embedded device to be tested through the command line interpreter to obtain target test information of the target test case.
2. The method of claim 1, wherein after obtaining a command line interpreter of the embedded device under test, the method further comprises:
determining whether a command line interpreter of the embedded device to be tested is successful;
if yes, determining a test case from the candidate test cases as a target test case, and uploading the target test case to the embedded equipment to be tested;
otherwise, the command line interpreter of the embedded device to be tested is acquired again.
3. The method of claim 1, wherein after obtaining the target test information for the target test case, the method further comprises:
determining whether the target test case in the embedded device to be tested is completed;
if yes, controlling the target test case to be deleted from the embedded device to be tested through the command line interpreter;
otherwise, the target test case is controlled to continue to run through the command line interpreter.
4. The method of claim 3, wherein after controlling, by the command line interpreter, the deletion of the target test case from the embedded device under test, the method further comprises:
determining whether all the candidate test cases are tested;
if yes, generating a target log file according to the target test information, and storing the target log file in the upper computer;
otherwise, a test case is redetermined from the candidate test cases to serve as a target test case, the target test case is uploaded to the embedded equipment to be tested, and the target test case in the embedded equipment to be tested is controlled to run through the command line interpreter.
5. The method of claim 1, wherein the test script is a python script;
correspondingly, acquiring the command line interpreter of the embedded device to be tested, including:
acquiring a command line interpreter of the embedded device to be tested through a preset control program in the upper computer; the preset control programs comprise telnet and pexpect.
6. The method of claim 1, wherein the test script is a python script;
correspondingly, uploading the target test case to the embedded device to be tested comprises:
and uploading the target test case to the embedded device to be tested through a ftplib module in python.
7. The automatic testing device of the embedded system is characterized in that the device is configured on an upper computer, the upper computer is used for running a test script and storing test cases, and the upper computer is connected with embedded equipment to be tested in advance through a network; the device comprises:
the command line interpreter acquisition module is used for acquiring the command line interpreter of the embedded device to be tested if the automatic test instruction is detected;
the target test case uploading module is used for determining a test case from the candidate test cases as a target test case and uploading the target test case to the embedded equipment to be tested;
and the target test information determining module is used for controlling the operation of the target test case in the embedded equipment to be tested through the command line interpreter to obtain the target test information of the target test case.
8. The apparatus of claim 7, wherein the apparatus further comprises:
the operation completion judging module is used for determining whether the target test case in the embedded device to be tested is completed or not after the target test information of the target test case is obtained;
the operation completion processing module is used for controlling the target test case to be deleted from the embedded device to be tested through the command line interpreter if the target test case is detected;
and the operation incomplete processing module is used for controlling the target test case to continue to operate through the command line interpreter if not.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the automated test method of an embedded system of any of claims 1-6.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the automated test method of an embedded system of any of claims 1-6.
CN202310465094.9A 2023-04-27 2023-04-27 Automatic test method, device, equipment and medium for embedded system Pending CN116185880A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310465094.9A CN116185880A (en) 2023-04-27 2023-04-27 Automatic test method, device, equipment and medium for embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310465094.9A CN116185880A (en) 2023-04-27 2023-04-27 Automatic test method, device, equipment and medium for embedded system

Publications (1)

Publication Number Publication Date
CN116185880A true CN116185880A (en) 2023-05-30

Family

ID=86452607

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310465094.9A Pending CN116185880A (en) 2023-04-27 2023-04-27 Automatic test method, device, equipment and medium for embedded system

Country Status (1)

Country Link
CN (1) CN116185880A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478721A (en) * 2023-12-28 2024-01-30 北京华云安信息技术有限公司 Connection method, device, equipment and storage medium for control program

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1932776A (en) * 2006-09-29 2007-03-21 上海科泰世纪科技有限公司 Automatic operating method for interface test in embedded operating system
CN102402480A (en) * 2011-10-12 2012-04-04 吴华中 Tool for debugging (testing) command line of circuit board firmware
US20140310690A1 (en) * 2013-04-15 2014-10-16 Futurewei Technologies, Inc. System and Method for Generating Automated Test Cases for Command Line Based Applications
CN105446849A (en) * 2015-11-06 2016-03-30 北京中星微电子有限公司 Product testing method and device
CN112035346A (en) * 2020-08-25 2020-12-04 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Automatic testing method, system and medium based on embedded DSP operating system
CN115982043A (en) * 2023-01-03 2023-04-18 重庆长安汽车股份有限公司 Vehicle interface testing method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1932776A (en) * 2006-09-29 2007-03-21 上海科泰世纪科技有限公司 Automatic operating method for interface test in embedded operating system
CN102402480A (en) * 2011-10-12 2012-04-04 吴华中 Tool for debugging (testing) command line of circuit board firmware
US20140310690A1 (en) * 2013-04-15 2014-10-16 Futurewei Technologies, Inc. System and Method for Generating Automated Test Cases for Command Line Based Applications
CN105446849A (en) * 2015-11-06 2016-03-30 北京中星微电子有限公司 Product testing method and device
CN112035346A (en) * 2020-08-25 2020-12-04 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Automatic testing method, system and medium based on embedded DSP operating system
CN115982043A (en) * 2023-01-03 2023-04-18 重庆长安汽车股份有限公司 Vehicle interface testing method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478721A (en) * 2023-12-28 2024-01-30 北京华云安信息技术有限公司 Connection method, device, equipment and storage medium for control program
CN117478721B (en) * 2023-12-28 2024-04-12 北京华云安信息技术有限公司 Connection method, device, equipment and storage medium for control program

Similar Documents

Publication Publication Date Title
CN116185880A (en) Automatic test method, device, equipment and medium for embedded system
CN115656788B (en) Chip testing system, method, equipment and storage medium
CN116702668A (en) Regression testing method and device, electronic equipment and storage medium
CN116089197A (en) Fault equipment switching exercise method, device, equipment and storage medium
CN115437865A (en) Method, device, equipment and medium for testing abnormal power failure of hard disk
CN113590498B (en) Method and system for testing application starting time of desktop operating system
CN115017047A (en) Test method, system, equipment and medium based on B/S architecture
CN114428747A (en) User interface testing method, device, server and storage medium
CN113836016B (en) Writing interface storage quality testing method, system, electronic equipment and storage medium
CN115422060A (en) Application program processing method, device, equipment and medium
CN114327682B (en) WebView white screen detection method, system, electronic equipment and storage medium
CN118277275A (en) Interface testing method and device, electronic equipment and storage medium
CN115562923A (en) Automatic testing method and device for equipment, electronic equipment and storage medium
CN115878461A (en) Operation log test method, device, equipment and storage medium
CN116185874A (en) Test report generation method, device, equipment and storage medium
CN117951024A (en) APP compatibility test method, device, equipment and medium
CN115543748A (en) Signal testing method, device, equipment and storage medium
CN118298853A (en) Feedback method and device for speech recognition test abnormality
CN117931155A (en) Code generation method, device, equipment and medium
CN117827666A (en) Script file debugging method and device, electronic equipment and storage medium
CN118098322A (en) Method, device, equipment and medium for testing rotation vibration of hard disk
CN116991737A (en) Software testing method, system, electronic equipment and storage medium
CN115794525A (en) BMC (baseboard management controller) pressure testing method, device, equipment and storage medium
CN117609064A (en) Unit test method and device, electronic equipment and storage medium
CN117056222A (en) Interface test file generation method and device, electronic equipment 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20230530

RJ01 Rejection of invention patent application after publication