Code Review, SR+ … but why?

I wanted to take some time and talk about code review. Let me start of by explaining what “code review” is, or rather what it is in reference to this blog. Code review is the act of looking at someone’s code in order to evaluate it.  Code that is in review is often referred to as a patch. The purpose of the code is to fix a bug, add functionality, or improve performance. Once the patch passes review it is then staged/added to the core of the project. The reason behind the review is simple. Does the code do what it says it is supposed to do? It is important to note that every project has review requirements.  For example, the popcorn-js project I am working on has the following requirements:

  1. Ensure the code follows the style guide and is appropriate
  2. Ensure the code passes lint
  3. Ensure main tests pass on multiple browsers: test/index.html
  4. Ensure new tests were added to test the new functionality and that they pass
  5. Ensure that other tests such as parser or plugin tests that are affected by the new code also pass

Looking at these requirements a patch for the popcorn-js project has to: fix/add the functionality it is meant to fix/add, it has to include tests, and it also has to follow a style guide. If the specific patch that you are looking at is missing any of these the review simply fails. However, what happens when it passes? Lately I have been seeing short and sweet review comments: “Super Review (SR) + ” . But what does this mean exactly? Did you follow the review requirements? Do you even know they exist? When a code patch fails review the reviewer always states the reason for the failure. This is obvious since the problem has to be outlined before it can be fixed. Is it too much to expect the same type of courtesy for a passing review? After all, the way a patch was tested is significant. I am not saying that the person reviewing the patch is not to be trusted. I am however pointing out that there is merit behind doing reviews. However, if a review is not properly documented it will be unofficially re-reviewed by the person who is responsible for staging the patch. Why? Simply because the person staging/adding the new code wants to ensure that nothing broke in the process. I am aware that the person staging usually checks to ensure noting is broken but there is a major difference here. For example, looking back at  the popcorn-js project and it’s review process requirements you will notice that the project has core unit tests as well as other parser and plugin tests. Typically after something has been staged the core unit tests, including any main demos, would be run. The plugin and parser test however would not. From a release engineer’s perspective proper review documentation saves a lot of time. Let me provide an example of good review documentation based on popcorn-js’ requirements:

SR+, code looks good

No lint errors

Unit tests passing on (Vista) Firefox, Chrome and Safari

This patch affects the googleMap plugin. I verified that all unit tests/demos using this plugin work as expected on the browsers mentioned above.

Notice that I am not writing a whole paragraph. Point form notes is all you really need to let the appropriate people know what you did and why the review had passed.  I hope you keep this in mind when doing a review.

 

View all of my blogs on popcorn-js
View all of my blogs

Advertisements

Popcorn-js 0.2v Release

If you haven’t heard about popcorn-js you are seriously missing out. Some Torontonians refer to it as CP24 online but of course its much better –  it’s open-source and allows anyone to make a content driven site. [Read my last post to get a better overview]  It has been less than 6 months since the initial launch of popcorn-js and only 1 month since our decision to make it into a plug-in architecture. Yes, we revamped the entire library in just one month.

Whats Changed?

In short everything; we re-wrote the entire thing. Using a plugin architecture enables people to easily add functionality to the library. Before, in order to get new features people would have to hack the actual popcorn.js file. Now they can make their own files (plugins, parsers) and simply use them. Another advantage of this is the fact that people will no longer need to write XML, although it is still supported.  Check-out the complete changelog. Read bocoup’s blog about the design.

Another exciting addition is butter. People who don’t want to code will need “butter for their popcorn”. Butter 0.1v has just been released. It is an online tool that enables anyone to make a popcorn.js enriched webpage. You just give it a link to your video, choose your plugins, fill in the needed data and it generates a webpage for you!

Looking to get involved?

There is countless ways for people to get involved in the project including idea generation, video generation, bug filing, documentation, promotion, and of course writing code. If you want to get involved here is a list of links to get you started:

View all of my blogs on popcorn-js
View all of my blogs

Open Subtitles Design Summit – Improving popcorn-js

In my previous post I talked about the Open Subtitles Design Summit. I attended numerous sessions one of which was a discussion on how to improve popcorn-js. For those of you unfamiliar with popcorn you can read my previous blogs related to it (link at the bottom) or look at the demo.  People had many interesting ideas however, the most important is giving people the ability to add their own extensions/metadata kind of like you can get extensions for Firefox. For example is someone has a myspace account that they want to incorporate into the metadata how can they go about doing this. Do they need to rewrite our code and make additions or can they fill in a simple form and have the code generated? The answer to this is still in the discussion phase and I welcome your comments. Another game changing comment was the fact that we are making our own XML format as oppose to using a standard. With so many different media players out there doing the same thing, it is pointless for everyone to be inventing different XML formats. We should all get together and come up with a standard that can be incorporated into the W3C specification. This is a great idea that requires a lot of time and efforts.

Here is a list of the other ideas:

  • have an area where images used in the video can be displayed
  • sync multiple devices: for people who like to see the content on different devices. For example the video will play on their TV but the twitter will be displayed on their mobile phone at the correct time. (Doable?)
  • splitting things into different tracts like a twitter track or a wiki track. This way people can add their own tracks.
  • add polls and accept/display answers
  • do everything that youTube does
  • use webSRT format + custom data to streamline content

For more notes on this session check out the wiki.

View all of my blogs on popcorn-js

View all of my blogs

Popcorn-js 0.1v Release

On April 24, 2010 i attended Drumbeat, a Mozilla initiative aimed at gathering creative people around big ideas and practical projects that will improve the Open Web. One of the projects that rose from this initiative is WebMadeMovies – an innovation lab transforming the way we create and experience video on the web. With the announcement of HTML5 and the new <video> <audio> and <canvas> tags came a whole new era for web users. However, in order for users and developers to benefit from these new tags – without having to study them that it – easy use tools have to be made available.  If you have read my blog before, you would know that I am currently working on a project that allows 2D and 3D visualizations via the <canvas> element called processing-js. Now, I am pleased to announce the start of a new project specifically made for WebMadeMovies. The project is called popcorn-js and its aim is to allow movie-makers to work and share their stories online. Because the project in still in its infant stage it is hard to say which direction it will go but one thing is for sure: it will be open-source.

To get some hype and spread the word about popcorn-js, the popcorn team has released a working demo. I know what you are thinking, it looks awesome but what am i looking at? Let me take some time to explain. The one sentence answer is popcorn-js displays meta data that was added to the video via a separate XML file. So if a filmmaker wants to share a video and emphasize some important points like featured people, news stories about the topic,  background information, or even the current location they can do so by following an XML structure.  The XML structure has not been finalized. We are currently working on a way to make it easy and quick to write and even discussing the possibility of  giving the user the ability of exporting information from Final Cut Pro.

If you are interested in using popcorn-js to enhance your own video here is how to do it:

  • download the source files from GitHub
  • edit the webmademovies.xml file found in the xml folder
  • edit the <video> tag in the index.html so that it links to your video. Note the video can be already online or in a directory
  • launch index.html and see the magic happen

Whats next for popcorn-js

We are currently looking for ideas for new demos. Some ideas include blurring parts of the video on mouse-over, editing the video online, and making the actual video spin. We are also discussing turning popcorn-js into a video library similar to processing-js that will enable video interaction and manipulation.

Looking to get involved?

There is countless ways for people to get involved in the project including idea generation, video generation, bug filing, documentation, promotion, and of course writing code. If you want to get involved here is a list of links to get you started:

View all of my blogs on popcorn-js
View all of my blogs