Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I systematically test and think like a real tester

Tags:

testing

My friend asked me this question today. How to test a vending machine and tell me its test cases. I am able to give some test cases but those are some random thoughts. I want to know how to systematically test a product or a piece of software. There are lots of tests like unit testing, functional testing, integration testing, stress testing etc. But I would like to know how do I systematically test and think like a real tester ? Can someone please explain me how all these testings can be differentiated and which one can be applied in a real scenario. For example Test a file system.

like image 852
brett Avatar asked Aug 10 '10 06:08

brett


People also ask

How do you think like a tester?

It requires critical thinking, creativity, and relies as much on instinct and intuition as it does the algorithmic execution of actions. Testing is often exploratory in nature — you don't fully know where you're going when you start. Great testers embrace the intuitive and exploratory nature of testing.

What is a good testing mindset?

An Agile testing mindset means avoid bogging testers down in red tape and bureaucracy. The more time testers spend doing menial tasks like documenting test cases, the less time they have to do value-added activities like finding defects.

What are the 4 types of testing?

There are four main stages of testing that need to be completed before a program can be cleared for use: unit testing, integration testing, system testing, and acceptance testing.


1 Answers

Even long-time, well respected, professional testers will tell you: It is an art more than a science.

My trick to designing new test cases starts with the various types of tests you mention, and it must include all those to be thorough, but I try to find a list of all the ways I can interact with the code/product.

For the vending machine example, there are tons of parts, inside and out.

Simple testing, as the product is designed to work, gives plenty of cases

  • Does it give the correct change
  • How fast can it process the request
  • What if an item is out of stock
  • What if it is overfilled
  • What if the change drawer is full
  • What if the items are too big, or badly racked
  • What if the user puts in too little money
  • What if it is out of change

Then there are the interesting cases, which normal users wouldn't think about.

  • What if you try to tip it over
  • Give it a fake coin
  • Steal from it
  • Put a coin in with a string
  • Give it funny amounts of change
  • Give it half-ripped bills
  • Pry it open with a crow-bar
  • Feed it bad power/brownout
  • Turn it off in the middle of various operations

The way to think like a tester is figure out every possible way you can attack it, from all the "funny cases" in usual scenarios, to all the methods that are completely outside of how it should be used. Any point of input, including ones you might think the developers/owners have control over, are fair game.

You can also use many automated test tools, such as pairwise test selection, model-based test toolkits, or for software, various stress/load and security tools.


I feel like this answer was a good start, but I now realize it was only half of the story.

Coming up with every single way you can possibly test the system is important. You need to learn to stretch the limits of your imagination, your problem decomposition skills, your understanding of chains of functionality/failure, and your domain knowledge about the thing you are testing. This is the point I was attempting to make above. With the right mindset, and with enough vigilance, these skills will start to improve very quickly - within a year, or within a few years (depending on the complexity of the domain).

The second level of becoming a very competent tester is to determine which tests you should care about. You will always be able to break every system, in a ton of different ways. Whether those failures are important or not is a more interesting question, and is often much more difficult to answer. The benefit to answering this question, though, is two-fold.

First, if you know why it is important to fix pieces of the system that break (or to skip fixing them!), then you can understand where you should focus your efforts. You know what you can afford to spend less time testing, and what you must spend more time on.

Second, and more importantly, you will help your team expose where they should be focusing their efforts. You will start to uncover things that are called "second-order unknowns". Your team doesn't know what it doesn't know.

The primary trick that helps you accomplish this is to always ask "why?", until whoever you are asking is stumped.

An example:

Q: Why this test?

A: Because I want to exercise all functionality in the system.

Q: Why does this system function this way?

A: Because of the decisions that the programmer made, based on the product specifications.

Q: Why did our product specifications ask for this?

A: Because the company that we are writing the software for had a requirement that the software works this way.

Q: Why did that company we are contracting for add that as a requirement?

A: Because their users need to do :thing:

Q: Why do the users need to do :thing:?

A: Because they are trying to accomplish :xyz:

Q: Why do they need to accomplish :xyz:

A: Because they save money by doing :abc:

Q: Why did they choose :xyz: to solve :abc:?

A: ... good question.

Q: What could they do instead?

A: ... now that I think about it, there's a ton of options! Maybe one of them works better?

With practice, you will start knowing which specific "why" questions to ask, and which to focus on. You will also learn to start deeper down the chain, and be less mechanical in your approach.

This is no longer just about ensuring that the product matches the specifications that the dev, pm, customer, or end user provided. It also helps determine if the solution you are providing is the highest quality solution that your team could provide.

A hidden requirement of this is that you must learn that half your job as a tester is to ask questions all the time. You might think that your team mates will be annoyed at this, but hopefully I've shown that it is both crucial to your development, and the quality of the product you are testing. Smart and curious teammates who care about the product (who aren't busy and frustrated) will love your questions.

like image 61
Merlyn Morgan-Graham Avatar answered Sep 23 '22 17:09

Merlyn Morgan-Graham