Test code generation method and device, equipment and medium

By automatically generating hardware pin test codes, the problems of low efficiency and difficulty in generating test codes in the existing technology are solved, and the testing efficiency and resource utilization are improved.

CN119862124APending Publication Date: 2025-04-22S2C
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411933600.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing hardware pin test code generation methods are inefficient and difficult, resulting in low testing efficiency and waste of human resources.

Method used

By obtaining the pin information of the part to be tested, classifying external pins, obtaining timing information and random data in response to user configuration operations, and generating matching test codes based on the preset code template table.

Benefits of technology

It realizes automatic generation of test code, improves the efficiency of test code generation, and thus improves the testing efficiency of pin testing work, saving human resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862124A_ABST
    Figure CN119862124A_ABST
Patent Text Reader

Abstract

The invention discloses a test code generation method and device, equipment and a medium. The method comprises the following steps: acquiring pin information of at least one external pin of a to-be-tested piece, and classifying each pair of external pins according to each piece of pin information to obtain each pair of external pin sets; in response to a configuration operation of a user, obtaining time sequence information and random data matched with the to-be-tested piece; and according to a preset code template table, based on the time sequence information and the random data, generating test codes respectively matched with each pair of external pin sets, so that a user uses the test codes to test each pair of external pin sets. By means of the technical scheme, automatic generation of the test code can be achieved, the generation efficiency of the test code is improved, then the test efficiency of pin test work is improved, and human resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of hardware testing, and in particular to a method, device, equipment and medium for generating a test code. Background Art

[0002] In the field of modern electronic technology, the performance and reliability of hardware are crucial, and the testing of hardware pins is a key link to ensure its quality. Traditional hardware pin test code generation methods are often extremely inefficient. During the generation process, a large amount of pin data and complex electrical characteristic parameters need to be processed, which leads to a lengthy and cumbersome process and consumes a lot of time and computing resources. Moreover, the knowledge and skills involved in the generation of hardware pin test code are extremely complicated. It not only requires a deep understanding of multiple hardware programming languages ​​and development environments, but also requires a mastery of the principles of hardware circuits, electrical characteristics, and related knowledge of signal transmission. In addition, for different types of hardware pins, such as input pins, output pins, bidirectional pins, etc., their test methods and code implementations have unique requirements, which further increases the complexity. Due to this complexity, usually only experienced and senior verification personnel can fully master and master the generation technology of hardware pin test code. This makes the actual project rely too much on a few experts. Once these expert resources are tight or unavailable, it may lead to delays in project progress and even affect the on-time delivery of products. More importantly, this high reliance on experts limits the dissemination and popularization of technology, making it difficult for new developers to get started quickly, and hindering the improvement of the overall technical level of the industry. At the same time, existing methods lack flexibility and adaptability when dealing with constantly updated hardware technologies and diverse pin types, and are unable to meet the rapidly evolving hardware development needs.

[0003] In summary, the existing test code generation method has the problems of low code generation efficiency and great difficulty, which in turn leads to low test efficiency of pin testing work and waste of human resources. Summary of the invention

[0004] The present invention provides a test code generation method, device, equipment and medium, which can solve the problem that the existing method has low code generation efficiency and great difficulty, which in turn leads to low test efficiency of pin testing and waste of human resources.

[0005] In a first aspect, an embodiment of the present invention provides a method for generating a test code, the method comprising:

[0006] Obtaining pin information of at least one external pin of the device under test, and classifying each external pin according to each pin information to obtain each external pin set;

[0007] In response to a configuration operation by a user, acquiring timing information and random data matching the device under test;

[0008] According to the preset code template table, test codes matching each external pin set are generated based on the timing information and random data, so that the user can use the test codes to test each external pin set.

[0009] In a second aspect, an embodiment of the present invention provides a device for generating a test code, the device comprising:

[0010] A pin classification module is used to obtain pin information of at least one external pin of the device under test, and classify each external pin according to each pin information to obtain each external pin set;

[0011] A data acquisition module, used to acquire timing information and random data matching the device under test in response to a configuration operation by a user;

[0012] The code generation module is used to generate test codes that match each external pin set according to a preset code template table, based on the timing information and random data, so that the user can use the test code to test each external pin set.

[0013] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a test code generation method described in any embodiment of the present invention.

[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a test code generation method described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention first obtains the pin information of at least one external pin of the device to be tested, and classifies the external pins according to the pin information to obtain each external pin set, and then obtains the timing information and random data matching the device to be tested in response to the user's configuration operation, and finally generates test codes matching each external pin set based on the timing information and random data according to a preset code template table, so that the user can use the test code to test each external pin set, thereby solving the problems of low code generation efficiency and difficulty in the existing method, low test efficiency of pin testing work, and waste of human resources, realizing automatic generation of test code, improving the generation efficiency of test code, thereby improving the test efficiency of pin testing work and saving human resources.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a method for generating a test code according to Embodiment 1 of the present invention;

[0022] Figure 2 is a flow chart of a method for generating a test code according to Embodiment 2 of the present invention;

[0023] Figure 3 is a schematic diagram of the structure of a test code generation device provided according to Embodiment 3 of the present invention;

[0024] Figure 4 The present invention is a schematic diagram of the structure of an electronic device for implementing a method for generating a test code according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, any variation of the terms "including" and "having" is intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] Embodiment 1

[0028] Figure 1 A flowchart of a test code generation method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation where test code is generated for testing of hardware pins. The method can be executed by a test code generation device. The test code generation device can be implemented in the form of hardware and / or software. The test code generation device can be configured in a terminal or server with a test code generation function.

[0029] like Figure 1 As shown, the method includes:

[0030] S110 , obtaining pin information of at least one external pin of the device under test, and classifying the external pins according to the pin information to obtain external pin sets.

[0031] The pin information includes: pin attributes and pin names of the external pins, and the pin attributes include independent pins and interface pins.

[0032] Specifically, each external pin is classified according to each pin information to obtain each external pin set, including: judging whether each external pin is an independent pin according to the pin attribute in each pin information; if the external pin is an independent pin, the external pin is classified separately to obtain each external pin set.

[0033] Among them, the independent pins are pins that can independently perform specific functions, referring to the pins corresponding to interfaces such as reset and clock, whose functions are only completed by a single pin; further, the interface pins are pins used to connect and interact with other devices or components, such as common USB interface pins.

[0034] Optionally, after determining whether each external pin is an independent pin based on the pin attributes in each pin information, the method further includes: if the external pin is an interface pin, classifying each interface pin according to the grammatical structure of the pin name of each interface pin to obtain each target pin set; obtaining the pin name of each interface pin in the target pin set, merging the interface pins containing the same keyword to divide the target pin set to obtain each external pin set.

[0035] In this embodiment, if it is determined that the external pin is an interface pin, then the classification work will be carried out according to the grammatical structure of the pin name of each interface pin, so as to obtain each target pin set. The grammatical structure of the pin name mentioned here refers to the composition method and rules of the pin name. For example, some pin names may start with specific letters or contain specific digital code combinations. Exemplarily, taking a common computer motherboard as an example, the names of the interface pins may be "USB_1", "USB_2", "LAN_1", "LAN_2", etc., where "USB" and "LAN" belong to the specific identification part of the pin name. Next, the pin names of each interface pin in the target pin set are obtained, and then the interface pins containing the same keyword are merged. For example, all interface pins containing the "USB" keyword will be classified into one category. Through such a merging operation, the target pin set is segmented, and finally each external pin set is obtained. This detailed classification and merging operation can more accurately distinguish and manage different types of interface pins, provide a clear and definite basis for subsequent functional testing, circuit design, and troubleshooting of these pins, and greatly improve the efficiency and accuracy of circuit design and system development.

[0036] S120 . In response to a configuration operation by a user, acquire timing information and random data matching the device under test.

[0037] Wherein, in response to the user's configuration operation, obtaining random data matching the device under test includes: obtaining a data generation range and a target generation quantity preset by the user; based on the data generation range, using a preset random data generation model to generate a target generation quantity of random data.

[0038] Specifically, in the actual operation process, in response to the user's configuration operation, it is necessary to obtain the timing information and random data that match the DUT; wherein the user configuration operation is a series of settings and selections made by the user through a specific interface or input method according to specific needs and test objectives. For example, when testing a new type of microcontroller, the user may check the relevant options and enter values ​​in the special configuration software.

[0039] Further, with regard to obtaining random data that matches the device under test, the following steps are specifically included: first, obtaining a data generation range and a target generation quantity pre-set by the user; wherein the data generation range can be an interval of specified values, such as between 0 and 100, or a data range of a specific type, such as an integer range, a floating point range, etc., and the target generation quantity is the number of random data that the user expects to generate, for example, the user wants to generate 50 random data, etc. Then, based on the data generation range, a pre-set random data generation model is used to generate the target generation quantity of random data, wherein the random data generation model can be a program module constructed based on various algorithms and mathematical principles, such as the common linear congruential method, the Mersenne rotation algorithm, etc. Through such a model, the required random data can be efficiently and accurately generated according to the range and quantity requirements set by the user, providing a rich and diverse data sample for the testing and analysis of the device under test, thereby more comprehensively and deeply evaluating the performance and function of the device under test.

[0040] S130. Generate test codes that match each external pin set respectively based on the timing information and random data according to a preset code template table, so that the user can use the test codes to test each external pin set.

[0041] The technical solution of the embodiment of the present invention first obtains the pin information of at least one external pin of the device under test, and classifies the external pins according to the pin information to obtain each external pin set, and then obtains the timing information and random data matching the device under test in response to the user's configuration operation, and finally generates test codes matching each external pin set based on the timing information and random data according to a preset code template table, so that the user can use the test code to test each external pin set, thereby realizing the automatic generation of test codes, improving the generation efficiency of test codes, and further improving the test efficiency of pin testing work, saving human resources.

[0042] Embodiment 2

[0043] Figure 2A flowchart of a method for generating test codes provided in the second embodiment of the present invention. This embodiment is refined on the basis of the above-mentioned embodiment. In this embodiment, the test codes that match each external pin set are generated based on the preset code template table, the timing information and the random data.

[0044] like Figure 2 As shown, the method includes:

[0045] S210 , obtaining pin information of at least one external pin of the device under test, and classifying the external pins according to the pin information to obtain external pin sets.

[0046] S220 . In response to a configuration operation by a user, acquire timing information and random data matching the device under test.

[0047] S230: Obtain a code template table.

[0048] The code template table includes at least one basic code framework and a pin type matching the basic code framework.

[0049] The code template table is a pre-built and organized structured table or database used to assist in generating specific codes. For example, when testing the pins of a specific model of microcontroller, the corresponding code template table may include at least one basic code framework such as "simple detection framework" and "complex output control framework". Matching these basic code frameworks are types corresponding to the keywords in the above pin names, such as "USB pins" and "LAN related pins".

[0050] By obtaining such a code template table, it is possible to provide convenience and guidance for the subsequent selection of the appropriate code basic framework according to the pin characteristics and test requirements of the device under test, thereby improving the efficiency and accuracy of test code generation.

[0051] S240: parse the timing information to obtain key timing parameters matching the timing information.

[0052] Among them, the timing information is the relevant data describing the temporal variation and mutual relationship of electronic signals; further, the timing key is the core indicator that can have an important impact on system performance and function. Taking the clock pin as an example, the timing key parameters may include rise time, fall time, hold time, etc. These parameters are of vital importance for evaluating the speed, stability and compatibility of the system.

[0053] S250: Integrate the key timing parameters with the random information to obtain target test data.

[0054] Optionally, after obtaining the key timing parameters and the random information, integration is performed based on preset integration rules to obtain target test data. The preset integration rules can be set by the developer according to the actual application scenario, such as front-to-back splicing or cross splicing, etc., which is not limited in this embodiment.

[0055] S260. In the code template table, according to each pin type, obtain a basic code framework that matches each external pin set.

[0056] S270, filling the target test data into the basic code framework matching the external pin set according to a preset filling rule, and obtaining the test code matching the external pin set, so that the user can use the test code to test each external pin set.

[0057] The preset filling rules are a series of criteria and methods formulated to ensure that data can be accurately and efficiently placed in the appropriate location. For example, it is stipulated that a specific type of data should be filled into a specific variable or parameter position in the code framework, or filled in a specific order.

[0058] In this embodiment, test codes matching the external pin sets are finally obtained. These test codes are specially generated for testing each external pin set. Users can use these carefully generated test codes to conduct comprehensive and in-depth tests on the functions, performance, stability and other aspects of each external pin set to ensure the normal operation of the pins and the reliable operation of the entire system.

[0059] Optionally, after filling the target test data into a basic code framework that matches the external pin set according to preset filling rules and obtaining the test code that matches the external pin set, it also includes: outputting the test code to a display device for display; and editing the test code in response to a user's editing operation to update the test code.

[0060] Exemplarily, first, the generated test code will be output to a display device for clear display, where the display device can be a computer monitor, a tablet screen or other terminals with display functions. Then, the system will respond to the user's editing operation. The user's editing operation refers to a series of actions in which the user modifies, adjusts or improves the displayed test code based on actual needs and personal experience. For example, the user may find that a certain parameter setting is not reasonable enough, or needs to add some specific comments to enhance the readability of the code. After receiving the user's editing operation instructions, the test code is edited accordingly to achieve the update of the test code. Through such an update, the test code can be more in line with the user's specific needs and actual application scenarios, thereby improving the accuracy and effectiveness of the test.

[0061] The technical solution of the embodiment of the present invention first obtains the pin information of at least one external pin of the device to be tested, and classifies the external pins according to the pin information to obtain each external pin set, and then obtains the timing information and random data matching the device to be tested in response to the user's configuration operation, and then obtains the code template table, and parses the timing information to obtain the timing key parameters matching the timing information, and then integrates the timing key parameters with the random information to obtain target test data, and in the code template table, obtains the code basic framework matching each external pin set according to each pin type, and finally fills the target test data into the code basic framework matching the external pin set according to the preset filling rule to obtain the test code matching the external pin set, so that the user can use the test code to test each external pin set, thereby realizing the automatic generation of test code, improving the generation efficiency of test code, thereby improving the test efficiency of pin testing work, and saving human resources.

[0062] Embodiment 3

[0063] Figure 3 A schematic diagram of the structure of a test code generation device provided in Embodiment 3 of the present invention.

[0064] like Figure 3 As shown, the device comprises:

[0065] The pin classification module 310 is used to obtain the pin information of at least one external pin of the device under test, and classify each external pin according to each pin information to obtain each external pin set;

[0066] The data acquisition module 320 is used to acquire the timing information and random data matching the DUT in response to the configuration operation of the user;

[0067] The code generation module 330 is used to generate test codes matching each external pin set according to a preset code template table, based on the timing information and random data, so that the user can use the test codes to test each external pin set.

[0068] The technical solution of the embodiment of the present invention first obtains the pin information of at least one external pin of the device under test, and classifies the external pins according to the pin information to obtain each external pin set, and then obtains the timing information and random data matching the device under test in response to the user's configuration operation, and finally generates test codes matching each external pin set based on the timing information and random data according to a preset code template table, so that the user can use the test code to test each external pin set, thereby realizing the automatic generation of test codes, improving the generation efficiency of test codes, and further improving the test efficiency of pin testing work, saving human resources.

[0069] Based on the above embodiment, the pin classification module 310 includes:

[0070] A pin determination unit, used to determine whether each external pin is an independent pin according to the pin attributes in each pin information;

[0071] The independent classification unit is used to classify the external pins separately if the external pins are independent pins to obtain external pin sets.

[0072] On the basis of the above embodiment, the pin judgment unit is also used to: after judging whether each external pin is an independent pin according to the pin attributes in the pin information, if the external pin is an interface pin, classify each interface pin according to the grammatical structure of the pin name of each interface pin to obtain each target pin set; obtain the pin name of each interface pin in the target pin set, merge the interface pins containing the same keyword to divide the target pin set to obtain each external pin set.

[0073] Based on the above embodiment, the data acquisition module 320 includes:

[0074] A data limiting unit is used to obtain a data generation range and a target generation quantity preset by a user;

[0075] The random data generating unit is used to generate a target generation quantity of random data using a preset random data generating model based on the data generation range.

[0076] Based on the above embodiment, the code generation module 330 includes:

[0077] A template acquisition unit, used to acquire a code template table, wherein the code template table includes at least one code basic framework and a pin type matching the code basic framework;

[0078] A timing analysis unit, used to analyze the timing information to obtain key timing parameters matching the timing information;

[0079] A data integration unit, used to integrate the key timing parameters with the random information to obtain target test data;

[0080] A framework matching unit, used for acquiring, in the code template table, a code basic framework that matches each external pin set according to each pin type;

[0081] The code filling unit is used to fill the target test data into the code basic framework matching the external pin set according to a preset filling rule to obtain the test code matching the external pin set.

[0082] On the basis of the above embodiment, the code filling unit is also used to: fill the target test data into the basic code framework that matches the external pin set according to the preset filling rules, and after obtaining the test code that matches the external pin set, output the test code to the display device for display; in response to the user's editing operation, edit the test code to update the test code.

[0083] A test code generation device provided in an embodiment of the present invention can execute a test code generation method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0084] Embodiment 4

[0085] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0086] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can 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 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0087] A number of 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, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0088] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for generating a test code.

[0089] Accordingly, the method comprises:

[0090] Obtaining pin information of at least one external pin of the device under test, and classifying each external pin according to each pin information to obtain each external pin set;

[0091] In response to a configuration operation by a user, acquiring timing information and random data matching the device under test;

[0092] According to the preset code template table, test codes matching each external pin set are generated based on the timing information and random data, so that the user can use the test codes to test each external pin set.

[0093] In some embodiments, a method for generating a test code may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for generating a test code described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute a method for generating a test code in any other appropriate manner (e.g., by means of firmware).

[0094] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, 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 implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0095] Computer programs for implementing the 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, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0096] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0097] To provide interaction with a user, the systems and techniques described herein may 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 the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the 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, voice input, or tactile input).

[0098] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0099] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0100] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

Claims

1. A method for generating a test code, characterized in that: include: Obtaining pin information of at least one external pin of the device under test, and classifying each external pin according to each pin information to obtain each external pin set; In response to a configuration operation by a user, acquiring timing information and random data matching the device under test; According to the preset code template table, test codes matching each external pin set are generated based on the timing information and random data, so that the user can use the test codes to test each external pin set.

2. The method according to claim 1, characterized in that The pin information includes: pin attributes of the external pin and the pin name, and the pin attributes include independent pins and interface pins.

3. The method according to any one of claims 1 to 2, characterized in that: According to the pin information, each external pin is classified to obtain each external pin set, including: According to the pin attributes in each pin information, determine whether each external pin is an independent pin; If the external pins are independent pins, the external pins are classified separately to obtain external pin sets.

4. The method according to claim 3, characterized in that After determining whether each external pin is an independent pin according to the pin attributes in each pin information, the following steps are also included: If the external pins are interface pins, classify the interface pins according to the grammatical structure of the pin names of the interface pins to obtain target pin sets; The pin name of each interface pin in the target pin set is obtained, and the interface pins containing the same keyword are merged to segment the target pin set to obtain each external pin set.

5. The method according to claim 1, characterized in that In response to a configuration operation by a user, obtaining random data matching the device under test includes: Obtain the data generation range and target generation quantity preset by the user; Based on the data generation range, a preset random data generation model is used to generate a target generation quantity of random data.

6. The method according to claim 1, characterized in that According to the preset code template table, based on the timing information and random data, test codes matching each external pin set are generated, including: Acquire a code template table, wherein the code template table includes at least one code basic framework and a pin type matching the code basic framework; Parsing the timing information to obtain key timing parameters matching the timing information; Integrate the key timing parameters with the random information to obtain target test data; In the code template table, a basic code framework matching each external pin set is obtained according to each pin type; The target test data is filled into a basic code framework that matches the external pin set according to a preset filling rule to obtain a test code that matches the external pin set.

7. The method according to claim 6, characterized in that After filling the target test data into the code basic framework matching the external pin set according to the preset filling rule to obtain the test code matching the external pin set, the method further includes: Outputting the test code to a display device for display; In response to an editing operation of a user, the test code is edited to update the test code.

8. A test code generation device, characterized in that: include: A pin classification module is used to obtain pin information of at least one external pin of the device under test, and classify each external pin according to each pin information to obtain each external pin set; A data acquisition module, used to acquire timing information and random data matching the device under test in response to a configuration operation by a user; The code generation module is used to generate test codes that match each external pin set according to a preset code template table, based on the timing information and random data, so that the user can use the test code to test each external pin set.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a test code generation method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a test code generation method according to any one of claims 1 to 7 when executed.