CS120 LAB - Week 9 -------------------- The theme this week is working with partners! We will consider two very useful approaches: pair programming and code reviews. The intent of each is to improve software development by putting multiple pairs of eyes on all code, rather than just one. They have both been shown to improve the quality of code, greatly reducing bugs, improving efficiency and consistency of styles, etc. Here are some references for pair programming: http://en.wikipedia.org/wiki/Pair_programming http://www.extremeprogramming.org/rules/pair.html http://collaboration.csc.ncsu.edu/laurie/Papers/Kindergarten.PDF Here are some references for code reviews. Note that there are formal code reviews and "light" code reviews. These articles touch on both. http://en.wikipedia.org/wiki/Code_review http://www.owasp.org/index.php/Steps_and_Roles http://www.macadamian.com/index.php?option=com_content&task=view&id=27&Itemid=31 http://www.developer.com/java/other/article.php/3579756 http://www.possibility.com/wiki/index.php?title=CodeReviews http://www.possibility.com/wiki/index.php?title=CodeReviewResearch And some opinions about both: http://www.codinghorror.com/blog/archives/000999.html Make sure you have a partner for the current assignment and email names and email addresses to Joanne before you leave lab today! Doing a light perspective based code review now: - get in groups of 4 - decide who will be in charge of each of these perspectives: - functional requirements (normally done beforehand with unit testing) - does the program do what it is supposed to do with good input? - user interface - does I/O meet requirements? are instructions clear? is it pretty/friendly? - error handling - does the program handle errors gracefully, according to requirements? - implementation - does it meet requirements? it is reasonably efficient? - is the code well documented? is a consistent style used? - download pg2A.c from lab website - each team member should evaluate each program from their perspective, making notes about problems and improvements - each reviewer then shares evaluation with other team members, soliciting additional feeback - one report should be generated with complete notes for each perspective Doing a quick line code review now: - stay in same group - download pg2B.c from lab website - do a round robin line by line reading and review of main: - consider variable naming and usage - consider function naming and usage - is overall structure and design of solution acceptable? - if time, do a line by line reading for each other function: - it is clear what each line does? - does the function appear to do what it claims? - what corrections and improvements are needed?