Tutorial: TDD with Selenium and Castle

| by James Vastbinder Follow 0 Followers on Feb 20, 2007. Estimated reading time: 1 minute |

In this InfoQ tutorial Dan Bunea shows developers how TDD can be applied in .NET using Selenium RC and Castle. Selenium is an automated test harness for building enterprise class web user interafaces written in any programming language.  Castle is an open source project dedicated to providing libraries to ease the enterprise application development process for .NET based applications.

Test first principals provide architects a way to quickly jump into active development early in the application development lifecycle.  Design of the application takes place as development occurs and obviates the need to design the application before the actual coding process begins.  This provides the architect with flexibility to respond to new and changing requirements as the application lifecycle evolves.

The benefits of TDD are a drastic reduction in defects as well as increased adaptability in the code base since the application advances quickly through an iterative process.  For each iteration developers must first create the tests their code must pass before they write any actual code. The iteration finishes with a period of refactoring dedicated to simplicity and flexibility.  Adherents claim TDD is a code tempering process allowing them more time to program and concentrate on writing quality applications.

What have been your experiences with TDD?

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

TDD by Thamaraiselvan Poomalai

TDD is always healthy for all projects as almost all projects deploy different version/variations of frameworks, drivers etc in production than what they started for development. Also, in typical infrastructure, there are always one after other upgrades (Service Packs, new versions, new softwares etc). TDD will reduce stress of development team to large extend in above scenarios. But all softwares are ready for TDD?, Current BPM tools are not test friendly.

Firefox and HTTPS plug-in problems? by Frank Cohen

Selenium looks like a very nice plug-in to help make test script creation easy. I maintain the TestMaker open-source SOA test automation tool and we long ago embedded a branch of the MaxQ proxy recorder to make script creation easy. Recording proxy servers work well for HTTP but require a lott of extra "stuff" to work with HTTPS. One of our users recommended we write a FireFox plug-in like Selenium and he added that Selenium was encountring problems with HTTPS too. Is there anything too that?

-Frank Cohen

Re: Firefox and HTTPS plug-in problems? by Patrick Lightbody

We (the Selenium guys) actually solved HTTPS a couple of months ago, but we haven't gotten off our lazy butts to put out a release. We're narrowing in on a single "mode" of Selenium RC that can handle all cross-domain and SSL traffic, becoming the one-stop shop for web testing.

I'd love to chat with you some more about Selenium if you'd like. Feel free to email me at


Re: TDD by Deepa Jain

Wat if I am not using .NET .Can this be done using simply HTML If Yes then plz tell me

Great tutorial but source code link's broken by Stefan Marev

Great tutorial. I know it's been a while since the article was published but the download source code link is broken.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

5 Discuss