advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Partners & Affiliates
advertisement
advertisement
advertisement
Average Rating: 4.5/5 | Rate this item | 2 users have rated this item.
 

Find the Java Bugs That Pose a Threat with FindBugs

FindBugs enables you to isolate and correct dangerous Java bugs. Its unique features separate it from the many static analysis tools in the Java world. Find out what makes FindBugs so special. 


advertisement
indBugs is an open-source static analysis tool designed to find bugs in your Java code. Unlike many other static analysis tools, however, FindBugs concentrates almost exclusively on isolating potentially dangerous coding errors that could break your application. This powerful tool can find subtle yet dangerous bugs that other static analysis tools will not detect.

FindBugs works by searching compiled Java bytecode for what it calls "bug patterns." Simply put, a bug pattern is a coding practice that often leads to bugs. Bug patterns are based on the observation that people tend to reproduce the same errors, both individually and collectively. Humans are creatures of habit, and habits tend to persist—even harmful ones. Inexperienced developers often make the same mistakes that more experienced developers were making when they were newbies. So, unless a conscious effort is made to identify and correct a poor programming habit, it will raise its head again and again. In particular, trickier parts of the Java language APIs can lead to common mistakes.

FindBugs comes with over 300 bug patterns (336 in FindBugs 1.3.4), organized in different bug categories, such as "Malicious Code," "Bad Practice," and "Performance." Each bug also has a priority rating (high, medium, and low). You can use this rating system to prioritize your bug-correction activities. The FindBugs team recommends treating both high- and medium-priority issues seriously.

In addition to isolating the most dangerous of these poor coding habits and mistakes, FindBugs also explains in great detail what is wrong with the code. This feature makes FindBugs not only an effective bug detector but also an excellent learning tool: it can help hone a team's programming skills and help individual developers avoid similar mistakes in the future.

Coding standards are generally recognized as a good thing, and any tool that helps you enforce your organization's own coding conventions is certainly worthwhile. While many coding best practices focus on making your code more readable and easier to maintain, FindBugs has a very different focus: finding nasty bugs and subtle errors that will crash your application, often at the worst possible time.

This article briefly introduces FindBugs, showing in particular how to use it in Eclipse, and then demonstrates its features with a few examples.

What You Need
Java 5
Lots of memory (at least 512MB are recommended)

  Next Page: Using FindBugs
Page 1: IntroductionPage 3: FindBugs in Practice: Beyond Checkstyle and PMD
Page 2: Using FindBugsPage 4: FindBugs in the Build Process
Please rate this item (5=best)
 1  2  3  4  5
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs