Improving Software Quality with Static Analysis and Annotations for Software Defect Detection



Similar documents
ABSTRACT TO FIND BUGS. Department of Computer Science. can be found using simple analysis techniques. We have found that simple static

Writing new FindBugs detectors

Java Interview Questions and Answers

No no-argument constructor. No default constructor found

CS 111 Classes I 1. Software Organization View to this point:

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

To Java SE 8, and Beyond (Plan B)

Licensed for viewing only. Printing is prohibited. For hard copies, please purchase from

Java Application Developer Certificate Program Competencies

CS 2112 Spring Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

Software security specification and verification

Crash Course in Java

Evaluation of AgitarOne

Introduction to Static Analysis for Assurance

Data Flow Static Code Analysis Best Practices

TOOL EVALUATION REPORT: FORTIFY

Java Programming Language

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Coding in Industry. David Berry Director of Engineering Qualcomm Cambridge Ltd

Software Engineering Techniques

CSE 308. Coding Conventions. Reference

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

The Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.0

D06 PROGRAMMING with JAVA

Java SE 7 Programming

Source Code Review Using Static Analysis Tools

<Insert Picture Here> What's New in NetBeans IDE 7.2

Towards Checking the Usefulness of Verification Tools

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

SQL and Java. Database Systems Lecture 19 Natasha Alechina

e ag u g an L g ter lvin v E ram Neal G g ro va P Ja

Java Memory Model: Content

Application-only Call Graph Construction

Ontology Model-based Static Analysis on Java Programs

Java on Guice Guice 1.0 User's Guide

AP Computer Science Java Subset

Will Dormann: Sure. Fuzz testing is a way of testing an application in a way that you want to actually break the program.

Designing with Exceptions. CSE219, Computer Science III Stony Brook University

The C Programming Language course syllabus associate level

CHAPTER 5 INTELLIGENT TECHNIQUES TO PREVENT SQL INJECTION ATTACKS

Java SE 8 Programming

DIPLOMADO DE JAVA - OCA

Using JML to protect Java code against SQL injection. Johan Janssen June 26, 2007

Business Application

Monitoring Java enviroment / applications

APPROACHES TO SOFTWARE TESTING PROGRAM VERIFICATION AND VALIDATION

Chapter 13 - Inheritance

So with no further ado, welcome back to the podcast series, Robert. Glad to have you today.

Java (12 Weeks) Introduction to Java Programming Language

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

COSC Introduction to Computer Science I Section A, Summer Question Out of Mark A Total 16. B-1 7 B-2 4 B-3 4 B-4 4 B Total 19

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

A Test Suite for Basic CWE Effectiveness. Paul E. Black.

Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages. Corky Cartwright Swarat Chaudhuri November 30, 20111

Tutorial: Getting Started

The Rules 1. One level of indentation per method 2. Don t use the ELSE keyword 3. Wrap all primitives and Strings

Static Code Analysis Procedures in the Development Cycle

Integrated Error-Detection Techniques: Find More Bugs in Java Applications

Fundamentals of Java Programming

Lecture 7: Class design for security

dictionary find definition word definition book index find relevant pages term list of page numbers

Java SE 7 Programming

Java SE 7 Programming

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

Detecting Pattern-Match Failures in Haskell. Neil Mitchell and Colin Runciman York University

Programming Languages CIS 443

core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt

16.1 DataFlavor DataFlavor Methods. Variables

Evaluation. Copy. Evaluation Copy. Chapter 7: Using JDBC with Spring. 1) A Simpler Approach ) The JdbcTemplate. Class...

How to create/avoid memory leak in Java and.net? Venkat Subramaniam

cs2010: algorithms and data structures

Problem 1. CS 61b Summer 2005 Homework #2 Due July 5th at the beginning of class

Everyday Lessons from Rakudo Architecture. Jonathan Worthington

The FDA Forensics Lab, New Tools and Capabilities

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Object Oriented Software Design II

CPLEX Tutorial Handout

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Practical Online Filesystem Checking and Repair

Iron Chef: John Henry Challenge

Introduction to Programming System Design. CSCI 455x (4 Units)

Source Code Security Analysis Tool Functional Specification Version 1.0

Capabilities of a Java Test Execution Framework by Erick Griffin

Real World Software Assurance Test Suite: STONESOUP

Visualizing Information Flow through C Programs

WA2099 Introduction to Java using RAD 8.0 EVALUATION ONLY. Student Labs. Web Age Solutions Inc.

Object Oriented Software Design

Web development... the server side (of the force)

Secure Software Programming and Vulnerability Analysis

Pattern Insight Clone Detection

Dart a modern web language

Transcription:

Improving Software Quality with Static Analysis and Annotations for Software Defect Detection William Pugh Professor, Univ. of Maryland http://www.cs.umd.edu/~pugh TS-2007

About Me Professor at Univ. of Maryland since 1988, doing research in programming languages, algorithms, software engineering Technical Lead on JSR-133 (Memory model), JSR-305 (Annotations for Software Defect Detection) Founder of the FindBugs project Open source static analysis tool for defect detection in the Java Programming Language Technical advisory board of 2

Static Analysis Analyzes your program without executing it Doesn t depend on having good test cases or even any test cases Generally, doesn t know what your software is supposed to do Looks for violations of reasonable programming Shouldn t throw NPE Shouldn t allow SQL injection Not a replacement for testing Very good at finding problems on untested paths But many defects can t be found with static analysis 4 3

Common Wisdom about Bugs and Static Analysis Programmers are smart Smart people don t make dumb mistakes We have good techniques (e.g., unit testing, pair programming, code inspections) for finding bugs early So, bugs remaining in production code must be subtle, and finding them must require sophisticated static analysis techniques I tried lint and it sucked: lots of warnings, few real issues 4

Can You Find The Bug? 5

Can You Find The Bug? if (listeners == null) listeners.remove(listener); JDK1.6.0, b105, sun.awt.x11.xmselection lines 243-244 5

Can You Find The Bug? if (listeners == null) listeners.remove(listener); JDK1.6.0, b105, sun.awt.x11.xmselection lines 243-244 5

Can You Find The Bug? if (listeners == null) listeners.remove(listener); JDK1.6.0, b105, sun.awt.x11.xmselection lines 243-244 5

Why Do Bugs Occur? Nobody is perfect Common types of errors: Misunderstood language features, API methods Typos (using wrong boolean operator, forgetting parentheses or brackets, etc.) Misunderstood class or method invariants Everyone makes syntax errors, but the compiler catches them What about bugs one step removed from a syntax error?

Who Uses Static Analysis? Lots and lots of projects and companies Among many others, Glassfish and Google use FindBugs Many companies are weird about letting you say they use your open source tool Lots of open source tools: PMD, CheckStyle, etc. IDEs include some: Eclipse, IntelliJ, Netbeans Commercial tools available from Fortify Software, KlocWork, Coverity, Parasoft, SureLogic Static analysis used even more widely/intensely for C/C++ More bugs to find Bugs a lot scarier Free tools not as good 7

FindBugs I'm mostly going to be talking about FindBugs I know it best Some things will be specific to FindBugs What we classify as a "correctness" issue Which potential null pointer issues we report But most of the concepts apply to other tools 8

Bug Categories Selected categories for today's discussion Correctness - the code seems to be clearly doing something the developer did not intend Bad practice - the code violates good practice 9

Bug Patterns Some big, broad and common patterns Dereferencing a null pointer An impossible checked cast Methods whose return value should not be ignored Lots of small, specific bug patterns, that together find lots of bugs Every Programming Puzzler Every chapter in Effective Java Many postings to http://thedailywtf.com/ 10

Analysis Techniques Whatever you need to find the bugs Local pattern matching If you invoke String.toLowerCase(), don t ignore the return value Intraprocedural dataflow analysis Null pointer, type cast errors Interprocedural method summaries This method always dereferences its parameter Context sensitive interprocedural analysis Interprocedural flow of untrusted data SQL injection, cross site scripting 11

Categories, ranking, use cases Every tool has categories, rules/patterns, priorities You can generally customize what you want to look at Sometimes, you want to do a code audit of a newly written module with 1,000 lines of code and sometimes you want to scan 1,000,000 lines of code that has been in production for a year Different use cases require different tunings, different tools 12

Correctness issues Stuff you really want to look at In FindBugs, we reserve the Correctness category for issues we are most confident are wrong code does something the developer didn t intend Many of the other categories reflect correctness issues But correctness issues are the things we think you should look at when scanning that million line code base low false positive rate, few low impact bugs 13

... Students are good bug generators Student came to office hours, was having trouble with his constructor: /** Construct a WebSpider */ public WebSpider() { WebSpider w = new WebSpider(); } A second student had the same bug Wrote a detector, found 3 other students with same bug 14

Infinite recursive loop... Students are good bug generators Student came to office hours, was having trouble with his constructor: /** Construct a WebSpider */ public WebSpider() { WebSpider w = new WebSpider(); } A second student had the same bug Wrote a detector, found 3 other students with same bug 14

Double Check Against JDK1.6.0-b13 Found 5 infinite recursive loops Including one written by Joshua Bloch public String foundtype() { } return this.foundtype(); Smart people make dumb mistakes 27 across all versions of JDK, 40+ in Google s Java code Embrace and fix your dumb mistakes 15

Finding Null Pointer Bugs with FindBugs FindBugs looks for a statement or branch that, if executed, guarantees a null pointer exception Either a null pointer exception could be thrown, or the program contains a statement/branch that can t be executed Could look for exceptions that only occur on a path e.g., if the condition on line 29 is true and the condition on line 38 is false, then a NPE will be thrown but would need to worry about whether that path is feasible 16

Null Pointer Bugs Found by FindBugs JDK1.6.0-b105 109 statements/branches that, if executed, guarantee NPE We judge at least 54 of them to be serious bugs that could generate a NPE on valid input Most of the others were deemed to be unreachable branches or statements, or reachable only with erroneous input Only one case where the analysis was wrong 17

Examples of null pointer bugs simple ones //com.sun.corba.se.impl.naming.cosnaming.namingcontextimpl if (name!= null name.length > 0) //com.sun.xml.internal.ws.wsdl.parser.runtimewsdlparser if (part == null part.equals("")) // sun.awt.x11.scrollpanepeer if (g!= null) paintscrollbars(g,colors); g.dispose(); 18

Redundant Check For Null Also known as a reverse null dereference error Checking a value to see if it is null When it can't possibly be null // java.awt.image.loopupop, lines 236-247 public final WritableRaster filter( Raster src, WritableRaster dst) { int dstlength = dst.getnumbands(); // Create a new destination Raster, // if needed if (dst == null) dst = createcompatibledestraster(src); 19

Redundant Check For Null Is it a bug or a redundant check? Check the JavaDoc for the method Performs a lookup operation on a Raster. If the destination Raster is null, a new Raster will be created. Is this case, a bug particularly look for those cases where we know it can't be null because there would have been a NPE if it were null 20

Bad Method Invocation Methods whose return value shouldn't be ignored Strings are immutable, so functions like trim() and tolowercase() return new String Dumb/useless methods Invoking tostring or equals on an array Lots of specific rules about particular API methods Hard to memorize, easy to get wrong 21

Examples of bad method calls // com.sun.rowset.cachedrowsetimpl if (type == Types.DECIMAL type == Types.NUMERIC) ((java.math.bigdecimal)x).setscale(scale); // com.sun.xml.internal.txw2.output.xmlwriter try {... } catch (IOException e) { new SAXException("Server side Exception:" + e); } 22

Type Analysis Impossible checked casts Useless calls equals takes an Object as a parameter but comparing a String to StringBuffer with equals(...) is pointless, and almost certainly not what was intended Map<K,V>.get also takes an Object as a parameter supplying an object with the wrong type as a parameter to get doesn't generate a compile time error just a get that always returns null 23

Lots of Little Bug Patterns checking if d == Double.NaN Bit shifting an int by a value greater than 31 bits Every Puzzler this year more than half for most years 24

When Bad Code Isn't A Bug Static analysis tools will sometimes find ugly, nasty code that can't cause your application to misbehave Cleaning this up is a good thing makes the code easier to understand and maintain But for ugly code already in production sometimes you just don't want to touch it We've found more cases like this than we expected 25

When Bad Code Isn't A Bug bad code that does what it was intended to do // com.sun.jndi.dns.dnsname, lines 345-347 if (n instanceof CompositeName) { // force ClassCastException n = (DnsName) n; } // sun.jdbc.odbc.jdbcodbcobject, lines 85-91 if ((b[offset] < 32) (b[offset] > 128)) { asciiline += "."; } 26

When Bad Code Isn't A Bug Code that shouldn't go wrong // com.sun.corba.se.impl.dynamicany.dynanycompleximpl String expectedmembername = null; try { expectedmembername = expectedtypecode.member_name(i); } catch (BadKind badkind) { // impossible } catch (Bounds bounds) { // impossible } if (!(expectedmembername.equals(membername)... )) { 27

When Bad Code Isn't A Bug When you are already doomed // com.sun.org.apache.xml.internal.security.encryption.xmlciper // lines 2224-2228 if (null == element) { //complain } String algorithm = element.getattributens(...); 28

Overall Correctness Results From FindBugs Evaluating Static Analysis Defect Warnings On Production Software, ACM 2007 Workshop on Program Analysis for Software Tools and Engineering JDK1.6.0-b105 379 correctness warnings we judge that at least 213 of these are serious issues that should be fixed Google's Java codebase over a 6 month period, using various versions of FindBugs 1,127 warnings 807 filed as bugs 518 fixed in code 29

Results on openjpa nightly build 39 correctness issues 35 of which I marked as must/should fix 2 doomed casts 1 uninitialized reads 6 null pointer issues 26 comparing Boolean objects using == feel free to argue with me on this one 30

Bad Practice A class that defines an equals method but inherits hashcode from Object Violates contract that any two equal objects have the same hash code equals method doesn't handle null argument Serializable class without a serialversionuid Exception caught and ignored Broken out from the correctness category 31

Fixing hashcode What if you want to define equals, but don't think your objects will ever get put into a HashMap? Suggestion: public int hashcode() { assert false : "hashcode method not designed"; return 42; } 32

Use of Unhashable Classes FindBugs previously reported all classes that defined equals but not hashcode as a correctness problem but some developers didn t care Now reported as bad practice but separately report use of such a class in a HashMap/HashTable as a correctness warning 33

Integrating Static Analysis Want to make it part of your development process Just like running unit tests Have to tune the tool to report what you are interested in Different situations have different needs Need a workflow for issues Almost all tools will report some issues that, after reviewing, you decide not to fix Need to have a way to manage such issues 34

Running Static Analysis "We've got it in our IDE, so we're done, right?" no, it really needs to also be done automatically as part of your build process Are you scanning 2 million lines of code? You probably don't want 20,000 issues to examine 35

Defect/Issue Workflow How do issues get reviewed/audited? Can you do team auditing and assign issues? Once you've reviewed an issue, does the system remember your evaluation when it analyzes that code again? even if it is now reported on a different line number? Can you identify new issues since last build? since last release to customer/production? 36

Learning from mistakes With FindBugs, we've always started from bugs We need API experts to feed us API-specific bugs Swing, EJB, J2ME, localization, Hibernate,... When you get bit by a bug writing a test case is good considering whether it can be generalized into a bug pattern is better You'd be surprised at the number of times you make a mistake so stupid no one else could possible make the same mistake but they do 37

JSR-305: Annotations for Software Defect Detection William Pugh Professor Status Report Univ. of Maryland pugh@cs.umd.edu http://www.cs.umd.edu/~pugh/ 38

Why annotations? Static analysis can do a lot can even analyze interprocedural paths Why do we need annotations? they express design decisions that may be implicit, or described in documentation, but not easily available to tools 39

Where is the bug? class Foo { int value; public boolean equals(object obj) { if (this.getclass()!= obj.getclass()) return false; Foo that = (Foo) obj; return this.value == that.value; }... } 40

Where is the bug? if (spec!= null) ffragments.add(spec); if (iscomplete(spec)) fpreferences.add(spec); 41

Where is the bug? if (spec!= null) ffragments.add(spec); if (iscomplete(spec)) fpreferences.add(spec); boolean iscomplete(annotationpreference spec) { return spec.getcolorpreferencekey()!= null && spec.getcolorpreferencevalue()!= null && spec.gettextpreferencekey()!= null && spec.getoverviewrulerpreferencekey()!= null; } 41

Finding the bug Many bugs can only be identified, or only localized, if you know something about what the code is supposed to do Annotations are well suited to this... 42

JSR-305 At least two tools already have defined their own annotations: FindBugs and IntelliJ No one wants to have to apply two sets of annotations to their code come up with a common set of annotations that can be understood by multiple tools 43

JSR-305 target JSR-305 is intended to be compatible with JSE 5.0+ Java Hope to have usable drafts and preliminary tool support out by the end of the summer 44

JSR-308 Annotations on Java Types Designed to allow annotations to occur in many more places than they can occur now ArrayList<@Nonnull String> a =... Targets JSE 7.0 Will add value to JSR-305, but JSR-305 cannot depend upon JSR-308 45

Nullness Nullness is a great motivating example Most method parameters are expected to always be nonnull some research papers support this Not always documented in JavaDoc 46

Documenting nullness Want to document parameters, return values, fields that should always be nonnull And which should not be presumed nonnull argument to equals(object) Should warn if null passed where nonnull value required Should warn if argument to equals is immediately dereferenced 47

Only two cases? What about Map.get(...)? Return nulls if key not found even if all values in Map are nonnull So the return value can t be @Nonnull But lots of places where you know that the value will be nonnull you know key is in table you know value is nonnull 48

more examples Object.equals(Object obj) must handle a null value for obj Method.invoke(Object obj, Obj.. args) obj should be null if method is a static method, nonnull if an instance method ConcurrentHashMap.get(K k) k must not be null 49

3 cases? May need to have 3 cases for nullness @Nonnull @CheckForNull @UnknownNullness same as no annotation Names in flux, might use Nullable for one of these (but which one?) 50

@Nonnull Should not be null For fields, should be interpreted as should be nonnull after object is initialized Tools will try to generate a warning if they see a possibly null value being used where a nonnull value is required same as if they see a dereference of a possibly null value 51

@CheckForNull Code should always worry that this value might be null e.g., argument to equals 52

@UnknownNullness Same as no annotation Needed because we are going to introduce default and inherited annotations Need to be able to get back to unannotated state Null under some circumstances might vary in subtypes 53

@CheckForNull requires work If you mark a return value as @CheckForNull, you will likely have to go make a bunch of changes kind of like const in C++ My experience has been that there are lots of methods that could return null but that in a particular calling context, you might know that it can t 54

Nullness annotations Tools that try to prove absence of NPE might treat @CheckForNull and @UnknownNullness the same This 3-way logic might reappear for some other annotations 55

Type Qualifiers Many of the JSR-305 annotations will be type qualifiers: additional type constraints on top of the existing Java type system 56

@Untainted / @Tainted Needed for security analysis Information derived directly from web form parameters is tainted can be arbitrary content Strings used to form SQL queries or HTML responses must be untainted otherwise get SQL Injection or XSS 57

@Syntax Used to indicate String values with particular syntaxes @Syntax( RegEx ) @Syntax( Java ) @Syntax( SQL ) Allows for error checking and used by IDE s in refactoring 58

@Pattern Provides a regular expression that describes the legal String values @Pattern( \\d+ ) 59

@Nonnegative and friends Fairly clear motivation for @Nonnegative More? @Positive Where do we stop? @NonZero @PowerOfTwo @Prime 60

Three-way logic again If we have @Nonnegative, do we also need: @Signed similar to check for null @UnknownSign similar to unknown nullness 61

User defined type qualifiers In (too many) places, Java APIs use integer values or Strings where enumerations would have been better except that they weren t around at the time Lots of potential errors, uncaught by compiler 62

Example in java.sql.connection createstatement(int resultsettype, int resultsetconcurrency, int resultsetholdability) Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability. resultsettype: one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE resultsetconcurrency: one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE resultsetholdability: one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or 63

The fix Declare public @TypeQualifier @interface ResultSetType {} public @TypeQualifier @interface ResultSetConcurrency {} public @TypeQualifier @interface ResultSetHoldability {} Annotate static constants and method 64

User defined Type Qualifiers JSR-305 won t define @ResultSetType Rather JSR-305 will define the metaannotations that allow any developer to define their own type qualifier annotations which they can apply and will be interpreted by defect detection tools 65

Other ideas Validators Subtypes exclusive type qualifiers (e.g., it can't be both A and B) 66

CreditCard example @Documented @TypeQualifier @Retention(RetentionPolicy.RUNTIME) @Pattern("[0-9]{16}") public @interface CreditCardNumber { class Validator implements TypeQualifierValidator<CreditCardNumber> { public boolean forconstantvalue(creditcardnumber annotation, Object v) { if (v instanceof String) { String s = (String) v; if (java.util.regex.pattern.matches("[0-9]{16}", s) } && LuhnVerification.checkNumber(s)) return true; return false; }}} 67

Default and Inherited Annotations

Most parameters are nonnull Most references parameters are intended to be non-null many return values and fields as well Adding a @Nonnull annotation to a majority of parameters won t sell Treating all non-annotated parameters as nonnull also won t sell 69

Default annotations Can mark a method, class or package as having nonnull parameters by default If a parameter doesn t have a nullness annotation climb outwards, looking at method, class, outer class, and then package, to find a default annotation Can mark a package as nonnull parameters by default, and change that on a class or parameter basis as needed 70

Inherited Annotations We want to inherit annotations Object.equals(@CheckForNull Object obj) int compareto(@nonnull E e) @Nonnull Object clone() 71

Do defaults apply to most JSR-305 annotations? Case for default and inherited nullness annotations is very compelling Should it be general mechanism? 72

Thread/Concurrency Annotations Annotations to denote how locks are used to guard against data races Annotations about which threads should invoke which methods See annotations from Java Concurrency In Practice as a starting point 73

What is wrong with this code? Properties getprops(file file) throws... { Properties props = new Properties(); props.load(new FileInputStream(file)); return props; } 74

What is wrong with this code? Properties getprops(file file) throws... { Properties props = new Properties(); props.load(new FileInputStream(file)); return props; } Doesn t close file 74

Resource Closure @WillNotClose this method will not close the resource @WillClose this method will close the resource @WillCloseWhenClosed Usable only in constructors: constructed object decorates the parameter, and will close it when the constructed object is closed 75

Miscellaneous @CheckReturnValue @InjectionAnnotation 76

@CheckReturnValue Indicates a method that should always be invoked as a function, not a procedure. Example: String.toLowerCase() BigInteger.add(BigInteger val) Anywhere you have an immutable object and methods that might be thought of a a mutating method return the new value 77

@InjectionAnnotation Static analyzers get confused if there is a field or method that is accessed via reflection/ injection, and they don t understand it Many frameworks have their own annotations for injection Using @InjectionAnnotation on an annotation @X tells static analysis tools that @X denotes an injection annotation 78

Wrap up Static analysis is effective at finding bad code Is bad code found by static analysis an important problem? Getting static analysis into the software development process can t be taken for granted Annotations will be helpful If we can get developers to use them 79