Agile Zone is brought to you in partnership with:

Mitch Pronschinske is a Senior Content Analyst at DZone. That means he writes and searches for the finest developer content in the land so that you don't have to. He often eats peanut butter and bananas, likes to make his own ringtones, enjoys card and board games, and is married to an underwear model. Mitch is a DZone Zone Leader and has posted 2573 posts at DZone. You can read more from them at their website. View Full User Profile

Using TDD With Modern JavaScript

03.20.2011
| 10671 views |
  • submit to reddit
Scott Allen is the founder and Principal Consultant with OdeToCode LLC. He is also a member of the Pluralsight technical staff.  This article contains NDC 2010 presentations by Allen and Mark Nijhof about modern JavaScript and how to make it 'test-driven'. 

"JavaScript is a dynamic, functional, ubiquitous language that has many hidden secrets. In this session we will take a deep look at the core JavaScript features that many contemporary libraries leverage, including constructor functions, prototypical inheritance, closures, hash parameters, method chaining, and more. Having a solid grasp of these features will not only help you write more maintainable JavaScript code, but also allow you to take greater advantage of today’s JavaScript libraries."  --Scott Allen



Mark Nijhof has been working in software development since 2000 and recently founded Cre8ive Thought to be the next step in his career.

"Javascript becomes much more important to interactive website development then before (ok it has been for a while already) but the notion of testing that logic seems even further fetched then testing the code written in C#, Java. And this is something that is wrong as well.

How do you test drive your javascript development, what do you need to think about to make it testable? How can you deal with timers, async calls and the dom. Demonstrate all these things including how easy it is to make your own fakes for testing. Demonstrate the refactoring and changing behaviour becomes so much easier.And not to forget that the design of the code is much better as well. Basically that you gain all the benefits that TDD gives you in other languages also when doing TDD for javascript development.

Building a feature without ever loading up a web–page to physically look at it and when you finally do it does exactly what you intended it to do, that is magic :–)"  --Mark Nijhof


Comments

darryl west replied on Tue, 2011/03/22 - 11:21pm

thanks for the pointers. i've hade a love/hate relasionship with javascript going back to the 90's. now that we are using to more java to solve serious probems its good to find some serios testing tools and techniques.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.