New work – bigger challenges – great stuff

I am the explorer type, I like to try new stuff and if something looks promising, I am willing to take a chance. In staying true to that attitude I have given up my cool job at Canonical and joined a friend’s start-up to make the Next Big Web Thing happen. I loved being part of the team that is still making the Next Big OS Thing happen but could not let this great opportunity pass me by. I am heading the development and am already up to my head in exciting new stuff.

No more details at the moment but stay tuned here and at blog.hbble.com to find out more as things unfold.

30 September 2011 at 09:46 1 comment

setUp in unit tests: mostly harmful

While hacking on my current Launchpad bug today an anti pattern hit me again that I have been fighting for some time. Everybody knows that sample data should not be used in tests and anybody earns bonus points for removing such use from tests in the Launchpad source tree. Much less known is that the setUp method is overrated and should not be used to create sample data for a test.

This is an anti-pattern that I have stopped using some time ago but I still come across a lot in the Launchpad source code. Sample data is created in setUp as instance variables of the test case, like this one here in my current example:

def setUp(self):
    super(TestPOExportView, self).setUp()
    self.pofile = self.factory.makePOFile()
    self.potemplate = self.pofile.potemplate
    # All exports can be requested by an unprivileged user.
    self.translator = self.factory.makePerson()

Then, this sample data is used in other helper methods and the tests itself.

def test_request_format_po(self):
    # It is possible to request an export in thePO format.
    self._createView({'format': 'PO'})

    self.assertContentEqual(
    [(self.potemplate, self.pofile, TranslationFileFormat.PO)],
        get_poexportrequests(include_format=True))

This is bad for two reasons: degraded readability and lack of extensibility.

To the casual reader of this test it will not be clear, what kind of view is being created and how self.potemplate and self.pofile relate to each other and to the test. Granted, in this case it is not very hard to guess but I have seen more complicated sample data creation in setUp.

Also, when extending the test it is not possible to use _createView with a different type of POFile without touching setUp and thereby risking to break existing tests. This is actually what caused me trouble here.

I removed setUp from this test completely. The translator person was only needed when creating the view, so its creation was simply moved into _makeView. I added a parameter to _makeView to take the POFile which to create the test for. The test now looks like this:

def test_request_format_po(self):
    # It is possible to request an export in the
    # PO format.
    pofile = self.factory.makePOFile()
    self._createView(pofile, {'format': 'PO'})

    self.assertContentEqual(
      [(pofile.potemplate, pofile, TranslationFileFormat.PO)],
      get_poexportrequests(include_format=True))

You can see how much clearer this is. I admit that the setUp was so simple that in this case it could easily be replaced with a single factory call. More complex sample data call for specialized factory methods in the test case that take numerous parameters to set up the sample data in the way it is needed for the test. I usually call these methods _makeSomethingAndSomethingElse or _makeSomethingWithSomethingElse. An example can be found in the test case at hand.

The other reason for avoiding this anti-pattern is to maintain extensibility. With the pofile object not being implicitly created by setUp and used by _makeView I can now create a pofile with different parameters and pass it to the test.

def test_pochanged_option_available_ubuntu_no_upstream(self):
    # The option for partial exports is always available on a
    # source package, even if there is no upstream pofile.
    ubuntu_pofile = self.factory.makePOFile(
        side=TranslationSide.UBUNTU)
    view = self._createView(ubuntu_pofile)

    self.assertTrue(view.has_pochanged_option)

That’s all I really wanted to do when I touched this test case but the anti-pattern of using setUp to create sample data forced me to refactor the whole test case. Please be considerate of the developers coming after you and avoid this pattern. Thank you. (Did I mention that the guy who wrote this test case in the first place looks a lot like me? ;-))

Oh, and there is good use for setUp! It is the perfect place to set feature flags, like so:

def setUp(self):
    super(SomeTestCase, self).setUp()
    self.useFixture(FeatureFixture(
        {'translations.sharing_information.enabled': 'on'}))

7 April 2011 at 11:10 4 comments

Ubuntu is the readers’ choice

Linux New Media Award 2011Last Thursday I had the honour of accepting the “Linux New Media Award 2011″ in the category “Reader’s Choice – Favorite Linux” . Linux New Media is an international publisher of Linux magazines and has been giving out these awards for a number of years now. This year included a new category in which the winner was determined by the magazines’ readers voting on their favourite Linux distribution. And the winner is … Ubuntu!

Some strange circumstance put me in the spot of being at the CeBIT show in Hannover and accepting the award on behalf of the Ubuntu community. I realized that I am just a very small piece of that community which includes Canonical employees as much as the hundreds of volunteers that helped it become so popular. I made sure to mention those in my acceptance speech as well as the well-known “shoulders of giants” on which we stand. The award was presented by Kristian Kißling, chief editor of the German “Ubuntu User” magazine.

Linux Media Award 2011 - Ubuntu - Reader's Choice Favorite LinuxSo, if you are working on Ubuntu or any of the open source projects that it builds on, this is YOUR award! Congratulations and thank you very much! Well done! This award shows that we are on the right track and we should take it as an encouragement to continue to make Ubuntu shine even brighter and take it beyond the realm of the Open Source community.

Among the other recipients were our  friends from Debian which received two awards, one for “Best Server Distribution” and also the main award titled “Outstanding Contribution to Open Source / Linux / Free Software”.  The remaining categories and their winners were:

  • “Best Mobile Linux Application” – Firefox
  • “Hottest Linux Device” - Samsung Galaxy Tablet
  • “Best Open Source Solution for Cloud Computing and Virtualization” – KVM
  • “Most Innovative Open Source Project” – Btrfs – presented by Jon “maddog” Hall

As you can tell, there are still some other categories we could win prices in although only the “Outstanding Contribution” and “Most Innovative Project” ones are awarded every year.

I was thrilled to meet Jon “maddog” Hall, Klaus Knopper and Karsten Gerloff of FSFE. Here is group picture of all recipients and their presenters.

All recipients and their presenters of the Linux New Media Award 2011

© 2011Linux New Media AG

7 March 2011 at 17:55 1 comment

LinuxTag 2010

Wow, I really enjoyed LinuxTag! This time I felt part of the community more than before probably because now I have my own little place in the community. This was my third time at this conference after 2007 and 2008 and this time I stayed for three days instead of just Saturday. I spent most of my time listening to talks. Here are my personal highlights.

Thursday

On Thursday I learned a lot about Open Source business models and licensing issues. I was glad to hear that the expert that was presenting considers Canonical’s mixed business model a very effective model and that Ubuntu is an excellent example for an Open Source business. I also learned from Matthias Kirschner of FSFE that Richard Stallman invented Free Software and what the Four Freedoms with regards to software are. I had never been formally introduced to the political concept behind FOSS so I really enjoyed that.

Microsoft‘s James Utzschneider’s keynote was definitely one of the highlights of the whole conference. Now we all know that Microsoft is so much more open than what we always thought it was and that we can use Office Programs through the web for free. Microsoft had to learn here and they did but are as usual the late-comers at the party. I am not sure, though, that adhering to official standards and taking part in standardization efforts makes an open company. I still don’t understand why we need OpenXML besides OpenDocument … After all you have to give him credit for not trying to pretend: “We are not going to be able to make everbody happy all of the time, especially in this community. We are not going to say we are the most open company in the world because we are not.”

The afternoon started out with a big disappointment. There was a talk by Romain Pelisse about distributed version control systems and all he could say about Bazaar was “I don’t know a thing about bazaar except that it has a bad reputation.” Romain, seriously, if you don’t know anything then, please, don’t say anything. That is much better than spreading false rumors.

The final two talks I listened to were about web testing and some positive experiences with agile development methods.

Friday

Friday started out with a replacement talk about Green IT at Oxford University. There are many aspects of that like the reduced air conditioning in data centers (25°C is enough in the cold isle nowadays), cut backs on travel and extending hardware lifetime by proper care and repair. It was an interesting fact to note that most of the energy a computer uses in its lifetime is consumed during its production. But this talk focused on the tens of thousands of desktop at Oxford University and its associated colleges. The measure taken was to switch as many of them off at night as possible. A lot of the work here is convincing users to do it, be it standby, hibernation or really off. To facilitate backup jobs or remote on-demand access, a decentralized network  of self-developed FiDo gateways was put in place that monitors computer activity and uses wake-on-lan to switch computers on as needed. Very nifty and the software is open source.

I got to hear a talk by Dirk Hohndel. That name sounded very familiar and I wanted to see who that is. It was during the talk that I looked up his CV and found that he was co-author of the “Linux User Handbook” which I used as a ready reference in my early Linux days. He now works for Intel and his talk on MeeGo was quite interesting and the demo of the system that he gave looked quited good. There was a statement, though, that I didn’t quite know how to take: “MeeGo is not like other projects who consider themselves the center of their universe and may or may not commit back upstream.” Should I take this personal to my Ubuntu heart? ;-) By the way, MeeGo has a 6-months release cycle, too, and MeeGo 1.1 in November will support tablets.

The first keynote of the day was by Larry M. Augustin, CEO of SugarCRM. He talked about “The move to Open Source and Open Cloud” and lined out three statements. (1) Enterprise Software business model is broken, (2) Open Source has become the safe bet, (3) Cloud computing will increase Open Source usage. For that he let off a firework of charts and numbers some of which were actually interesting.

(1) Whereas healthy software companies used to spend equal parts on R&D, marketing, and sales, todays big players spend as little as 10% on R&D while the rest goes into trying to convince people to buy the product. There main business is not software development anymore but software sales. He mainly concluded that Microsoft’s business model of charging up-front for software and then trying to convince the customers to upgrade and pay for the next version is flawed. He obviously favored SugarCRM’s business model of giving the software away for free and charge for maintenance.  As I had heard elsewhere, that is not the only alternative business model but I am glad it works for him.

(2) It used to be that nobody ever got fired for buying IBM (80s) or Microsoft (90s), today nobody ever gets fired for using Open Source Software. He noted that venture capitalist are now funding Open Source Companies which to him is a major indicator that it must be a safe bet now. One of the reasons he put forward was that Open Source development encourages higher quality and quoted Linus’ Law. Big surprise.

(3) Finally he flipped some slides that showed which software is used by cloud providers and which software run by their customers. Most of them Open Source, pretty impressive. He stated that 91.5% of the systems run by users are Linux systems, no mention of Ubuntu, though.

Before his keynote, Chris DiBona of Google played with Web Seer to the enjoyment of everybody and the distraction of Larry who was still answering questions. ;-) Some interesting numbers that Chris gave at the beginning of the talk: there are 31 million Open Source projects with more than 2 Billion lines of code. They have actually crawled the repositories of the world to produce these figures. For the technically interested he also showed how Google is not using expensive server hardware but PC-class motherboards and low-end, large size storage and networking hardware. They find their reliability in software, running Linux and in-house software. He then went on to list the major Open Source projects that Google has released (total 800+, about 1-2 per week): Chrome, Android, ChromeOS, WebM and the protocols to Google Wave. The rest of the talk was about the vp8 codec which did not really interest me, so I left.

In the afternoon I listened to Lennart Pöttering’s explanation of why systemd is better than upstart. (Being better than init is not hard.) He drew quite a crowd. Systemd features parallelization (which upstart does, too), pre-creation of sockets and dbus names (copied from Apple’s launchd as he freely admits) and something about autofs which I missed.  He demoed it on his laptop and the result was indeed impressive although he had to reveal that having an SSD helps but SSDs are the future, anyway, as he put it. Lennart is pretty certain that systemd will soon be the default on all distributions except Ubuntu. Let’s not destroy his charming optimism but I think he should wait for the next Ubuntu release when upstart will make proper use of kernel events. I am a bit sad that his ideas did not simply find their way into upstart and I hear that our Contributor Agreement might have something to do with it. Oh well.

The rest of the day I strolled around the fair and talked to a few projects.

The Cream Desktop Enviroment looked really neat, nice little widgets on the desktop and a pleasing design. The main advantage is that new gadgets are very easy to write so that the environment is highly customizable. They are already talking to Gnome for cooperation but want to remain a stand-alone project.

I also looked at a green box with many network interfaces like a switch or a fire wall. Looked pretty impressive but all it does is check software versions on systems it can find on the local network and alert you if it needs upgrading. The sales guy had a hard time time explaining why it needed 8 (or even 16?) network interfaces for that. I also forgot the name of the thing or the company. Sorry but I don’t think it’s a big loss.

I chatted with an OpenOffice.org guy about document format support, vendor lock-in for Apple customers (guilty!) and the stupid new naming of StarOfice: Oracle Open Office. How insane is that? It’s OOo and OOO now? What have they been drinking? He also pointed me nicely to the help resources available so that I can use my OpenOffice.org more effectively. Thank you. ;)

The highlight for me was the c-base Open Moon project. Community into space! Yeah! Actually, it is the comoonity in this case. Nice little model of a moon rover (c-rove) that hopefully will be leaving marks on the moon by the end of 2012 to win the Google Lunar XPrice (Official Team). And if not, it is a great idea that should be pursued anyway. They can use some generous sponsors with an affinity to space travel (hint, hint ;).

Oh, and there was Amit Kucherias talk about what Linaro is and does. Unfortunately, his talk was at such a short notice and bad time slot that he mainly spoke to Canoical  people. Linaro is not a new distribution and it is not “Ubuntu on ARM”. Linaro is a pure R&D company that improves the Linux kernel, system libraries and tool chain for ARM processors. All work is contributed to the respective projects and will thus find its way back in to the products of the funders of Linaro.

Saturday

Saturday was Ubuntu day. Thorsten Franz and Timo Denissen of ubuntuusers.de presented the various ways to contribute to Ubuntu. Daniel Holbach ran the listeners through a quick bug fix, start to end, including merge proposals on Launchpad, debian packaging and the like.  The Communtu guys presented their project that makes it possible to create your own Ubuntu installation disk with pre-installed applications. It features application bundles for different usage scenarios. Quite nice!

Mark’s keynote drew the biggest crowed of the whole week. He spoke about Cadence, Quality, and Design which he thinks the community should focus their work on to get Open Source software into mainstream. He mentioned the chasm that needs to be crossed. He then went on to explain what we are planning for the next Ubuntu releases, as was already heard about at UDS. I had to leave when the questions started to prepare for my own talk but the first one was “Why did you move the min/max/close buttons to the left?” ;-)

Our presentation “Ubuntu in 50 minutes” was scheduled right after Mark’s talk but two floors up from the keynote area. We had to wait a bit for people to show up but eventually there were a few listeners. The talks went well, five people (Caspar Clemens Mierau, Daniel Holbach, Me, Michael Nelson, Benjamin Drung), 10 minutes each. It is always surprising how short 10 minutes are…

After us Amsel of the Ubuntu community presented tmux, a newer and better maintained alternative to screen. It throws of some extra weight by dropping supoprt for outdated terminal types and adds better scripting support. It organizes a server session into windows and panes. Looked very interesting!

Finally, Daniel gave a presentation on the usage of launchpadlib which was well done, too. He really had a busy day that day.

The day and the whole LinuxTag finished of with the Canonical-sponsered barbecue at c-base, organized by the Berlin Ubuntu community. As always, a great way to finish of a great conference and Mark even came, too. Thanks to the Berlin crew!

18 June 2010 at 18:40 Leave a comment

Somebody please explain “Evangelism”

Since UDS I have been using Chromium instead of Firefox as a browser. It also looks like it will be the default browser for UNE.

Yesterday I tried for the first time to sell something on eBay using it. Some things about the page looked odd, not really the modern ajaxy page I’d expect. I did not find a place to upload the picture and clicking on “Save Draft” also did not produce any results. I switched to Firefox and it all worked fine. What is going on here?

I found this issue on the Chromium issue tracker which looks a lot like what I was seeing. The interesting bit is in comment 5: Making Chromium pretend to be Firefox lets the page behave as expected. So it is not a matter of Chromium not being able to display the enhanced page but of eBay not issuing it to Chromium browsers. Wow!

The bug was tagged as “Evangelism” but I cannot really find a definition of the term in this context. I suspect it has something to do with Mozilla’s Technology Evangelism which sounds like a good thing at first. How can it cause bugs like that? Would somebody please care to explain?

2 June 2010 at 19:28 Leave a comment

Going to LinuxTag

Next week I will be at the LinuxTag in Berlin, Thursday to Saturday. On Saturday I will also be speaking alongside other colleagues and community members about Ubuntu. See you there!

1 June 2010 at 16:08 Leave a comment

Extended message sharing is coming

In case you saw my 5 minutes in the UDS plenary, you’ll be glad to hear that the sharing of translations between upstream projects and source packages in Launchpad is coming along nicely. It should be available within the next two Launchpad cycles (by the end of July).

That said, I do plan a vacation for July,  so keep your fingers crossed. ;-)

28 May 2010 at 23:12 Leave a comment


Ubuntu 11.10 days to go
Banner by picomol.de

Follow

Get every new post delivered to your Inbox.