Ajax Control Toolkit and Superexpert

Microsoft has asked my company, Superexpert Consulting, to take ownership of the development and maintenance of the Ajax Control Toolkit moving forward. In this blog entry, I discuss our strategy for improving the Ajax Control Toolkit.

Why the Ajax Control Toolkit?

The Ajax Control Toolkit is one of the most popular projects on CodePlex. In fact, some have argued that it is among the most successful open-source projects of all time. It consistently receives over 3,500 downloads a day (not weekends — workdays). A mind-boggling number of developers use the Ajax Control Toolkit in their ASP.NET Web Forms applications. Why does the Ajax Control Toolkit continue to be such a popular project?

clip_image002

The Ajax Control Toolkit fills a strong need in the ASP.NET Web Forms world. The Toolkit enables Web Forms developers to build richly interactive JavaScript applications without writing any JavaScript. For example, by taking advantage of the Ajax Control Toolkit, a Web Forms developer can add modal dialogs, popup calendars, and client tabs to a web application simply by dragging web controls onto a page.

The Ajax Control Toolkit is not for everyone. If you are comfortable writing JavaScript then I recommend that you investigate using jQuery plugins instead of the Ajax Control Toolkit. However, if you are a Web Forms developer and you don’t want to get your hands dirty writing JavaScript, then the Ajax Control Toolkit is a great solution.

The Ajax Control Toolkit is Vast

The Ajax Control Toolkit consists of 40 controls. That’s a lot of controls (For the sake of comparison, jQuery UI consists of only 8 controls – those slackers J).

Furthermore, developers expect the Ajax Control Toolkit to work on browsers both old and new. For example, people expect the Ajax Control Toolkit to work with Internet Explorer 6 and Internet Explorer 9 and every version of Internet Explorer in between. People also expect the Ajax Control Toolkit to work on the latest versions of Mozilla Firefox, Apple Safari, and Google Chrome. And, people expect the Ajax Control Toolkit to work with different operating systems. Yikes, that is a lot of combinations.

The biggest challenge which my company faces in supporting the Ajax Control Toolkit is ensuring that the Ajax Control Toolkit works across all of these different browsers and operating systems.

Testing, Testing, Testing

Because we wanted to ensure that we could easily test the Ajax Control Toolkit with different browsers, the very first thing that we did was to set up a dedicated testing server. The dedicated server — named Schizo — hosts 4 virtual machines so that we can run Internet Explorer 6, Internet Explorer 7, Internet Explorer 8, and Internet Explorer 9 at the same time (We also use the virtual machines to host the latest versions of Firefox, Chrome, Opera, and Safari).

The five developers on our team (plus me) can each publish to a separate FTP website on the testing server. That way, we can quickly test how changes to the Ajax Control Toolkit affect different browsers.

clip_image004

QUnit Tests for the Ajax Control Toolkit

Introducing regressions – introducing new bugs when trying to fix existing bugs – is the concern which prevents me from sleeping well at night. There are so many people using the Ajax Control Toolkit in so many unique scenarios, that it is difficult to make improvements to the Ajax Control Toolkit without introducing regressions.

In order to avoid regressions, we decided early on that it was extremely important to build good test coverage for the 40 controls in the Ajax Control Toolkit. We’ve been focusing a lot of energy on building automated JavaScript unit tests which we can use to help us discover regressions.

We decided to write the unit tests with the QUnit test framework. We picked QUnit because it is quickly becoming the standard unit testing framework in the JavaScript world. For example, it is the unit testing framework used by the jQuery team, the jQuery UI team, and many jQuery UI plugin developers.

We had to make several enhancements to the QUnit framework in order to test the Ajax Control Toolkit. For example, QUnit does not support tests which include postbacks. We modified the QUnit framework so that it works with IFrames so we could perform postbacks in our automated tests.

At this point, we have written hundreds of QUnit tests. For example, we have written 135 QUnit tests for the Accordion control.

The QUnit tests are included with the Ajax Control Toolkit source code in a project named AjaxControlToolkit.Tests. You can run all of the QUnit tests contained in the project by opening the Default.aspx page.

clip_image006

Automating the QUnit Tests across Multiple Browsers

Automated tests are useless if no one ever runs them. In order for the QUnit tests to be useful, we needed an easy way to run the tests automatically against a matrix of browsers. We wanted to run the unit tests against Internet Explorer 6, Internet Explorer 7, Internet Explorer 8, Internet Explorer 9, Firefox, Chrome, and Safari automatically.

Expecting a developer to run QUnit tests against every browser after every check-in is just too much to expect. It takes 20 seconds to run the Accordion QUnit tests. We are testing against 8 browsers. That would require the developer to open 8 browsers and wait for the results after each change in code. Too much work.

Therefore, we built a JavaScript Test Server. Our JavaScript Test Server project was inspired by John Resig’s TestSwarm project. The JavaScript Test Server runs our QUnit tests in a swarm of browsers (running on different operating systems) automatically.

Here’s how the JavaScript Test Server works:

1. We created an ASP.NET page named RunTest.aspx that constantly polls the JavaScript Test Server for a new set of QUnit tests to run. After the RunTest.aspx page runs the QUnit tests, the RunTest.aspx records the test results back to the JavaScript Test Server.

2. We opened the RunTest.aspx page on instances of Internet Explorer 6, Internet Explorer 7, Internet Explorer 8, Internet Explorer 9, FireFox, Chrome, Opera, Google, and Safari.

Now that we have the JavaScript Test Server setup, we can run all of our QUnit tests against all of the browsers which we need to support with a single click of a button.

clip_image008

A New Release of the Ajax Control Toolkit Each Month

The Ajax Control Toolkit Issue Tracker contains over one thousand five hundred open issues and feature requests. So we have plenty of work on our plates J

At CodePlex, anyone can vote for an issue to be fixed. Originally, we planned to fix issues in order of their votes. However, we quickly discovered that this approach was inefficient. Constantly switching back and forth between different controls was too time-consuming. It takes time to re-familiarize yourself with a control.

Instead, we decided to focus on two or three controls each month and really focus on fixing the issues with those controls. This way, we can fix sets of related issues and avoid the randomization caused by context switching.

Our team works in monthly sprints. We plan to do another release of the Ajax Control Toolkit each and every month. So far, we have competed one release of the Ajax Control Toolkit which was released on April 1, 2011. We plan to release a new version in early May.

Conclusion

Fortunately, I work with a team of smart developers. We currently have 5 developers working on the Ajax Control Toolkit (not full-time, they are also building two very cool ASP.NET MVC applications). All the developers who work on our team are required to have strong JavaScript, jQuery, and ASP.NET MVC skills.

In the interest of being as transparent as possible about our work on the Ajax Control Toolkit, I plan to blog frequently about our team’s ongoing work. In my next blog entry, I plan to write about the two Ajax Control Toolkit controls which are the focus of our work for next release.

Discussion

  1. Roland says:

    A well-writen, concise blog entry as usual. I do hope you are going to another book.

    By the way is it cool to maintain the ACT? Looking into the library is, say, challenging. You deserve a medal Stephen ;o)

  2. Chamila says:

    Quite interesting.

  3. Andrew says:

    How can we use it, on asp.net mvc with razor ?

  4. Andrei says:

    You write "…it consistently receives over 3,500 downloads a day". But the screenshot below shows 2907.91 downloads / day

  5. @Andrei – The number of downloads plummets on the weekend so the toolkit averages around 2,907 downloads a day. That’s why I write "not weekends — workdays" 🙂 You can see the full stats for the toolkit here http://ajaxcontroltoolkit.codeplex.com/stats

  6. Hi stephen, i know this comment does not fit in this conversation =P sorry! here comes the explanation… i am doing manual backlinking LOL, i saw your blog gives dofollow with anchortext, anyways, i hope you approve my comment, its really difficult to get backlinks, specially when you are doing something good, do you have a list of high pr sites where i can submit a link with anchortext? sorry to bother you >.<"

  7. E says:

    Thank you!
    It is a sign of responsibility.

  8. Mario says:

    Thankyou for the support. I develop in a enterprise environment and while some of the controls can be easily done via jquery etc, the ability to roll out our items quickly thanks to the toolkit, makes RAD development a lot easier. There are purists who complain about the "bloat" of the ACT but for folks who need to get the job done and can trade bloat over dev time, it’s a great tool.

    Also it gives devs time to become comfortable with the more direct approach of jqeury and java script.

  9. Simon says:

    Great news – and it couldn’t be in better hands! Hey, perhaps one day you’ll even convert it into a nice, light jQuery plugin! 🙂

  10. rtpHarry says:

    This is good news. I know that a lot of the esoteric controls are rarely used but there are some core components which provide really useful features to the .net community like the modalpopup, collapsepanel and others.

    It seems that it would make sense to replace as much code as possible to use the jquery library. Is this a long term goal or something that would take too much coding to achieve?

    Also, I dont know if this is the official demo site any more but its the one I have bookmarked and send people to when answering forum questions and it doesn’t look like it has been updated:
    http://www.asp.net/ajax/ajaxcontroltoolkit/samples/

    I didnt see this announced on the homepage of asp.net which is a shame as I missed this news only just spotted it researching for another forum question.

    Anyway good to know its in safe hands, you are a great developer that codes things right and i’m sure your team will achieve great things 🙂