Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Members: 41
Language: English
Group categories: Not categorized
More group info »
Recent pages and files
Create Unit Test Framework for Editor Formatting    

Goal :

Test a Wysiwyg JS editor as a black box (or as near to black as possible).
For me, the most important point is having a clear testing plan.

We should have a clear testing scenario with input text, action, and waiting output text.

With lot of combination's, and test action on only a part of the submit test.

And a mapping with action and the Javascript action in the current tested editor.

With an api to make the mapping between the testing scenario and the association.

With that it will be easy to change the testing framework, or the test editor.


By example:
For the test scenario:

“Hello Word”, blod, “<strong>Hello Word</strong>”

For the mapping api:

Blod : tinyMCE.execInstanceCommand('mce_editor_0','Bold',false)).


How:

I see 3 principal ways for testing:

*- JS emulator,*

Advantage: clean for continuous build.

Disadvantage: I'm not convinced by this option because we should have
browser Dependant bugs and I think, we must test it in the real condition.

Not testing a this visual component in visual
environment (I check this as a black box but the goal of the component's
/What you see is what you get/ ... and user return is important.)

Example of Js emulator :

http://www.mozilla.org/rhino/
http://www.thefrontside.net/crosscheck/crosscheck_tutorial

*- A Php testing framework with Js mapping

Advantage : Php is proved language, it's the main language of WP and php unit is a good testing framework

Disadvantage : Server could not execute Js function call directly, not
easy to do reverse Ajax..

This way need a Ajax call from the page and I'm not sure that's the
best way.

But this solution as the advantages to test the editor in real condition .

*- Full JS testing with JsUnit*

Advantage: testing code in his own language and there is no matter of
server connexion.
           test Js composant in real condition (browser and
Visualization environment)
            And we will used to test Js editor as component, and easy to re use it to unit testing to debug it.

disadvantage : JsUnit is still in Alpha I will test it first and if it's doesn't work, use php unit way.

I will search and explore all solution to find the best one.

This black box test will find some bug.(I will check the forum
http://wordpress.org/search/editor+formating?forums=1 to orientate bugs search and help community )

After, isolate bug with testing unit JS and fix it! With code legacy
techniques.

Next steep :

*About for extend project point : *

   * Extend unit testing framework : I see try to extend to other
Wysiwyg editor used by Wp or do unit test to others JS part of Wp.
    Or Better : do something witch make simpler unit testing of Js and ajax part in WP.

   * Automate running test : I think it's will be not very difficult
to launch a web browser with good parameters

   * To improve: Use Jsunit to delimitate bugs and fixe it.

About me and WP :

I’m Wp user.

I use it for my old blog (currently inactive) and I use it for my next
public blog (Soc will be a good reason to start a new one !)

And I use Wordpress MU for Cnam, my private projects (http://mu.blacksheepstudio.net ) and in my company (to improve internal communication).

Planning:

Avril : Test Jsunit possibility to decided with solution I chose
(and start mapping design and implementation).

Jun : Technical Framework choice and begin to write test. (I'm in
exam session this is why I want be fixed about technologies before)

July : cleaning, doing documentation and automatize the test
running.

August: chose one aspect and extend, fix bug, or extend Framework to other Wp part. I will see what is the best to do (with technologies and time), and ask to community what they want


Deliverable :

- Testing scenario

- Java script mapping for editor testing.

- Automatize testing engine.


References :

Unit testing :

http://www.jsunit.net/
http://www.phpunit.de/


Code legacy :
 http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052
http://xp-france.net/cgi-bin/wiki.pl?PraticiensDeParis


Ajax proof of concept :

http://mashpit.pbwiki.com/MashPitParis participate to a funny Ajax
distributed maps prof of concept

http://www.wotton.org/barcamp/interactive/createur.html
http://www.wotton.org/barcamp/interactive/display.html


Luc
 

Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google