The end of GSoC 2013

This is a status update for my Google Summer of Code 2013 project - implementing advanced statistics importers for Amarok. Please read the first post if you would like to know more about the project.

So here came the end of Google Summer of Code 2013. It's the best moment to talk about what has been planned, what was done, and - traditionally - what the future holds. Oh, and let's get some stats and pictures (because that's what we're here for)!

Plans

I planned to:

  • rewrite following statistics importers based on the existing StatSyncing framework:
    • Amarok 1.4 (FastForward)
    • Apple iTunes
  • create new statistics importers for the following media players:
    • Amarok 2.x
    • Rhythmbox
  • soft goal two-way synchronization for created importers (I guess I shouldn't call them "importers" anymore, but something like "synchronization targets" just sounds too unwieldy)
  • softer goal write tests for created importers
  • side goal make new importers easy to write.

Reality

We all know that thing about plans and reality in software development, right?

©2005 Paragon Innovations, Inc. I promised you pictures.
©2005 Paragon Innovations, Inc. I promised you pictures.

So let's recap what I've done:

  • I created a framework for importers that takes care of managing them, loading and saving their configuration
    • the consequence is that a user can create, remove, reconfigure new importers on a whim
    • programmer can also make as many configuration options as he wants and store as much state in the importer as needed
  • I created following statistics importer types, loadable as plugins:
    • Amarok 1.4
    • Amarok 2.4
    • Apple iTunes
    • Banshee
    • Clementine
    • Rhythmbox
  • ...and I implemented two-way synchronization for each of them
  • I wrote tests for every importer and all parts of the framework (except for one helper, as it's destined to be removed)
  • I made new importers very easy to create - and they automatically gain all goodies from the framework.

Please take a look at earlier posts if you're interested in pictures - I didn't want to overload this one with duplicates.

Statistics

Let's get the total number of changes reported by git:

konrad@KonPC-Linux ~/kde/src/amarok $ git log a214c0a2^..HEAD --shortstat \
    | grep -E "file(s)? changed" \
    | awk '{inserted+=$4; deleted+=$6} END \
        {print "lines inserted:", inserted, "lines deleted:", deleted}'
lines inserted: 21529 lines deleted: 10225

That's a nice number of changes. Here's what it actually sums up to:

konrad@KonPC-Linux ~/kde/src/amarok $ git diff a214c0a2^ HEAD --shortstat
 303 files changed, 13519 insertions(+), 2257 deletions(-)

The difference between these numbers tells us a story: at least about ⅖ of the code I wrote was removed afterwards through heavy refactoring. (Alright, maybe this wasn't much of a story.) In other words I not only overshot my initial plans, I was also making sure I'm doing it with style. ;) Of course the numbers take into account only the changes that were finally committed - there were a lot more in between.

Let's make some code size comparisons between old and new importers.

I really wanted some graphs in this post.
I really wanted some graphs in this post.

As you can see, the numbers are similar. Rhythmbox and iTunes importers are made bigger by XML-processing code (oh how I hate it), and Amarok 2.x and FastForward importers by custom, rich configuration widgets. The simplest importers, Clementine and Banshee, are small and pretty.

Oh, but that's not the whole story here, is it? All of the new importers also contain write capabilities - they can sync the statistics back to the foreign media player. Without it a new importer can easily fit inside 100 lines, as demonstrated in one of my previous posts. Mission accomplished.

As an aside, I find it interesting to note that the number of lines does translate very well into the number of characters. The average number of characters per line for measured code is 38.17, with standard deviation of 2.60 characters between files.

Oh, and I have proof that I was actually doing something during GSoC. Do take a look at this video that I made, if only for the amazing soundtrack (720p recommended). For details, please see the video's description.

The future

So, it's the end of Google Summer of Code, but it's not the end of the project nor my contribution to Amarok. Arguably the most important event in the project's lifetime - code review - still lies ahead. Not only that, but I already have some further refactorings in mind.

Other than the project, there's always a lot to do for Amarok, and the great community around it makes it hard to leave - so I'm not. There's just too much fun to be had. ;)

Well, that's it for the post. I'm going to take a few days off and then an academic term starts, and I'm back to my daytime job - I'll need some time to adjust my schedule. Thanks for sticking around. It's been - and continues to be - a pleasure!