Welcome to Mozilla Science Lab's Study Group Orientation!


4.4 Code Review

As research becomes more and more powered by data and focused on data analysis, the ability to write and skillfully use code (whether in R, python, or your language of choice) to process that data is key. Documenting and vetting the code you use is a critical part of ensuring your research is reproducible by others. As genomics researcher Titus Brown says in his blog post "A few thoughts on code review of scientific code:"

“...as soon as "theory" touches "real data" there is a gulf of unknown size between the theory and the data. Code is what bridges that gap, and specifies how edge cases, weird features of the data, and unknown unknowns are handled or ignored.”

Because the outcome of your analysis is dependent on the design and performance of your code, it’s critical that your code is validated. A code review is when you allow someone who has programming expertise to read over and comment on the code you’ve written. By getting another pair of eyes on your code, you can:

  • Catch any errors or bugs, verify assumptions and logic, and get feedback to improve your documentation
  • Ensure that your code can be understood by others
  • (Eventually) minimize the amount of time you coding by participating in the collaborative development and sharing of valid code with other researchers.

The friendly, peer to peer learning environment of a Mozilla Study Group is the perfect setting for informal code review.