$RL/pr_utilGenv12diffs/05s523asgnt3.txt - RJL050321.0045 This file and email defines a code inspection assignment which I want you to read BEFORE class Tue Mar 22, agree with partners on spliing the work in class, and complete in your $CASE/05s523/user directory ASAP thereafterxa (say, by Friday?). The assignment is modeled on an example which I completed in pr_delete.dif. The goal is to estimate the code modification workload to migrate genv12 to genv13. The commands I used to generate the .dif files are appended. The raw output of diff has a gross metric from wc, and .dif file inspection shows a partition into change-blocks of type add/delete/change prefixed by left-file line# range and suffixed by right-file line# range. (E.g. this entry in 'tail -40 pr_delete.dif': 47:141,142c159,160) Inputs to this assignment are the pr*.dif and *schema.dif files. There are four files with significant diffs from genv12 outputs: 94sbde_schema.dif, pr_dump.dif, pr_load.dif and pr_log.dif. Pr_free.c and pr_stats.c differ trivially between $RL/pr_util and the code that genv12 generates so you can ignore them. 1. Assignment 3: ---------------- All I ask you to do is what I did in pr_delete.dif, the example which I completed for pr_delete.c (details below). Copy (-r) the complete directory $RL/pr_utilGenv12diffs and divide up the work on your assigned .dif file. Each person should annotate one half of the comments and also inspect the partner's comments, then add a comment that states agreement with, or specific questions unresolved by, the partner's work. The submission may be one merged .dif file or two separate ones, depending on schedule and time (No person need wait for the partner to complete before submitting the assigned half.) Put your results in a group-readable file in $CASE/04f522/user. (and don't forget to send me email when you do.) 2. Team assignments: ------------------- Based on the size of each .dif file (see below) I've assigned a 3-person to pr_load.dif, a 2-person team to inspect pr_log.dif, and a third 2-man team to inspect both 94sbde_schema.dif and pr_dump.dif. ` 94sbde_schema.dif and pr_dump.dif: Norm Gross and Harsh Jha pr_load.dif: SBoddireddy, Sesha Malladi and Mallika Mulakaluri pr_log.dif: SFrye and KYang You are free to re-combine if mutually agreeable. The pair-programming experience (check-your-partner's-work) is to improve inspection quality. This is an important byproduct of this assignment, and can be iterated. I hope you do not need a face-to-face meeting for this. [You might want to look at Fagan's Inspection reprint handout last week for additional motivation:-)] 3. Details: -------- Copy $RL/pr_utilGenv12diffs and do 'tail -40 pr_delete.dif'a to see the list which I extracted from pr_delete.dif, into a temp file where I added a comment to each diff entry (by inspecting the corresponding code file) and then appended the commentetd block to the .dif file again.. My comments were of the form '*' for a comment change, add or del or upd for a diff of type a, d, or c, and custom comments for unique cases (e.g. a printf. or the sequence of change pairs in pr_delete.c that canceled out each other and don't add refactoring work.) One special challenge applies to pr_load and pr_log: Identify large function definition blocks that may be new in $RL/pr_util, and comment on how dependent they are on table types in the schema file. (We want to know which code blocks are independent of schema tables because they may be easier to generate (e.g., by declaring a multi-line string in quotation marks and writing it out, as in $RL/src/fprint.cc lines 308-408.) Another special challenge applied to pr_load.c: I intend to deprecate and eventually eliminate the pr_init() method, which is complex as are its calling contexts. Pr_init() is not really needed since its filelist argument contains only one file, but it cannot be removed until pr_load() is modified to do its work: finding out the pkey range that exists over the list of files passed to it. [pr_log.c also has a messy context for pr_util during replay.] This suggests that pr_init() has more sophistictaed inspection goals (WHICH I INVITE YOU ALL TO CONSIDER :-a:) Finding out pr_util's side-effects on the internal database of hcg_struct* tables and how pr_load depends on them, so pr_load() can do this extra work, if any. (Main goal of pr_init() was to make sure that pr_load() does not duplicate some table row that already appears ANYWHERE in the list of files. This list typically (and will) contain just the file that pr_load is loading. [Existing pkeys are checked by pr_load.c:pr_add(), which initializes the pkey in each pr_added table row.] 4. More details on the unix commands I used: ------------------------------------------ Below are some notes on the diff commands I executed and the findChanges.csh command I executed to extract and resort the change block entries and re-append them to the .dif file. This may be helpful to those of you not familiar with unix commands like csh, grep, and sort. mercury.cs.uml.edu(234)> lg $RL/pr_utilGenv12diffs lg $RL/pr_utilGenv12diffs total 136 drwxr-xr-x 2 lechner 04f522 4096 Mar 20 22:51 . drwxr-xr-x 25 lechner 04f522 4096 Mar 20 22:15 .. -rw-r--r-- 1 lechner fac 15936 Mar 20 22:07 94sbde_schema.dif -rwxr-xr-x 1 lechner fac 1090 Mar 20 22:51 findChanges.csh -rw-r--r-- 1 lechner fac 3612 Mar 20 22:47 pr_delete.dif -rw-r--r-- 1 lechner fac 16966 Mar 20 22:04 pr_dump.dif -rw-r--r-- 1 lechner fac 664 Mar 20 22:01 pr_free.dif -rw-r--r-- 1 lechner fac 47781 Mar 20 22:07 pr_load.dif -rw-r--r-- 1 lechner fac 28492 Mar 20 22:04 pr_log.dif -rw-r--r-- 1 lechner fac 486 Mar 20 22:10 pr_stats.dif mercury.cs.uml.edu(235)> cat $RL/pr_utilGenv12diffs/findChanges.csh cat $RL/pr_utilGenv12diffs/findChanges.csh #!/bin/csh ##findChanges.csh: grep and sort change blocks and append to $1.dif;-RJL050320 ## These commands were used to generate the initial file $1.dif in $RL: ##saturn.cs.uml.edu(88)> diff genpr_util.050316 newpr_util050316 |grep '(^diff|^Only)' ##1:diff -bitw genpr_util.050316/94sbde_schema.h newpr_util050316/94sbde_schema.h ( 367) ##368:diff -bitw genpr_util.050316/pr_delete.c newpr_util050316/pr_delete.c ( 107) ##475:diff -bitw genpr_util.050316/pr_dump.c newpr_util050316/pr_dump.c ( 348) ##823:diff -bitw genpr_util.050316/pr_free.c newpr_util050316/pr_free.c ( 20) ##843:diff -bitw genpr_util.050316/pr_load.c newpr_util050316/pr_load.c (1050) ##1893:diff -bitw genpr_util.050316/pr_log.c newpr_util050316/pr_log.c ( 812) ##2705:diff -bitw genpr_util.050316/pr_stats.c newpr_util050316/pr_stats.c ( 16) ##------------------------------------ grep '(^[0-9]*(a|c|d)[0-9]*)' $1 > $1.tmp grep '(^[0-9]*,[0-9]*(a|c|d)[0-9]*)' $1 >> $1.tmp sort -n -t: < $1.tmp >> $1 cat $1.tmp ls -alsg $1 $1.tmp echo rm $1.tmp rm $1.tmp exit