Font Size: a A A

Static Input Determination Method In Partial Evaluation For Compiler Test

Posted on:2021-01-16Degree:MasterType:Thesis
Country:ChinaCandidate:J WengFull Text:PDF
GTID:2428330629452682Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
The validation method based on partial evaluation is a novel and effective method to validate compilers.However,in this method,the static inputs and their values are specified by hand,which limits the framework to run automatically.To solve this problem,this thesis proposes a method for determining the static input of the source program and a method for determining the static input value based on the variable dependency relationship.The method proposed in this article uses data flow analysis to abstract the source program into a control flow graph.By defining the definition set of variables and the reference set of statements,a data flow equation is constructed to measure the active degree of variables participating in expression calculations in the program.The data flow equation can quantify the activity of the variable.This article defines the dependency of a variable as this measurement and determines the static input of the program based on the dependency of the variable.After determining the static input,this thesis considers some branch structure statements that are prone to cause bugs.Based on the conditional operation expressions in these statements,the value range of the static input is calculated,so that each static input can have a specific value during one test pass.This paper implements the proposed method at the abstract syntax tree level and the intermediate expression level,respectively.At the abstract syntax tree level,the source program is first transformed into an abstract syntax tree,where the nodes in the control flow graph correspond to specific statements type nodes,which contain information about expressions as well as variable nodes,and can be computed by traversing the syntax tree.This paper improves the compiler testing framework based on the implementations of proposed method which can be automated,thus improve the efficiency of testing.In order to verify the validity of the method in this paper,I perform two experiments: firstly,I manually inject errors into the compiler to be tested,secondly,I use a collection of existing test cases for triggering compiler bugs.The results show that the test framework can all trigger the corresponding bugs.
Keywords/Search Tags:compiler test, partial evaluation, static input, program static analysis
PDF Full Text Request
Related items