Code Reviews - PowerPoint PPT Presentation

About This Presentation
Title:

Code Reviews

Description:

Fundamentals of Software Development 1. Slide 1. Code Reviews. What are they? Why do them? Fundamentals of Software Development 1. Slide 2. What are Code Reviews ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 7
Provided by: davidmutch
Category:
Tags: code | reviews | software

less

Transcript and Presenter's Notes

Title: Code Reviews


1
Code Reviews
  • What are they?
  • Why do them?

2
What are Code Reviews
  • Other team members read code before it is added
    to the project to look for
  • Logical correctness
  • For example a ball is destroyed from view but
    still lives
  • Code conventions
  • public class myfavoriteclass .
  • Code readability
  • if (igt0) ii else i-i
  • Graceful error handling
  • For example the ball to be destroyed does not
    exist
  • Performance
  • half i0.5 or half i/2
  • Many others

3
Why perform Code Reviews
  • Help save time and money and increase
    reliability
  • Identifies problems early
  • So they are easier to fix
  • Helps new software developers integrate into the
    team
  • Understand the system
  • Learn from others
  • Facilitates teamwork
  • Helps team communication and awareness
  • Produces better code
  • More logically correct
  • Follow code conventions
  • Easier to read and maintain

4
Example Code from Bouncer
  • public void act()
  • super.act()
  • Point2D myPoint new Point2D.Double(this.xloc,thi
    s.yloc)
  • if (!this.myManager.isTrue1(myPoint))
  • int i this.XV/(-1)
  • this.XV i
  • if (!this.myManager.isTrue2(myPoint))
  • int i this.YV/(-1)
  • this.YV i

5
Example Code from Bouncer
Indent properly!
Add comments!
  • public void act() // Overrides the supers
    act...
  • super.act() // Calls the code for same routine
    in super
  • Point2D myPoint new Point2D.Double(this.xloc,t
    his.yloc)
  • // Make it bounce in x or y direction as
    appropriate!
  • if (!this.myManager.isInsideWorldX(myPoint))
  • this.xVeloc - this.xVeloc
  • if (!this.myManager.isInsideWorldY(myPoint))
  • this.yVeloc - this.yVeloc

Use descriptive names!
Fields start with lower case (also use
descriptive names!
Simplify Logic!
6
Summary
  • Other team members check code before it is added
    to the project to look for
  • Logical correctness
  • Code conventions
  • Code readability
  • Graceful error handling
  • Performance
  • Help save time and money and increase
    reliability
  • Identifies problems early
  • Helps new software developers integrate into the
    team
  • Facilitates teamwork
  • Produces better code
Write a Comment
User Comments (0)
About PowerShow.com