Better Software - April 2008 - (Page 34) Figure 5: A demonstration of the power of a problem domain-specific querying language pAge rAnking stAtic code revieWs Static code analysis is the reviewing of source code offline for bug patterns otherwise known as anti-patterns. Tools such as PMD and Findbugs (see the StickyNotes for links) are effective in finding common defects such as unsafe practices and unduly complex or dense code regions. For example, a common bad practice in Java is checking for string equality when one of the string objects may be null. If you call equalsIgnoreCase on a string object, it may throw an exception, as the following code snippet illustrates: String notGood notGood=null; notGood if (notGood.equalsIgnoreCase(“testValue”)){ System.out.println(“Matches”); } A better coding pattern is to place the constant string first: “testValue”.equalsIgnoreCase(notGood) This statement returns false instead of interrupting the smooth execution of the program. Key problems with static code analysis include “finding” a bug that isn’t there and differentiating trivial and critical mistakes. This is a pity, as one would assume that static code analysis and bug density would be logical ways to rank source code by quality. Another weighting factor for quality is the density and code coverage of related documentation and comments. For example, one would consider Java code that has a decent proportion of relevant Javadoc comments to be of higher quality than the same code without comments. If source code search engines are to be used to automatically measure the quality of a product before making buying decisions, then pageranking manipulation to improve search positioning will generate enhanced recognition. If improving ranking involves removing perceived defect densities found during static code reviews, then search engines will push quality upward. 34 BETTER SOFTWARE APRIL 2008 www.StickyMinds.com http://www.StickyMinds.com
Table of Contents Feed for the Digital Edition of Better Software - April 2008 Better Software - April 2008 Contents Mark Your Calendar Contributions eLightenment Technology Speaking - A Change Would Do You Good Code Craft - A "D" In Programming, Part 1 Test Connection - Learning the Hardware Lessons Management Chronicles - The Art of Persuading Management Cover Story - Incremental and Iterative Development Developers...Start Your Engines Where Do I Go From Here Product Announcements 10 Things You Might Not Know About... The Last Word - Software Quality and the Prisoner's Dilemma Ad Index Better Software - April 2008 Better Software - April 2008 - (Page Intro) Better Software - April 2008 - Better Software - April 2008 (Page Cover1) Better Software - April 2008 - Better Software - April 2008 (Page Cover2) Better Software - April 2008 - Better Software - April 2008 (Page 1) Better Software - April 2008 - Better Software - April 2008 (Page 2) Better Software - April 2008 - Contents (Page 3) Better Software - April 2008 - Mark Your Calendar (Page 4) Better Software - April 2008 - Mark Your Calendar (Page 5) Better Software - April 2008 - Contributions (Page 6) Better Software - April 2008 - Contributions (Page 7) Better Software - April 2008 - eLightenment (Page 8) Better Software - April 2008 - eLightenment (Page 9) Better Software - April 2008 - eLightenment (Page 10) Better Software - April 2008 - eLightenment (Page 11) Better Software - April 2008 - eLightenment (Page 12) Better Software - April 2008 - Technology Speaking - A Change Would Do You Good (Page 13) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 14) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 15) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 16) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 17) Better Software - April 2008 - Test Connection - Learning the Hardware Lessons (Page 18) Better Software - April 2008 - Test Connection - Learning the Hardware Lessons (Page 19) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 20) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 21) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 22) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 23) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 24) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 25) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 26) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 27) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 28) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 29) Better Software - April 2008 - Developers...Start Your Engines (Page 30) Better Software - April 2008 - Developers...Start Your Engines (Page 31) Better Software - April 2008 - Developers...Start Your Engines (Page 32) Better Software - April 2008 - Developers...Start Your Engines (Page 33) Better Software - April 2008 - Developers...Start Your Engines (Page 34) Better Software - April 2008 - Developers...Start Your Engines (Page 35) Better Software - April 2008 - Where Do I Go From Here (Page 36) Better Software - April 2008 - Where Do I Go From Here (Page 37) Better Software - April 2008 - Where Do I Go From Here (Page 38) Better Software - April 2008 - Where Do I Go From Here (Page 39) Better Software - April 2008 - Where Do I Go From Here (Page 40) Better Software - April 2008 - Where Do I Go From Here (Page 41) Better Software - April 2008 - Where Do I Go From Here (Page 42) Better Software - April 2008 - Product Announcements (Page 43) Better Software - April 2008 - Product Announcements (Page 44) Better Software - April 2008 - Product Announcements (Page 45) Better Software - April 2008 - 10 Things You Might Not Know About... (Page 46) Better Software - April 2008 - The Last Word - Software Quality and the Prisoner's Dilemma (Page 47) Better Software - April 2008 - Ad Index (Page 48) Better Software - April 2008 - Ad Index (Page Cover3) Better Software - April 2008 - Ad Index (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.