Posts tagged code review
I would like to share with you our internal policy we use to do Open Code Review, feel free to adjust it to your needs. I will be very glad if you share any experience, comments and thoughts you have!
Open Code Review process:
- What is needed:
- Two Moderators – one for each team to build team spirit – if team cooperates , it isn’t needed
- Moderators only guard the process, time-boxing and at the end gathering a summary, publish it on a Wiki
- Conference room booked for 1 hour (45 minutes for review, 15 minutes to summarize)
- Class source code printed out on A3 sheets (x2 sets) – less than 300 lines of source code – for largest class it will take more than one hour
- 6 attendees (conference room limit)
- We are doing review of a code and not the person who wrote that code (!)
- Attendees should play role of maintainers of the code, are they able to find and solve a bug
- Split people for two teams, each of three persons
- Attendees should focus on:
- Structure of a class
- Are there any positives? – point that hard on the beginning
- Are there any undocumented tricks / hacks?
- JavaDoc comments are adequate to what class / method is doing
- Is class intuitive to understand?
- Allow to review the source code for 45 minutes, make notes (in English is preferable)
- Moderator should help to focus on above topics – if they stuck ask about above topics
- Finish the review after 45 minutes (definitively) – cut down any following discussion
- Summarize attendees ideas for 15 minutes – prioritize them
- Make recommendation / suggestion regarding coding style for the rest of team mates
- The end:
- Moderator should write down all the suggestions, recommendations and publish them on a Wiki with the source code
- Send an e-mail to all with the summary and with the link to the Wiki page
At last I got a new task – I mean new bugs to solve 😉 Yea all were related to a print layout. Many simple text changes, it took me around half a day to solve them all. I still have some bugs to solve but first I need to investigate how they will impact application – the changes I made to layout till now were safe, they will not brake application. So it’s a bit boring but better than nothing 😀
Another thing, I started learning Google Web Toolkit – as a member of Warszawa Java User Group I have access to group’s bookshelf and free books from many publishers – you know “book for review”. Anyway I had a copy on my PC and started reading it.
In the same time when I’m reading GWT in Action I started working on Maven2 archetype to work with Google AppEngine. You can find some over the Internet but they are not really suitable to what I want. After two day I had stable environment to work with GWT and AppEngine. I’m using my good old IntelliJ IDEA instead existing plugin for Eclipse 😉
The last thing, I’ve presented my idea about Open Code Review on Design Patterns Study Group’s meeting, I explained what it’s about, how to steer the whole activity and how to solve problem with “gurus” 😀 I hope they will be able to introduce it in their teams! I’m waiting for feedback!
I was too lazy to write something interesting or even not 😉 This is over! I want to share a great idea we* introduce in our office – Open Code Review.
What’s that? It’s a quite simple process to have some fun and learn how a code should looks like. We’re spending one hour analysing and commenting a class source code from a open source project. We always have two teams (conference room doesn’t allow more 😉 ) that are working with piece of paper – yes, the source code is printed out, no IDE’s, no fancy tools support. All you have is your brain, piece of paper and a pen.
It can be a bit odd at the beginning but it gives you lot of fun, when you are able to make real comments, crossing the code and so on. The whole exercise is about building team spirit and in mean time you can grab a knowledge from more experienced collogues – knowledge spreading 😀
Till now we did two code reviews – the first one we called prototype to check if it’s make sense doing it. The second was the real exercise – with random attendees, with real code (maybe a bit to hard 😉 ), but all the reviewers were happy and they made lot of comments for future. So we have another good idea to introduce, stay tuned!
I forgot to mention that at the end all the comments and the code is put on our internal Wiki and announcement is sent to all office employees with some suggestions how to improve our work 😉
* we – I used “we” because I’m member of Architect board in the office.
I hadn’t have any particular tasks for last two days. Some minor updates to print layout – that’s it! So I had time to work with Apache Struts2 project and with Xwork project. Also I prepared another presentation from Javarsovia 2009 conference and uploaded it on beta.parleys.com.watch film Lady Macbeth now
Today we had Code Review – it was a bit to long, over three hours! Code Reviews are great if they are organized more often, but hopefully we will have another Code Review soon 😉