A software compatibility automatic testing method and system

Through an automated test system, the instruction library and ARM processor are used to solve the compatibility testing complexity problem when X86 architecture software is migrated to ARM architecture, and fast and accurate software compatibility testing is achieved, improving testing efficiency and coverage.

CN113626339BActive Publication Date: 2025-01-14SHENZHEN POWER SUPPLY BUREAU
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110991959.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-27
Publication Date
2025-01-14
Estimated Expiration
2041-08-27

AI Technical Summary

Technical Problem

When the X86 architecture software is migrated to the ARM architecture, traditional compatibility testing requires a lot of manpower and time, and the results may not cover all situations, resulting in complex and incomplete software compatibility testing.

Method used

Design an automatic software compatibility test system, including input unit, test unit and output unit, through the instruction library and ARM processor, automatically test the compatibility problems of X86 architecture software on the ARM architecture, and use the orderly coded test instruction library to avoid Subjective errors in manual testing, integrating test features such as unsign char, value overflow, inline assembly instructions and XCHGL problems.

Benefits of technology

It realizes automated testing, improves the work efficiency of software compatibility testing, can quickly identify and locate multiple compatibility issues, reduces manual testing time, and generates detailed test reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626339B_ABST
    Figure CN113626339B_ABST
Patent Text Reader

Abstract

This invention relates to an automated software compatibility testing system and method, applied to the automated testing of software compatibility when migrating x86 architecture software to ARM architecture. It includes: an input unit for acquiring software usage information of the x86 architecture software; a testing unit for testing whether there are multiple preset software compatibility issues when migrating the x86 architecture software to ARM architecture based on the software usage information, and outputting the test results; and an output unit for generating a test report based on the test results and displaying it. This invention provides effective automated testing for existing compatibility issues when migrating x86 architecture software to ARM architecture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a method and system for automatically testing software compatibility. Background Art

[0002] The ARM architecture has the advantages of high performance-to-power ratio (Perf / W) and energy saving and greenness, which makes the ARM architecture not only suitable for smart devices and edge computing, but also can greatly save the energy consumption of data centers, thereby constructing full-stack and full-scenario green computing. The ARM architecture can achieve flexible customization of the kernel, and can optimize performance and enhance security for specific scenarios. The many-core architecture can support up to 64 cores, and has more advantages in parallel computing and big data computing. It uniquely supports national secret algorithms to achieve autonomous and controllable firmware security and data security protection.

[0003] In the process of migrating X86 architecture software to ARM architecture, programs developed in high-level languages ​​such as pure Java and Python, such as web containers such as Tomcat, can be easily migrated. However, programs based on C, C++, etc. and inline assembly languages ​​should be used. The migration is difficult. The software application compatibility testing after migration is also a very complicated process. Traditional compatibility testing is based on manual testing at the application software level, which requires a lot of manpower and time. Moreover, the final result of the compatibility test may not be able to cover all, resulting in the compatibility test passing, but some abnormal situations will occur in the application software under special conditions during subsequent use. Summary of the invention

[0004] The purpose of the present invention is to propose a software compatibility automatic testing method and system, and to provide effective automated testing for the compatibility issues of existing x86 architecture software migrated to ARM architecture.

[0005] To achieve the above object, an embodiment of the present invention provides a software compatibility automatic testing system, which is applied to the software compatibility automatic testing when the X86 architecture software is migrated to the ARM architecture, and includes:

[0006] An input unit, used to obtain software usage information of X86 architecture software;

[0007] A testing unit, used for testing whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture according to the software usage information, and outputting the test result;

[0008] The output unit is used to generate a test report according to the test result and output it for display.

[0009] Optionally, the testing unit comprises:

[0010] An instruction library, used to store a plurality of test instructions for testing whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture, wherein the plurality of test instructions are provided with sequential codes;

[0011] The ARM processor is used to run the X86 architecture software, and according to the order encoding of the multiple test instructions, retrieve the test instructions from the instruction library in order, control the X86 architecture software to execute the retrieved test instructions, and mark the instruction execution result with the corresponding order number and save it as one of the test results.

[0012] Optionally, the input unit is further used to receive a retest instruction input by a user, wherein the retest instruction is one or more sequence numbers;

[0013] The ARM processor is also used to rerun the X86 architecture software according to the retest instruction, and to retrieve test instructions from the instruction library in order according to one or more sequence numbers of the retest instruction, control the X86 architecture software to execute the retrieved test instructions, and replace the test result corresponding to the original sequence number after marking the instruction execution result.

[0014] Optionally, the software compatibility problem includes at least one of an unsigned char problem, a value overflow problem, a problem of inline embedded assembly instructions in C language code, and an XCHGL problem.

[0015] Another embodiment of the present invention provides a software compatibility automatic testing method, which is applied to the software compatibility automatic testing when the X86 architecture software is migrated to the ARM architecture, comprising:

[0016] Step S10: the input unit obtains software usage information of the X86 architecture software;

[0017] Step S20: The testing unit tests whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture according to the software usage information, and outputs the test result;

[0018] Step S30: the output unit generates a test report according to the test result, and outputs it for display.

[0019] Optionally, the step S20 includes:

[0020] The instruction library stores a plurality of test instructions for testing whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture, and the plurality of test instructions are provided with sequential codes;

[0021] The ARM processor runs the X86 architecture software, and according to the order encoding of the multiple test instructions, calls the test instructions from the instruction library in order, controls the X86 architecture software to execute the called test instructions, and marks the instruction execution result with the corresponding order number and saves it as one of the test results.

[0022] Optionally, the input unit receives a retest instruction input by a user, wherein the retest instruction is one or more sequence numbers;

[0023] The ARM processor reruns the X86 architecture software according to the retest instruction, and calls out test instructions from the instruction library in order according to one or more sequence numbers of the retest instruction, controls the X86 architecture software to execute the called test instructions, and replaces the test result corresponding to the original sequence number after marking the instruction execution result.

[0024] Optionally, the software compatibility problem includes at least one of an unsigned char problem, a value overflow problem, a problem of inline embedded assembly instructions in C language code, and an XCHGL problem.

[0025] The embodiments of the present invention have at least the following beneficial effects:

[0026] The embodiment of the present invention integrates the testing functions of various problems that are most likely to cause software compatibility during the migration of X86 architecture software to the ARM framework into a testing unit. Through this testing unit, various problems can be automatically tested, avoiding manual testing that requires a lot of manpower and time, and improving the work efficiency of software compatibility testing.

[0027] Other features and advantages of the embodiments of the present invention will be described in the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative work.

[0029] Figure 1 This is a framework diagram of a software compatibility automatic testing system described in an embodiment of the present invention.

[0030] Figure 2 This is a flow chart of a method for automatically testing software compatibility according to another embodiment of the present invention. DETAILED DESCRIPTION

[0031] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In addition, in order to better illustrate the present invention, numerous specific details are given in the specific embodiments below. It should be understood by those skilled in the art that the present invention can also be implemented without certain specific details. In some examples, means well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.

[0032] See also Figure 1 An embodiment of the present invention provides a software compatibility automatic testing system, which is applied to the software compatibility automatic testing when the X86 architecture software is migrated to the ARM architecture, and includes:

[0033] An input unit, used to obtain software usage information of X86 architecture software;

[0034] A testing unit, used for testing whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture according to the software usage information, and outputting the test result;

[0035] The output unit is used to generate a test report according to the test result and output it for display.

[0036] Optionally, the testing unit comprises:

[0037] An instruction library, used to store a plurality of test instructions for testing whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture, wherein the plurality of test instructions are provided with sequential codes;

[0038] Specifically, the order code is, for example, 1, 2, 3, 4, ..., n;

[0039] The ARM processor is used to run the X86 architecture software, and according to the sequence encoding of the plurality of test instructions, retrieve the test instructions from the instruction library in sequence, control the X86 architecture software to execute the retrieved test instructions, and mark the instruction execution result with the corresponding sequence number and save it as one of the test results;

[0040] Specifically, in the prior art, during manual testing, testers will manually input test instructions to test whether the software can execute the test instructions normally. However, manual testing may miss certain tests, or the test instructions may be input incorrectly, which may easily lead to test failure due to subjective factors of the tester. Therefore, in an embodiment of the present invention, in order to avoid this situation, all test instructions are pre-stored in an instruction library and sequence-encoded. During testing, the ARM processor reads the test instructions from the instruction library in the order of the sequence coding, and then performs the test. This can avoid the above-mentioned problem of test failure due to subjective factors of the tester.

[0041] Optionally, the input unit is further used to receive a retest instruction input by a user, wherein the retest instruction is one or more sequence numbers;

[0042] The ARM processor is also used to rerun the X86 architecture software according to the retest instruction, and to retrieve test instructions from the instruction library in order according to one or more sequence numbers of the retest instruction, control the X86 architecture software to execute the retrieved test instructions, and replace the test result corresponding to the original sequence number after marking the instruction execution result.

[0043] Specifically, in this embodiment, it is also provided to retest certain instructions according to the retest instructions input by the tester / user, and replace the original test results after the retest.

[0044] Optionally, the software compatibility problem includes at least one of an unsigned char problem, a value overflow problem, a problem of inline embedded assembly instructions in C language code, and an XCHGL problem.

[0045] Among them, the unsigned char problem is specifically:

[0046] The concept of two's complement. For example, the original binary code of 1 is 10000001, and its two's complement is the inversion of the sign and the addition of 1, and the final two's complement is 11111111. In the X86 architecture, char is signed by default, so when printing, it prints -1 normally; but in ARM, char is unsigned by default, and the binary 11111111 is exactly the unsigned 255. So you need to pay attention to adding the -fsigned-char compilation option when compiling for ARM to avoid this problem as follows: aarch64-redhat-linux-gcc-fsigned-char-o transfer*.c.

[0047] Among them, the problem of value overflow is specifically:

[0048] The floating point to integer conversion instruction in the X86 CPU defines an indefinite integer value (0x80000000000000000) to handle overflow problems, but it is impossible to determine overflow or underflow from the indefinite integer value. The ARM processing strategy is to retain the maximum or minimum value that the integer can represent regardless of overflow or underflow. An example comparison is shown in Table 1 below:

[0049] Table 1

[0050]

[0051] Among them, the problems of inline embedded assembly instructions in C language code are specifically:

[0052] Since the X86 architecture belongs to CISC (Complex Instruction Set) and ARM belongs to RISC (Reduced Instruction Set), their assembly instructions are completely different, and some commonly used X86 instructions have no corresponding instructions in the ARM system. In particular, some X86 system programs that require extremely high efficiency often use multi-data stream related instructions such as SSE, SSE2, etc.

[0053] Among them, the XCHGL problem is specifically:

[0054] xchgl is an assembly instruction on x86, which is used to exchange the values ​​of memory variables. We know that the exchange operation requires an intermediate transition and requires the execution of three instructions, namely A->TMP, B->A, TMP->B. This is a common X86 assembly instruction, which is completed with a single instruction and is an atomic operation. If you need to atomically exchange variable values ​​on Kunpeng, you need to use the atomic operation interface __atomic_exchange_n of glibc, and there is still the efficiency problem mentioned above.

[0055] The above four problems are the most likely to cause software compatibility problems during the migration of X86 framework software to ARM framework. If the current method of manually clicking on function points on the software page is used to test compatibility, a complex software test may take half a day or even more time to complete a compatibility test report, but this result may not fully cover all possible situations. The embodiment of the present invention integrates the above-mentioned problems into a test unit. The tester only needs to provide software-related usage information. Using this test unit, it can achieve rapid testing, report generation and problem location.

[0056] See also Figure 2 Another embodiment of the present invention provides a software compatibility automatic testing method, which is applied to the software compatibility automatic testing when the X86 architecture software is migrated to the ARM architecture, comprising:

[0057] Step S10: the input unit obtains software usage information of the X86 architecture software;

[0058] Step S20: The testing unit tests whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture according to the software usage information, and outputs the test result;

[0059] Step S30: the output unit generates a test report according to the test result, and outputs it for display.

[0060] Optionally, the step S20 includes:

[0061] The instruction library stores a plurality of test instructions for testing whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture, and the plurality of test instructions are provided with sequential codes;

[0062] The ARM processor runs the X86 architecture software, and according to the order encoding of the multiple test instructions, calls the test instructions from the instruction library in order, controls the X86 architecture software to execute the called test instructions, and marks the instruction execution result with the corresponding order number and saves it as one of the test results.

[0063] Optionally, the input unit receives a retest instruction input by a user, wherein the retest instruction is one or more sequence numbers;

[0064] The ARM processor reruns the X86 architecture software according to the retest instruction, and calls out test instructions from the instruction library in order according to one or more sequence numbers of the retest instruction, controls the X86 architecture software to execute the called test instructions, and replaces the test result corresponding to the original sequence number after marking the instruction execution result.

[0065] Optionally, the software compatibility problem includes at least one of an unsigned char problem, a value overflow problem, a problem of inline embedded assembly instructions in C language code, and an XCHGL problem.

[0066] The method of this embodiment corresponds to the system of the above embodiment. Therefore, the contents not described in detail in the method of this embodiment can be obtained by referring to the contents of the above embodiment system and will not be repeated here.

[0067] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A software compatibility automatic testing system, applied to the automatic testing of software compatibility when migrating X86 architecture software to ARM architecture, characterized in that: include: An input unit, used to obtain software usage information of X86 architecture software; A testing unit, used for testing whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture according to the software usage information, and outputting the test result; The software compatibility problem includes at least one of an unsigned char problem, a value overflow problem, a problem of inline embedded assembly instructions in C language code, and an XCHGL problem; An output unit, used to generate a test report according to the test results, and output it for display; The testing unit comprises: An instruction library, used to store a plurality of test instructions for testing whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture, wherein the plurality of test instructions are provided with sequential codes; The ARM processor is used to run the X86 architecture software, and according to the sequence encoding of the plurality of test instructions, retrieve the test instructions from the instruction library in sequence, control the X86 architecture software to execute the retrieved test instructions, and mark the instruction execution result with the corresponding sequence number and save it as one of the test results; The input unit is also used to receive a retest instruction input by a user, wherein the retest instruction is one or more sequence numbers; The ARM processor is also used to rerun the X86 architecture software according to the retest instruction, and to retrieve test instructions from the instruction library in order according to one or more sequence numbers of the retest instruction, control the X86 architecture software to execute the retrieved test instructions, and replace the test result corresponding to the original sequence number after marking the instruction execution result.

2. A software compatibility automatic testing method, applied to the software compatibility automatic testing when the X86 architecture software is migrated to the ARM architecture, characterized in that: include: Step S10: the input unit obtains software usage information of the X86 architecture software; Step S20: The testing unit tests whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture according to the software usage information, and outputs the test result; The software compatibility problem includes at least one of an unsigned char problem, a value overflow problem, a problem of inline embedded assembly instructions in C language code, and an XCHGL problem; Step S30: the output unit generates a test report according to the test result, and outputs it for display; The step S20 comprises: The instruction library stores a plurality of test instructions for testing whether there are multiple preset software compatibility issues when the X86 architecture software is migrated to the ARM architecture, and the plurality of test instructions are provided with sequential codes; The ARM processor runs the X86 architecture software, and according to the sequence encoding of the plurality of test instructions, retrieves the test instructions from the instruction library in sequence, controls the X86 architecture software to execute the retrieved test instructions, and marks the instruction execution result with the corresponding sequence number and saves it as one of the test results; The input unit receives a retest instruction input by a user, wherein the retest instruction is one or more sequence numbers; The ARM processor reruns the X86 architecture software according to the retest instruction, and calls out test instructions from the instruction library in order according to one or more sequence numbers of the retest instruction, controls the X86 architecture software to execute the called test instructions, and replaces the test result corresponding to the original sequence number after marking the instruction execution result.

Citation Information

Patent Citations

  • Device and method for testing software compatibility of mobile terminal

    CN105677571A