MozCampEU2012/Make Sure Your Code Works
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 (https://wiki.mozilla.org/MozCampEU2012/Tracks):
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:
Equipment Needs (Video projector already included):
The included projector. A whiteboard or a giant post-it note for drawing diagrams would be useful.
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: http://www.slideshare.net/hskupin/make-sure-your-code-works
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:
- Ubuntu 12.04 64bit VM (only if you have a 64bit host OS. We will have a 32bit version with us on the USB thumb drives)
- VMWare client: http://people.mozilla.com/~rwood/MozCampEU/VMClientInstall/ (A temporary license key for Fusion we will have with us on Saturday)
To help you with getting in touch with B2G and WebAPIs we have prepared some links which point to useful documentation about those components:
- Marionette: https://developer.mozilla.org/en-US/docs/Mozilla/Boot_to_Gecko/Setting_Up_Marionette_for_B2G
- B2G emulator: https://developer.mozilla.org/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators
- WebAPI: https://wiki.mozilla.org/Webapi
- Existent WebAPI tests: http://mxr.mozilla.org/mozilla-central/source/dom/telephony/test/marionette/
- Running B2G tests: https://developer.mozilla.org/en-US/docs/Marionette/Running_Tests
(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>