Posts Tagged ‘testing’

Brainstorm session: what would you like writing tests to look like?

Thursday, August 11th, 2011

There’s a good thread about building features into Firefox on dev.planning. The recurring problem of writing quality frontend code came up, and I found myself ranting about our testing framework.

Is it tacky to quote yourself? I’m in a devil-may-care frame of mind this morning, so I’m doing it anyway!

From this post:

I’m an imperfect being and I know I should write much more tests than I do.
I will continue fighting the urge to just ignore tests and keep telling
myself why they are so crucial. I’m trying to be part of the solution, and
I’ve committed a few mochitest patches along the way. What Mozilla could do
to help me significantly is to give me great tools…

And then:

It’s worth noting that the details matter. I know we devs tend to think of
ourselves as very practical and rationally minded, but the longer I make
stuff the more I am convinced that an emotional feeling of using these tools
is crucial to a happy developer. So let’s get some ideas, and I’ll be happy
to file some bugs!

Etherpad here:
http://ietherpad.com/mozilla-test-tools

Brainstorm your ideas. We’ll sort them out and file some bugs! I’m particularly interested in what the web developers in the crowd have to say, as in my experience the tools there are a pleasure to use.

Writing browser chrome mochitests

Thursday, April 28th, 2011

My fellow developers,

You may already be writing good browser chrome tests that properly reset any side effects your test may have caused, but do you always clean up? Instead of manually cleaning up your test after a successful run, please consider using registerCleanupFunction. You can register as many functions as you like, and they are guaranteed to run at the end of the test! I didn’t know this technique existed until recently, so I thought I’d pass it along.

Unfortunately, I’m not aware of anything similar for other mochitests.