Changes

Jump to: navigation, search

Unit Testing

934 bytes added, 21:49, 13 December 2006
What I have learned
==== Step 2. A Write a test suite holding variable called suite that holds all the your test cases. ====
The following is example of bookmarks test suite.
=== Customize Extension Menu Item Name ===
If users want to change the menu item namefor a specific test case, they can open file '''unittesting.dtd ''' under folder '''local'''.
[[image:extension02.png|600px]] <br />
And then they can change the first item to your test case name in the file unittesting.dtd.
[[image:extension03.png|600px]] <br />
=== Run the tests ===
After adding the test cases to the extension, the participant can install the extension by drag and drop the extension into Firefox, and then click on install to install the unit testing framework with your test cases. You  Running test cases is also easy, user can click on '''Tools ''' menu from Firefox, and you will see the following screen shotan extension called '''Unit Testing for [...]'''.
[[image:extension01.png|602px]] <br />
Select the '''Unit Testingfor [...]''', system will pop up the test following testing window as following.
[[image:extension04.png|602px]] <br />
Users Now click on the run button on test window, the test result will be displayed on test window. [[image:extension07.png|602px]] <br />  Further more, user can also open run test cases as many times as they want, and the error console result will be populated on test window as well. [[image:extension08.png|602px]] <br /> {{clear}} === Unit testing log ===Right now, this framework provides a detail log for test running. This will allow users to watch all track the detail testing process and any error that encountered during the testing logs. Here is  In order to check the error console window, go to '''Tools''' menu in Firefox, and select '''Error Console'''.
[[image:extension05.png|602px]] <br />
Now click on After push the run '''Run''' button on test window. All logs , the testing process message will be displayed in console.
[[image:extension06.png|602px]] <br />
[[image:extension06-2.png|602px]] <br />
 
 
After pushing button, the test result will be displayed on test window.
 
[[image:extension07.png|602px]] <br />
 
 
Further more, user can run test cases as many times as they want, and the result will be populated on test window as well.
 
[[image:extension08.png|602px]] <br />
{{clear}}
* Better layout of testing window if you have innovative idea
* Write log into file for further analyzing by Mozilla
* Improve the structure of the framework and make it more easier for users if you could
{{clear}}
=== What I have learned ===
Based on my experice in open source developing, I had a lot of fun for doing it. Also I'd like to address some improtant comments when we are I was working on the open source.
* It was very time-consuming. Confidence and patience are the key to success.
: This project has no prototype or even any example; most of time I couldn't get help because very less people work on this; and different people will do a different way in unit testing. It took me a lot of time to do researching, trying, and debugging. It also needs a lot of patience; if one way doesn't work, you still need to keep working on it until find the solution. You can take a short break and a deep breath, but never give up.
* Documentation.
: Any code we wrote should be documentated. It's very important for you to check back and for the people who want to contrubute to it.This is really important in open source community. Because I couldn't find the documentation for the Bookmarks services, I cannot make the bookmark unit testing work.
1
edit

Navigation menu