Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

BlackBerry WebWorks Contributions

Reply
New Developer
pnewhook
Posts: 70
Registered: ‎01-13-2011
My Carrier: Rogers

What Unit Testing Framework WIll WebWorks Use?

I don't see any tests in the current repo but I'd like to write a couple to get acquainted. I assume there's been some discussion or standard at RIM that I'd play along with. 

 

I'm not sure how tests could be run. I suppose the easiest way would be to a simple applicaiton that runs through a bunch of unit tests.

 

I'm fond of qUnit but I could also see something like JS Test Driver  being helpful because it supports pointing tests to run on another machine and other larger scale features. JS Test Driver has adapters to a bunch of frameworks, including qUint .

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,693
Registered: ‎10-16-2008
My Carrier: Rogers

Re: What Unit Testing Framework WIll WebWorks Use?

Currently we have a couple different frameworks.

 

For testing the JavaScript interfaces we are using the yUI testing framework.  

 

For testing the Java APIs we have a junit like test framework that will work on the simulators

 

For testing the ActionScript APIs we rely on the top level yUI JavaScript testing.  We haven't found a nice free solution for actionscript unit testing.

 

These will all be pushed up into the repository when they are ready to roll on a developer's desktop that isn't inside of RIM's walls :smileyhappy:

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
filmaj
Posts: 18
Registered: ‎09-02-2009

Re: What Unit Testing Framework WIll WebWorks Use?

Tim, has RIM ever talked about integration/functional testing? Something that is end-to-end, and could be run on a simulator. I've been thinking about this for a bit and I've read various bits about how the BlackBerry simulator could be "scripted" with basic events.

 

Related to this is Android's Exerciser Monkey that sends random events to the simulator/device to stress test applications: http://developer.android.com/guide/developing/tools/monkey.html

 

Unit tests for both "sides" of the API (native & JavaScript) is good, but I think it can get better. This has been in the back of my mind for general PhoneGap testing, but I have to start at some specific platform and looking for ideas if it's possible to implement on BlackBerry.

 

Cheers,

Fil

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,693
Registered: ‎10-16-2008
My Carrier: Rogers

Re: What Unit Testing Framework WIll WebWorks Use?

Hi Fil,

 

Yes it is possible to run the simulator and then tell it to load a test suite and run it and put its results somewhere.  We currently have this running with our testing teams internally.  We are planning on getting this out as part of the project.  To be honest we're swimming in the PlayBook release at the moment so we haven't had a chance to get it up into github.

 

What are your thoughts around how the test suites should be structured?  Should they be different test suites for each platform (Smartphone and PlayBook) or should there just be one test suite repo that you can run either the PlayBook or Smartphone tests?  I'm imagining there will be a lot of them in common.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
filmaj
Posts: 18
Registered: ‎09-02-2009

Re: What Unit Testing Framework WIll WebWorks Use?

I really can't say without having a better idea of the discrepancies between the two. Since the goal is to eventually merge the two projects, then having the same objective in mind for the test suite makes sense.

 

I would recommend, try keeping the suite as consistent as possible so as to run on both devices, and only branch out when you need to.

 

I am looking forward to see all this good stuff on GitHub!

Please use plain text.