Unit Testing of C Language Study and Implementation Based on Symbolic Execution

Author
WengZiSheng
Advisor
WangBaoSheng
School
National University of Defense Science and Technology
Major
Computer technology
Classification
TP311.52 Software Development
Degree
Master's thesis
Year
2010
Downloads
196
Citations
3

Request the full text

Abstract

The software security is more and more important. We start from the unit testing of source code, and then study how to detect the potential vulnerabilities of the source code and improve the security of the code. We use the technology of static analysis and constraint solve. This paper has implemented a virtual execution machine of“Phoenix IR”, which analyses the“Phoenix IR”directly. It can generate unit testing cases of the normal input or trigger input of potential defects using the method of constraint solve.Symbolic execution is path-sensitive, whose precision of analysis is high. Its consumption of time and space is large, but it is a good way to do unit testing. This paper deals with the analysis of C language, and some complex structures such as pointer, struct, and multidimensional array can be processed well. The tool CUTG supports the inter-procedural analysis. We use the method of simulating the back-end“C2”of Phoenix to construct the base of whole program analysis. This tool uses symbolic expression trees as the storage structure of symbolic manipulation in symbolic execution. CUTG uses the traditional method of depth-first to traversal the path space of being tested code. The major type of vulnerability that CUTG detects is buffer overflow. The harmfulness of buffer overflow is great and it’s hard to detect. Also this tool can detect the exception of NULL pointer and the divide zero error. As the Phoenix’s large-scale IR instruction set,CUTG has only achieved a part of the instruction modeling. The analytical capacity of CUTG is to be further improved.This paper gives out an experiment of typical example. It can detect the vulnerabilities of the example and generate the test inputs. And it also gives out the experiment of analyzing the source code of wget. It shows that the tool can analyze tens of thousands of lines of source code, and can give results of the analysis with a guiding value.

Table of contents

Abstract 8-9 ABSTRACT 9-10 first chapter 10-15 1.1 thesis research background, content and significance 10-11 1.2 status and Development trend 11-13 1.3 major achievements papers and theses structural arrangements 13-14 1.3.1 thesis results 13 1.3.2 thesis chapters arranged 13-14 1.4 Summary 14-15 Chapter static analysis basic theory 15-27 2.1 grid 15-16 2.2 data flow analysis 16-19 2.2.1 control Flow Graph 17 <br / > 2.2.2 data Flow Analysis Fundamentals 17 2.2.3 data flow analysis example 17-19 2.3 widening and contraction operator 19-21 2.4 constraints assertions Add 21-22 2.5 symbolic execution analysis 22-26 2.5.1 process to analyze 22-25 <br / > 2.5.2 interprocedural analysis 25-26 2.6 Summary 26-27 the third chapter is based on symbolic execution of unit test data generation method 27 -32 3.1 buffer overflow security constraints 27-29 3.1.1 buffer overflow 27-29 3.1.2 buffer overflow security constraints 29 3.2 constraint solving based on symbolic execution and automatic test data generation 29-31 3.3 Summary 31-32 Chapter CUTG system design and achieve 32-60 4.1 architecture design 32-34 4.2 Phoenix compiler framework 34-41 4.2.1 analysis object 34-35 4.2.2 Phoenix Fundamentals 35-40 4.2.3 build system global analytical framework 40-41 4.3 IR commands symbolic execution machine module 41-55 4.3.1 IR commands symbolic execution machine Description 41-43 4.3.2 IR commands symbolic execution machine model is designed 43 -44 4.3.3 instruction operands semantic interpretation 44-52 4.3.4 instruction opcode semantic interpretation 52-55 4.4 symbolic execution path scheduling module 55-57 4.4.1 Description 55 4.4.2 functions to achieve 55-57 4.5 security constraint management and constraint Solver 57-58 4.5.1 Description 57-58 4.5.2 functions to achieve 58 4.6 Summary 58-60 < br /> CHAPTER experimental results 60-69 5.1 typical code example experiment 60-65 5.2 wget code analysis experiments 65-67 <br / > 5.3 Summary 67-69 Conclusion 69-70 Thanks 70-71 References 71-74 <br / > in the study period of academic achievements 74

Related dissertations

  1. Reverse Static Analysis of Executable Program Guided by Sematic Analysis of Versions
  2. Binary code security analysis
  3. Study of Multicore-based Parallel Algorithm for Constructing Extremal Graphs
    ZhengRuiJun ·Beijing Jiaotong University ·2014 ·Master's thesis
  4. Research on Software Technology in HVDC Transmission Design Software Package
    LiZhiPeng ·Zhejiang University ·2014 ·Master's thesis
  5. Code security flaw detection system based on static analysis
  6. Research and Implementation of Vulnerability Detection System Based on Symbolic Execution
    JiangShuGuang ·Hunan University ·2012 ·Master's thesis
  7. Research on Key Technologies of Malicious Code Binary Program Behavior Analysis
  8. The Design and Implementation of Software Auto Test System Based on Enodeb Control Plane
  9. Unit Testing Technology and Its Application Based on Java ME
  10. Research on Testing Technology of Binary Program Based on Coverage of Critical Path
  11. Research and Implementation for Method of Component Regression Testing
  12. Unit Testing Strategies and Methods of Lightweight J2EE Applications System
  13. Research on Abstract Memory Modeling Technology Supporting Test Case Automatic Generation of Non-Numeric Data Type
  14. Research and Application on Unit Testing Technology for Object Oriented Program by CppUnit
  15. The Research and Application in the Unit Testing by Using JUnit Framework
  16. Path Feasibility Detection Using Symbolic Execution and Data Mining
    Fan ·Shanghai Jiaotong University ·2013 ·Master's thesis
  17. The Processing of External Enviroments in Symbolic Execution
  18. Research on Memory Modeling Based Automatic Test Data Generation Technique
  19. Vulnerability testing technology based on symbolic execution software
  20. Design and Implementation of a Concolic-Testing Tool
    JiangSiYuan ·East China Normal University ·2012 ·Master's thesis