Transformation-based Program Analysis Technology and Its Application
- Author
- LiGuangQiang
- Advisor
- WuWeiMin
- School
- Guangdong University of Technology
- Major
- Applied Computer Technology
- Classification
- TP311.11 Programming method
- Degree
- Master's thesis
- Year
- 2007
- Downloads
- 157
- Citations
- 3
Abstract
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.
Table of contents
Abstract 4-5
ABSTRACT 5-7
directory 7-10
CONTENTS 10-13
The first chapter 13-23
1.1 This research background 13-20
1.1.1 program analysis and evaluation of technology status 14-16
1.1.2 program understanding technology status 16-18
1.1.3 program metric technology status 18-19
1.1.4 program conversion technology status 19-20
1.2 This paper points 20-22
1.2.1 lexical and syntax analyzer construction 20-21
1.2.2 program metric 21
1.2.3 interactive function to an internal function to convert 21
1.2.4 internal function analysis 21-22
1.2.5 Comparison and evaluation of the program 22
1.3 subject objectives 22
1.4 Content Organization 22-23
Chapter AnalyseC framework 23-28
2.1 AnalyseC system framework 23-24
2.2 development AnalyseC The main tool used 24-28
2.2.1 ANTLR introduction 24-25
2.2.2 program to convert the data structure used 25-28
Chapter C language parser construction 28-34
3.1 C language parser 28-32
3.1.1 lexical analyzer 28-31
3.1.2 parser 31-32
3.2 syntax tree parser 32-34
3.2.1 syntax tree structure 32-33
3.2.2 parser syntax tree structure 33-34
fourth chapter analyzes the structural level programming 34-42
4.1 Traditional software metrics 34-36
4.1.1 annular complexity metrics 34-35
4.1.2 Halstead Software Science theories 35-36
4.1.3 Object-Oriented Software Metrics 36
4.2 structural similarity analysis 36-40
4.2.1 Control Structure Analysis 36-38
4.2.2 function call analysis 38-39
4.2.3 Data structure analysis 39-40
4.3 program structure analyzer design 40-42
Chapter semantic level program analysis 42-63
5.1 interactive function to an internal function to convert 43-47
5.1.1 Overview 43-44
5.1.2 Inline rules 44-45
5.1.3 to avoid duplicate names 45-46
5.1.4 inline recursive function 46-47
5.2 internal function analysis 47-61
5.2.1 Basic conversion program 47-55
5.2.2 The procedures used to program dependence graph representation 55-59
5.2.3 program advanced conversion 59-61
5.3 program semantic analyzer designed 61-63
Chapter VI procedures for comparison and evaluation 63-69
6.1 Program Slicing 63-65
6.2 Comparison and evaluation of the program 65-68
6.2.1 text differences and semantic differences 65-66
6.2.2 Comparison and evaluation of 66-68
6.3 Program comparator design 68-69
Chapter VII and run the sample application discussed 69-77
7.1 Running the sample 69-75
7.1.1 Analysis hierarchy example 70-72
7.1.2 semantic level analysis sample 72-75
7.2 application discussion 75-77
Conclusion 77-79
References 79-84
papers published during the master's degree 84-86
Thanks 86
Related dissertations
- Research on the Transformation of Chinese Commercial Banks’ Profit Model Under Capital Constraint
- The Comparative Analysis in Transformation of Resource-based Cities between China and USA
- Comparative study of Zhou Enlai and Deng Xiaoping's scientific and technical thought
- A Study on College Internal Audit Risk Based on Modern Risk-oriented Audit Mode
- The Empirical Study on the Value Relevance Difference between Consolidated Financial Statements and Parent Company Financial Statements
- Research on Investment Style in P2P Online Lending
- The Network Transformation Research on a Bank
- Study on the transformation of Yangzhou City Industrial and commercial Banking Company business
- Research on the Sustainable Development of China’s Commercial Banks
- Research on Strategy of the Retail Channels Transition for M Bank Jilin Branch
- The Research on Development Transformation of ShangRao Bank
- Study on Branch Management Transformation of Postal Savings Bank of China
- The Development Research on Transformation Process of the Agricultural Development Bank of China
- The development of China bancassurance business and Its Countermeasures
- Research on the Path of Innovatory Development about Retail Banking of Industrial and Commercial Bank of China
- Research on the Improvement of Social Financing Structure and the Transformation of Commercial Bank Businesses
- Comparative study of Chinese and Russian Foreign Direct Investment
- What Determine Commericial Banks’ Profitability?
- Research on the Transformation of China’s Current Land Fiscal Model
- Research on the Development Status of E-commerce Transformation of Large Traditional Retailers, Problems and Solutions in China