understanding qa kampala
TRANSCRIPT
Understanding Quality Assurance
Luiza NunesSanchari VivianaPooja
Oct 2013
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
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.
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());
}
}
Introduction toBDD
Workshop – Understanding Quality Assurance
Oct 2013
17
What is BDD?Behavior driven development
Collaborative Approach to defining software requirements which facilitates Test Automation
19
BDD fundamentalsFaster feedback
Focused communication
Enhanced teamwork
Living documentation
Enough is enough!
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
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…
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