MozCampEU2012/Make Sure Your Code Works

From MozillaWiki
Jump to: navigation, search

Make Sure Your Code Works, How to Craft Automated Tests for B2G


Facilitator(s): Henrik Skupin, Rob Wood

Are you paid or volunteer staff?: Paid

Area of Contribution (Team Name): Automation and Tools

How are you currently involved with the community?:

We help extend the automated tests for B2G and Firefox Desktop. We would like to expose this kind of work to the community for a number of reasons:

  • It would enable community contributors to be full fledged developers (every patch they write will need to have an automated test with it, so this is a necessary skill for contribution to Mozilla)
  • Writing automated tests is an excellent, simple way for people with fledgling technology skills to get involved, and get the first series of successes under their belt so that they are prepared for deeper involvement at Mozilla in general. Several of our core developers today began as volunteers writing automated tests.

Location of Work (where do you reside?): Dresden (Germany) and Toronto (Canada)

Talk Length (please choose between 30, 60, 90, 120 minutes): 90/120 minutes (we can tailor it to fit either slot)

Summary: We would want to give the participants a hands-on demo and allow them to write their own tests. Our goal at the end of the session would be to have each participant write a test and have those patches ready to land at the end of the session.

How your session furthers the MozCamp Goals (

Writing automated tests is one of the very best avenues for new developers to get involved with the Mozilla code base. It provides a simple environment where they can get up to speed quickly and make real contributions in a matter of hours rather than spending days to understand a complex problem and then craft a complex solution. Writing automated tests can be a gateway to further involvement with the Mozilla project, and by writing automated tests participants in the session are actively making the B2G offering better during their session. This gives them a concrete task they can accomplish and it will plant the seed for further future involvement once they return home.

Expected Outcome or Deliverable:

We expect each person to write an automated test by the end of the session. We will have a set of tests that need to be written already defined, we'll do a show case on how to write one of them, and we will then help the participants in a 1:1 basis to write their tests. By the end of the session we aim to have the tests written.

Desired Audience Type or Skill-set:

New developers and technically curious folks. Some JavaScript or other programming experience is nice. The tests will be written in JavaScript, so the more JS you know, the better. But the tests we will be writing will be quite elementary so a deep understanding is not required.

Equipment Needs (Video projector already included):

The included projector. A whiteboard or a giant post-it note for drawing diagrams would be useful.

Session Details

We will start the session with a short presentation of about 5-10 minutes to bring everyone up-to-speed with the test automation for B2G with Marionette. Right after there should be time for a short Q&A session before everyone will start working on the same test to implement. For those who are fast we will have one or two more tests available. We will collect final patches from everyone on Bugzilla.

You can find the slides already on slideshare:

To be prepared for the session we would advise you to download all necessary software before the session gets started. For those who will not be able to we will have USB thumb drives available where you can get the files from.

Stuff to download:

To help you with getting in touch with B2G and WebAPIs we have prepared some links which point to useful documentation about those components:


(If you would like) Submit a Question for the Speaker(s) or indicate what information you hope to gain by attending this talk here:

Place your name here if you would like to attend this talk:

  • Philipp Kewisch
  • Toni Hermoso
  • Paolo Amadini
  • Szabolcs Hubai
  • Alex Lakatos
  • <put your name here>