Defect Tracking, Coding Standards, Reviews - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Defect Tracking, Coding Standards, Reviews

Description:

You can't control what you can't measure. - Tom Demarco. How do we know what ... Jalopy. Eclipse. Coming Up... Java 1.5 New Features. Java Streams/Serialization ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 23
Provided by: Robert9
Category:

less

Transcript and Presenter's Notes

Title: Defect Tracking, Coding Standards, Reviews


1
Defect Tracking, Coding Standards, Reviews
  • CS2335
  • Spring 2006

2
Agenda
  • Review
  • Defect Tracking
  • Coding Standards
  • Code Reviews

3
Measurement for Improvement
You cant control what you cant measure. -
Tom Demarco
In God we trust, all others send data - Edward
Deming
How do we know what to fix?
If you dont know where you are Going, any map
will do. If you dont know where you are, A map
wont help. -- Watts Humphreys
4
Defect Tracking
Defect Log Date Phase (Analysis, Design,
Coding, Test) Type Category Description Ig
nore Cascading Failures
5
Defect Categories
  • 10 Documentation problem
  • 20 Syntax
  • 30 Build
  • 40 Assignment
  • 50 Interface
  • 60 Error Handling
  • 70 Data
  • 80 Function
  • 90 System
  • 100 Environment

6
Aggregated Defect Log
Lab 3, Sig Manager Deluxe 10 Incorrect
Comments Code Standard Violations
20 Missing Semicolons Misspelled
variable names 30 Make file syntax
7
Code and Customers
If we want to conform to customer expectations,
then who are the customers for our source code????
8
Code Standards
  • We write code for
  • Compiler
  • Ourselves
  • Others (Maintainers and Team Members)

9
Bad Code
X X XX XXX A ST(A) X X LF(X1,X)
XXX X X I(X1,X)
10
Better Code
Balance Balance LastPayment MonthlyTotal
NewPurchase
SalesTax(NewPurchase) Balance Balance
LateFee(CustomerID, Balance)
MonthlyTotal Balance Balance
Interest(CustomerID,Balance)
11
Code Standards Guide
1. Adhere to original style
2. Principle of Least Astonishment
3. Do it right the first time
4. Document Deviations
5. Indent nested code
6. Break Long Lines
7. Include Whitespace
8. Avoid Hard Tabs
9. Use Good Meaningful Names
See Sun Web site and EJS
12
Code Reviews
  • Formal or Informal
  • Find Errors in Style and Logic
  • Research -gt 50-90 of code defects
  • Roles
  • Reader
  • Moderator
  • Recorder
  • Use Checklist
  • Critique Code, NOT Coder
  • Preparation

13
Checklist (Classes)
  • Is the class name appropriate?
  • Could it be abstract?
  • Does the header describe its purpose?
  • Does the header reference reqmnts/ design?
  • Does the header identify the package or
    component that the class is a part of?
  • Is it as private as it can be?
  • Should it be final, singleton or other pattern?
  • Have documentation standards been applied?

14
Checklist (Attributes)
  • Is the attribute necessary?
  • Could it be static?
  • Should it be final?
  • Are naming conventions followed?
  • Proper access control (pub,prot,priv)
  • Are attributes independent?
  • Is there a comprehensive initialization strategy?

15
Checklist (Constructors)
  • Is constructor necessary (vs. factory)?
  • Does it initialize all the attributes?
  • Is it as private as possible?
  • Does it execute the inherited constructors where
    necessary?

16
Checklist (Method Header)
  • Is the method name appropriate?
  • Is it as private as possible?
  • Should it be static?
  • Should it be final?
  • Does header describe purpose?
  • Does header ref reqmnts/design?
  • Does it state pre/post conditions?
  • Does it comply with doc standards?
  • Are parameter types restricted?

17
Checklist (Method Body)
  • Is algorithm consistent with design?
  • Does code comply with precondition?
  • Does code produce all postcondition?
  • Does every loop terminate?
  • Compliance with notation standards?
  • Braces Balanced?
  • Illegal parameter handling?
  • Return type correct?
  • Comments?
  • Side Effects?
  • Layout/Style?

18
Outputs
  • Code Review Report
  • Members (Who was there)
  • Issues (NOT SOLUTIONS!!)
  • Priorities (How important is each issue)
  • Action Plan (What you are doing about this)
  • Signatures (Admit you were there)

19
Automated Code Reviews
Checkstyle PMD
20
Remember
  • Write your code for somebody else who doesnt
    understand it, because by the time you come back
    to it, that somebody else will be you.

21
Automated Code Reviews
  • Checkstyle
  • PMD
  • Jalopy
  • Eclipse

22
Coming Up
Java 1.5 New Features
Java Streams/Serialization
Java Threads/Network Programming
Write a Comment
User Comments (0)
About PowerShow.com