background preloader

Test

Facebook Twitter

Test-Driven JavaScript Development, The Book. ATDD vs. BDD, and a potted history of some related stuff. Another question that people often ask around or to me is, “What’s the difference between Acceptance Test Driven Development and Behavior Driven Development?”

ATDD vs. BDD, and a potted history of some related stuff

To explain, I’ll go back to the time when I first learnt BDD. BDD started at a unit or class level Dan North started doing BDD at a unit or class level, as a replacement for TDD – a mechanism for describing the behaviour of code and providing examples, without using the word “test”, because it turned out that this clarified a lot of the confusion (and I still find it much easier to teach TDD if I avoid the word “test”, whatever I subsequently call it). It was only when Chris Matts said, “That looks quite a lot like analysis,” that Dan began taking it out to describe the behaviour of whole systems of code. ATDD practices at the time weren’t all that solid When I came across BDD (late 2004), I was working on a project which had been driven quite heavily with ATDD – at least to start with.

This project had 160 acceptance tests. TypeScript unit testing with Visual Studio 2012, jasmine, backbone, sinon, require and testem on Windows 7. This blog is a starting point for those who are just getting into TypeScript development (like all of us I guess), and need a workable unit testing framework.

TypeScript unit testing with Visual Studio 2012, jasmine, backbone, sinon, require and testem on Windows 7

While my initial preference was to try and integrate TypeScript with Chutzpah, I ran across a few issues where changes to TypeScript files were not being picked up by the Test Discoverer. Unit testing therefore with Chutzpah will need to wait until official support has been added. The full solution used for this walkthrough can be downloaded from skydrive (TypeScriptSampleApp.zip) here. UPDATE 10th October 2012: Many thanks to Jim Newbery, over at tinnedfruit for this excellent tutorial, which has been the reference that I have been working from. Software Pre-requisites This walkthrough uses the following software: TypeScript Setup The TypeScript installation process is straight-forward, simply download the installation .msi from and run it. Create a new TypeScript Project Project Structure \ (root directory) \lib \lib\jasmine.

Zerobase/TypeScript-TDD-Boilerplate. Jasmine: Behavior-Driven JavaScript. Karma - Spectacular Test Runner for Javascript. Zombie.js. PhantomJS. CasperJS. YUI Test. YUI Test is a complete testing framework for JavaScript and Web applications.

YUI Test

You can use the simple JavaScript syntax to write unit tests that can be run in web browsers or on the command line, as well as functional tests to be run in web browsers. Additional tools that build on top of the JavaScript library's core functionality allow integration with build systems. Reporting Defects / Making Enhancement Requests YUILibrary.com is the proper location for reporting defects found in the YUI Test code as well as for logging enhancement requests for consideration for future updates. You can review existing tickets filed for YUI Test by clicking the View Tickets link at the top of this page. *Only logged in users can submit bugs and feature requests. QUnit. Testswarm. Just getting started with TestSwarm?

testswarm

Check out the README and wiki pages first. This document describes how TestSwarm can be used in a large scale testing environment. Features: Fully automated submissions of jobs to TestSwarmThe swarm is automatically populated with browser clientsEvents can be used to create additional post-build actions (such as IRC notifications). Main frameworks: TestSwarm, Jenkins, QUnit Utilities: node-testswarm, node-browserstack, testwarm-browserstack, grunt TL;DR: → Check out the End result. Prerequisites The following prerequisites are assumed to be installed already (this document does not cover setting that up, these software packages have their own manuals): Note that none of these are claimed to be the "ultimate" tool.

For example: Jenkins: It is not required for a working continuous integration environment with TestSwarm. Static clone jQuery The following is an example of such a script to make a static copy. . #! MediaWiki. Selenium. Testing Backbone applications with Jasmine and Sinon – Part 1 – Tinned Fruit. Overview This is the first in a series of articles demonstrating how to test a Backbone.js application, employing the Jasmine BDD test framework and the Sinon.JS spying, stubbing and mocking library.

Testing Backbone applications with Jasmine and Sinon – Part 1 – Tinned Fruit

In this part, we’ll take a brief look at Backbone, and then move on to an introduction to some of the features of Jasmine and Sinon.JS. Along the way we’ll look at why these tools are a such good fit for testing Backbone applications. If you have never written any JavaScript tests before, you might like to take a look at Christian Johansen’s recent series of articles over at scriptjunkie. Backbone everywhere.