Skip to main content

How to write good manual tests?

When I first started out writing manual tests, I was really keen to do every step in minute detail and write out the expected result for every little step. In an ideal world where time is no constraint, resource is no constraint and updating the scripts is no constraint.. oh and the person writing the scripts didn't get bored.. then this would probably be the best way!

However, in the business world, we have all these constraints!!

The business want features yesterday, they want these features delivered with the minimal resource within the acceptable time frame and they want new features further down the line that make the old features redundant. 

With the above in mind, it's important to address, what makes up a good manual test? As these tests may or may not be around forever....

I think in order to answer the question above another question needs to be addressed, which is:

Is it going to form part of a manual regression test pack? Or is it throwaway?

If a test is going to be rerun and form a manual regression pack, then it is my opinion that it needs to be in as much detail as possible, and time taken to maintain these as I believe it's good practise to get new QA starters to run through a regression pack of what they are testing, which will help them get a feel for the application. The last thing you want is constant questions over whether this is correct behaviour or not (I am not moaning at new starters who do this, as it's genuine questions and the fault of the test if the test says otherwise)... It's also beneficial in a truly cross functional team, meaning that developers can run the tests without too much confusion.

For throwaway tests, I am a big fan of Given, When, Thens (Gherkin and BDD) or even Exploratory Testing (more on this in future posts). For example:

A Given When Then for searching for a Coming Soon product on a website


Whenever it's possible I like to write throwaway tests in this style, purely because it is meant to be run by someone who knows the application under test and it means that the test is quick and easy to write, quick and easy to update (if required) and can easily be parameterised. Of course there can be additional information in there (for example SQL scripts that may be needed to be run) if required, so long as each step is clearly defined, then I see no reason why you wouldn't want to write tests in this way (unless it is a complex end to end test, but then these types of tests tend to make it into some form of a regression pack anyway, so GWTs aren't really suitable for this form).

The project I am working on currently, isn't really new functionality that will need to be added to a regression pack, and as such, all of the tests that are being written are in this format, with attached data (SQL scripts etc.) if needed.

Another positive for GWTs is that they are easily automated, this can be achieved using SpecFlow, which binds the steps together and creates automated tests which can be run using a toolset of your choice (we use Selenium WebDriver for the WebUI automated tests currently - I will go over this in more detail in future posts).

Manual tests are on the decline,  when I first started in QA 5 years ago the vast majority of tests were manual,  however now with agile values,  continuous integration and better tooling more and more tests are becoming automated,  with what little manual testing that remains being covered by exploratory testing (again more on this in future posts).



Comments

  1. what do you mean by throwaway tests in terms of automation?

    ReplyDelete
    Replies
    1. Sorry, perhaps I wasn't 100% clear, I meant in throwaway manual tests, tests that aren't going to form a part of a regression pack, and aren't going to be used again. For instance, I recently worked on a project that had an aggressive golive date, and the business wanted it out quickly and it was just reworking existing functionality for a new language, so I created throwaway tests around them, in the format of GWTs. Minimal time/effort, but enough information to be able to let people know what is being tested and how.

      Delete

Post a Comment

Popular posts from this blog

Considerations when creating automated tests

We recently released to a number of teams our automated regression pack that has been worked on over the past few months. This regression pack tests legacy code, but contains a large number of tests.  As a bit of background, a number of teams are working on new solutions whilst some are still working on legacy code. With this in mind we constructed an email with a list of guidelines when creating new tests that need to be added to this regression pack.  I figured that these can be quite broad so should apply for any organisation, so thought it would make an interesting blog post...  So here goes,  when creating automated tests, it's important to consider and adhere to the following: - Think about data . The tests need to retrieve or set the data they need without any manual intervention - This should help them be more robust and easier to run without manual intervention. - The tests need to be idempotent - By making it so that each test is standalone and does...

Coding something simple.... or not! Taking a screenshot on error using Selenium WebDriver

I recently wrote a little function that takes a screenshot at the end of a test if it has errored. What sounded very simple at the start turned out to be quite a bit of work, and quite a few lines of code to handle certain scenarios! It's now over 50 lines of code! I'll start with what I had at the beginning, this was to simply take a screenshot in the working directory, we are using SpecFlow and Selenium to run the tests, so we are going to check if the ScenarioContext.Current.TestError isn't null, if it is, then using Selenium, take a screenshot (note the below code is a simplified version of what I had at the beginning). [AfterScenario]         public static void TakeScreenShotOnError()         {             if (ScenarioContext.Current.TestError == null) return;             var screenshotDriver = Driver as ITakesScreenshot;             if (screenshotD...

How to manage resources within new teams?

Working where I work we are constantly spinning up new teams to take on new workloads as business come up with new demands and new features they want developed and tested. The problem with this is how do we ensure the work of the newly spun up team is of sufficient quality. One method is by taking people from other established teams and placing them on the new team. This works great for the new team, but unfortunately it will oftenl eave the established team lacking in a resource whilst they try and fill the gap left by the person who has left. We are seeing this often with our offshore teams, it can be damaging to the team structure and the teams velocity, but try as I might, I can't think of another way around it. It's far easier to take 1 person from a team that is established than it is to build a whole new team from scratch. At least by leaving the core of a team in place, you should be guaranteeing that the new team are aware of any coding standards or any QA standard...