Friday, February 02, 2007

Bug Patterns:

While developing web applications there are few common errors that get reported again & again.We don't usually document these.I thought it will be very useful if we can document these after consolidating from the existing bug reports. So here I am trying capture few.

I am sure it will be helpful for new developers to reduce the bug count in their web related projects. I will be updating this list whenever I come across new common mistakes. So keep checking this blog for latest updates :-)

UI Bug Patterns:
  1. Handle the date display format @ common place, there is great possibilityto change here.
  2. Screen resolution/Browser Compatibility issues (Make sure these are part of NFR) should be tracked well.
  3. Make sure about UI issues while taking off the shelf tag libraries (For example tag libraries dsiplay tag, struts-menu comes with good CSS support)
  4. "Enter" key should work for search screens (Use java script), Struts submit won't work most of the times
  5. Session clearing issues- (Use case dependency, back button), Test all the scenarios by pressing the back button & clicking on the links/buttons.
  6. Horizontal scroll bar appearence (Look for fields that accepts more than 80 chanracters) Look into IFrame, Frame and <div> tags.
  7. Wrapping of characters in the table (header & other cells) will certainly help to avoid the horizontal scrool bar but for a continous String (without any space) wrapping will no effect
  8. Placement Calender window(Any pop-up for that matter) all platforms (Mac Safari, IE behaviour), Don't include calender option below the screens with vertical scrollbar.
  9. Don't use high resolution images(for thumbnails etc...),it takes more time to load the screens
  10. Don't add all the import statements as part of the common init.jsp.
  11. Before using any variable from session check for null if you are taking care of clearing of that session variable (Ideally you should not keep variables in the session,avoid if possible)
  12. Instead of hardcoding, use context Root path in JS or JSP files, make sure to use the relative paths. Use http server to load all the static data (if possible). It will reduce the sover-all ize of EAR file to be deployed.
  13. If user provides some junk values as HTML parameters (by directly editing url in the browser, just forward to same page by validating the same.For Example: He may enter the some String for Integer ID, then expect NumberFormatException & forward it to the same page.
  14. Cache all the Combo-box related data & make sure to update cache data as well if there is seperate edit(add/update/delete) for these data.
  15. Make sure to trim the input data while reading from text area/text feild
  16. Use "value".equals(value) rather than value.equals("value") to avoid NullpointerException - This is not general rule but failrly applicable in web applications
  17. Externalize all the user visbile data into properties file even if internationalization is not required. Eclipse(or any IDE) provides easy way to refarctor for externalizing
  18. Handle duplicate submission
I am also planning to come similar kind of list for Java track as well. I am sure this would be helpful for developers/managers as checklist which can be part of defect prevention activity.
Bookmark and Share