Download pdf - Master's Thesis Defense

Transcript
Page 1: Master's Thesis Defense

A Static Code Analysis Tool ForObjective-C and Related Languages

Longyi Qi

April 2012

1

Advisor: Dr. Venkat Subramaniam

Page 2: Master's Thesis Defense

2

* Image in this slide: Spinellis, D. Code Quality: The Open Source Perspective. (2006). Indianapolis, IN: Addison-Wesley Professional

Page 3: Master's Thesis Defense

Outline

• Motivation

• Related Work

• Open Problems• OCLint and What’s Good

• How OCLint Can Help

• Conclusion and Future Work

3

Page 4: Master's Thesis Defense

Motivation

4* Image in this slide: Copyright © 2010 Apple Inc.

Page 5: Master's Thesis Defense

Related Work

5

Page 6: Master's Thesis Defense

Open Problems

• The Objective-C programming language

• Care about code quality

• Continuous Integration

6

Page 7: Master's Thesis Defense

Theory Study

• Static Code Analysis Process

• Abstract Syntax Tree (AST)

• Analysis Techniques– Control Flow Analysis– Data Flow Analysis– Dependence Analysis

• Code Smells

7

Page 8: Master's Thesis Defense

OCLint

8

Page 9: Master's Thesis Defense

Workflow

9

Page 10: Master's Thesis Defense

Good Architecture

10

Page 11: Master's Thesis Defense

Dynamically Loading Rules

• Dynamic libraries

• Rule search path

11

Page 12: Master's Thesis Defense

Configuring & Extending Rules

• Alter thresholds

• Custom rules

12

Page 13: Master's Thesis Defense

Smart AST Traversing

• AST is traversed only once and dispatch each node to registered rules

• Intelligent traverse policy

13

Page 14: Master's Thesis Defense

High Accuracy and Low False Positive Rate

14

Page 15: Master's Thesis Defense

Report

• Support multiple output format

• Meaningful violation message

• As continuous integration artifacts

15

Page 16: Master's Thesis Defense

OCLint

• Good architecture

• Dynamically loading rules

• Configuring and extending rules• Smart AST traversing

• High accuracy and low false positive rate

• Report

16

Page 17: Master's Thesis Defense

OCLint helps

• Find code smells

• Refactor the code

• Find problems early• Add customer rules if needed

• Integrate into developers’ workflow

17

Page 18: Master's Thesis Defense

Conclusion

• A static code analysis tool for Objective-C

• Focus on code quality

• Involve many analysis techniques• Good design

• Positive case study feedback

• Research infrastructure

18

Page 19: Master's Thesis Defense

Future Work

• Accuracy and False Positives

• Better Code Quality

• Extended Rules• Compatibility

• Performance

• User Experiences

19

Page 20: Master's Thesis Defense

Acknowledgements

20

Page 21: Master's Thesis Defense

Questions?

21

Page 22: Master's Thesis Defense

Thank you!

Contact Information:•OCLint Project: http://oclint.org @oclint_project•Longyi Qi: http://longyiqi.com @longyiqi

22