Wednesday 5 June 2013

Recapping the last couple weeks

To make my blog posts clearer I decided that I would follow the format of the morning 'SCRUM' that I am participating at CDOT.  For those who do not know what a SCRUM is, I will tell a little more.  Every morning at CDOT (The Seneca Centre for Development of Open Technology) we talk about some task that we have done are will do that relates to our job.  I found an article on Wikipedia that explains the term http://en.wikipedia.org/wiki/Scrum_(software_development).  My latest task is to create tests for the NEXJ Mobile Bluetooth Adapter https://bitbucket.org/nexj/mobile-bluetooth-adapters/.  This task will be done using QUnit http://qunitjs.com/.

In the last three to four weeks I have spent a fair amount of time becoming familiar with this Testing Framework.  There is still more to learn.  At first I could not get the tests working and wondered why?  It took me some time to think that I should check the QUnit cookbook hosted on its site.  I could not get my tests started.  What kind of Tests? Asynchronous Callback Tests...  More information can be found here http://qunitjs.com/cookbook/#asynchronous-callbacks.  What helped me in the end was to overcome my sense of estrangement by comparing my source code with the examples on the CookBook page.  I found out that I had not:

"
setTimeout(function() {
ok( true, "Passed and ready to resume!" );
start();
}, 1000);
"

After setTimeout everything worked fine.

The next thing I learned was that I could easily set the:

"
expect( 1 );
"

where needed.

Currently these tests are available as a Pull Request: Pull Request with tests.  You can easily skim and checkout the commits tab.  This is just for now.  But I am learning a lot from the QUnit Testing Framework.

No comments:

Post a Comment