Close
Close

How To Sleep Better After an Upgrade – Blog Unit Testing

Upgrading your blog platform? This guest post from Sid Savara, who writes about personal development and personal productivity is for you.

blog-upgrade-testing.png

If you’re a Thesis user (like me) you may have had some issues recently when upgrading to version 1.4. The issues affected a minority of Thesis users, and required reverting to an old version of Thesis for the sites to function while Chris Pearson troubleshot the issue – on his customer’s servers, free of charge. Chris was very responsive and issued a patch the same day (1.4.1), followed by another patch over the weekend (1.4.2). My hat’s off to Chris for providing what can only be called unparalleled customer support in a difficult situation.

This experience brings me to the larger issue – how do you ensure everything on your blog still works after an upgrade? This isn’t the first time I’ve had an issue upgrading – and I’m certainly not the first WordPress user to experience hiccups during the upgrade process either. We all occasionally have issues when we upgrade plugins, install a new plugin or upgrade WordPress itself.

Perhaps the most sinister are those issues where everything looks like it’s working fine. Sometimes after an upgrade I won’t even notice an issue until days later, and I’ll have to go back through my plugins one at a time to see what originally caused the problem.

Until recently, I checked for problems after an upgrade with the old blogger favorite “randomly click around and see if anything looks broken” strategy. The weakness of this strategy is the propensity to miss errors. I decided I needed a way to be more certain that everything went smoothly, and borrowed a couple concepts from my background in software engineering to help: Unit Tests and Regression Testing.

Unit Tests and Regression Testing

Units tests are simple, single function tests done to ensure every part of the software does what it is supposed to. If the test fails, you know exactly where the problem is and can fix it. Likewise, for my blog, each unit test checks for a specific piece of blog functionality.

In software development, a test might work at the time I first run it – but down the road I may change something that causes the test to fail. Repeating the tests whenever any change is made is called regression testing. In my years of software development, I’ve learned that a new change can cause software to react in ways we may not expect. Upgrading a plugin may cause another plugin to fail, or perhaps cause errors in your RSS subscriptions (which happened to me). For this reason, whenever I upgrade or install anything new to my blog, it is important I retest everything, every time – even if the change appears unrelated.

Blog Unit Tests

With that background, here is a handy checklist to review every time you install new plugins or themes, or upgrade any part of your blog. Some tests are especially relevant when installing a new theme, while some should be reviewed carefully in cases of plugin installs and upgrades. Since you won’t know exactly what is affected by each change, it’s important to go through the entire list every time. This list gives you specific checks you can run through in 15-30 minutes and know that your installation is successful. I use WordPress – but this list should apply regardless of your blog or CMS platform.

Note: When running these tests, be sure to force a refresh and clear your browser cache before beginning so you are seeing the current version of your site. If this sounds like Greek to you, here’s a brief explanation of forcing refreshes.

  1. Index page
    1. Title of the page. Is it what you want it to be? Are site name and tag line in the order you desire?
    2. Site name. Is it present? Is it clickable (if you want it to be)?
    3. Description/tag line. Is it present? Is it clickable (if you want it to be)?
    4. Header image. Does clicking on it return you to the home page? Do you want it to?
    5. Favicon. Is your favicon still present? This is a sinister one, as browsers sometimes cache these even if you are forcing a refresh.
    6. Excerpts, Thumbnails and Full Posts. Is the index showing excerpts or full posts the way you want it to? If applicable, are thumbnails and featured posts where they should be?
    7. Post Titles/Permalinks. Does clicking on a post title take you to the blog post?
    8. Comment links. Are the correct comment counts displayed? Does clicking the link take you to the appropriate comment form?
    9. Categories/Tags. Are category and tag links displayed? Do you want them to be?
    10. Meta description. View your page source. Look for <meta name=”description” content=”[...]” />. Is the value in the [...] what you expect it to be? See SEO Tips for Blogs for a detailed discussion of why this is important. You may, optionally, want to repeat this test on single post pages.
  2. Index sidebar (s), navigation links and footer
    1. Widget enabled theme. Are all the widgets present?
    2. Widget order. Are the widgets in the order they should be?
    3. Links in widgets the sidebar. Does clicking a link take you where you expect it to? Appropriate pages, external sites, etc? Do the links open in a new window, or the current window?
    4. Site wide navigation (if applicable). Are all the links present? Are they in the order desired? Click a couple. Do the links work? Do the links open in a new window, or the current window?
  3. Archive pages – tags, categories, sitemap, and date based

    1. Index page tests. Repeat all the same tests as the index page. Spot check one category, one tag and one month archive as applicable. If you have a sitemap, check that as well.
  4. Single Post pages
    1. Title bar. Is the post title and site name in the order desired? Does it show everything you want? Post Title, Category, Site Name, Tag Line?
    2. Post Title. Is the post title present? Is it clickable (or not) depending on what you want?
    3. Comment links. Do you want a link to the comment form displayed near the post title? Are the correct comment counts displayed? Does clicking that link take you to the appropriate comment form?
    4. Next/Previous post links. Are they displayed? Before, after, or both? Are they nofollowed or dofollow based on your preference?
    5. Page layout. Are sidebars, navigation links and footer present? Repeat the checks described under #2 above, Index sidebar (s), navigation links and footer .
    6. Categories and tags. Are categories displayed (or hidden) as desired? How about tags? Are they clickable? Are they nofollow or follow based on your preference?
    7. Breadcrumbs. If you have breadcrumbs, are they present and appropriate for the navigation you desire?
    8. Comment and Trackbacks: run through the list below.
  5. Comment and Trackbacks
    1. Comment form. Is your comment form present?
    2. Comments. Are comments displayed? Are the comment counts accurate? Do the gravatars work, if desired?
    3. Trackbacks. Is the trackback link present? Do you want it to be? Are your trackbacks listed?
    4. Test comment. Submit a test comment. Does your comment submit? Is it held in a moderation queue?
    5. Comment subscriptions. Subscribe to comments option
      1. Comment feed. Subscribe to a comment feed – do you see all the comments? When you submit/approve a new comment, does it update?
      2. Subscribe by email. If applicable, try subscribing by email and then submitting another comment – are you notified via email?
  6. Regular pages
    1. Comments on pages. Do you have comments enabled? Do you want them to be? Trackbacks?
    2. Sidebars. Are sidebars present? Do you want them to be?
    3. Page hierarchy. Is the hierarchy displayed the way you want it to be? How about your permalink?
    4. Repeat all the tests for the single post pages.
  7. Images and image links
    1. Images. Navigate to a page or blog post with images hosted on your blog. Do your images load? Check the alt text and title text on the images – are they what you want them to be?
    2. Larger image. Does clicking the image bring up the large version (if applicable)? Is the link nofollow or follow based on your preference?
  8. RSS feed
    1. New post. Publish a test post – does it appear in your feed? (You are subscribed to your own feed, right?)
    2. RSS Link. Double check the RSS link – is it pointing to your feed?
  9. Errors and Redirects
    1. 404 page. Type in an address that does not exist. Review the 404 page. Is it the way you want it to be?
    2. Redirects. Have you redirected posts or pages in the past? Spot check a few. A couple internal posts, a couple internal pages, and a couple external links.
  10. Contact form (if applicable)
    1. Send a test email. Send yourself a test email to ensure your contact form still works. Do you receive the email? Are all the fields present?
    2. Confirmation. Do you see an appropriate confirmation shown to the user on the site after submission? If applicable, is a confirmation email sent to the submitter?

This is only a partial list – but it’s a great starting point. If you have specific plugins installed such as CommentLuv, or various search plugins, be sure to check all of them individually as well. If you have a plugin that generates your sitemap, and you upgrade it – that’s a good time to go and double check that your sitemap page still loads appropriately.

What do you think? What tips do you have for ensuring upgrades go smoothly?

This is a guest post from Sid Savara, who writes about personal development and personal productivity at SidSavara.com. If you’re struggling to get through everything in your RSS reader and inbox, you should definitely click through to learn How to Effectively Read 12,853 Articles, Forum Topics & Blog Posts a Week.

About Darren Rowse

Darren Rowse is the founder and editor of ProBlogger Blog Tips and Digital Photography School. Learn more about him here and connect with him on Twitter, Facebook, Google+ and LinkedIn.

Problogger.net runs on the Genesis Framework

Genesis Framework

The Genesis Framework empowers you to quickly and easily build incredible websites with WordPress. Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.

Check out the incredible features and the selection of designs. It's that simple - start using Genesis now!

Comments

  1. Martin says:

    That’s a nice comprehensive list!

    If possible, it can also be worthwhile running a copy of your blogging software on a development server, to allow you to test upgrades / config changes / etc, without affecting your production blog. You can then run all your unit tests (as described so nicely in the post above) on the development server, and once you’re happy with the functionality, you can then migrate the changes onto your production blog.
    With virtualisation, it’s very feasible to run a linux virtual machine on your desktop PC, and use it for test purposes.

    After making significant changes and/or upgrades, it can also be worth while monitoring the logs for any unusual behaviour, as that can sometimes indicate a possible issue.

  2. nikola says:

    really nice round up, or you can say definite guide … upgrade is always a problem especially with big sites ….

  3. Very good tips, I’m a software developer also and totally agree to to test everything every time you upgrade your blog or plugin. It’s better to test on another blog instance or another server before roll-out to production server.

  4. That’s a GREAT starting list! Thanks

  5. Writer Dad says:

    Hey, Sid! That was a great post, but mostly I just wanted to say it’s great to see you here.

  6. This is an awesome checklist. You’re right, I would definately sleep better after I used this checklist. Every blogger should have this!

  7. TechMata says:

    This would come in handy for me in the future. Bookmarked… Thanks!

  8. Oddly enough I just re-themed my blog last night and am planning a version upgrade in the next day or two. I tend to find (with the best will in the world) that something goofy always happens, usually minor layout issues. I will certainly make use of the checklist above! For those ‘with the luxury’ you can also set up an offline version of the site using a local web server. Everything can then be tested before migrating to the live site. That’s not always practical of course and does require a deeper technical background.

  9. Excellent post ! Considering the fact that I’d be redesigning and upgrading my blog soon, this post would help a lot !

  10. Swastik says:

    Blog transfer can be a very big headache, specially when you have no previous knowledge. One may spend hours fixing the problems after an upgrade.

    Extremely handy post, just bookmarked it.

  11. Akila says:

    It’s almost like QAing a software project. Isn’t it? There are some free tools which makes a QA’s life easy. I’ll try to find few names.

  12. Sid Savara says:

    @Everyone – Thank you for your kind words and comments. I am glad to see the list has been helpful and you’ve bookmarked it for reference =)

    @Writer Dad – Nice seeing you round these parts too ;)

    @Akila – Absolutely. I felt there were a lot of parallels with QA. Perhaps the simplest method might be best for blog upgrades, rather than some large tracking software: a text file or excel spreadsheet, and just check tests off as one goes down the line. I use Trac, Bugzilla etc for larger projects – but hopefully my blog won’t have such longstanding bugs =)

  13. Monthiel says:

    WOW, That’s was a nice article and a GREAT starting list! Tks

  14. Bill says:

    It’s good advice, but what you describe is not what software engineers mean by “unit testing”. In practice, unit testing is always automated and by definition it never tests the application in its assembled form.

    This is just straightforward functional testing / QA.

  15. tammy says:

    Good tips.

    It seems everytime we do an upgrade, there’s always something that doesn’t work.

    http://www.singlerose.com

  16. Ankur Jain says:

    I like the way you related unit and regression testing with wordpress upgrade.

    Good post!

  17. A very good list there. Its not only good to check these after an upgrade but even when starting a new blog.

  18. Gennaro says:

    It’s always a little nerve racking to upgrade. Even more so for a new theme (not necessary with thesis, of course). There are so many things that go into a site working properly that it’s easy to miss something that’s not working properly. That’s where a good readership helps. They’ll point it out.

  19. Roman says:

    Something you might consider is to add a little comment on the blog letting the visitors know you just made a major upgrade. And to ask them to let you know if they spot anything wrong.

  20. Sid Savara says:

    @Bill Hi Bill, it’s true my unit tests are all automated with Cruise Control, JUnit, EMMA, etc.

    I agree with your point though: in *practice*, software development unit testing *is* automated and this process is closer to quality assurance than it is to software testing.

    I wanted to emphasize the need to unit test individual components, as opposed to functionally testing a whole page etc. This manual approach can be called unit testing, provided each test is looking at the output of a single function (the way I have broken it up – Title Tag, etc)

    http://en.wikipedia.org/wiki/Unit_testing#Techniques

  21. Eric Hamm says:

    Very useful stuff, Sid! I’ve had my share of issues trying to help others (*cough* Sean Platt *cough*) upgrade their Thesis installation. Great reference post, Eric.

  22. Sid Savara says:

    @Eric Thanks! Yeah better watch out for that Sean Platt guy, he’s a menace. I hear he also has a mean snarl on his face when he does video blogs. ;)

  23. My headaches are less now. when I made the change I had no idea what I was getting myself into. I am still working on some issues, as many I have had to discover as I need them. I will print this list out. Some of your tips can certainly help me. :)

  24. Binny V A says:

    I am sure there are scripts to automate the whole process. Anyone know where I can find it?

  25. Sid Savara says:

    @Binny There are scripts to upgrade WordPress, and you can automatically upgrade plugins as well – themes typically you have to FTP the new version still.

    If you mean to automate the testing process, you may want to check out Selenium IDE. That tool can be used to test your website, but based on how often we update sections of our blog, it may be difficult to automate the tests.

  26. Jonathan says:

    Way over my head.

  27. That’s definitely a complete list. I don’t think I did 80% of that stuff when I did the upgrade. I just fired up the WordPress Automatic Upgrade plugin and went at it. Double checked everything to make sure it was working and I was good to go.

    Then again I don’t use Thesis and never have. Seems pretty difficult for a theme upgrade.

  28. Nice post Sid, very logical and programmer-like!

    It would be nice if a WordPress plugin could do these tests for you, and send you an email if something is wrong.

  29. Evelyn Lim says:

    Oh my goodness!! Version 1.4 has some minor issues?? I have just installed the thesis theme to my site. Luckily, I installed the old version as I did not realize the new one is out. I prefer to wait for a while in that case for all fixes to be done first.

  30. Sid Savara says:

    @Evelyn

    The issues did not affect everyone – some people upgraded just fine. I do not know the root cause, but it does not appear to be Chris’ fault – it appears to affect a minority of users (and unluckily, I was one of them ;) ).

    Chris fixed the problems promptly, I am running 1.4.2 and it looks great =)

  31. Arshad says:

    thanks a lot.The article was splendid.Although iam not a wordpress user i will have this bookmarked so that it might be of use in future .

  32. Timon weller says:

    Good points on upgrading, other issues can be where when your own server upgrades as well and can effect part of the script.. In the end it is all about running blogs or scripts online.. :)

  33. Thank you for this, it’s perfect, I needed it as I upgraded one blog recently and it messed stuff up and I was scrambling to figure out what was not working, now I am going to upgrade two other blogs and this will help a lot.

  34. Really nice and informative points regarding blog Unit Testing………
    Thanx
    http://www.commediait.com

  35. I’m glad that more main stream “big” computer system processes are moving into the blogging arena

  36. Wise Finish says:

    I second the suggestion to use Selenium IDE to test your site. This is a great tool that can automate everything described above. Automating your tests will allow you to run them more frequently, and therefore make your blog / website even better.

  37. Lee says:

    I am basically in thesis hell. And granted, I am a writer not a computer tech person. I bought it and am having no luck getting it uploaded.
    Here’s what happened:
    I was working with a wordpress.com blog.
    I bought thesis.
    I tried to upload which didn’t work as I was told that I needed a real host. (And know that I have no idea what that even means.)
    Bought a host from Go Daddy.
    Bought the wrong version of the host.
    Was told I bought the wrong version of the host, and then bought the right version which was compatible. I was told.
    Now I go to try to install Thesis zip which has been sitting on my desk top for weeks mocking me while everyone tells me how fabulous my website will be when I start using that it, and no luck. The zip appears in my file manager, but it will not open.
    I am nearly ready to call am ex, cancel it and give up for good but ultimately I really wanted to try it out.
    Please advise.
    Thank you.
    Lee
    How did you get in touch with Chris?

  38. Lara Kulpa says:

    Lee – You’re not in Thesis hell, you’ve managed to get yourself worked deeply into WordPress hell… it’s where people who are new to WordPress go.

    The good news, is that it’s pretty easy to get out of.
    The bad news, is that Thesis and Chris have nothing to do with it.

    Go to the WordPress.org documentation and forums… read the stuff, seriously. You seem to have missed some pretty crucial steps, and it looks like by doing so you’ve only served to frustrate yourself further, you know?

    Take your time, slow down, and don’t skim instructions.

    Yes, I do this all day long, every day, so for me it’s literally 3 minutes and I have WP installed and a new theme up and rarin’ to go – however MY first time took no more than 30 mins because I followed directions CAREFULLY. It’s the only solution – and the only place you can find guaranteed help is at the wordpress.org site. (There are even really nice folks that will help you with the install for nothing if you ask nicely!) :)