Wednesday, June 27, 2007

javascript and unit tests

With dynamic typed languages, things can go wrong after a few refactorings due to lack of extra information that is available with static typed languages.

Unit/integration tests are expected to cover this front for these languages. It shouldn't be coincidence that the rise of dynamic languages are in parallel with the rise of test driven development/continuous integration (agile/lean)

Two approaches come to mind.

Selenium like tests ( scenario based kinda integration tests)
JsUnit like tests (kinda unit tests)

Traditionally JS testing/debugging was left to alert statements and lots of retries, however i find myself using firebug regularly to inspect and analyze my javascript codes.

Here you can watch the creator of it going through most useful features of it.

No comments: