{"id":1112,"date":"2010-03-14T19:09:44","date_gmt":"2010-03-15T00:09:44","guid":{"rendered":"http:\/\/mikeconley.ca\/blog\/?p=1112"},"modified":"2023-12-20T16:25:17","modified_gmt":"2023-12-20T21:25:17","slug":"lessons-from-peerscholar-an-approach-to-teaching-code-review","status":"publish","type":"post","link":"https:\/\/mikeconley.ca\/blog\/2010\/03\/14\/lessons-from-peerscholar-an-approach-to-teaching-code-review\/","title":{"rendered":"Lessons from peerScholar:  An Approach to Teaching Code Review"},"content":{"rendered":"<h4>We Don&#8217;t Know How To Teach Code Review<\/h4>\n<p>If you go to <a href=\"http:\/\/mikeconley.ca\/blog\/2009\/09\/09\/code-reviews\/\">my very first blog post about code review<\/a>, you&#8217;ll discover what my original research question was:<\/p>\n<blockquote><p>Code reviews. They  can help make our software better. But how come I didn\u2019t learn  about them, or perform them in my undergrad courses?\u00a0 Why aren\u2019t they  taught as part of the software engineering lifecycle right from the  get-go?\u00a0 I learn about version control, but why not peer code review?\u00a0  Has it been tried in the academic setting?\u00a0 If so, why hasn\u2019t it  succeeded and become part of the general CS curriculum?\u00a0 If it hasn\u2019t  been tried, why not?\u00a0 What\u2019s the hold up?\u00a0 What\u2019s the problem?<\/p><\/blockquote>\n<p>I have mulled the question for months, and read <a href=\"http:\/\/mikeconley.ca\/blog\/2009\/09\/21\/integrating-pedagogical-code-reviews-into-a-cs-1-course-an-empirical-study\/\">several<\/a> <a href=\"http:\/\/mikeconley.ca\/blog\/2009\/09\/23\/exploring-peer-review-in-the-computer-science-classroom-part\/\">papers<\/a> <a href=\"http:\/\/mikeconley.ca\/blog\/2009\/09\/24\/exploring-peer-review-in-the-computer-science-classroom-part-2\/\">that discuss<\/a> different models for introducing code review into the classroom.<\/p>\n<p>But <em>I&#8217;m no teacher<\/em>.\u00a0 I really don&#8217;t know what it&#8217;s like to run a university level course.\u00a0 Thankfully, two course instructors from our department gave their input on the difficulty of introducing peer code review in the classroom.\u00a0 Here&#8217;s the first:<\/p>\n<blockquote><p>The problem is that is completely un-assessable. You can\u2019t get the students to hand in reports from their inspection, and grade them on it, <em>because they quickly realise it\u2019s easier to fake their reports than it is to do a real code inspection<\/em>. And the assignment never gets them to understand and internalize the real reasons for doing code inspection \u2013 here they just do it to jump through an artificial hoop set by the course instructor.<\/p>\n<p><em>What we really need to do is to assess code quality<\/em>, and let them figure out for themselves how the various tools we show them (e.g. test-case first, code inspection, etc) will help them achieve that quality. Better still, we give them ways of measuring directly how the various tools they use affect code quality for each assignment. But I haven\u2019t thought enough yet about how to achieve this.<\/p>\n<p>So, I\u2019ve long since dropped the idea of a specific marked assignment on code inspections, but still teach inspection in all of my SE courses. I need to find a way to teach it so that the students themselves understand why it\u2019s so useful.<\/p>\n<p>(From <a href=\"http:\/\/www.easterbrook.ca\/steve\/\">Steve Easterbrook<\/a>, commenting on <a href=\"http:\/\/mikeconley.ca\/blog\/2009\/09\/13\/do-peer-code-reviews-seem-incompatible-with-the-traditional-classroom\/#comments\">this post<\/a>)<\/p><\/blockquote>\n<p>And here&#8217;s the second:<\/p>\n<blockquote><p>1. How many different tasks can we ask students to do on a 3-week assignment? I think students should learn to use an IDE, a debugger, version control, and a ticket system. <em>We have been successful in getting students to use version control because that\u2019s the only way they can submit an assignment.<\/em> We have had mixed success getting students to use IDE\u2019s and debuggers, partly because it is hard to assign marks for their use. We have been even less successful in convincing students to use tickets because a 3-week assignment isn\u2019t big enough or long enough to make tickets essential.<\/p>\n<p>2. If the focus of my course is teaching operating systems, how much time (and grades) should I devote to software development tools and practices that aren\u2019t centered on operating systems?<\/p>\n<p>(From <a href=\"http:\/\/www.cs.toronto.edu\/~reid\/\">Karen Reid<\/a>, commenting on <a href=\"http:\/\/mikeconley.ca\/blog\/2009\/10\/05\/research-question-idea-2\/\">this post<\/a>)<\/p><\/blockquote>\n<p>All of this swirls around a possible answer that <a href=\"http:\/\/www.third-bit.com\">Greg Wilson<\/a> and I have been approaching since September:<\/p>\n<p><em>What if peer code review isn&#8217;t taught in undergraduate courses because we just don&#8217;t know how to teach it?\u00a0 We don&#8217;t know how to fit it in to a curriculum that&#8217;s already packed to the brim.\u00a0 We don&#8217;t know how to get students to take it seriously.\u00a0 We don&#8217;t know if there&#8217;s pedagogical value, let alone how to show such value to the students. <\/em><\/p>\n<p>If that&#8217;s really the problem&#8230; Greg and I may have come up with a possible solution.<\/p>\n<h4>But First, Some Background<\/h4>\n<p>In 2008, <a href=\"http:\/\/www.utsc.utoronto.ca\/~joordens\/\">Steve Joordens<\/a> and <a href=\"http:\/\/www.utsc.utoronto.ca\/~psych\/students\/pare.html\">Dwayne Pare<\/a> published <a href=\"http:\/\/absurdium.utsc.utoronto.ca\/peerScholar\/peerScholar_site\/Publications\/Peering%20into%20large%20lectures_examining%20peer%20and%20expert%20mark%20agreement%20using%20peerScholar,%20an%20on%20line%20peer%20assessment%20tool.pdf\">Peering into Large Lectures:\u00a0 Examining Peer and Expert Mark Agreement Using peerScholar, an Online Peer Assessment Tool<\/a>.<\/p>\n<p>It&#8217;s a good read, but in the interests of brevity, I&#8217;ll break it down for you:<\/p>\n<ol>\n<li>Joordens and Pare are both at the University of Toronto Scarborough, in the Psych Department<\/li>\n<li>Psych classes (especially for the first year) are large.\u00a0 For large classes, it is generally difficult to introduce writing assignments simply due to the sheer volume of writing that would need to be marked by the TAs.\u00a0 Alternatives (like multiple-choice tests) are often used to counteract this.<\/li>\n<li>But writing is important.<\/li>\n<li>The idea:\u00a0 what if we let students grade one another?\u00a0 There&#8217;s <a href=\"http:\/\/www.eric.ed.gov\/ERICWebPortal\/custom\/portlets\/recordDetails\/detailmini.jsp?_nfpb=true&amp;_&amp;ERICExtSearch_SearchValue_0=EJ403024&amp;ERICExtSearch_SearchType_0=no&amp;accno=EJ403024\">research showing the benefits of peer evaluation for writing assignments<\/a>.\u00a0 So lets see what kind of grades peers give to one another.<\/li>\n<li>A tool is built (<a href=\"http:\/\/www.peerscholar.com\/\">peerScholar<\/a>), and an experiment is run:\u00a0 after submitting their writing assignments, show students 5 submissions from other students, and have them grade the work (with specific grading instructions from the instructor).\u00a0 Then, compare the grades that the students gave with grades from the TAs.<\/li>\n<li>A significant positive correlation was found between averaged TA marks and average peer marks.\u00a0 More statistical analysis shows that <em>there is no significant difference between the agreement levels of TA and peer markers.<\/em><\/li>\n<li>To ensure repeatability, a second experiment is run &#8211; similar to the first.\u00a0 Except, this time, students who receive the marks from their peers are able to &#8220;mark the marker&#8221; and flag any marks that seem suspicious (a 1\/10, for example, if all the other students and the TA gave something closer to a 7\/10).<\/li>\n<li>It looks good &#8211; numbers were closer this time.<\/li>\n<li>Conclusion:\u00a0 the average grade grade given by a set of peer markers was similar to the grade given by the TAs in terms of overall level and rank ordering of assignments.<\/li>\n<\/ol>\n<p>This is a very interesting result.\u00a0 Why can&#8217;t we apply it to courses in a computer science department?\u00a0 What if students started marking each others code?<\/p>\n<p>What they&#8217;d be doing would be called <em>code review.<\/em><\/p>\n<h4>The Idea<\/h4>\n<p>Let&#8217;s modify Joorden and Pare&#8217;s model a little bit.<\/p>\n<p>Let&#8217;s say I&#8217;m teaching an undergraduate computer science course where students tend to do quite a bit of coding.\u00a0 Traditionally, source code written by students would be collected through <a href=\"http:\/\/www.markusproject.org\">some mechanism or another<\/a>, be marked by TAs, and then be returned to students after a few weeks.<\/p>\n<p>What if, after all of the submissions have been collected, each student must anonymously grade 5 submissions, chosen randomly from the system (with the only stipulation that students cannot grade their own work).<\/p>\n<p>But here&#8217;s the twist:<\/p>\n<p>Instead of just calculating a mark for students based on the peer reviews that they <em>get<\/em>, how about we mark the students based on the reviews that they <em>give<\/em> &#8211; specifically, based on how close they are to generating the same marks that the TAs give?<\/p>\n<p>So now a students mark will be partially based on how well they are able to review code.<\/p>\n<h4>Questions \/ Answers (or Concerns \/ Freebies)<\/h4>\n<p>I can think of a few initial concerns with this idea.<\/p>\n<p><strong>Q:<\/strong> What if the TA makes a huge mistake, or makes an oversight?\u00a0 They&#8217;re not infallible.\u00a0 How can students possibly make the same mistake \/ give the same mark?<\/p>\n<p><strong>A:<\/strong> I agree that TAs are not infallible.\u00a0 Nobody is.\u00a0 However, if a TA gives a submission a 3\/10, and the rest of the students give 9\/10&#8217;s, this is useful information.\u00a0 It either means that the TA missed something, or might signal that the students in general have not learned something crucial.\u00a0 In either case, this sort of problem can be easily detected, and sorted out via human intervention.<\/p>\n<p><strong>Q: <\/strong> What if students game the system by just giving their peers all 10\/10&#8217;s, or try to screw each other by just giving 0\/10&#8217;s?<\/p>\n<p><strong>A:<\/strong> Remember, students are being marked on their ability to review.\u00a0 If the TAs gave a more appropriate mark, and a student starts behaving as above, they&#8217;re going to get a poor reviewing mark.\u00a0 No harm done to the reviewee.<\/p>\n<p><strong>Q:<\/strong> I&#8217;m already swamped.\u00a0 How can I cram a system like this into my course?<\/p>\n<p><strong>A:<\/strong> I&#8217;m one of the developers on <a href=\"http:\/\/www.markusproject.org\">MarkUs<\/a>, a tool that is being used to grade source code for students at the University of Toronto and the University of Waterloo.\u00a0 It would not be impossible to adapt MarkUs to follow this model.\u00a0 Through MarkUs, a lot of this idea can be automated.\u00a0 Besides some possible human intervention for edge cases, I don&#8217;t see there being a whole lot of course-admin overhead to get this sort of thing going.\u00a0 But it <em>does<\/em> mean a little bit more work for students who have to review the code.<\/p>\n<p><strong>Q:<\/strong> This is nice in theory, but is there any real <em>pedagogical<\/em> value in this?\u00a0 And if so, how can I show it to my students?<\/p>\n<p><strong>A: <\/strong>First off, as a recent undergraduate student at UofT, I must say <a href=\"http:\/\/mikeconley.ca\/blog\/2009\/09\/13\/do-peer-code-reviews-seem-incompatible-with-the-traditional-classroom\/\">how rare it is to be given the opportunity to read another student&#8217;s code<\/a>.\u00a0 It just doesn&#8217;t happen much.\u00a0 I would have found it interesting &#8211; I&#8217;d be able to see the techniques that my peers employed to solve the same problems that I was trying to solve.\u00a0 It would give me a good informal measuring stick to see how I rank in the class &#8211; <strong>and students always want to know how they rank in the class<\/strong>.<\/p>\n<p>Would they learn anything from it though?<\/p>\n<p>That&#8217;s a good question.\u00a0 Would students learn anything from this, and realize the benefits?\u00a0 Remember &#8211; that&#8217;s what Steve Easterbrook says was the major stumbling block to introducing peer review&#8230;we have to show them that it&#8217;s useful.<\/p>\n<h4>The Questions<\/h4>\n<ul>\n<li>How good are students at grading their peers?\u00a0 How close to they get to the grades that a TA would give?\n<ul>\n<li>By study year<\/li>\n<li>By their perceived programming ability<\/li>\n<li>By their perceived programming experience<\/li>\n<li>By their programming confidence<\/li>\n<\/ul>\n<\/li>\n<li>What happens to students&#8217; ability to review their peers as they perform each review?\u00a0 Do they get better after each one?\u00a0 And is there a point where their accuracy gets poorer from fatigue?<\/li>\n<li>How many student reviewers are needed to approximate the grade that a TA would give?<\/li>\n<li>How long do students generally take to peer review code? (bonus)<\/li>\n<li>How long do graduate students generally take to mark an assignment? (bonus)<\/li>\n<li>Do the students actually learn anything from the process?<\/li>\n<li>How do the students feel about being graded on their ability to review?\n<ul>\n<li>Do they think that this process is fair?<\/li>\n<li>Do they think that they&#8217;re learning anything useful?<\/li>\n<li>Do they feel like it is worth their time?<\/li>\n<li>Do they enjoy reading other students&#8217; code?<\/li>\n<li>If it was introduced into their classes, how would they feel?<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Lots of questions.\u00a0 Luckily, it just so happens that <a href=\"http:\/\/imgs.xkcd.com\/store\/imgs\/stand_back_square_0.png\">I&#8217;m a  scientist<\/a>.<\/p>\n<h4>The Experiment<\/h4>\n<p>First, I mock up (or procure) 10 submissions for a programming assignment that our undergraduates might write.<\/p>\n<p>I then get\/convince some graduate students to grade those 10 submissions to the best of their ability, using MarkUs.\u00a0 These marks are recorded.<\/p>\n<p>I then take a cross-section of our undergraduate student body, and (after a brief survey to determine their opinions of their coding experience\/confidence), I get the students to peer review and grade those 10 submissions.\u00a0 They will be told that their goal is to try to give the same type of marks that a graduate student TA might give.<\/p>\n<p>After the grades are recorded, I take the submission that they reviewed first, and get them to grade it again.\u00a0 Do they get closer to the TAs mark than their first attempt?<\/p>\n<p>Students are then given a second survey (probably Likert scales) to assess their opinions on the process.\u00a0 Would it be fair if their ability to grade was part of their mark?\u00a0 Did you get anything useful out of this?\u00a0 Did you feel that it was worth your time?\u00a0 Did you enjoy reading other students&#8217; code?\u00a0 How would you feel if it was part of your class?\u00a0 &#8230;<\/p>\n<p>The final survey will (hopefully) knock out the last series of questions in my list.\u00a0 Timing information recorded during marking will help answer the bonus questions.\u00a0 Analysis of the marks that the students give in relation to the marks that the TA give will hopefully help answer the rest.<\/p>\n<h4>What Am I Missing?<\/h4>\n<p>Am I missing anything here?\u00a0 Is there a gaping hole in my thinking somewhere?\u00a0 Would this be a good, interesting experiment to run?\u00a0 For those who teach&#8230;if my results are encouraging, would you ever try implementing this in your classroom?<\/p>\n<p>And if this <em>was <\/em>introduced into the classroom&#8230;what would happen to student learning?\u00a0 What would happen to marks?\u00a0 How would instructors like it?<\/p>\n<p>So, what do you think?\u00a0 I&#8217;m all ears.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We Don&#8217;t Know How To Teach Code Review If you go to my very first blog post about code review, you&#8217;ll discover what my original research question was: Code reviews. They can help make our software better. But how come I didn\u2019t learn about them, or perform them in my undergrad courses?\u00a0 Why aren\u2019t they [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[454,626],"tags":[501,641,496,643,494,642,503,640,644],"class_list":["post-1112","post","type-post","status-publish","format-standard","hentry","category-code-reviews","category-research-computer-science-technology","tag-code-review","tag-dwayne-pare","tag-experiment","tag-pedagogy","tag-peer-review","tag-peerscholar","tag-research","tag-steve-joordens","tag-teaching-code-review"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/prmTy-hW","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/1112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/comments?post=1112"}],"version-history":[{"count":21,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/1112\/revisions"}],"predecessor-version":[{"id":3182,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/1112\/revisions\/3182"}],"wp:attachment":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/media?parent=1112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/categories?post=1112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/tags?post=1112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}