Top Banner
Understanding Quality Assurance Luiza Nunes Sanchari Viviana Pooja Oct 2013
38

Understanding QA Kampala

Aug 20, 2015

Download

Technology

ThoughtWorks
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Understanding QA Kampala

Understanding Quality Assurance

Luiza NunesSanchari VivianaPooja

Oct 2013

Page 2: Understanding QA Kampala

2

What is Software Development?

Page 3: Understanding QA Kampala

3

Why do we test?Testing should be integrated with one of the quality assurance activities

This verification is done to ensure that we are building the system right

Page 4: Understanding QA Kampala

4

Types of testingUnit TestingIntegration TestingFunctional TestingSystem TestingLoad TestingPerformance TestingAcceptance Testing

Page 5: Understanding QA Kampala

5

Testing Pyramid

Page 6: Understanding QA Kampala

Introduction toTDD

Workshop – Understanding Quality Assurance

Oct 2013

Page 7: Understanding QA Kampala

7

Unit Test“Unit Test is a procedure used to validate that individual units of functional code are working properly.

Is usually done by developersImproves qualityFacilitates changes (refactoring)Enables automationSimplifies integration

Page 8: Understanding QA Kampala

8

What is TDD“TDD is an evolutionary approach to development which instructs you to have test-first development intent. “

Small successful, tested steps.Do the simplest thing that could possibly work.

Page 9: Understanding QA Kampala

9

TDD Cycle

Page 10: Understanding QA Kampala

10

JUnitA open source regression testing frameworkUsed by developers to implement unit tests in JavaProvides tools for:-assertions-running tests-aggregating tests (suites)

Page 11: Understanding QA Kampala

11

Sample Codepublic class Foo {

public Foo() {

}

public String helloWorld() {

return "Hello World";

}

public boolean truth() {

return true;

}

}

Page 12: Understanding QA Kampala

12

How to test it?Debugger-Needs human intervention, slow, boring

Print Statements-Needs human intervention, slow, polluted code, "Scroll Blindness”

JUnit-Automatic,quick,no code pollution

Page 13: Understanding QA Kampala

13

Sample JUnit Codepublic class FooTest extends TestCase {

private Foo foo= new Foo();

public void testHelloWorld() {

assertEquals("Hello World", foo.helloWorld());

}

public void testTruth() {

assertTrue(foo.truth());

}

}

Page 14: Understanding QA Kampala

TDD By Example

Page 15: Understanding QA Kampala

Introduction toBDD

Workshop – Understanding Quality Assurance

Oct 2013

Page 16: Understanding QA Kampala

16 Picture Courtesy : Anand Bagmar

Page 17: Understanding QA Kampala

17

What is BDD?Behavior driven development

Collaborative Approach to defining software requirements which facilitates Test Automation

Page 18: Understanding QA Kampala

18

What are the benefits?Focus on value

Predictable quality

Protection from defects

Page 19: Understanding QA Kampala

19

BDD fundamentalsFaster feedback

Focused communication

Enhanced teamwork

Living documentation

Enough is enough!

Page 20: Understanding QA Kampala

20

How can I use BDD?

Page 21: Understanding QA Kampala

21

Given

When

Then

Page 22: Understanding QA Kampala

22

GivenTells us the prerequisites (what needs to be setup / done before we start this test?)

Setup phase of automated testing

Page 23: Understanding QA Kampala

23

WhenTells us the action that needs to happen in order to trigger the outcomes that we are

Testing for - this will be the action that the test needs to perform

Page 24: Understanding QA Kampala

24

ThenTells us what to expect when the action is performed - this is the validation step of the automated test

Page 25: Understanding QA Kampala

25

How we use BDD?

Page 26: Understanding QA Kampala

26

How we use BDD?

Given the account has a balance of UGX 100,000When the customer requests for UGX 50,000Then the account is debited by UGX 50,000

Page 27: Understanding QA Kampala

27

How we use BDD?

Given the machine contains cashWhen the customer requests cashThen ensure the customer’s account is debitedAnd ensure cash is returnedAnd ensure the card is returned

Page 28: Understanding QA Kampala

28

How we use BDD?

New expected functionality:

Customer should be able to withdraw money from his account only if his card is valid.

Page 29: Understanding QA Kampala

29

How we use BDD?

Given the card is validAnd the machine contains cashWhen the customer requests cashThen ensure the customer’s account is debitedAnd ensure cash is returnedAnd ensure the card is returned

Page 30: Understanding QA Kampala

30

How can I assess the scenarios that I write?

Capturing the expected behavior?Readable and clear enough for a human?Testable?Driving the developers down a particular implementation route?Using “strong verbs” to describe each step?Allowing automation on “WHEN” statement?Telling a story?

Are my scenarios:

Page 31: Understanding QA Kampala

31

Scenario: Searching for an item on Amazon

Given I’m at Amazon’s homepageWhen I search for “Electronics” on the search dropdown on the top of the pageThen I can see the results of my search

Page 32: Understanding QA Kampala

32

What’s wrong?

Contains User Interface (UI) language (dialogs, selecting, clicking)

The scenario language contains details that only an experienced user of Amazon customer can follow it

“Weak” verbs – can…

Page 33: Understanding QA Kampala

33

Tools to enable BDD

Cucumber

JBehave

SpecFlow

Twist

Page 34: Understanding QA Kampala

34

Page 35: Understanding QA Kampala

35

Page 36: Understanding QA Kampala

36

Let’s practice it!

Page 37: Understanding QA Kampala

37

Want to know more?

The Rspec book – David Chelimsky

Bridging the Communication Gap – Gojko Adzic

Specification by Example - Gojko Adzic

The Cucumber Book – Matt Whynne/Aslak Hellsay

Page 38: Understanding QA Kampala

38

Thank you! [email protected]

[email protected]@[email protected]

join.thoughtworks.com