Tuesday, 10 November 2015

How to Add Value (A Guide for Testers)


In a previous post I talked about "What are Testers for? What should a Tester Do?". I discussed the sphere of influence which a Tester has and suggested that maybe the boundaries we work to, as Testers, aren't in the right place.

I also covered the idea of Testers adding value. I think there is a general perception in the industry that Testers are there to prevent a loss of Quality - they just 'test the codes' and make sure there aren't any 'bugs', they are gatekeepers.

Well if that were true it would suck, I don't think I'd enjoy a role where all I got to do was kick the tyres. I also don't consider that to be adding value. Sure, it is valuable but in this scenario, the best possible outcome is that the Quality which existed in the developers intended solution has been delivered.

Before we go on it would help if you read my previous post about ‘what’ Quality is here.

So now we know what Quality is, let’s explore how it changes through the development process.

Where is Quality?

Let's think about how much 'potential Quality' there is at each stage of a development cycle, and how it can change as it becomes 'realised Quality':
Quality degrades through each phase

  1. Business Vision: The business has identified a market it wants to enter or a demand it wants to supply.
  2. Quantifying the Idea: This is the point at which you start breaking that idea into 'pieces' of work and thinking about who may do the work.
  3. Requirements: Once the idea has been broken into 'pieces', specific requirements are written to attempt to quantify what work needs to be done and how we will know when it has been achieved.
  4. Implementation: The requirements are then turned into 'stuff' - the embodiment of those requirements.
  5. Release/Launch: The 'stuff' is then sent off into the wild with the hope that it fulfils the Business Vision it was built to deliver.

I think of it as if there is a bucket (the process and the people) and water (the Quality). If we have a good process and good people, then as we build things, we get to the end with as much water in our bucket as we started with. But, what happens if we have a hole in our process, or several holes? Our bucket wouldn't let us deliver any water/Quality at all! The really important thing here is that we can't top up our bucket. Once we lose Quality it STAYS lost.

So looking at the graph, the best possible outcome is that the blue line stays horizontal - we deliver something into the world which completely fulfils the original vision of the business, nothing more, nothing less.
If everything is perfect...!

Why does Quality degrade?

  • Poor Process - This is a wide topic, but suffice it to say, if your process does  not encourage efficiency, openness, accountability, focus and delivery, your going to lose Quality.
  • People - People are everything, not having the right people will make everything much harder, if not impossible. Similarly, if people are not motivated or focussed, Quality will suffer.
  • Communication - Passing the information about the idea down the process chain to the end can end up being like ‘Chinese whispers’, meaning that over time the idea is warped and degraded and the output does not fully realise the original idea.
  • Context/Understanding - Decisions will be made throughout the process and out of context, the wrong choice may be made. Without a good understanding of the idea and the goal, people can make less than optimum decisions.
  • Changing Business Needs - The longer the time between the Business Vision and the Launch, the more chance there is that the original idea is out of date. The market may have changed, customers expectations may have changed etc. This is mitigated by utilising the correct processes and methodology.

The Testers part in this.

You'll remember the point I made in this article about the scope and boundaries a Tester may or may not have. If a Tester’s only input is during the implementation phase, then the best possible impact they can have on Quality is to maintain it through the 4th section on the graph:
Is this the only place we can make a difference?

If the scope of the Tester is purely limited to that section of the process, then this is the result. But, what if we really go after that idea of expanding our influence and our challenging behaviour, what could that mean for Quality?

Let’s Start at the End.

Release/Launch. Now, I’m not going to suggest that as a Tester you should be knowledgeable or skilled enough to second guess the Sys Admins and Infrastructure team in your company. But, that doesn’t get you off the hook! As a Tester you must be focussed on minimising risk and risk often comes with difference.
Look at the differences between how you test during the implementation phase and the system when it is deployed into Production. These differences fall into two categories: Infrastructure and Use.

  • The closer your testing environments are to the Production infrastructure, in terms of spec and scale, the better. Let’s say you have an environment which once tested became the live Production environment. The risk of ‘deployment’ related issues is reduced considerably versus a test environment which bears little resemblance to the Production environment. As a tester it’s your responsibility to drive toward this goal and ensure you get the ‘best’ test environments you can.
  • Use it like a customer! Always use the ‘C’ word! If your testing is focussed on exercising the system in the same way that it will be used once it’s launched then you are going to be finding the important issues which may affect the customers.

Deployment Success/Failure criteria. Making a change, testing it and releasing doesn’t mean the change is working. You need to monitor the release to ensure the behaviour it is exhibiting is what was desired, and that unexpected and/or undesired behaviour does not present itself. The best way to know this, is to include ‘success/failure’ criteria into your release plan.

What else is required?

Requirements. When we go to planning and are given pieces of work to undertake, this work will have requirements associated. Depending on your processes, habits and traditions, these may take different forms but they will try to convey ‘what it needs to do’.

This phase is absolutely critical.

This phase takes the abstract, delicate, ‘vision’ of an idea and attempts to solidify it into a hard and fast mould. A bit like making a plaster cast, the requirements are the mould, if the mould is loose, not detailed and not rigid, then the plaster model is will not be what the artist envisaged.

The science of good requirements is a well documented area, as a tester, you should be intimate with this knowledge! I won’t cover it here. However, as a Tester you are in a unique position to be able to guide, influence and improve requirements standards. You should have excellent business context understanding, combined with a good interpretation of how the requirements may be implemented. This means you can bridge the skills and knowledge gap between Business Analyst/Product Owner and Developer in a way no one else can.


Quantifying the Idea. So someone in the business (or in the industry) has a had an idea. Before we head into requirements and development, we need to really get to grips with the idea. As a Tester this means, I’m thinking about the following questions:

  • Who would use this new feature?
  • What is the use case? Are there some case studies we could look at (even theoretical one’s are useful)?
  • How will this affect the use of other features?
  • How do we expect the new feature to change our revenue?
  • Do I know enough about this subject yet?

During this phase I would expect in most cases that wire frames and prototypes are built, theories should be tested and validated and alternative options investigated. In some ways it’s helpful to use this phase to think of as many reasons as possible why we shouldn't build this idea.

That’s not to say we should be negative, let’s face it, if nobody built anything we wouldn't have much work on would we!? The point I am trying to make is, that the best ideas will always stand up to scrutiny. You will find that scrutiny actually improves ideas, because they change and adapt as weaknesses and flaws are discovered.

As a Tester you are again in a unique position to work on this phase. Your business context knowledge, experience of how users interact with the existing product, their complaints, and the things they like, are all available to you. Combine this with your ability to think critically, but objectively about things and your inbuilt curiosity and desire to learn make you a valuable asset here.

Sure the decision makers (Business Analysts, Product Owners, etc.) have much of this information, and it is certainly not your job to be hijacking these decisions away from them, but you do have a different skill set and way of thinking. Use it.

And finally...

Business Vision. So this is a tougher nut to crack. ‘Business Vision’ is seated in the domain of the ‘higher ups’, the Business Leaders. I'm not about to suggest you should be scheduling weekly checkpoints with your CEO, to test his 5 year plan for the company (although…!?). Of course, that’s not the way to go. But we really have to be paying a lot of attention to this. The Business Vision is going to dictate the work coming through the business for the foreseeable future, you need to be aware of these so you can up-skill and gain knowledge of the new things you will be encountering.

It’s not good enough to wait until you need the skills and the knowledge, before you start to learn. Be proactive. When the Business says “we’re changing”, be ready, waiting. This is the way in which you can ensure that - as the decisions are being made, the requirements set, the code written - you are right there, challenging, validating, questioning and adding value, every step of the way.

Final thoughts

It is easy to think of ourselves as "just Testers". Let's face it, there's always so much to do, without seeking out more work! But I would really urge you to consider expanding your horizons. I am increasingly coming around to the idea that the title of "Tester" is an inaccurate representation of what our real skills and value are. You have a unique skill set and a unique viewpoint, often able to bring together aspects from all around the business, which other disciplines have less access to. You really should be using it!
Go add value!

Monday, 9 November 2015

Automation in testing - writing your own tools


A consistently hot topic in testing is “automation” and how it can be used to improve testing. In this blog post I’m going to talk about how you can really get the most out of “automation” very quickly.

Automation? So you’re going to replace me with a machine?

Nope, I’m going to suggest you augment your abilities as a tester like a cyborg! Part human, part machine. Frequently people assume automation is referring to having a machine perform all of the tests you might perform manually. But actually automation can be used to help you manually test faster. Are you spending a lot of time tearing down databases and re-creating data? Are you spending a lot of time repetitively reading and comparing files? Automation can help you focus on the fun part of testing!

So where do I start?

Before I get onto some of the ideas for what you can automate, you need tools in order to create the automation! First of all, do you have any programming knowledge? If you don’t, don’t fret! (if you do, please ignore me as I’m writing this assuming you don’t). There are things called “scripting languages” - these are a form of programming language that is usually interpreted rather than compiled. What does that mean? Well it means they are much easier to work with and some of them even have more natural english language-like syntax. These scripting languages are a great way to quickly and easily put together programs that automate tasks for you and hopefully you will find them much more accessible than compiled programming languages such as Java or C.

So which language is best?

The one you are most comfortable with really, if you already know a language, then there is nothing wrong sticking with that language. If you don’t know any languages, then some I would recommend are Python and Ruby. I personally prefer Python and I will write the rest of this blog on Python but Ruby is equally good place to start.
Check them both out and decide for yourself which you like the most:
The reason I recommend Python and Ruby is because they are very commonly used and can be run on any machine be it Windows, Mac or Linux. There are lots of examples of free code or libraries (collections of code) available online for you to use to tackle almost any problem too. I personally prefer Python simply because it is more human-readable than Ruby and many other languages.

Ok, so I’ve done a few tutorials but what do I start automating?

Think about tests you’re running and where you spend the most time, can any of it be handled by a script? Is there something about the setup of the test that can be automated?

I don’t know?

That’s ok, it is hard at first to really know what you can and can’t do until you’ve attempted something or seen it done before. Naturally I would recommend trying some ideas as this is always a good way to learn. But to give you some ideas of what is possible, I’ll cover some of the tools that I’ve created myself.

Data Setup

My first port of call whenever I’m considering automation-assisted testing is to look at the data setup for the test. Sometimes there can be a lot of tests that require a lot of setup before hand but you don’t want to vary that setup too much, you simply want to have an environment where you can focus on a particular area. Perhaps you’re attempting to recreate a bug 20 pages into a website or an application. Or perhaps you’re testing an invoicing system and you simply want some base data to repeatedly test against. Sometimes these kinds of tests involve a lot setting up and then restarting to try something else - you want a “clean” set of data that isn’t spoiled too much by testing you’ve done before.

Automation can help a lot in quickly setting the exact same “clean” data up again. You may ask “but why not just have a saved state of an environment?” - sure, that is a valid alternative strategy to deal with this problem. However, it’s a different kind of maintenance - with that you are maintaining a database that you need to keep updating. With a script you may also need to keep updating with changes to the system you are testing. Personally I prefer maintaining scripts, I feel you can more easily create scripts that are less affected by change than keeping a database in a clean state.

Some examples of tools I’ve created to help speed my testing up by creating data are:
  • A script that utilises the Selenium Webdriver library to open a browser window and create data in a web application for me. I wouldn’t normally recommend using Selenium for data setup because it is designed for checking UI elements and is therefore quite slow. But in this particular case this was a legacy system with no alternative than a UI for creating the data. I felt it was worth mentioning because Selenium is a useful library if you need to script around a UI. This script became a time-saver simply because it could be left running while I worked on other things.
  • A script that controlled two SIP telephones and had one call the other using the sipcmd program and later, the PJSIP library. This was used to quickly and easily create call traffic, especially in large amounts (e.g. making 100 calls). During some of my testing I’ve had instances where I’ve had to simulate telephone calls and it was useful to automate it to create volume. It also had the benefit of being able to then log and provide details about the phone call that would have been more difficult to see manually.
  • A script that uses the requests library to interact with a REST API. This allowed very rapid data setup within seconds and the requests library is extremely straightforward to use. I fully recommend this approach to data setup because of its speed.

Speeding up tests

The second area I focus on is to look at where I spend the most time during a test. Am I manually performing something that is just checking? Can a machine do this checking instead? I once had to test a change to a billing system that produced invoices for customers. I wanted to run the invoices on the old system and the new system and compare them to see if I could quickly identify any obvious problems between the two. Manually, this was a lot of “checking” that didn’t really require much intellectual thought - I would be literally comparing one value to another. This is a candidate for automation, so I can focus on more intellectual tests such as focusing on edge cases or perhaps scenarios where we don’t currently have a customer (so I can’t test through this method).

Some examples of tools I’ve created for speeding up tests are:
  • A script that compares groups of CSV (comma-separated values) files. I used this to very quickly compare the results of running invoices in one version of a billing system with another. It very simply compared the totals of the invoices - so it wasn’t “testing” very much, but it allowed me to very quickly identify any easy or obvious failures in the billing if the totals didn’t match. This is a good example of a script that augmented my manual testing and allowed me to provide information much faster.
  • A script that uses the requests library to quickly check every customer-facing API endpoint returns a 200 OK response. This was useful for very quickly performing a very basic check that the API appeared to be functioning - which would quickly catch any easy bugs.

When not to automate

So this all sounds great right? Remove all the boring, time-consuming testing and leave a machine to do it? Hold your horses! It’s not quite as straight-forward as that. There are times when automation really isn’t a good idea. Here are some common pitfalls for automation:
  • The desire for invention. Beware of becoming more interested in engineering automation than providing valuable testing. Make sure that any automation you are writing is going to deliver some value to your testing. Don’t simply automate parts of your testing simply because you can.
  • Avoid creating a mirror image of the system you’re testing. This is very easy to do, say you are testing a calculator - it’s easy to end up writing a script that enters 2+2 and then calculates the answer itself. So both the calculator and the script calculate the answer is 4. Why is this bad? Because in a more complex example where a failure occurs, how do you know which is wrong? Have you written a script that calculates the answer wrong or is the calculator failing? Instead you should be writing a script that already knows the answer. You shouldn’t be calculating the answer during the test.
  • Once-only tests with little to no repetitive nature to them. When I say repetitive nature, I mean there isn’t anything in this one-off test that requires you to repeat something like data setup or checks - these are obviously good to automate potentially. But otherwise one-off tests are nearly always quicker to perform manually and the cost of creating your automation script won’t be recovered in value because it may never be used again.

One more thing…

This post has been all about creating your own tools via scripting, but sometimes a tool may already exist! It's always worth searching around the Internet for existing tools that may help your testing, but learning scripting is useful in situations where you don’t have time to search and try different options and just want to quickly script something small.
Existing tools can take many forms such as Python libraries, professional software products or perhaps plugins or extensions to another piece of software your company already uses.


  • Automation is useful to augment your testing, improving your speed and efficiency.
  • Scripting languages are a good place to start learning how to create your own automation tools.
  • It’s hard to know what you can script at first, so never stop asking the question “can I script this?”.
  • However, beware of creating automation simply because you can, make sure it’s valuable.
  • Even if you can’t create your own tool, have a look around and see if anyone else has.