Floating point type data interface testing method and device

By designing floating-point data interface testing methods and devices in software testing, and generating and testing floating-point field data, the problem of insufficient floating-point data interface testing in the prior art is solved, and the quality and security of software testing are improved.

CN119829420AActive Publication Date: 2025-04-15BEIJING INST OF COMP TECH & APPL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411712489.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-04-15
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The existing software testing technology is insufficient when testing floating-point data interfaces, and cannot effectively detect the software's processing capabilities for special floating-point data, resulting in errors in calculation results or errors exceeding expectations, and the defects in software security protection measures cannot be discovered.

Method used

A floating-point data interface testing method and device are proposed. By receiving data frame description information, floating-point field testing data is generated, including floating-point special data and floating-point ordinary data, calculating checksums, and forming data frames to comprehensively test the software's processing capabilities of floating-point data.

Benefits of technology

It improves the quality and testing efficiency of software testing, enhances the software's detection of floating-point data processing capabilities, and avoids software security problems caused by not testing floating-point special data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829420A_ABST
    Figure CN119829420A_ABST
Patent Text Reader

Abstract

The invention relates to a floating point type data interface testing method and device, and belongs to the field of software interface testing. The method comprises the following steps: receiving data frame description information, analyzing and processing to obtain a data frame format; judging whether the field type is a floating point type field or not; under the condition that the field type is a floating point type field, generating floating point type field test data according to the field length and the field value range; under the condition that the field type is not the floating point type field, generating other field test data according to the field length and the field content; calculating and generating a checksum according to the checksum calculation mode; and forming a data frame by the fields. According to the method and the device, the problems caused by insufficient floating point type data interface testing in related technologies are solved, the software testing quality and the software testing efficiency are improved, and the software security is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of software interface testing, and in particular relates to a floating point data interface testing method and device. Background Art

[0002] Interface testing is a typical test type in software testing. The interfaces of the test object are divided into internal interfaces and external interfaces. The internal interface is usually tested together with the functions and performance of the test object. The external interface focuses on testing whether the information format, information content, and time characteristics of the external interface meet the requirements, as well as testing abnormal situations to verify the security of the software data interface.

[0003] Software interface testing is generally performed by testers who write test cases based on the software interface communication protocol, design normal and abnormal interface data, inject them into the interface, test whether the software can correctly receive and parse the normal data input to the interface, whether it can identify errors and perform corresponding processing on the abnormal data input to the interface, and test whether the data output by the software interface meets the requirements.

[0004] Software interface data mainly include two types of data: integer and floating-point data. When testing the input interface of the software under test, in the existing testing technology, testers generally use equivalence class partitioning and boundary value analysis to design normal and abnormal data, including three categories. The first category is normal data whose values ​​are within the value range of the field specified by the protocol. The second category is boundary data whose values ​​are at the upper and lower points of the boundary of the value range of the field specified by the protocol. The third category is abnormal data that exceeds the value range of the field specified by the protocol.

[0005] However, since the floating-point data storage method is different from that of integer data, it is not sufficient to test the floating-point data interface using the above three types of data. The inventor found that the existing testing technology has defects. In actual applications, when the floating-point data received by the software input interface is a certain type of special data, the software will be abnormal during storage and processing, and this type of special data is transitive, which will cause calculation results to be wrong or the error exceeds expectations; the existing testing technology does not design special data for testing based on the characteristics of floating-point data storage, and cannot test the processing ability of the tested software for the special data, so it is impossible to find defects in the security protection measures of the tested software.

[0006] There are a large number of high-precision calculations in aerospace systems, and it is very common for software to exchange information through floating-point data. Various complex environmental conditions increase the possibility of the occurrence of special floating-point data. Therefore, when testing the software interface, for the floating-point data interface, in addition to designing normal data, boundary data, and abnormal data, the special data must also be designed to test whether the software under test has the ability to perform special processing on the special data to avoid causing serious adverse consequences.

[0007] The purpose of the present invention is to provide a floating-point data interface testing method and device to solve the defect of insufficient software floating-point data interface testing, improve software testing quality and testing efficiency, and further enhance software security. Summary of the invention

[0008] 1. Technical issues to be resolved

[0009] The technical problem to be solved by the present invention is how to provide a floating-point data interface testing method and device to solve the defect of insufficient software floating-point data interface testing.

[0010] (II) Technical solution

[0011] In order to solve the above technical problems, the present invention provides a floating point data interface testing method, the method comprising:

[0012] S1. Steps for receiving data frame description

[0013] Receive data frame description information, analyze and process it, and obtain the data frame format; the data frame description information includes field sequence number, field type, field length, field value range, field content, multi-byte transmission order, checksum calculation method;

[0014] S2. Test data generation steps

[0015] Determine whether the field type is a floating-point field; if the field type is a floating-point field, generate floating-point field test data according to the field length and the field value range; if the field type is not a floating-point field, generate other field test data according to the field length and the field content;

[0016] S3. Calculate checksum steps

[0017] According to the checksum calculation method, calculate and generate the checksum;

[0018] S4, framing steps

[0019] According to the field sequence number and the multi-byte transmission order, the fields are organized into a data frame.

[0020] The present invention provides a floating point data interface test device, the device comprises a receiving analysis module, a test data generation module, a checksum module, and a framing module;

[0021] The receiving and analyzing module is used to receive data frame description information, obtain field sequence number, field type, field length, field value range, field content, multi-byte transmission order, checksum calculation method;

[0022] The test data generation module is used to determine whether the field type is a floating-point field; if the field type is a floating-point field, generate floating-point field test data according to the field length and the field value range; if the field type is not a floating-point field, generate other field test data according to the field length and the field content;

[0023] The checksum calculation module is used to calculate and generate the checksum according to the checksum calculation method;

[0024] The frame assembly module is used to compose a data frame according to the field sequence number and the multi-byte transmission order.

[0025] (III) Beneficial effects

[0026] The present invention proposes a floating-point data interface testing method and device. The floating-point data interface testing method and device provided by the present invention solve the problems caused by insufficient floating-point data interface testing in the related art, improve software testing quality and testing efficiency, and further enhance software security. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a flow chart of the method of the present invention;

[0028] Figure 2 It is a structural diagram of the device of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.

[0030] The present invention provides a floating point data interface testing method and device, which solve the problem caused by insufficient floating point data interface testing in the related art.

[0031] According to one aspect of the present invention, there is provided a floating point data interface testing method, comprising the following steps:

[0032] S1. Steps for receiving data frame description

[0033] Receive data frame description information, analyze and process it, and obtain the data frame format; the data frame description information includes field sequence number, field type, field length, field value range, field content, multi-byte transmission order, checksum calculation method.

[0034] S2. Test data generation steps

[0035] Determine whether the field type is a floating-point field; if the field type is a floating-point field, generate floating-point field test data according to the field length and the field value range; if the field type is not a floating-point field, generate other field test data according to the field length and the field content.

[0036] The floating point field test data includes floating point special data and floating point common data.

[0037] The floating-point special data include: floating-point special value NaN (Not a Number), floating-point special value Inf (Infinite), special data whose value is within the field value range and will produce NaN after high-low byte sequence conversion, and floating-point value 0.

[0038] S3. Calculate checksum steps

[0039] The checksum is calculated and generated according to the checksum calculation method.

[0040] S4, framing steps

[0041] According to the field sequence number and the multi-byte transmission order, the fields are organized into a data frame.

[0042] Furthermore, the special data whose value is within the field value range and will generate NaN after high-low byte order conversion includes: special data whose value is within the field value range and will generate qNaN (quietNaN) after high-low byte order conversion, and special data whose value is within the field value range and will generate sNaN (signalingNaN) after high-low byte order conversion.

[0043] Furthermore, the floating-point special value NaN includes: a floating-point special value qNaN (quietNaN) and a floating-point special value sNaN (signalingNaN).

[0044] Furthermore, the floating point special value Inf includes: a floating point special value +Inf and a floating point special value -Inf.

[0045] Furthermore, the floating point number 0 value includes: floating point number +0, floating point number -0.

[0046] Furthermore, the floating-point normal data includes: abnormal data whose values ​​exceed the value range of the field, boundary data whose values ​​are at the upper point and the off point of the boundary of the value range of the field, and normal data whose values ​​are within the value range of the field.

[0047] According to another aspect of the present invention, a floating point data interface test device is provided, the device comprising a receiving and analyzing module, a test data generating module, a checksum module, and a framing module.

[0048] The receiving and analyzing module is used to receive data frame description information, obtain field sequence number, field type, field length, field value range, field content, multi-byte transmission order, checksum calculation method.

[0049] The test data generation module is used to determine whether the field type is a floating-point field; if the field type is a floating-point field, generate floating-point field test data according to the field length and the field value range; if the field type is not a floating-point field, generate other field test data according to the field length and the field content.

[0050] The checksum calculation module is used to calculate and generate the checksum according to the checksum calculation method.

[0051] The frame assembly module is used to compose a data frame according to the field sequence number and the multi-byte transmission order.

[0052] Embodiment 1:

[0053] In this embodiment, a floating point data interface testing method is provided. Figure 1 It is a flow chart of a floating point data interface test method, such as Figure 1 As shown, the process includes the following steps:

[0054] The first step is to receive the data frame description step. Receive the data frame description information, analyze and process it, and obtain the data frame format. The data frame description information includes field sequence number, field type, field length, field value range, field content, multi-byte transmission order, and checksum calculation method. Taking the servo control command received by the software as an example, Table 1 is a schematic table of data frame description information according to an embodiment of the present invention, including frame header, source address, destination address, information code, control voltage, control angle, checksum, frame tail, and the checksum field needs to set the checksum calculation method; Table 2 is a schematic table of setting the checksum calculation method according to an embodiment of the present invention, including the starting field sequence number, the ending field sequence number, and the checksum type.

[0055] Table 1 Schematic table of data frame description information according to an embodiment of the present invention

[0056]

[0057] Table 2 Schematic diagram of the checksum calculation method according to an embodiment of the present invention

[0058]

[0059] The second step is the test data generation step. Determine whether the field type is a floating point field; if the field type is a floating point field, generate floating point field test data according to the field length and the field value range; if the field type is not a floating point field, generate other field test data according to the field length and the field content.

[0060] The floating point field test data includes floating point special data and floating point common data.

[0061] The floating-point special data include: floating-point special value NaN (Not a Number), floating-point special value Inf (Infinite), special data whose value is within the field value range and will produce NaN after high-low byte order conversion, and floating-point value 0. The special data whose value is within the field value range and will produce NaN after high-low byte order conversion include: special data whose value is within the field value range and will produce qNaN (quietNaN) after high-low byte order conversion, and special data whose value is within the field value range and will produce sNaN (signalingNaN) after high-low byte order conversion. The floating-point special value NaN includes: floating-point special value qNaN (quietNaN), floating-point special value sNaN (signalingNaN). The floating-point special value Inf includes: floating-point special value +Inf, floating-point special value -Inf. The floating-point value 0 includes: floating-point number +0, floating-point number -0. Table 3 is a schematic table of floating-point special data according to an embodiment of the present invention.

[0062] Table 3 Schematic diagram of floating-point dedicated data according to an embodiment of the present invention

[0063]

[0064] The floating point normal data includes: abnormal data whose values ​​exceed the value range of the field, boundary data whose values ​​are at the upper point and the off point of the boundary of the field value range, and normal data whose values ​​are within the value range of the field.

[0065] The third step is to calculate the checksum. According to the checksum calculation method, the checksum is calculated and generated.

[0066] The fourth step is a frame formation step. According to the field sequence number and the multi-byte transmission order, each field is formed into a data frame. Table 4 is a schematic diagram of a data frame corresponding to floating-point special data according to an embodiment of the present invention.

[0067] Table 4 shows a schematic diagram of a data frame corresponding to floating-point special data according to an embodiment of the present invention.

[0068]

[0069]

[0070] Through the above steps, floating-point data interface test design data is obtained, and the test adequacy of the floating-point data interface is improved, thereby avoiding the software security problem caused by the influence of untested floating-point special data on the tested software in the prior art. A floating-point data interface test method is provided to solve the defect of insufficient software floating-point data interface test and improve the quality of software testing.

[0071] In this embodiment, a floating point data interface test device is also provided, which includes a receiving and analyzing module, a test data generating module, a checksum module, and a framing module. Figure 2 The figure is a schematic diagram of the structure of a floating point data interface test device.

[0072] The receiving and analyzing module is used to receive data frame description information, obtain field sequence number, field type, field length, field value range, field content, multi-byte transmission order, checksum calculation method.

[0073] The test data generation module is used to determine whether the field type is a floating-point field; if the field type is a floating-point field, generate floating-point field test data according to the field length and the field value range; if the field type is not a floating-point field, generate other field test data according to the field length and the field content.

[0074] The checksum calculation module is used to calculate and generate the checksum according to the checksum calculation method.

[0075] The frame assembly module is used to compose a data frame according to the field sequence number and the multi-byte transmission order.

[0076] Through the above modules, a floating-point data interface test device is obtained. Combined with the floating-point data interface test method provided by the present invention, the problem caused by insufficient floating-point data interface testing in the related art is solved, and the problem of low efficiency of manual design is solved, thereby improving the software testing quality and testing efficiency, and thus enhancing software security.

[0077] The floating-point data interface testing method and device provided by the present invention solve the problem caused by insufficient floating-point data interface testing in the related art, improve software testing quality and testing efficiency, and further enhance software security.

[0078] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A floating point data interface testing method, characterized in that: The method includes: S1. Steps for receiving data frame description Receive data frame description information, analyze and process it, and obtain the data frame format; the data frame description information includes field sequence number, field type, field length, field value range, field content, multi-byte transmission order, checksum calculation method; S2. Test data generation steps Determine whether the field type is a floating-point field; if the field type is a floating-point field, generate floating-point field test data according to the field length and the field value range; if the field type is not a floating-point field, generate other field test data according to the field length and the field content; S3. Calculate checksum steps According to the checksum calculation method, calculate and generate the checksum; S4, framing steps According to the field sequence number and the multi-byte transmission order, the fields are organized into a data frame.

2. The floating point data interface testing method as claimed in claim 1, wherein: The floating point field test data includes floating point special data and floating point common data.

3. The floating point data interface testing method as claimed in claim 2, wherein: The floating-point special data include: floating-point special value NaN, floating-point special value Inf, special data whose value is within the field value range and will produce NaN after high-low byte sequence conversion, and floating-point value 0.

4. The floating point data interface testing method as claimed in claim 3, wherein: The special data whose value is within the field value range and will generate NaN after high-low byte conversion includes: special data whose value is within the field value range and will generate qNaN after high-low byte conversion, and special data whose value is within the field value range and will generate sNaN after high-low byte conversion.

5. The floating point data interface testing method as claimed in claim 3, wherein: The floating point special value NaN includes: floating point special value qNaN and floating point special value sNaN.

6. The floating point data interface testing method as claimed in claim 3, wherein: The floating point special value Inf includes: a floating point special value +Inf and a floating point special value -Inf.

7. The floating point data interface testing method as claimed in claim 3, wherein: The floating point number 0 value includes: floating point number +0, floating point number -0.

8. The floating point data interface testing method as claimed in claim 2, wherein: The floating point normal data includes: abnormal data whose values ​​exceed the value range of the field, boundary data whose values ​​are at the upper point and the off point of the boundary of the field value range, and normal data whose values ​​are within the value range of the field.

9. A floating point data interface test device, characterized in that: The device comprises a receiving and analyzing module, a test data generating module, a checksum module, and a framing module; The receiving and analyzing module is used to receive data frame description information, obtain field sequence number, field type, field length, field value range, field content, multi-byte transmission order, checksum calculation method; The test data generation module is used to determine whether the field type is a floating-point field; if the field type is a floating-point field, generate floating-point field test data according to the field length and the field value range; if the field type is not a floating-point field, generate other field test data according to the field length and the field content; The checksum calculation module is used to calculate and generate the checksum according to the checksum calculation method; The frame assembly module is used to compose a data frame according to the field sequence number and the multi-byte transmission order.

10. The floating point data interface test device as claimed in claim 9, characterized in that: The floating-point field test data includes floating-point special data and floating-point common data; The floating-point special data include: floating-point special value NaN, floating-point special value Inf, special data whose value is within the field value range and will produce NaN after high-low byte sequence conversion, and floating-point value 0.

Citation Information

Patent Citations

  • Vector floating point test data class immediate instruction

    CN104956319A

  • Resynchronization of a superscalar processor

    US5649225A