Font Size: a A A

Transformation-based Program Analysis Technology And Its Application

Posted on:2008-10-20Degree:MasterType:Thesis
Country:ChinaCandidate:G Q LiFull Text:PDF
GTID:2178360215962198Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Program analysis technology has a bright application future in various fields, such as, automatic analysis and assessment for student programming exercises, and making use of program analyais tool to help analyse software copyright.Nowadays, the program analysis technology mainly focuses on comparison of program outputs. In this way, the errors in a successfully compiled program cannot be found through comparison. There are some scholars who has tried to figured it out by semantic comparison, but the programming language they have tried is not the within the ones widely used throughout the world. Although there are some related technologies, such as Program Comprehension, Software Metrics and Program Transformation, there is little research that integrates and applies these technologies to Program Analysis and Assessment.In this thesis, we do research in Program Analysis technology and its application on Program Assessment, and discuss the prospect of other applications. Based on transformation techniques of compilers and Code Optimization technology, we propose a new framework AnalyseC, and implement the prototype. AnalyseC features in software metrics, structural analysis, semantic analysis and visualization.In AnalyseC, we use ANTLR to construct a C parser, which is able to generate Abstract Syntax Tree as intermediate language. At structural level, based on Abstract Syntax Tree, AnalyseC makes use of software metrics to compute and visualize the metrics information of programs. We propose that Data Structure used in a program can be a kind of software metrics to analyze a program. At semantic level, Program Depedence Graph originally used in Code Optimization is the representation form of a program. We apply transformation technology of compilers and Code Optimization Technology to achieve semantically preserving transformation, control flow analysis and data flow analysis, forming Program Dependence Graph, a form that can be compared at semantic level. Finally, through partition and compassion of the Program Dependence Graph, an assessment report is given, identifying the semantic differences of two programs.Source code is provided to AnalyseC to perform assessment. AnalyseC analyses programs at structural and semantic level, generating analysis results. It can facilite teachers in assessing programming exercises, and give students assistance when they find difficult in finding errors. The protype of AnalyseC can now analyse some specific exercises of Data Structure course. But it still has a long way to go before it can be practically used in automatic program assessment and other fields in the real world.
Keywords/Search Tags:Program Analysis, Transformation, Comparison, Assessment, Visualization
PDF Full Text Request
Related items