Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

11.3. FindBugs

We’ve written our code. We’ve written a lot of tests for that code. If we are developing as part of a team,[50] we’ve had at least one other member of the team review the code and the tests, which has led to some changes in both the code and the tests. Having gone through all that, we can be sure that our code is bug-free, right?

[50] Really thorough code reviews, in which someone else reads your code carefully to find problems, are the best way I know to do early bug detection. But they are rarely done. This is partly because they take a lot of time to do well, but I think it is mainly because most programmers are a bit afraid of having someone else review their source. We as a profession need to get over this reluctance; if you don’t want someone to read your code, then write it so you do. If someone else shouldn’t read it, why should someone else use it?

Unfortunately, no. No matter how careful we are, there is always some bug that has made it through our scrutiny, slipped by the tests, and gone unnoticed by our reviewers. So we should be on the lookout for any tool that attempts to help us find the bugs that might otherwise get away.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial