当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

南京大学:《软件工程研究导引 Introduction to Software Engineering Research》课程教学资源(课件讲稿)06 Static Program Analysis

资源类别:文库,文档格式:PDF,文档页数:33,文件大小:1.44MB,团购合买
点击下载完整版文档(PDF)

Static Program Analysis Jun Ma majun@nju.edu.cn

Static Program Analysis majun@nju.edu.cn Jun Ma

Static Prgram Analysis: Overview

Static Prgram Analysis: Overview

What is Static Analysis? A program that takes programs as input and produces useful results. Transformed code (assembly,instrumented code,...) Code or Binary Static Analyser Useful Results Potential bugs(bad practices,null pointers,...) Software artifacts(diagrams,architecture,...) ■Examples Compilers (and optimization passes) Static checkers (e.g.,-Wall,lint,...) Useful results for SE practices

What is Static Analysis? Code or Binary Static Analyser Useful Results Transformed code (assembly, instrumented code, ...) Potential bugs (bad practices, null pointers, ...) Software artifacts (diagrams, architecture, ...) Examples Compilers (and optimization passes) Static checkers (e.g., -Wall, lint, …) Useful results for SE practices A program that takes programs as input and produces useful results

Categories of Static Program Analysis Static Analysis Lexical Analysis Syntax Analysis Semantic Analysis

Categories of Static Program Analysis Static Analysis Lexical Analysis Syntax Analysis Semantic Analysis

Lexical Analysis Treating program as a sequence of Symbols/Tokens

Lexical Analysis Treating program as a sequence of Symbols/Tokens

Example:Empirical Study on Variable Naming What are the style,abbreviation,..of variable names? Are they correlated to bugs/code quality/...? You can study this by treating code as a tokenized text stream 1"(a+b)*2”=> 2【(SYM,('),(ID,'a'),(BIN0P,'+),(ID,'b'),(SYM,)'),(BIN0P,*'),(INT,'2)J We are interested in the IDs

Example: Empirical Study on Variable Naming Are they correlated to bugs/code quality/…? You can study this by treating code as a tokenized text stream We are interested in the IDs What are the style, abbreviation, … of variable names? 1 "(a + b) * 2" => 2 [ (SYM, '('), (ID, 'a'), (BIN_OP, '+'), (ID, 'b'), (SYM, ')'), (BIN_OP, '*'), (INT, '2') ]

Example:Differencing Files How to define"diffs"between two file versions?

Example: Differencing Files How to define "diffs" between two file versions?

The Edit Distance Approximation a b c a bb a ,21 a a C Delete Insert Unchanged Myers,E.W.An O(ND)difference algorithm and its variations.Algorithmica 1,251-266(1986). https:/doi.org/10.1007/BF01840446

The Edit Distance Approximation Myers, E.W. An difference algorithm and its variations. Algorithmica 1, 251–266 (1986). https://doi.org/10.1007/BF01840446 O(ND)

Is Edit Distance a Good Idea? Open Problem:How to produce even more developer-friendly diffs? Minimizing edit distance is a good hack Lacks semantic explanations to what are changed Not work for adding indention,renaming variables,.. You can work out a paper on this!

Is Edit Distance a Good Idea? Minimizing edit distance is a good hack Lacks semantic explanations to what are changed Not work for adding indention, renaming variables, … You can work out a paper on this! Open Problem: How to produce even more developer-friendly diffs?

Syntax Analysis on AST

Syntax Analysis on AST

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共33页,可试读12页,点击继续阅读 ↓↓
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有