What does the broken link test do?

The broken link test checks for links to web addresses that don't exist, or which return an error. These are known as broken links.

Why is it important to test for broken links?

Broken links are very common and happen to almost any website (usually because one party changes or removes a page, which another party has linked to, but doesn’t know). Testing these regularly with an automated tool is the quickest and easiest way to avoid them.

How is it measured?

Conventional HTML links and Meta Refresh links are checked by this test.

Each link within the website is tested to see whether it returns a valid response. There are four potentially 'bad' responses:

  • Page not found (ungraceful) - when asked for the page, the webserver simply replied saying 'that page was not found' (a HTTP 404 response). No HTML was sent by the server, so the error will be displayed by the user's web browser, usually a relatively poor user-experience.
  • Page not found (graceful) - when asked for the page, the webserver replied with a full HTML page, but marked it as 'not found' (a HTTP 404 response). This is the best way to handle broken links, as the user will have seen something - ideally a professionally made and useful error message, explaining the problem.
  • Host not found - the website itself was not found to exist (the hostname was not found). For example, a link to www.this-domain-does-not-even-exist.com wound fail in this manner. Such errors are always handled by the user's web browser, which cannot be avoided.
  • Broken 404 header - when asked for the page, the webserver simply replied saying 'that page was not found' (a HTTP 404 response), however when the page was downloaded it did exist. Technically it replied with a 404 to a HEAD request, but with a valid response to a GET request. This usually means the code behind the website doesn't handle HEAD requests properly: poor practice but not disastrous.
The score is based on a weighted balance of possible and definite broken links, plus links with header issues. For technical details, see below.
 

How to improve this score

Review the list of broken links and fix them, either by removing the link, or pointing it to the correct address.

How to use this test effectively

This test should be run regularly and used as a key quality control mechanism.