Extensible multi-verification method and system suitable for compiler development

By introducing extensible multi-verification methods and systems in compiler development, and using four verification modes to verify the multi-faceted information of the compiler, the problem of diversified testing needs in the existing technology is solved, and efficient and accurate testing coverage is achieved.

CN120144441APending Publication Date: 2025-06-13SHANGHAI BAOSIGHT SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510172359.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The existing technology is difficult to meet the diverse testing needs in compiler development, and the basic testing framework cannot effectively verify the compiler's variable values, the correctness of intermediate codes and other information.

Method used

Provide a scalable multi-verification method and system suitable for compiler development. It verifies the correctness of the compiler's variable values, error information, intermediate code and monitoring mode through four verification modes (numerical verification, information verification, text verification and simulation verification), and generates a test report.

Benefits of technology

It improves the coverage and accuracy of tests, can automatically execute test files and generate test reports, greatly improving the efficiency and accuracy of tests, and the framework is easy to expand to meet the different needs of subsequent development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144441A_ABST
    Figure CN120144441A_ABST
Patent Text Reader

Abstract

The invention provides an extensible multi-verification method and system suitable for compiler development, and aims at solving the problems that an existing test framework is single in verification and poor in expansibility. According to the framework, multiple verification modes including numerical value verification, information verification, text verification and simulation verification are configured through script files, and the correctness of information such as variable numerical values, error information, intermediate codes and monitoring modes of the compiler can be comprehensively verified. The framework has the capability of automatically executing the test file and generating the test report, so that the test efficiency and accuracy are greatly improved. Meanwhile, the framework is easy to expand, new test interfaces and methods can be added according to development requirements, and the test coverage rate is increased. According to the method, the stability and the accuracy of functions of the compiler are effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computers, and in particular, to an extensible multi-verification method and system applicable to compiler development. Background Art

[0002] Compiler errors are mainly divided into two categories: one is that compilation fails due to error faults such as crashes during compilation, and the other is that the conversion of a high-level programming language program into incorrect executable instructions is caused by errors in the compiler logic model design. For such errors, an effective method is to design test cases to verify whether the compilation result is consistent with the expected result.

[0003] In the development scenario, as the development process progresses and functions are extended, the test requirements gradually increase. It is necessary to verify various aspects such as the numerical values of variables after compilation and the correctness of intermediate code. The basic test framework can no longer meet the test requirements.

[0004] A system and method for automatic testing of a compiler in a logic configuration software are disclosed in the patent document with the publication number CN104516818A. The test system includes a test driver tool and a test tool. The test driver tool is used to call the test tool, complete the test of test cases, and generate a test report. The test cases include the project to be tested and a test script file for describing the test process. The test tool includes a script engine, a test fixture, an online debugging module, etc.; the test driver tool includes a configuration file parsing module, a statistics module, a test case execution module, a report generation module, an email sending module, etc. The test cases designed based on this automatic test system can not only verify the correctness of the compiler in the logic configuration software, but also verify the correctness of some other non-GUI type modules and controller software in the logic configuration software. Both this patent and the present invention have innovated in the automatic test process. The basic process is that testers design and write test cases and test file scripts according to test requirements, including the expected results of the test objects in the scripts. The compiler automatically executes the test framework to generate test results. The present invention has invented four verification modes for test requirements and has good scalability, and can verify the relevant information of compiler numerical values, output information, intermediate code, and monitoring mode variables, greatly improving the test coverage and accuracy. This patent focuses on the design and innovation of the test process.

[0005] Therefore, a new technical solution needs to be proposed to improve the above technical problems. Summary of the Invention

[0006] Aiming at the defects in the prior art, the purpose of the present invention is to provide an extensible multi-verification method and system applicable to compiler development.

[0007] An extensible multi-verification method applicable to compiler development provided by the present invention, the method comprising the following steps:

[0008] Step S1: Prepare test cases according to test requirements;

[0009] Step S2: Collect all script files in the test path and register test cases;

[0010] Step S3: Load compiler data, obtain script files in the test path, and load verification parameters;

[0011] Step S4: Perform verifications in multiple modes according to the verification mode fields in the script files;

[0012] Step S5: Run the compiler compilation process and perform corresponding test verifications according to the compilation results;

[0013] Step S6: Output a test report.

[0014] Preferably, the verification modes in step S3 include: numerical verification, information verification, text verification, and simulation verification;

[0015] Numerical verification: Compare the variable values in the "VALUE" field of the script file with the values of variables with the same name in the memory area to verify the correctness of the compiler operation logic;

[0016] Information verification: The script file contains a "MESSAGE" field. This verification mode is applied to negative test cases to verify whether the compiler error message meets the expectations;

[0017] Text verification: The script file contains a "TEXT" field. This verification mode is for the case where the host computer only implements function declarations. When the compiler compiles the host computer, no actual values are generated, and the numerical mode cannot verify the correctness of the compiler logic design. Instead, verify the correctness of the host computer compilation logic by verifying the generated intermediate code;

[0018] Simulation verification: The script file contains a "SIMULATION" field. This verification mode is for verifying the compiler monitoring function, and specifically verifies whether the variable values monitored during program operation are correct.

[0019] Preferably, the information verification includes: verifying whether the compiler error message meets the expectations in the "MESSAGE" field of the script file, including positive tests and negative tests. In positive tests, verify that the output message does not contain error messages in the "[EXCLUDE]" field. In negative tests, compare the error messages in the "[INCLUDE]" field with the information in the compiler information output cache.

[0020] Preferably, the text verification includes: storing the intermediate code generated during the operation of the compiler in a newly generated temp.ll file, and using a pattern matching text verification tool to compare the code in this file with the expected code under the "TEXT" field in the script file to verify the correctness of the compilation logic of the host computer.

[0021] Preferably, the simulation verification includes: obtaining the corresponding variable information from the monitoring module of the compiler, storing it in a newly allocated memory space, after reading the variable address information in the monitoring mode from the generated monitoring file, mapping this address to the newly allocated memory space, and then obtaining the variable value stored under this memory address and the relevant position and type information, and using a pattern matching text verification tool to compare this information with the expected result in the script file to verify the correctness of the compiler monitoring function.

[0022] Preferably, the process of running the compiler compilation in step S5 includes the following steps:

[0023] Step S5.1: If the compilation process is correct, load some function definitions;

[0024] Step S5.2: If an error occurs during the compilation process, perform a text mode check for negative testing, and subsequently verify whether the error handling method of the model design has been executed.

[0025] Preferably, the test report in step S6 includes the case details of test failures and the summary of successful cases.

[0026] Preferably, when an error occurs during the compilation process of the method, a text mode check for negative testing is performed, and it is verified whether the error handling method of the model design has been executed;

[0027] After successful compilation, load some function definitions, simulate their definitions, and load them into the executor in the test framework.

[0028] Preferably, the method sets a "MESSAGE" field in the script file, and uses a pattern matching text verification tool to compare the error messages in the compiler information output cache with the expected error messages in the script file.

[0029] The present invention also provides an extensible multi-verification system applicable to compiler development, and the system includes the following modules:

[0030] Module M1: Prepare test cases according to test requirements;

[0031] Module M2: Collect all script files in the test path and register test cases;

[0032] Module M3: Load compiler data, obtain script files under the test path, and load verification parameters;

[0033] Module M4: Execute verifications in multiple modes according to the verification mode fields in the script files;

[0034] Module M5: Run the compiler compilation process and perform corresponding test verifications according to the compilation results;

[0035] Module M6: Output test reports.

[0036] Compared with the prior art, the present invention has the following beneficial effects:

[0037] 1. The present invention simulates the compilation processes of the compiler host computer and the lower computer, verifies the correctness of the generated products, can automatically execute test files and generate test reports, greatly improving the efficiency and accuracy of testing;

[0038] 2. The present invention provides an extensible multi-verification method test framework applicable to compiler development, which can verify the correctness of information such as variable values, error messages, intermediate codes, and monitoring modes of the compiler in multiple modes. At the same time, the framework of the present invention is easy to expand and can meet different requirements for subsequent development;

[0039] 3. The present invention has invented four verification modes for testing requirements, and has good scalability. It can verify relevant information such as compiler values, output information, intermediate codes, and monitoring mode variables, greatly improving the test coverage and accuracy;

[0040] 4. The present invention conducts multi-mode integration testing on compiler products; it can skip tests that take too long or encounter errors to ensure the normal operation of other tests, thereby controlling the smooth completion of the test process. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] By reading the following detailed description of the non-limiting embodiments with reference to the accompanying drawings, other features, objects, and advantages of the present invention will become more apparent:

[0042] Figure 1 It is a schematic diagram of the implementation process of the extensible multi-verification method test framework of the present invention;

[0043] Figure 2 It is a schematic diagram of the classification of multi-verification methods of the test framework of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] The present invention will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, without departing from the concept of the present invention, several changes and improvements can still be made. These all belong to the protection scope of the present invention.

[0045] Example 1:

[0046] Refer to Figure 1 , according to an extensible multi-verification method applicable to compiler development provided by the present invention, the method includes the following steps:

[0047] Step S1: Prepare test cases according to test requirements;

[0048] Step S2: Collect all script files under the test path and register the test cases;

[0049] Step S3: Load compiler data, obtain the script files under the test path, and load verification parameters;

[0050] Refer to Figure 2 , the verification modes include: numerical verification, information verification, text verification, and simulation verification;

[0051] Numerical verification: Compare the variable values in the "VALUE" field of the script file with the values of variables with the same name in the memory area to verify the correctness of the compiler running logic;

[0052] Information verification: The script file contains the "MESSAGE" field. This verification mode is applied to negative test cases to verify whether the compiler error messages meet the expectations;

[0053] Text verification: The script file contains the "TEXT" field. This verification mode is for the case where the host computer only implements function declarations. When the host computer of the compiler compiles, no actual values are generated, and the numerical mode cannot verify the correctness of the compiler logic design. Instead, the method of verifying the generated intermediate code is adopted to verify the correctness of the host computer compilation logic;

[0054] Step S4: Execute verifications of multiple modes according to the verification mode fields in the script files;

[0055] Step S5: Run the compiler compilation process and perform corresponding test verifications according to the compilation results;

[0056] The process of running the compiler compilation includes the following steps:

[0057] Step S5.1: If the compilation process is correct, load some function definitions;

[0058] Step S5.2: If an error occurs during the compilation process, perform a text-based verification for negative testing, and subsequently verify whether the error handling method of the model design has been executed.

[0059] Step S6: Output a test report, which includes the case details of test failures and an overview of successful cases.

[0060] When an error occurs during the compilation process, the method performs a text-based verification for negative testing and verifies whether the error handling method of the model design has been executed; after successful compilation, it loads partial function definitions, simulates their definitions, and loads them into the executor in the test framework.

[0061] The method sets a "MESSAGE" field in the script file and uses a pattern matching text verification tool to compare the error messages in the compiler information output cache with the expected error messages in the script file.

[0062] The present invention also provides an extensible multi-verification system applicable to compiler development. The extensible multi-verification system applicable to compiler development can be implemented by executing the process steps of the extensible multi-verification method applicable to compiler development. That is, those skilled in the art can understand the extensible multi-verification method applicable to compiler development as the preferred implementation manner of the extensible multi-verification system applicable to compiler development.

[0063] Example 2:

[0064] The present invention also provides an extensible multi-verification system applicable to compiler development. The system includes the following modules:

[0065] Module M1: Prepare test cases according to test requirements;

[0066] Module M2: Collect all script files in the test path and register test cases;

[0067] Module M3: Load compiler data, obtain the script files in the test path, and load verification parameters;

[0068] Module M4: Perform verifications in multiple modes according to the verification mode fields in the script files;

[0069] Module M5: Run the compiler compilation process and perform corresponding test verifications according to the compilation results;

[0070] Module M6: Output a test report.

[0071] Example 3:

[0072] In order to meet the test requirements of multi - target verification and overcome the defect that the existing test framework is limited to a single test target, the present invention provides a test framework for multi - verification methods with good scalability. By simulating the compilation processes of the host computer and the slave computer of the compiler, verifying the correctness of the generated products, it can automatically execute test files and generate test reports, greatly improving the test efficiency and accuracy. The method includes the following steps:

[0073] Step S1: According to the test requirements, each test case includes files such as itf, st, etc., and a script file containing verification modes and expected results;

[0074] Step S2: Collect all the script files under the test path and register the test cases;

[0075] Step S3: The main part of the test framework: After passing in the relevant data in the backpack of the compiler, perform the following operations:

[0076] Step S3.1: Obtain the relevant files under the file path, such as st, itf, ld, etc. files;

[0077] Step S3.2: Load the verification parameters, read the fields in the script file, and perform verifications in different modes.

[0078] According to the user's needs, for different attributes of the object to be tested, an appropriate verification mode can be selected. By adding fields corresponding to various verification modes in the script file, combined tests of single or multiple verification modes can be carried out. Specifically, this test framework is divided into the following verification modes:

[0079] Step S3.2.1: Numerical verification:

[0080] Read the attributes of the variable corresponding to the "VALUE" field in the script file: such as name, type, value, etc.;

[0081] Read the variable attributes corresponding to the same variable name in the system memory area;

[0082] Compare the corresponding variable attributes in the second step with those in the first step one by one;

[0083] If all the comparison results are equal, it proves that the compiler running logic is correct; otherwise, it proves that there is an error in the processing logic of the corresponding module of the compiler.

[0084] Step S3.2.2: Information verification: The script file contains the "MESSAGE" field. This verification mode can be applied to positive or negative tests to verify whether the compiler error message meets the expectations.

[0085] The specific implementation is as follows:

[0086] For positive tests:

[0087] Write a script file, and in the "MESSAGE" field, set the information that should not be included to "[EXCLUDE]". For example, set the information of the "[EXCLUDE]" attribute to: "Compilation failed";

[0088] Read the information under the "MESSAGE" field in the script file;

[0089] Compare the information in the first step with the information in the compiler information output buffer;

[0090] If the compiler information output does not contain the information in the first step, the verification is successful, indicating that the compiler compilation is successful; otherwise, the test reports an error "compilation failed", which is inconsistent with expectations and the test fails;

[0091] For negative tests:

[0092] Write a script file. The information of the "[INCLUDE]" attribute under the "MESSAGE" field is the expected compiler error message.

[0093] Read the information under the "MESSAGE" field in the script file;

[0094] Compare the information in the first step with the information in the compiler information output buffer;

[0095] If the compiler information output contains the information in the first step, the verification is successful, indicating that the compiler compilation error does contain the expected error information; otherwise, it means that the test error information does not meet expectations and the test fails;

[0096] Step S3.2.3: Text verification: The script file contains the "TEXT" field. This verification mode is for the case where the host computer only implements function declarations. In this case, the compiler host computer compilation will not generate actual values, and the numerical mode cannot verify the correctness of the compiler logic design. Therefore, the verification of the generated intermediate code is adopted to verify the correctness of the host computer compilation logic.

[0097] The specific implementation is:

[0098] Store the intermediate code generated during compiler operation in the newly generated temp.ll file.

[0099] Write a script file and use the pattern matching text verification tool to write the key intermediate code statements that need to be verified under the "TEXT" field in the script file.

[0100] Compare the intermediate code in the temp.ll file in the first step with the expected code under the "TEXT" field in the script test verification document. If they are consistent, the correctness of the upper computer compilation logic is verified; otherwise, it indicates that the intermediate code of the corresponding functional module in this test case is incorrect and the test fails.

[0101] Step S3.2.4: Simulation verification: The script file contains a "SIMULATION" field. This verification mode is mainly for verifying the compiler monitoring function, specifically verifying whether the variable values monitored during program operation are correct.

[0102] The specific implementation is as follows:

[0103] Write a script file. Under the "SIMULATION" field, write the relevant information of the variables to be monitored, such as name, type, row and column information, value, etc. (which can be modified and extended according to test requirements).

[0104] Obtain the information of the corresponding variables to be monitored from the monitoring module of the compiler and store it in a newly allocated memory space.

[0105] After reading the variable address information in the monitoring mode from the generated monitoring file, map this address to the newly allocated memory space, and then obtain the variable value, type, and row and column information stored at this memory address.

[0106] Use a pattern matching text verification tool to compare the information in the third step with the expected results in the script test file in the first step. If they are consistent, the correctness of the compiler monitoring function is verified; otherwise, it indicates that there is a fault in the monitoring function and the test fails.

[0107] Step S3.3: Run the compiler compilation process;

[0108] Step S3.3.1: If the compilation process is correct, load some function definitions: Since some functions are implemented by the lower computer, this test framework simulates their definitions and loads them into the executor in the test framework in subsequent steps to ensure that the compiled compilation product has the expected correct algorithm logic and verify the correctness of the compilation process;

[0109] Step S3.3.2: If an error occurs during the compilation process, perform a text-based verification for negative testing, and then verify whether the error handling method designed in the model is executed;

[0110] Step S3.4: Load all compiler modules; and compile the intermediate code into machine code;

[0111] Step S3.5: Execute the verification of all test cases;

[0112] Step S3.6: Output a test report for acceptance by testers.

[0113] Testers only need to write test cases once as needed. Subsequently, the compiler can automatically perform automatic regression testing on all test cases and display the test results. This greatly ensures the stability and accuracy of the compiler's functions during the development process.

[0114] Meanwhile, this test framework also has good scalability. According to the requirements of the development progress, other test interfaces and methods can be added to improve the coverage rate of the test object.

[0115] For example: To verify the accuracy of the compiler error message, the specific content and location information of the error message can be further verified. For this verification requirement, an information text verification mode can be added to the test framework, and the "MESSAGE" field can be set in the script file.

[0116] The specific implementation is as follows: For negative testing, use a pattern matching text verification tool to compare the error message in the compiler information output cache with the expected error message that is regularly matched under the "MESSAGE" field in the script test verification document. If they are consistent, the accuracy of the host computer compilation error message is verified.

[0117] The present invention provides an extensible multi-verification method test framework applicable to compiler development, which can verify the correctness of information such as variable values, error messages, intermediate codes, and monitoring modes of the compiler in multiple modes. At the same time, the framework of the present invention is easy to expand and can meet different requirements for subsequent development.

[0118] Figure 1 For the specific implementation flowchart of the present invention, the verification modes currently included in this test framework are as Figure 2 shown. The specific implementation approach of the present invention is as follows:

[0119] Step 1: According to the test requirements, write a script test file, which can include any one or more fields such as "VALUE", "MESSAGE", "TEXT", "SIMULATION", etc., and the relevant attributes of the corresponding verification mode according to the test needs.

[0120] Step 2: The test framework reads the files with corresponding suffixes in the test case directory, such as files with the suffixes ".st", ".itf", etc.;

[0121] Step 3: Read the script file in the test case directory, obtain the special fields in the file, and load the verification parameters. Such as fields like "VALUE", "MESSAGE", "TEXT", "SIMULATION", etc., and store the information in the above special fields in the form of strings. Taking the numerical mode as an example: Store the variable name, type, and value, etc. under the "VALUE" field in the form of strings;

[0122] Step 4: Perform compiler compilation;

[0123] Step 4.1: If the compilation fails, perform information mode testing: Obtain the compiler error message cache, compare the string corresponding to "[INCLUDE]" under the "TEXT" field with the string in the compiler information cache. If no identical information is found, the test fails; for the "[EXCLUDE]" attribute information, it is necessary to verify that there are no relevant characters in the compiler information cache to further prove the correctness of the positive test;

[0124] Step 4.2: If the compilation is correct, continue with the following steps;

[0125] Step 5: Load partial function definitions; such as library functions, etc.;

[0126] Step 6: Compile the intermediate code into machine code;

[0127] Step 7: Perform test case verification;

[0128] Step 7.1: Numeric mode: Compare the string obtained in Step 3 with the numeric value of the same variable name in the compilation product;

[0129] Step 7.2: Information verification: Perform the same operation as in Step 4.1;

[0130] Step 7.3: Text verification: Store the intermediate code generated by compilation in the temporary file temp.ll, store the verification rules under the "TEXT" field in the rule file rule.check, and use a pattern matching text verification tool to compare the contents of the above two files. If they are consistent, the correctness of the host computer compilation logic is verified;

[0131] Step 7.4: Simulation verification: Store the verification rules under the "SIMULATION" field in the rule file rule.check, obtain the corresponding variable information from the monitoring module of the compiler, store it in a newly allocated memory space, after reading the variable address information in the monitoring mode from the generated monitoring file, map this address to the newly allocated memory space, and then obtain the variable value and related position and type information stored at this memory address. Store this information in the temporary file temp. Similarly, use text pattern matching for verification and compare the consistency of the contents of the above two files to further verify the correctness of the compiler monitoring function;

[0132] Step 8: Output a test report, including the details of the test failure cases and a summary of the correct cases.

[0133] An example of using this test framework is as follows. There is an existing test case for the st language:

[0134]

[0135]

[0136] When running this test framework, since there are errors in the script file, the verification fails. Testers can make further modifications and verifications to the test based on the test report.

[0137] Those skilled in the art can understand this embodiment as a more specific description of Embodiment 1 and Embodiment 2.

[0138] Those skilled in the art know that in addition to implementing the system and its various devices, modules, and units provided by the present invention in the form of pure computer-readable program code, the method steps can be logically programmed to enable the system and its various devices, modules, and units provided by the present invention to be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers, etc., to achieve the same functions. Therefore, the system and its various devices, modules, and units provided by the present invention can be regarded as a kind of hardware component, and the devices, modules, and units included therein for implementing various functions can also be regarded as the structures within the hardware component; the devices, modules, and units for implementing various functions can also be regarded as either software modules for implementing the method or the structures within the hardware component.

[0139] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. Without conflict, the embodiments of the present application and the features in the embodiments can be combined arbitrarily with each other.

Claims

1. A scalable multi-verification method suitable for compiler development, characterized in that: The method comprises the following steps: Step S1: Prepare test cases according to test requirements; Step S2: Collect all script files under the test path and register test cases; Step S3: Load compiler data, obtain the script file under the test path, and load verification parameters; Step S4: Execute multiple modes of verification according to the verification mode field in the script file; Step S5: Run the compiler compilation process and perform corresponding test verification according to the compilation result; Step S6: Output the test report.

2. The scalable multi-verification method suitable for compiler development according to claim 1, characterized in that: The verification modes in step S3 include: numerical verification, information verification, text verification and simulation verification; Value verification: compare the variable value in the "VALUE" field in the script file with the variable value of the same name in the memory area to verify the correctness of the compiler's running logic; Message verification: The script file contains the "MESSAGE" field. This verification mode is applied to negative test situations to verify whether the compiler error message meets expectations; Text verification: The script file contains the "TEXT" field. This verification mode is for the case where the host computer only implements function declarations. The compiler host computer compilation does not generate actual values. The numerical mode cannot verify the correctness of the compiler logic design. The verification method of generating intermediate codes is adopted to verify the correctness of the host computer compilation logic. Simulation verification: The script file contains a "SIMULATION" field. This verification mode verifies the compiler monitoring function and specifically verifies whether the variable values ​​monitored during program execution are correct.

3. The scalable multi-verification method suitable for compiler development according to claim 2, characterized in that: The information verification includes: verifying whether the compiler error information meets the expectations of the "MESSAGE" field in the script file, including positive testing and negative testing. The positive test verifies that the output information does not contain the error information of the "[EXCLUDE]" field, and the negative test compares the error information of the "[INCLUDE]" field with the information in the compiler information output cache.

4. The scalable multi-verification method suitable for compiler development according to claim 2, characterized in that: The text verification includes: storing the intermediate code generated during the operation of the compiler in a newly generated temp.ll file, using a pattern matching text verification tool to compare the code in the file with the expected code under the "TEXT" field in the script file to verify the correctness of the upper computer compilation logic.

5. The scalable multi-verification method suitable for compiler development according to claim 2, characterized in that: The simulation verification includes: obtaining corresponding variable information from the monitoring module of the compiler, storing it in the newly opened memory space, reading the variable address information under the monitoring mode in the generated monitoring file, mapping the address to the newly opened memory space, and then obtaining the variable value stored under this memory address and related position and type information, using a pattern matching text verification tool to compare the information with the expected results in the script file to verify the correctness of the compiler monitoring function.

6. The scalable multi-verification method suitable for compiler development according to claim 1, characterized in that: The compiler compilation process in step S5 includes the following steps: Step S5.1: If the compilation process is correct, then load some function definitions; Step S5.2: If an error occurs during the compilation process, a negative test text verification is performed, and then it is verified whether the error handling method designed by the model is executed.

7. The scalable multi-verification method suitable for compiler development according to claim 1, characterized in that: The test report in step S6 includes details of test failure cases and a summary of successful cases.

8. The scalable multi-verification method suitable for compiler development according to claim 1, characterized in that: When an error occurs during the compilation process, the method performs a text check in a negative test and verifies whether the error handling method designed by the model is executed; After successful compilation, load some function definitions, simulate their definitions, and load them into the executor in the test framework.

9. The scalable multi-verification method suitable for compiler development according to claim 1, characterized in that: The method sets a "MESSAGE" field in the script file and uses a pattern matching text verification tool to compare the error message in the compiler message output buffer with the expected error message in the script file.

10. A scalable multi-verification system suitable for compiler development, characterized in that: The system includes the following modules: Module M1: Prepare test cases according to test requirements; Module M2: Collect all script files under the test path and register test cases; Module M3: loads compiler data, obtains the script file under the test path, and loads verification parameters; Module M4: performs multiple mode verification according to the verification mode field in the script file; Module M5: Run the compiler compilation process and perform corresponding test verification according to the compilation results; Module M6: Output test report.

Citation Information

Patent Citations

  • Automatic testing system and method both applicable to compiler in logical configuration software

    CN104516818A