Hi guys, I have a pretty basic question about test cases in the world of Website development. Does it make sense to have a separate test case for each hyperlink for all pages in a site? For e.g. my site might have 10 pages, each with approx. 10 hyperlinks in it. Should I have 100 test cases each explaining where that link should redirect me to. I just want to know what is the best approach to make sure all links are correct before going live.
"Test until fear turns to boredom"
Really depends on how worried you are about each link...
You could put it live on a private server and use wget to test for broken links. GNU Wget manual page would be a good place to start. The recursive option and the spider option seem to be the most used. If you only want to report your domain look at the -D option.
If you write a quick bash script you'll have it around for the future as well.
This is obviously the easy and quick option.
Well - as a matter of common sense, if you wanna be sure they work you're gonna have to smoke test them somehow - but I highly suggest you to setup some kind of automated UI testing suite for that.
Test Cases are usually defined on features, so it makes sense to associate Test Cases only to the hyper links (in your case) that represent features, if they're just redirections you'll just end up with bunch of highly ceremonious docs which will be covered in dust soon enough.
Something that's kind of a middle ground, would be to spider the site and make sure that all of the links return 200/300 statuses (that is to say not 404s or 500s).
You could even extend it to write regexes to define which should return redirects and which should straight up return 200s.
If these links do not change much, you could consider using some simple tests : do they still point to a page ? is that page on the same server ? is it an html page ? is it an https link ? etc. And, as Cogsy said, you may test seriously the most importants one.