18
Testing Anti-Patterns Mark Collin - @Ardesco http://ardesco.lazerycode.com

Testing antipatterns

  • Upload
    ardesco

  • View
    324

  • Download
    1

Embed Size (px)

DESCRIPTION

Slides from my LTG talk on 30 July 2014

Citation preview

Page 1: Testing antipatterns

Testing Anti-Patterns

Mark Collin - @Ardesco http://ardesco.lazerycode.com

Page 2: Testing antipatterns

!

BDD

Page 3: Testing antipatterns

What people call BDD

Page 4: Testing antipatterns

As a user I want my search to return search results

Given I navigate to the google Website

When I type cheese in the search box

And click the “Google Search” button

Then search results for cheese will be shown

CHECK THAT SEARCH WORKS ON THE GOOGLE WEBSITE

STEP 1 Navigate to the google website

STEP 2 Type “cheese” in the search box

STEP 3 Click the “Google Search” button

STEP 4 Check that search results for cheese are shown

Page 5: Testing antipatterns

What people call BDD

• Conflating Scenarios

!

Page 6: Testing antipatterns

Given I want to expand my knowledge of all things cheese related

When I search for cheese on google Then I will get lots of cheesy information

Try to be more like this:

Page 7: Testing antipatterns

Interviewer: So you currently work in a BDD environment, can you tell me a bit more about that? Candidate: We use cucumber !Interviewer: That’s great, what else do you do.!Candidate: Um… we use cucumber

Page 8: Testing antipatterns

What people call BDD

• Conflating Scenarios

• Using Cucumber != BDD

Page 9: Testing antipatterns

BDD uses examples in conversation to illustrate behaviour. We sometimes call those examples scenarios, but really they mean the same thing. My favourite technique for eliciting examples is just to ask for them: “Can you give me an example?”

Liz Keogh

Page 10: Testing antipatterns

!

Defects

Page 11: Testing antipatterns

Curiously Reported/Unintelligible Defects

• Too little information / Presumed knowledge

!

!

Page 12: Testing antipatterns

Too little informationDescription:

When I try to log into the site it breaks

Reproduction steps:

Log into the site

Actual:

It breaks

Expected:

It shouldn’t break

Page 13: Testing antipatterns

Presumed KnowledgeDescription:

Using a TGS connecting to PDB and exercising scenario Alpha12, results not saved and notifications not sent.

Reproduction steps:

1. Enable all tunnels

2. Configure PDB data sources

3. Exercise scenario Alpha12 and then save results to CDC

Actual:

Results not saved to CDC

Expected:

Results should be saved to CDC and GMQ should be notified!

Page 14: Testing antipatterns

Curiously Reported/Unintelligible Defects

• Too little information / Presumed knowledge

• You haven’t diagnosed the problem!

!

Page 15: Testing antipatterns

Curiously Reported/Unintelligible Defects

• Too little information / Presumed knowledge

• You haven’t diagnosed the problem!

• Multiple defects in one ticket

Page 16: Testing antipatterns

An Ideal Defect

• Be clear about which Operating System / Device / Server you found the issue on!• If testing a website say which browser version you are using!• Minimal reproduction steps - if you don’t need to interact with 5 other systems

first to produce the error don’t add it to the reproduction steps.• Expected/Actual - explain what you think should happen, and what actually

happens (you may be wrong, but its the starting point for a conversation).• Add relevant attachments, e.g. screenshots, logs, etc.!Finally we should always endeavour to make the reproduction steps simple enough that they can be followed by a 6 year old with no technical knowledge.  

Page 17: Testing antipatterns

Inappropriate Automation• Rewriting dev code badly

• Going through the motions, but not actually checking anything

• Doing everything through the UI

• Focus your tests, don’t check everything!

Page 18: Testing antipatterns

Questions?

Mark Collin - @Ardesco http://ardesco.lazerycode.com