Testing web apps

Both of us work in website development, each running companies that develop websites for clients on either side of the Atlantic. Anyone who’s worked in web development can tell you that the complexity of websites has increased significantly since the early days, with the steepest increase in the last few years. A few years ago, you could carry round in your head what a website was supposed to do, which made testing the site relatively simple. But now, with more complex pages and techniques like Ajax, testing web applications has become a substantial problem. The fact that web application development has matured to the extent that people now even talk about testing will shock some people, but it really has changed that much.

Testing web apps

One of the first websites we ever built was almost unique for its time in that it used a program to build some of the pages on-the-fly – at that time, most websites were written using flat HTML files. Now, almost all websites contain some degree of programmed behaviour and, in many cases, that behaviour is very complex. In a future column, we intend to look at some of the tools that can help developers manage this complexity, but this month we’re going to start off by looking at website testing.

There are three main categories of test you can apply to a website. The first is the classic kind of function testing to establish whether the site actually does what it’s supposed to. The second is load testing to determine whether, given that the site works, it works acceptably fast. The third kind is regression testing, which involves repeating earlier tests to establish that a bug that’s supposedly been fixed has actually gone away.

The bulk of the first kind of testing is carried out using a web browser, interfaced to the web application in the way the author intended. To help with this style of testing, there are many tools that can walk the length and breadth of a site carrying out various tests. Some, for example, test all the links or check the HTML is compliant with various standards, while others can find all your web forms and try to fill in and submit them.

There are also tools that let you set up load tests for a site. A website might be perceived as slow by users due to many factors: some sites are slow because of server loading, but there can be many other more esoteric problems caused by third-party content, such as adverts being served externally into a page. However, if server loading is the issue, you should be able to test that.

To understand what we mean by regression testing, consider the following example from the PC Pro website, which we built and maintain. PC Pro operates a registration system, via which users provide various personal details in order to be allowed to see all the content and access all the facilities of the site. The registration system itself is made up of a number of forms that collect new information, as well as forms to log in existing users and allow them to edit their stored information. The registration system also links into other pieces of software, such as the excellent open-source forum system phpBB, so that users only have one login that covers multiple facilities. An added complexity of this system is that it’s common to all the Dennis Publishing magazine websites, which means that if you’re registered for PC Pro you don’t need to re-register for the Computer Shopper or ITPRO sites. What starts off looking like a simple set of forms soon becomes a complex network that has to take into account changing business requirements and legacy decisions.

Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.

Todays Highlights
How to See Google Search History
how to download photos from google photos