How to Human-Behaviour Test your ASP.NET MVC Application

2. February 2009

I’ve been using a super-cool application in the development of Nett 30 that’s let me automate a lot of the tedious functional testing that is needed after every change in the application.

You know what I mean – you make a change to the code and you’re sure everything will work correctly, however, you still have to manually click through every function of the app in the web browser and test to ensure it’s solid and ready for users.  This takes a lot of time and effort – and the more complex your app gets, the more time and effort it takes!

“Functional testing” AKA “When users click around mp app, does it still work as expected?” is the process of ensuring your application functions as expected in the users web browser.

There must be an easier way right… well there is, and I’m pretty sure I was drooling when I found it…

The application is called Selenium and quoting their website: “Selenium is a Firefox add-on that records clicks, typing, and other actions to make a test, which you can play back in the browser.”

If you’re an ASP.NET MVC developer (or any web developer really), you need to be using Selenium.  Here’s what it’s done for us, and hopefully what it can do for you:

1) Every little change we make to the code, we test with Selenium immediately.  If the tests pass, we move on to the next change.  This gives us piece of mind that we’re not building bugs on top of bugs.

2) Every release we do we check with Selenium - then do a manual human test as well.  This gives us huge comfort that the release will function as expected for users.

3) We’re finding it’s saving us 50% of the time we used to use with functional testing and it costs us nothing!  We used to have to human-test the app regularly during development of a feature, not that’s not really necessary – all we do is human-test when the feature is complete and use Selenium for minor testing.

4) I sleep a whole heap better :)

Selenium is not just a Firefox plug-in however.  You should also download the Selenium Remote Control that allows you to run your tests automatically in different browsers and also modify the tests.  Selenium also exports your tests as C# so you can integrate them in your Visual Studio testing workflow and control them from there.

Remember Selenium is not an entire replacement for human testing but it does eliminate a lot of the human testing you have to do.

All in all, if you’re developing for the web you owe it to yourself to try Selenium – it’s totally free and it might just be the best thing since sliced bread?  Let me know what you think :)

Link to Selenium: http://www.seleniumhq.org

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

ASP.NET MVC

ASP.NET MVC: Upgrading our live app from Beta to Release Candidate 1

27. January 2009

Well it’s great news that ASP.NET MVC is at Release Candidate stage.  According to the MVC team, this release offers us the final update before it’s at the final v1 milestone.  For a full run-down on what’s changed, what’s improved etc check out ScottGu’s blog post or Phil Haack’s.  For download links and additional tutorials, please visit the asp.net mvc website.

We’ve developed out latest web application, nett 30 entirely using MVC, starting from the Preview 2 release and finally this morning updating it to this Release Candidate.  Check out my up-coming posts for how we used MVC to create nett 30 – I’ll be outlining in detail how most of the main features have been implemented.

Today however, this post deals with the upgrade from Beta to Release Candidate 1, so without further ado…

Overall the update went very smoothly and thanks to the unit testing that was baked in to our application and the great functional tests we had that were created in Selenium, the upgrade process was pretty painless.

We did encounter a problem with the Html.DropDownList helper however…

Technorati Tags: ,,,

When we ran our functional tests, Selenium reported back that we were getting some failures:

image

Turns out the problem was simply fixed by getting rid of the “”’s and the drop-down was then created and populated correctly again.  I couldn’t find this documented anywhere in the release notes so I thought I would mention it here – so you know before you push the upgrade button, what to expect.

So, all in all a very clean upgrade process and I can’t recommend highly enough ASP.NET MVC as a great application development platform.  The guys from Selenium also deserve a big mention as that tool provides me with a much better nights sleep.

Happy coding :)

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

ASP.NET MVC