← Back to team overview

launchpad-dev team mailing list archive

Phasing in the Architecture Design Metrics into our reviews

 

Hi all,

A (good) while back Robert released his Architecture Guide[1] for Launchpad.  At the end is a section called "Design Metrics".  The reviewer team was asked to start incorporating aspects of the design metrics into our reviews to both screen incoming code for adherence to these metrics and to inculcate into the developers and reviewers the traits we want to see in our code base.

As you know, delivering the document and saying "Here, start including all of these things in your reviews" didn't work so well.  Everyone was open to the idea but it was too many things thrown in at once.

So at Maris' suggestion we're going to phase in one metric at a time.  We'll introduce one metric and ask all reviewers to concentrate on it during their reviews for that time period, and then add another metric for concentration.  Of course, the traits will be cumulative as they become part of your reviewer fiber.  :)

The first design metric to incorporate is Testing Performance:

"Tests for a class should complete in under 2 seconds. If they aren't, spend at least a little time determining why."

To incorporate this metric into your reviews you'll obviously need to run the tests.  If a test is brand new then you can just evaluate the timing.  Modifications to existing tests should be compared with before and after timings.  So reviewers, either download the code being reviewed and run the tests yourself or ask the developer for comparative timings.  Start the conversation.

The first time I paid attention to timing on new tests I found a simple test I'd written was incredibly slow.  Doing some simple, though non-obvious, refactoring led to a test that was several times faster.  I wrote a blog[2] post about the experience which appeared on the Launchpad planet.

We need to share techniques that we find to speed up tests.  For instance, I discovered using views is many times faster than using a browser object.

Remember the metrics in that guide are guidelines.  Two seconds is a worthy goal but not written in stone.  If you think something in the document should be changed either do it or add a comment at the bottom of the document.

We'll concentrate on this one metric for three weeks starting today.  Keep some notes so we can have a discussion next week in our meeting to gauge the success of the first week.

--Brad


[1] https://dev.launchpad.net/ArchitectureGuide
[2] http://bradcrittenden.net/post/1319374106/testing-explicit-vs-fast-er


Follow ups