![]() |
|
![]() |
||||||||||
|
|
||||||||||||
|
Null-Safe ComplianceEven within a single project it is not usually practical to enforce a rule like "We must have absolutely no NPE's." We therefore need to define various levels of "Null-Safe Compliance." Developers should be able to "switch" the level of compliance they want in the build system or right in the source code. Perhaps key modules or classes can be checked strictly while other classes are barely checked at all. Over time you can increase your compliance. There are different levels of "compliance" to a "no NullPointerException guarantee." Each level is stricter but not necessarily "better." A lot of code would never need more than Level 3 to be considered very clean.
Practical application of compliance levelsThere is no reason not to acheive at least compliance Level 2. At this point you are providing the tool to your developers and in your automated build system, and at least some classes are being checked. Over time you might check more classes, especially in high-risk areas. For any serious product, especially one with long expected lifetime or high reusability, it is worthwhile to achieve Level 3 compliance. This implies that an entire package, JAR, or project is fully-documented with regard to NPE errors; typically most of the possible NPE's will have been removed. It would be reasonable for customers to demand Level 3 compliance of software they purchase as one measure of product quality. Level 4 compliance is not necessary for most internal project source code, but when a library will be "published" it becomes important. Once the code gets into the hands of another developer group who might not be at e.g. Level 2 or 3 compliance, achieving Level 4 ensures that your library is robust enough to behave properly even when abused. It would be reasonable for customers to demand Level 4 compliance for 3rd-party libraries they purchase as one measure of implementation quality. Level 5 compliance can be reserved only for the most critical of libraries. Typically it can be acheived only with "low-level" libraries that depend on none or very few other libraries, where those other libraries are already mature, well-documented, and at least mostly null-safe. It is very difficult to acheve Level 5 compliance from the "top-down," that is starting with high-level libraries and working down to core libraries. Tool Support for ComplianceNullSafe specifically supports these compliance levels. You can direct the tool to enforce a particular level on a set of code, either in an unattended build or inside Eclipse. In addition, you can get a report on which code satisfies which compliance levels so you always know exactly where you stand. |
|||||||||||
|
|
CODE COLLABORATOR | CUSTOMERS | ARTICLES & WHITE PAPERS | TRAINING & CONSULTING | COMPANY | DOWNLOAD |
|
||||||||||
SMART BEAR SOFTWARE - "All your code review are belong to us." |
||||||||||||