Open Source

Lab 4: Getting a feel of Testing

The goal for this lab is to get a familiarity of how testing is done in development, but more specifically to this course is testing in the open source development.

To dive in deeper into the type of testing I am assigned to do for this lab, David has assigned us to contribute to the active testing of the JavaScript (ECMAscript) language itself using the test suite built for it called Test262.  Perhaps 262 means that this is the 262nd release, or something?

Getting familiar with the test suite required us to clone the repository off Github, installing and then running it to see the results.

Figure 1: Cloning the Test262 repository

Capture.PNG

Figure 2: Installing it and all its dependencies

Capture1.PNG

Figure 3: Running the test suite.  It appears that of the 205 tests that were executed, 201 has passed and 4 has failed.  It has got something to do with locale.js but I am quite not sure what it is.

Capture2.PNG

Continuing with this lab, our task was to write a simple test for the Array.prototype.reverse() functionality of JavaScript.  reverse() as literally it means to reverse the order of the elements it stores.

So I wrote a very simple test.js script that simply tests whether an array has been successfully reversed.

Capture3.PNG

The initialized an array of 6 elements, reversed it, and then passed it into another array.

I wrote two simple tests that assesses whether the second array captured the reversed values of the original array that was also reversed.  And also,  I wrote a simple test that determines whether the type of both is the same.

I saved and ran the tests, and both passed.

Capture4.PNG

And that’s pretty much it!

Leave a comment