understanding qa kampala

38
Understanding Quality Assurance Luiza Nunes Sanchari Viviana Pooja Oct 2013

Upload: thoughtworks

Post on 20-Aug-2015

529 views

Category:

Technology


0 download

TRANSCRIPT

Understanding Quality Assurance

Luiza NunesSanchari VivianaPooja

Oct 2013

2

What is Software Development?

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

4

Types of testingUnit TestingIntegration TestingFunctional TestingSystem TestingLoad TestingPerformance TestingAcceptance Testing

5

Testing Pyramid

Introduction toTDD

Workshop – Understanding Quality Assurance

Oct 2013

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

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.

9

TDD Cycle

10

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

11

Sample Codepublic class Foo {

public Foo() {

}

public String helloWorld() {

return "Hello World";

}

public boolean truth() {

return true;

}

}

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

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());

}

}

TDD By Example

Introduction toBDD

Workshop – Understanding Quality Assurance

Oct 2013

16 Picture Courtesy : Anand Bagmar

17

What is BDD?Behavior driven development

Collaborative Approach to defining software requirements which facilitates Test Automation

18

What are the benefits?Focus on value

Predictable quality

Protection from defects

19

BDD fundamentalsFaster feedback

Focused communication

Enhanced teamwork

Living documentation

Enough is enough!

20

How can I use BDD?

21

Given

When

Then

22

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

Setup phase of automated testing

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

24

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

25

How we use BDD?

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

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

28

How we use BDD?

New expected functionality:

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

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

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:

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

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…

33

Tools to enable BDD

Cucumber

JBehave

SpecFlow

Twist

34

35

36

Let’s practice it!

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

38

Thank you! [email protected]

[email protected]@[email protected]

join.thoughtworks.com