CN-121996528-A - Test case generation method and device
Abstract
A method and a device for generating test cases comprise the steps of obtaining configuration information of a single board, wherein the single board is provided with a slot for installing an electronic device, the configuration information comprises first attribute information, the first attribute information comprises the type of the slot, the type of the slot and the type of the electronic device installed in the slot have a corresponding relation, based on the first attribute information, test codes of the electronic device of the corresponding type are obtained according to the type of the slot, and then the test cases are generated according to the test codes of the electronic device, so that automatic generation of the test cases is realized, the generation efficiency of the test cases is improved, and further the test efficiency of the single board is improved, and the requirement of rapid evolution of calculation force is met.
Inventors
- MA LI
- CHEN ZHENGGUANG
- Guo Huitong
Assignees
- 成都华为技术有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241029
Claims (10)
- 1. A test case generation method, comprising: Obtaining configuration information of a single board, wherein the single board is provided with a slot for installing an electronic device, the configuration information comprises first attribute information, the first attribute information comprises the type of the slot, and the type of the slot has a corresponding relation with the type of the electronic device installed in the slot; according to the type of the slot, acquiring a test code of an electronic device of a corresponding type; And generating a test case according to the test code of the electronic device.
- 2. The method of claim 1, wherein a memory is provided on the board, the memory storing the configuration information; The obtaining the configuration information of the single board includes: and reading the configuration information stored in the memory.
- 3. The method of claim 1 or 2, wherein the generating test cases from the test code of the electronic device comprises: sequencing the test sequence of the electronic devices according to the position numbers of the electronic devices in the single board; and sequencing the test codes of the electronic devices based on the test sequence of the electronic devices to obtain the test cases.
- 4. A method according to any of claims 1-3, wherein the configuration information further comprises second attribute information; The method further comprises the steps of: And establishing a corresponding relation between the test result of the single board and the second attribute information.
- 5. The method of claim 4, wherein the second attribute information includes one or more of an identification of the board, an identification and a version of a transmission protocol.
- 6. The method of any of claims 1-5, wherein after the generating the test case, the method further comprises: And testing the single board by using the test case.
- 7. An apparatus, comprising: The device comprises an acquisition module, a configuration module and a display module, wherein the acquisition module is used for acquiring configuration information of a single board, the single board is provided with a slot for installing an electronic device, the configuration information comprises first attribute information, the first attribute information comprises the type of the slot, and the type of the slot has a corresponding relation with the type of the electronic device installed in the slot; the processing module is used for acquiring test codes of electronic devices of corresponding types according to the types of the slots; And generating a test case according to the test code of the electronic device.
- 8. A board comprising a socket for mounting an electronic device, and a memory; The memory stores configuration information, the configuration information comprises first attribute information, the first attribute information comprises the type of the slot, and the type of the slot has a corresponding relation with the type of an electronic device installed in the slot.
- 9. A computing device comprising a processor and a memory for storing computer-executable instructions therein, the computing device, when run, executing the computer-executable instructions in the memory to perform the steps of the method of any of claims 1-6 using hardware resources in the computing device.
- 10. A computer program product, characterized in that it, when run on an apparatus, causes the apparatus to perform the method according to any of claims 1-6.
Description
Test case generation method and device Technical Field The present application relates to the field of information technology (Information Technology, IT), and in particular, to a method and apparatus for generating test cases. Background With the development of technology, the types and kinds of veneers are gradually increased. The board may refer to a server hardware device integrated with electronic devices such as a circuit board (Printed CircuitBoard, PCB), a slot, and a diode, where the slot is used to mount electronic devices such as a processor, a memory, and a display card. In practical application, after a board is developed, the board is generally required to be tested by a test case to determine the service processing performance of the board. Due to the different processing capabilities, the types and the number of electronic devices that need to be installed by different boards may be different, such as different processors corresponding to different boards. Therefore, different single boards cannot be tested through the unified test cases, and test case developers are generally required to manually generate test cases for different single boards to realize testing of the single boards. The test case is artificially generated, the technical requirement on the test case developer is high, the generation efficiency of the test case is low, the test efficiency of the single board is low, and the requirement of rapid evolution of calculation force is difficult to meet. Disclosure of Invention The application provides a test case generation method and device, which are used for automatically generating test cases, so that the generation efficiency of the test cases is improved, and the test efficiency of a single board is further improved. In a first aspect, the present application provides a test case generating method, where the method may be applied to a device, or a module (such as a processor, a processing unit, a chip, a circuit, etc.) of the device, or a system corresponding to the device, where the device may be a network device (such as a server), or a terminal device (such as a computer). Based on the configuration information, the method comprises the steps of obtaining configuration information of a single board, wherein the single board is provided with a slot for installing an electronic device, the configuration information comprises first attribute information, the first attribute information comprises the type of the slot, the type of the slot and the type of the electronic device installed in the slot have a corresponding relation, obtaining test codes of the electronic device of the corresponding type according to the type of the slot based on the corresponding relation, and generating test cases according to the test codes of the electronic device to automatically generate the test cases. In the method, the configuration information of the single board can be stored during research and development, so that the test case does not need to be developed manually by identifying the electronic device required to be installed on the single board, and the manpower resource consumption is reduced. The test codes of the electronic devices can be understood as test codes for testing the performance of the electronic devices, and the same test codes can be used for testing the same type of electronic devices, so that the test codes corresponding to all electronic devices (generally a plurality of electronic devices) required to be installed by a single board can be obtained according to the types of the electronic devices, the test cases can be automatically generated according to the test codes of the electronic devices, the generation efficiency of the test cases is improved, and the test efficiency of the single board is further improved, so that the demand of rapid evolution of computing power is met. A possible implementation manner is that a memory is arranged on the single board, the memory stores the configuration information, and the obtaining of the configuration information of the single board comprises the step of reading the configuration information stored in the memory. In the implementation manner, the configuration information of the single board is stored in the memory of the single board, so that unified management of the configuration information of the single board can be avoided, and the management workload of the configuration information of different single boards is reduced. In addition, because the configuration information of the single board can be obtained through the memory arranged on the single board, the hardware cross-platform upgrading and cross-generation upgrading of the single board can be supported, and the development investment and the development period are reduced. Optionally, the memory is a charged erasable programmable read-only memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ ONLY MEMORY, EEPROM). A possible implementation manner of the method f