Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Understanding QA Kampala


Published on

Presentation part of the workshop about Quality Assurance, which happened at ThoughtWorks Kampala in October of 2013.
This presentation gives an overview around Agile Test Practices, including TDD, BDD, as well as the test automation pyramid.

Published in: Technology

Understanding QA Kampala

  1. 1. Understanding Quality Assurance Luiza Nunes Sanchari Viviana Pooja Oct 2013
  2. 2. 2 What is Software Development?
  3. 3. 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. 4. 4 Types of testing Unit Testing Integration Testing Functional Testing System Testing Load Testing Performance Testing Acceptance Testing
  5. 5. 5 Testing Pyramid
  6. 6. Introduction to TDD Workshop – Understanding Quality Assurance Oct 2013
  7. 7. 7 Unit Test “Unit Test is a procedure used to validate that individual units of functional code are working properly. Is usually done by developers Improves quality Facilitates changes (refactoring) Enables automation Simplifies integration
  8. 8. 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. 9. 9 TDD Cycle
  10. 10. 10 JUnit A open source regression testing framework Used by developers to implement unit tests in Java Provides tools for: -assertions -running tests -aggregating tests (suites)
  11. 11. 11 Sample Code public class Foo { public Foo() { } public String helloWorld() { return "Hello World"; } public boolean truth() { return true; } }
  12. 12. 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. 13. 13 Sample JUnit Code public class FooTest extends TestCase { private Foo foo= new Foo(); public void testHelloWorld() { assertEquals("Hello World", foo.helloWorld()); } public void testTruth() { assertTrue(foo.truth()); } }
  14. 14. TDD By Example
  15. 15. Introduction to BDD Workshop – Understanding Quality Assurance Oct 2013
  16. 16. 16 Picture Courtesy : Anand Bagmar
  17. 17. 17 What is BDD? Behavior driven development Collaborative Approach to defining software requirements which facilitates Test Automation
  18. 18. 18 What are the benefits? Focus on value Predictable quality Protection from defects
  19. 19. 19 BDD fundamentals Faster feedback Focused communication Enhanced teamwork Living documentation Enough is enough!
  20. 20. 20 How can I use BDD?
  21. 21. 21 Given When Then
  22. 22. 22 Given Tells us the prerequisites (what needs to be setup / done before we start this test?) Setup phase of automated testing
  23. 23. 23 When Tells 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. 24. 24 Then Tells us what to expect when the action is performed - this is the validation step of the automated test
  25. 25. 25 How we use BDD?
  26. 26. 26 How we use BDD? Given the account has a balance of UGX 100,000 When the customer requests for UGX 50,000 Then the account is debited by UGX 50,000
  27. 27. 27 How we use BDD? Given the machine contains cash When the customer requests cash Then ensure the customer’s account is debited And ensure cash is returned And ensure the card is returned
  28. 28. 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. 29. 29 How we use BDD? Given the card is valid And the machine contains cash When the customer requests cash Then ensure the customer’s account is debited And ensure cash is returned And ensure the card is returned
  30. 30. 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. 31. 31 Scenario: Searching for an item on Amazon Given I’m at Amazon’s homepage When I search for “Electronics” on the search dropdown on the top of the page Then I can see the results of my search
  32. 32. 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. 33. 33 Tools to enable BDD Cucumber JBehave SpecFlow Twist
  34. 34. 34
  35. 35. 35
  36. 36. 36 Let’s practice it!
  37. 37. 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. 38. 38 Thank you!