0% found this document useful (0 votes)
127 views

Testing in Agile Software Development

Slide deck prepared for an internal training program on Agile software development in late 2010. This deck covers the concepts and application of testing and test automation in agile project deliveries using storytelling and hands-on exercises.

Uploaded by

Unmesh Gundecha
Copyright
© Attribution (BY)
0% found this document useful (0 votes)
127 views

Testing in Agile Software Development

Slide deck prepared for an internal training program on Agile software development in late 2010. This deck covers the concepts and application of testing and test automation in agile project deliveries using storytelling and hands-on exercises.

Uploaded by

Unmesh Gundecha
Copyright
© Attribution (BY)
You are on page 1/ 55

Testing in Agile Software

Development

Iterate with Confidence!!

Author – Unmesh Gundecha / v1.0 / 2010


Module 4: Applying test
automation in Agile Projects
Unmesh Gundecha
Learning Objectives
• Explain Software test automation and
application in Agile software development
• Recognize the benefits of test automation
• Identify various testing tools and select a
testing tool for test automation
• Explain test driven development & acceptance
testing, create unit & acceptance tests
Welcome to Pet Shop
Meet Rajesh & Pooja….

Rajesh and Pooja are working together in a team,


building a revolutionary new online sales-
frontend for a Petshop using agile software
development method "Scrum"
Rajesh is working on the Shopping Cart
Page and Pooja is helping him in testing
these features…

To Do WIP Done
These are the user stories Rajesh & Pooja are working on
for Shopping Cart Page features in current Sprint:
Let’s Identify some Acceptance
Tests/Criteria for these User Stories
Pooja starts testing the Shopping Cart Page

€5.60

€95.00

and spots Bugs!!


Rajesh already stressed with sprint
backlog, spends most of his night fixing
defects. He gives a new build for testing to
Pooja next morning…
While Pooja is retesting earlier bugs, she finds that
functionality working earlier is broken. This happened
after changes made by the user interface team did not go
well with Rajesh’s change…

…now Pooja needs to test everything again


while they are about to finish the sprint
leaving other important features untested…..
Finally sprint is over, features are demoed to the
Customer.

As release date is nearing, the Product Owner


and customer is disappointed about the defects
and quality of the system and the lost customer
value…
Cost of Quality
In Sprint Retrospective meeting Rajesh and Pooja
discuss the problems they are facing with other
members of the Scrum team and the Scrum
master
A Quick Check

• What problems Rajesh and Pooja are facing?


• What can be improved here, and how?
the Scrum master suggests Rajesh and Pooja to
find whether automation can help….

They do some research, consult friends &


colleagues in other teams and suddenly find an
idea...

Using software test automation!!


Wait a minute, What’s all about
automation?

An Industrial Robot A bomb disposal An iRobot cleaning


in a car production robot, saving your home
line innocent lives
Software Test Automation

“Test automation is the use of software to control the execution of


tests, the comparison of actual outcomes to predicted outcomes,
the setting up of test preconditions, and other test control and test
reporting functions. Commonly, test automation involves
automating a manual process already in place that uses a
formalized testing process”

{Wikipedia}
Benefits of test
automation!!

Speed
Reliability
Repeatability
Test Coverage
The Agile Testing Pyramid
The top tier will the least automated tests because this Manual
level is usually composed of UI tests that are expensive Tests
to write or maintain and that often require human
control (over visual aspects for instance)

The middle tier is more difficult to automate than the


foundation and tests at this level will be focused on
business-facing tests. These functional tests will give
an answer to the question “are we building the right
thing”. It will ensure functionalities match the
requirements

The bottom tier has to be automated the most: it gives


the best ROI as unit tests can be easily written by
developers and gives them an immediate feedback.
The more automated unit tests, the stronger will be
the foundation
Implementing Test Automation
• Get the Management Support

• Define Goals for Test Automation

• Track the Progress using Goals and metrics

• Choose right tools!!


Selecting the right
tools for Agile Test
Automation
Welcome!!
to the world of testing
tools...

our software robots!!


Robot!! What's the
deal?
Personal Story

When I was kid, I had a


dream to build my own
Robot...but I don't know
electronics or mechanics!!
LEGO® is a trademark of the LEGO Group
MINDSTROM
NXT 2.0
Pros:
Gives you many features out of the box
Highly Flexible with other LEGO Parts
You can build many models from same set

Cons:
Very costly (including operating cost)
Additional features not available easily and they cost a lot
Limited help/user Community
Proprietary programming language
and limited sense of achievement 
Meet ARDUINO, an open
source electronics prototyping
platform
ARDUINO

Pros:
Cheap
Supports 100s third party components
Endless possibilities
Help/User Community
Gives great sense of achievement ☺

Cons:
Does not give out of the box features, you need to build..
Sometimes time consuming and need greater understanding of
electronics and mechanics
Major commercial testing tools
Tool Name Area Description Scripting/Programming
Languages
HP QuickTest Pro Functional Testing Market leading functional testing VBScript
tool. Supports various technologies
including Web, Java, .NET, Standard
Windows, Silverlight, Oracle,
Mainframe etc.

IBM Rational Functional Functional Testing Supports Standard Windows, Java, Java, VB.NET
Tester .NET and Mainframe Applications

SmartBear TestComplete Unit, Functional Second largest selling tool. Supports VBScript, C#
Testing, Load & Standard Windows, Java, .NET
Performance Applications
Testing

Microsoft Visual Studio Test Unit, Functional & Recently launched tool from C#, VB.NET
Professional Load Testing, Test Microsoft. Supports complete testing
Management life cycle for Standard Windows, Web
& .NET Applications
Major free & open source testing tools
Tool Name Area Description Scripting/Programming
Languages
xUnit (JUnit, NUnit. dbUnit) Unit Testing, API Supports major development Java, C# etc. (planform
Testing platforms specific variants available)

Selenium Functional Testing Supports Web Applications Java, C#, Python, Perl, Ruby

WATIR Functional Testing Supports Web Application Ruby

SoapUI Web Services Supports Testing of Web Services Java, XML


Testing
Now let's help Rajesh to implement
Test Driven Development using JUnit…
Test Driven Development
• Test-Driven Development (TDD) is the practice
of writing a unit test before writing any code

• This can be done relatively quickly, with the


developer writing the test, then writing the
code, and then running the test in small
increments

• Tools like xUnit Frameworks are used in TDD


Test Driven Development
TDD ensures the code is consistently refactored for a better design.
TDD has the following distinct benefits:

• It contributes to better overall system design by reducing code


duplication and other anomalies

• It forces programmers to think about end results first, which


increases the likelihood that the code will meet customer needs

• It increases test coverage for the system under development, which


uncovers more defects and reduces what Kent Beck, author of Test
Driven Development by Example, calls defect density
Red

Refactor Green
package com.tests;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class CalcDiscountTests {

@Before
public void setUp() throws Exception {
}

@Test
public void testGetDiscount() {
fail("Not yet implemented");
}

@After
public void tearDown() throws Exception {
}
}
package com.shoppingcart;

public class CalcDiscount {

public CalcDiscount()
{

}
public double getDiscount(double total, int discount_level)
{

}
package com.tests;

import junit.framework.Assert;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.shoppingcart.CalcDiscount;

public class CalcDiscountTests {

CalcDiscount cd = new CalcDiscount();

@Before
public void setUp() throws Exception {
}

@Test
public void testGetDiscount() {
Assert.assertEquals(10, cd.getDiscount(100.00,10),0);
}

@After
public void tearDown() throws Exception {
}
}
package com.shoppingcart;

public class CalcDiscount {

public CalcDiscount()
{

}
public double getDiscount(double total, int discount_level)
{

double discount;
discount = total * discount_level / 100;
return discount;
}

}
package com.tests;

import junit.framework.Assert;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.shoppingcart.CalcDiscount;

public class CalcDiscountTests {

CalcDiscount cd = new CalcDiscount();

@Before
public void setUp() throws Exception {
}

@Test
public void testGetDiscount() {
Assert.assertEquals(10, cd.getDiscount(100.00,10),0);
}

@After
public void tearDown() throws Exception {
}
}
Unit testing done...
Rajesh is Happy!!
Now let's fix
functional testing!!
What's Selenium?
• Selenium is most famous open source tool for
functional system & acceptance testing for web
applications

• Selenium supports tests on multiple browsers


including FireFox, Internet Explorer, Chrome,
Safari etc. on Windows, Linux & Mac

• Selenium provides a rich set of testing features


Hands-on Lab – Selenium IDE

Refer lab guide for details


with the power of test
automation you deliver on
time, within budgets and
with highest quality levels...
Applying test
automation in agile – a
recap
A Video Case Study
What’s in Video?
• What challenges for QA & testing in Agile?
• Goals for using test automation?
• Levels of test automation applied?
• Benefits realized?
• Measure of success?
Quiz
In Agile testing pyramid which layer gives best
value for money for implementing test
automation?

❑Acceptance Tests
❑Unit Tests
❑Beta Tests
❑Performance Tests
Quiz
Test automation helps in increasing test
coverage? True or False?

❑True
❑False
Quiz
Following is not an Unit Testing Framework?

❑JUnit
❑dbUnit
❑QuickTest Pro
❑pyUnit
Quiz
The refactor part in Red-Green-Refactor signifies
what?

❑Removing the Unit Tests


❑Completion of the Feature
❑Further optimizing the code implemented for the
feature
❑None of the above
Quiz
You can use Selenium to automate which types
of tests? (select all that apply)

❑Functional Tests
❑Unit Tests
❑Acceptance Tests
❑System Tests
Q&A
Thanks!!

You might also like