SlideShare a Scribd company logo
1 of 57
Download to read offline
Agile Testing
BC Holmes
@bcholmesdotorg
© 2015 Intelliware Development Inc.
What you’ll learn in this presentation:
• Why do we use Agile testing?
• What Agile testing isn’t
• What Agile testing is: unit testing and test-driven development (TDD)
• High-level properties of good tests
• Testing in different languages
• Test suites and code coverage
• Using mock objects to help isolate units
• Beyond unit testing
© 2015 Intelliware Development Inc.
Design
• A test usually provides a concrete usage scenario that helps a developer think
about the following when writing code:
• What is the code expected to do?
• How will the code be set up and executed?
• What other pieces of code are needed as collaborators, and how will the code interact
with them?
• Especially good at helping to write code that is loosely coupled.
3© 2015 Intelliware Development Inc.
Why do we use Agile testing?
Why do we use Agile testing?
Focus/Rhythm
• Unit tests provide an easy way for a developer to focus
on a particular coding task.
• Clear and fast feedback if the code is working or not.
• Always clear what to do next:
• Either fix a failing test or write a new test as a prelude to
adding functionality.
4© 2015 Intelliware Development Inc.
What Agile testing isn’t
Agile Testing is not a “phase”.
• In traditional methodologies, testing is a phase of the project that happens after coding.
• In Agile methodologies, coding, refactoring and testing are tightly inter-related tasks and
can’t be separated.
A testing “phase” that’s months, weeks or even days in the future provides
very slow feedback to developers.
• Faster feedback gets failure information to developers while the details of the code
implementation is still fresh in their minds.
5© 2015 Intelliware Development Inc.
What Agile testing isn’t (continued)
Agile testing is not a replacement for quality assurance (QA) testing.
• Agile testing is a practice to help developers create better code.
• Agile testing is intended to improve the quality (design, defects, etc.) of the final code
deliverables.
• That might mean that you have a lower need for QA, but not necessarily.
6
It’s noteworthy that Lisa Crispen’s book, Agile Testing,
is principally about the role of dedicated QA-style
testers on Agile projects, rather than the testing
practices of Agile developers.
© 2015 Intelliware Development Inc.
What Agile testing is:
unit testing and test-driven development
© 2015 Intelliware Development Inc.
Test-driven development (TDD)
TDD is one of the earliest forms of Agile testing, and the most
commonly implemented types of Agile testing. It’s a style of
programming in which three activities are tightly interwoven:
coding, testing (in the form of writing unit tests) and design (in
the form of refactoring).
• Write a "single" unit test describing an aspect of the program.
• Run the test, which should fail because the program lacks that feature.
• Write "just enough" code, the simplest possible, to make the test pass.
• "Refactor" the code until it conforms to the simplicity criteria.
• Repeat, "accumulating" unit tests over time.
8
Source: Agile Alliance
© 2015 Intelliware Development Inc.
Origins
9© 2015 Intelliware Development Inc.
What is a unit test?
“In computer programming, unit testing is a software testing
method by which individual units of source code, sets of one or
more computer program modules together with associated
control data, usage procedures, and operating procedures are
tested to determine if they are fit for use. Intuitively, one can
view a unit as the smallest testable part of an application.
[…] In object-oriented programming, a unit is often an entire
interface, such as a class, but could be an individual method.
Unit tests are short code fragments created by
programmers… during the development process.”
10
Source: Wikipedia
© 2015 Intelliware Development Inc.
The TDD process
11
Commit code
Create a unit
test
Execute the
Test
Fix the code
so that the
test runs
Execute the
Test
Refactor the
code
Run all tests
Automated
build (includes
running tests)
© 2015 Intelliware Development Inc.
Creating a simple unit test in Java
• Unit tests are most
commonly created using the
JUnit framework.
• Imagine this scenario: we’re
writing code to calculate
mortgage payments.
12© 2015 Intelliware Development Inc.
Create code that tests a specific expectation
13© 2015 Intelliware Development Inc.
Run the unit test
• In this example, we’re using Eclipse’s
built-in JUnit test support to run the unit
test.
• The red bar indicates that our test
doesn’t yet pass successfully.
• Note how the test name appears to
clarify which test has failed.
• The name gives an indication of the expected
behaviour.
14© 2015 Intelliware Development Inc.
Fix code and rerun
• The developer should write enough
code to make the test pass.
• The green bar indicates that all the
expected behaviour is correctly
implemented.
15© 2015 Intelliware Development Inc.
Rules about tests
• Often, once the tests are green, the developer’s next step is to
refactor code.
• Refactoring involves improving the design of existing code.
• Make it more readable, increase the efficiency, or remove duplication.
• The tests help to ensure that the developer hasn’t broken any functionality during
the refactoring.
• Run all tests before committing or pushing code in to the source
code repository.
• If there are any broken tests, you should not commit.
• Automated build processes should run all of the tests as an
indication of the validity of the build artifacts.
16© 2015 Intelliware Development Inc.
Some high-level properties of good tests
© 2015 Intelliware Development Inc.
Representative: Of events that are
likely to be encountered by the user.
(Not necessarily “commonly”, but
likely). Hacking attempts, for
example, might be likely, but not
common.
Non-redundant: The test shouldn’t
reproduce the work of another test.
Motivating: Your client will want to
fix the problem exposed by this test.
Properties of good tests
Power: A test should reveal
problems when they exist.
Valid: When the test states that
there’s a problem, it is a genuine
problem.
Value: Tests should reveal problems
that the client cares about.
Credible: The test should be trusted
to actually test the things that people
expect it to test.
18
Source: Cem Kaner
© 2015 Intelliware Development Inc.
Coverage: The test exercises a part
of the code that isn’t already handled
by another test.
Easy to evaluate: It should be
relatively easy to determine whether
the test has passed or failed.
Insightful: A good test should reveal
things about our assumptions.
Properties of good tests (continued)
Performable: Designing a test that
can’t actually be performed is
useless.
Maintainable: If the end product
changes, it’s important to be able to
update the tests.
Repeatable: It should be easy and
inexpensive to execute the test again
and/or reuse it as appropriate.
19
Source: Cem Kaner
© 2015 Intelliware Development Inc.
Cost: the cost to
create/execute/maintain the
test should compare favourably
to the value.
Opportunity Cost: The test
obviates the need to perform
some other work.
Supports troubleshooting: If the
test fails, it should help the
programmer identify the problem.
Appropriately complex: No more
complex than necessary.
Accountable: Can you explain why
the test exists, and can you
demonstrate that it was executed?
20
Source: Cem Kaner
© 2015 Intelliware Development Inc.
Properties of good tests (continued)
Testing in different languages
© 2015 Intelliware Development Inc.
Common unit test frameworks
Java
• JUnit, TestNG.
.Net
• Microsoft Unit Testing Framework and NUnit.
JavaScript
• Mocha, Jasmine, Unit.js, Nodeunit, QUnit, JSUnit, and
many others.
iOS / Objective-C
• XCUnit (successor to OCUnit).
Python
• Nose, unittest (a.k.a. PyUnit).
22© 2015 Intelliware Development Inc.
Unit testing with JavaScript and Mocha.js
Slightly different syntax from JUnit, but most concepts are comparable.
23© 2015 Intelliware Development Inc.
Executing Mocha.js on the command line
Most JavaScript unit test frameworks are command-line-based.
24© 2015 Intelliware Development Inc.
Unit testing with C# and Microsoft’s unit testing tools
Again, slightly different
syntax, but same basic
concepts.
25© 2015 Intelliware Development Inc.
Visual Studio’s built-in test support
26© 2015 Intelliware Development Inc.
Testing with Objective-C and XCUnit
27© 2015 Intelliware Development Inc.
XCode’s built-in support for XCUnit
28© 2015 Intelliware Development Inc.
Successful execution
29© 2015 Intelliware Development Inc.
Key insights
Unit testing in a variety of languages (and test frameworks)
is largely the same.
• Test a specific function and give it a descriptive name.
• Set up some necessary classes and/or data.
• Invoke the function/method under test.
• Check/assert that calculated values match expectations.
Most test runner tools use red and green indicators to tell
developers the current state of the tests.
30© 2015 Intelliware Development Inc.
Test suites and code coverage
© 2015 Intelliware Development Inc.
Test suites
Over time, as more and more tests are created, a sizeable amount of the
application is backed by unit tests that are executed many times a day to
ensure that previously-created functionality still works.
• Hundreds or even thousands of unit tests are not uncommon for a single application.
As more and more tests are added, the amount of time it takes to execute
the tests increases.
• If that amount of time is too long, developers will start becoming discouraged from running
the tests regularly.
• A few seconds is awesome.
• Less than 30 seconds is still pretty good.
• A few minutes isn’t terrible.
• More than that is likely to be irritating.
32© 2015 Intelliware Development Inc.
Code coverage
Some languages/environments have tools that can calculate the amount of
your application’s code that gets executed during the running of the unit test
suite.
• These tools are called “code coverage” or “test coverage” tools.
High coverage usually indicates that the application is well-tested, and that
usually results in developer confidence that they can change the application
and not break the existing functions.
• How high is high enough? There are a lot of factors and not all projects are the same, but
75% or 80% coverage is often used as a starting goal.
33© 2015 Intelliware Development Inc.
Some stuff is hard to test
Visual output
• Does a web page look attractive? Is an animation jerky or glitchy? Is one component of a
web page covering or obscuring another component?
• Graphical output — especially image-based.
• Example: a class that outputs a bar chart as a PNG image.
Code that’s date/time-driven or based on timers
• But if you parameterize the date/time information, you can often mitigate the difficulty.
Legacy code
• The best time to start unit testing code is at the beginning of a project.
• Legacy code, especially tightly-coupled stuff, is harder to make testable.
34© 2015 Intelliware Development Inc.
Using mock objects to help isolate units
© 2015 Intelliware Development Inc.
Mock objects: dealing with collaborators
“In object-oriented programming, mock
objects are simulated objects that mimic
the behaviour of real objects in controlled
ways. A programmer typically creates a mock
object to test the behaviour of some other
object, in much the same way that a car
designer uses a crash test dummy to
simulate the dynamic behaviour of a human
in vehicle impacts.”
36
Source: Wikipedia
© 2015 Intelliware Development Inc.
Tools for working with mock objects
Usually involves a mock framework
• Java
• Mockito, Jmock
• JavaScript
• Sinon.js
• Objective-C
• OCMock
37© 2015 Intelliware Development Inc.
Example
We want to test functionality related to
renewing a mortgage.
• Renewing a mortgage should be based on same
payment type, but current interest rate.
Mortgage collaborates with a class that
provides the current interest rates.
• But we’re currently testing the renew functionality, not
the providing of interest rates.
Let’s try an example using Java and Mockito.
38© 2015 Intelliware Development Inc.
39
Need a special
test runner
© 2015 Intelliware Development Inc.
40© 2015 Intelliware Development Inc.
Additional thoughts
Mock object frameworks provide a powerful way to ensure
that you’re testing only a single unit at a time.
• Helps isolate an individual unit.
If the configuration of your mock object starts to get
complex or messy, that’s an indication that your class is too
tightly intertwined with the mock object’s class.
• Remember: loosely-coupled classes are easier to test, and usually a
better design choice.
41© 2015 Intelliware Development Inc.
Defining your units
A “unit” is often a class or small collection of related classes.
• Anything not contained in that “unit” is a dependency or collaborator.
• We usually create mock objects to take the place of the dependency/collaborator when we
build the unit test.
Consider special case: a class that reads data from a database.
• In Java, such classes are often referred to as “Data Access Objects” or DAOs.
• Key question: does the “unit” that you’re testing include the database?
• Or should the database be considered a dependency/collaborator?
42© 2015 Intelliware Development Inc.
The case for “no”
• Unit tests that connect to the
database are often slower than
most other unit tests.
• Both because of set up and
because of I/O.
• You need to consider the
contents of the database: does
your test expect certain records?
How do they get there? What if
those contents are changed?
Managing the initial state or
“home state” of the database is a
non-trivial exercise.
My gut is telling me “maybe”
The case for “yes”
• It’s often hard to mock out an
entire database API.
• Including the database allows
you to test more: object-
relational mapping
configuration, query
correctness, etc.
• If you use database features
such as triggers or stored
procedures, this might be the
only way you can test those.
43© 2015 Intelliware Development Inc.
Database tests
Don’t get hung up on the name.
• Whether or not they’re “unit” tests, it’s often fruitful to include
tests that touch the real database.
Dealing with “Home State” is often worth the initial
investment.
• Home state is a version of the database (or other resource)
that contains the data that the tests expect.
44© 2015 Intelliware Development Inc.
Approaches to home state
Restore the database prior to running tests.
• Always brings the data back to home state, but might take time.
Have a separate database specifically for unit tests to use.
• But need to apply necessary table definition changes as the project evolves.
Don’t let unit tests change the state of the database.
• Rollback any changes or undo database changes when the tests finish.
• Doesn’t help if the same database is used for ad-hoc testing.
Try to minimize the expectations.
• Not always possible or easy.
Home state management isn’t easy, but the benefits are worth it.
45© 2015 Intelliware Development Inc.
Beyond unit testing
© 2015 Intelliware Development Inc.
Beyond unit testing
Although Agile testing is often described in terms of creating unit tests, there
are other forms of testing that can prove useful for an agile project.
Common test types:
• Integration Tests: tests that integrate a number of units, to ensure that the parts interact
with one another properly.
• UI Tests: tests that automate interaction with a UI and the complete application codebase to
ensure that all parts function together properly.
• Performance Tests: tests that automatically capture information about the response time of
the application, possibly under load.
• Static Analysis Tests: tests that analyze code, looking for violations of coding conventions
and development rules.
• Acceptance Tests: tests that demonstrate to the customer that the requested functionality
has been implemented.
47© 2015 Intelliware Development Inc.
Integration testing
Sometimes, the integration between multiple units is sufficiently
complex that it’s fruitful to test it.
• Especially true of application-specific code that needs to be integrated with and
configured in major frameworks.
Examples:
• Ensure that a certain number of classes are correctly configured and wired
together in a Spring configuration file.
• Ensure that a SOAP interface has been correctly configured to send or receive
the necessary data.
The goal is to integrate no more parts than absolutely necessary.
48© 2015 Intelliware Development Inc.
Integration tests (continued)
Because more parts need to be set up and initialized, integration
tests may take longer than other types of tests.
• Integration tests might end up being run less frequently.
Still interested in this question: “Do the integration tests run quickly
enough that we can expect the developers to run them prior to
synching with source control?”
• A “yes” answer provides more value than a “no” answer, but a “no” answer can
still be helpful.
49© 2015 Intelliware Development Inc.
UI tests
Can be considered a special case of integration tests —
essentially integrating all of the parts.
Examples:
• Web UI Tests.
• Launch the full application in a web server.
• Selenium is a very commonly-used web UI test tool.
• Mobile UI Tests
• There are many approaches to building mobile apps.
• Native, HTML5 or Mobile Application Development Platforms (MADPs)
like Worklight, Kony or Appcelerator Titanium.
• As a result, no one mobile UI test tool has become de facto standard, so
mobile UI testing is still an emerging discipline.
50© 2015 Intelliware Development Inc.
Performance tests
• If one of the requirements (user stories) of your application involves
performance targets, testing is the ideal way to ensure that those targets
are met.
• While Agile developers often caution against premature performance
optimization, it’s also not necessarily a good idea to wait until the end of a
project to test performance.
• Performance testing often tests the integration of many of the parts of the
application, rather than just individual units.
• We frequently instrument applications to gather performance metrics, and
run a suite of performance tests that can give us a performance checkpoint
with every build.
51© 2015 Intelliware Development Inc.
Automated performance test report
Three types of data:
• What’s the current
performance, at the highest
level (see diagram)?
• What’s the current
performance at different
layers of the application
(Service Layer, DAO Layer).
• What the historical
performance?
52© 2015 Intelliware Development Inc.
Static analysis tests
• Developers tend to think of functional business requirements as
the things that drive unit tests.
• Unit tests can additionally be built around non-functional requirements or even
development rules or standards.
• Examples:
• Organization has a web standard to use relative units (e.g.: rems) rather than
pixel units (px) in web page style sheets (CSS).
• Write a unit test that scans all of the CSS and fails if px units are found.
• Architectural standard that Java code should not have cyclical package
dependencies.
• Write a unit test that fails if package cycles are found.
53© 2015 Intelliware Development Inc.
Static analysis tests (continued)
• Provides proactive identification of problems, rather than after-the-fact
need for clean-up.
• Interesting consequence:
• Tests continue to enforce rules as more code or more developers are added to the project.
• Developers can’t say, “nobody told me about that rule!”.
54© 2015 Intelliware Development Inc.
Acceptance tests
• An acceptance test is a description of a scenario that demonstrates the
expected behaviour of a software component.
• Ideally, the acceptance test is recorded in a way that’s readable by a
customer (and developers), but still supports automated execution.
• Several tools such as JBehave or Cucumber, attempt to make acceptance tests readable
while still providing automated execution.
• Acceptance Testing is often tied to the idea of “Behaviour Driven
Development”.
• Emphasizes “specifications” and “scenarios”.
• Many BDD proponents like the “Given-When-Then” structure.
• Given a particular context, when an action is taken, then a particular result is expected.
55© 2015 Intelliware Development Inc.
56© 2015 Intelliware Development Inc.
About Intelliware Development Inc.
Intelliware is a custom software, mobile solutions and product development
company headquartered in Toronto, Canada. Intelliware is a leader in Agile
software development practices which ensure the delivery of timely high quality
solutions for clients. Intelliware is engaged as a technical partner by a wide
range of organizations in sectors that span Financial Services, Healthcare, ICT,
Retail, Manufacturing and Government.
/company/intelliware-development-inc-
/intelliware.inc
/intelliware_inc
/GooglePlusIntelliware
www.intelliware.com
© 2015 Intelliware Development Inc.
Check out other entries in our Agile methodology series
57

More Related Content

What's hot

Agile Testing – embedding testing into agile software development lifecycle
Agile Testing – embedding testing into agile software development lifecycle Agile Testing – embedding testing into agile software development lifecycle
Agile Testing – embedding testing into agile software development lifecycle Kari Kakkonen
 
Lightening Talk: definition of ready
Lightening Talk: definition of readyLightening Talk: definition of ready
Lightening Talk: definition of readyAgileee
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
 
Agile QA presentation
Agile QA presentationAgile QA presentation
Agile QA presentationCarl Bruiners
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in PracticeSteven Mak
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICDKnoldus Inc.
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Ajay Danait
 
Agile transformation 1.3
Agile transformation 1.3Agile transformation 1.3
Agile transformation 1.3Krystian Kaczor
 
Scrum Testing Methodology
Scrum Testing MethodologyScrum Testing Methodology
Scrum Testing MethodologyGaya1985
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test AutomationNaveen Kumar Singh
 
SRE Demystified - 01 - SLO SLI and SLA
SRE Demystified - 01 - SLO SLI and SLASRE Demystified - 01 - SLO SLI and SLA
SRE Demystified - 01 - SLO SLI and SLADr Ganesh Iyer
 
Agile-overview: Agile Manifesto, Agile principles and Agile Methodologies
Agile-overview: Agile Manifesto, Agile principles and Agile MethodologiesAgile-overview: Agile Manifesto, Agile principles and Agile Methodologies
Agile-overview: Agile Manifesto, Agile principles and Agile MethodologiesBalaji Sathram
 
Kks sre book_ch1,2
Kks sre book_ch1,2Kks sre book_ch1,2
Kks sre book_ch1,2Chris Huang
 
Introduction to Extreme Programming
Introduction to Extreme ProgrammingIntroduction to Extreme Programming
Introduction to Extreme ProgrammingNaresh Jain
 

What's hot (20)

Agile Testing – embedding testing into agile software development lifecycle
Agile Testing – embedding testing into agile software development lifecycle Agile Testing – embedding testing into agile software development lifecycle
Agile Testing – embedding testing into agile software development lifecycle
 
Lightening Talk: definition of ready
Lightening Talk: definition of readyLightening Talk: definition of ready
Lightening Talk: definition of ready
 
Agile QA Process
Agile QA ProcessAgile QA Process
Agile QA Process
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
Agile QA presentation
Agile QA presentationAgile QA presentation
Agile QA presentation
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in Practice
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICD
 
Agile Testing
Agile TestingAgile Testing
Agile Testing
 
Behavior Driven Development (BDD)
Behavior Driven Development (BDD)Behavior Driven Development (BDD)
Behavior Driven Development (BDD)
 
Agile transformation 1.3
Agile transformation 1.3Agile transformation 1.3
Agile transformation 1.3
 
Scrum Testing Methodology
Scrum Testing MethodologyScrum Testing Methodology
Scrum Testing Methodology
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test Automation
 
Agile KPIs
Agile KPIsAgile KPIs
Agile KPIs
 
SRE Demystified - 01 - SLO SLI and SLA
SRE Demystified - 01 - SLO SLI and SLASRE Demystified - 01 - SLO SLI and SLA
SRE Demystified - 01 - SLO SLI and SLA
 
QA Best Practices in Agile World_new
QA Best Practices in Agile World_newQA Best Practices in Agile World_new
QA Best Practices in Agile World_new
 
Agile-overview: Agile Manifesto, Agile principles and Agile Methodologies
Agile-overview: Agile Manifesto, Agile principles and Agile MethodologiesAgile-overview: Agile Manifesto, Agile principles and Agile Methodologies
Agile-overview: Agile Manifesto, Agile principles and Agile Methodologies
 
Tdd and bdd
Tdd and bddTdd and bdd
Tdd and bdd
 
Kks sre book_ch1,2
Kks sre book_ch1,2Kks sre book_ch1,2
Kks sre book_ch1,2
 
Introduction to Extreme Programming
Introduction to Extreme ProgrammingIntroduction to Extreme Programming
Introduction to Extreme Programming
 

Viewers also liked

Canadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology StandardsCanadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology Standards Intelliware Development Inc.
 
I2 Argentina Unitech
I2 Argentina UnitechI2 Argentina Unitech
I2 Argentina UnitechUNITECH S.A.
 
Environmental Law for Road Builders
Environmental Law for Road Builders Environmental Law for Road Builders
Environmental Law for Road Builders DSaxe
 
Power Pointless How To Make An Amazing Presentation
Power Pointless How To Make An Amazing PresentationPower Pointless How To Make An Amazing Presentation
Power Pointless How To Make An Amazing PresentationJoan Shi
 
Quelle gouvernance pour le numérique?
Quelle gouvernance pour le numérique?Quelle gouvernance pour le numérique?
Quelle gouvernance pour le numérique?Antoine Vigneron
 
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...Larry Ajuwon
 
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...Intelliware Development Inc.
 
Add 2009 10
Add 2009 10Add 2009 10
Add 2009 10RUAULT
 
Coding is the new literacy to make a difference in the world
Coding is the new literacy to make a difference in the worldCoding is the new literacy to make a difference in the world
Coding is the new literacy to make a difference in the worldmcd_boulanger
 
5 mythes de la marche au ralenti
5 mythes de la marche au ralenti5 mythes de la marche au ralenti
5 mythes de la marche au ralentiellipsos inc.
 
U.S. Economic Sanctions Update
U.S. Economic Sanctions UpdateU.S. Economic Sanctions Update
U.S. Economic Sanctions UpdateJon Yormick
 

Viewers also liked (20)

Hong kong
Hong kongHong kong
Hong kong
 
Why Nortel Went Bankrupt
Why Nortel Went BankruptWhy Nortel Went Bankrupt
Why Nortel Went Bankrupt
 
Canadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology StandardsCanadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology Standards
 
I2 Argentina Unitech
I2 Argentina UnitechI2 Argentina Unitech
I2 Argentina Unitech
 
Environmental Law for Road Builders
Environmental Law for Road Builders Environmental Law for Road Builders
Environmental Law for Road Builders
 
Power Pointless How To Make An Amazing Presentation
Power Pointless How To Make An Amazing PresentationPower Pointless How To Make An Amazing Presentation
Power Pointless How To Make An Amazing Presentation
 
City of deception
City of deceptionCity of deception
City of deception
 
Quelle gouvernance pour le numérique?
Quelle gouvernance pour le numérique?Quelle gouvernance pour le numérique?
Quelle gouvernance pour le numérique?
 
Master of deception (mod)
Master of deception (mod)Master of deception (mod)
Master of deception (mod)
 
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
Clinical development, contract & outsourcing in mena & asia pac webinar-l aju...
 
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
 
Add 2009 10
Add 2009 10Add 2009 10
Add 2009 10
 
Coding is the new literacy to make a difference in the world
Coding is the new literacy to make a difference in the worldCoding is the new literacy to make a difference in the world
Coding is the new literacy to make a difference in the world
 
Proyecto de Protección Ambiental de Bosawas, NIcaragua
Proyecto de Protección Ambiental de Bosawas, NIcaraguaProyecto de Protección Ambiental de Bosawas, NIcaragua
Proyecto de Protección Ambiental de Bosawas, NIcaragua
 
Xerox Corporation Fraud Case
Xerox Corporation Fraud CaseXerox Corporation Fraud Case
Xerox Corporation Fraud Case
 
5 mythes de la marche au ralenti
5 mythes de la marche au ralenti5 mythes de la marche au ralenti
5 mythes de la marche au ralenti
 
U.S. Economic Sanctions Update
U.S. Economic Sanctions UpdateU.S. Economic Sanctions Update
U.S. Economic Sanctions Update
 
Agile Story Writing
Agile Story WritingAgile Story Writing
Agile Story Writing
 
Agile Release & Iteration Planning
Agile Release & Iteration Planning   Agile Release & Iteration Planning
Agile Release & Iteration Planning
 
Afrika Tikkun Annual Review
Afrika Tikkun Annual ReviewAfrika Tikkun Annual Review
Afrika Tikkun Annual Review
 

Similar to Agile Testing

PMI-ACP Lesson 06 Quality
PMI-ACP Lesson 06 QualityPMI-ACP Lesson 06 Quality
PMI-ACP Lesson 06 QualityThanh Nguyen
 
Topic production code
Topic production codeTopic production code
Topic production codeKavi Kumar
 
Test driven development
Test driven developmentTest driven development
Test driven developmentLuis Goldster
 
Test driven development
Test driven developmentTest driven development
Test driven developmentTony Nguyen
 
Test driven development
Test driven developmentTest driven development
Test driven developmentYoung Alista
 
Test driven development
Test driven developmentTest driven development
Test driven developmentJames Wong
 
Test driven development
Test driven developmentTest driven development
Test driven developmentFraboni Ec
 
Test driven development
Test driven developmentTest driven development
Test driven developmentHarry Potter
 
Increasing Quality with DevOps
Increasing Quality with DevOpsIncreasing Quality with DevOps
Increasing Quality with DevOpsCoveros, Inc.
 
Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)Abhijeet Vaikar
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentnikhil sreeni
 
How to build confidence in your release cycle
How to build confidence in your release cycleHow to build confidence in your release cycle
How to build confidence in your release cycleDiUS
 
Cleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentCleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentAll Things Open
 
Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Hong Le Van
 

Similar to Agile Testing (20)

Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Methodology: IT test
Methodology: IT testMethodology: IT test
Methodology: IT test
 
PMI-ACP Lesson 06 Quality
PMI-ACP Lesson 06 QualityPMI-ACP Lesson 06 Quality
PMI-ACP Lesson 06 Quality
 
Agile testing
Agile testingAgile testing
Agile testing
 
Topic production code
Topic production codeTopic production code
Topic production code
 
Agile testing
Agile testingAgile testing
Agile testing
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
QA in an Agile Environment
QA in an Agile EnvironmentQA in an Agile Environment
QA in an Agile Environment
 
Tdd
TddTdd
Tdd
 
Increasing Quality with DevOps
Increasing Quality with DevOpsIncreasing Quality with DevOps
Increasing Quality with DevOps
 
Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
How to build confidence in your release cycle
How to build confidence in your release cycleHow to build confidence in your release cycle
How to build confidence in your release cycle
 
Cleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentCleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven Development
 
Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++
 

More from Intelliware Development Inc.

UX – A Way of Thinking, Lessons from the Real World
UX – A Way of Thinking, Lessons from the Real WorldUX – A Way of Thinking, Lessons from the Real World
UX – A Way of Thinking, Lessons from the Real WorldIntelliware Development Inc.
 
Everyone can learn to code: a starter's guide to software development
Everyone can learn to code: a starter's guide to software developmentEveryone can learn to code: a starter's guide to software development
Everyone can learn to code: a starter's guide to software developmentIntelliware Development Inc.
 
The HL7 Games: Catching FHIR - Healthcare Standards after v3
The HL7 Games: Catching FHIR - Healthcare Standards after v3The HL7 Games: Catching FHIR - Healthcare Standards after v3
The HL7 Games: Catching FHIR - Healthcare Standards after v3Intelliware Development Inc.
 
21 Compelling Software Development Facts & Figures: Software Stats
21 Compelling Software Development Facts & Figures: Software Stats21 Compelling Software Development Facts & Figures: Software Stats
21 Compelling Software Development Facts & Figures: Software StatsIntelliware Development Inc.
 
2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise
2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise
2012 Toronto Liferay Roadshow - Mobilizing Your EnterpriseIntelliware Development Inc.
 
Web accessibility for municipalities - How to meet compliance requirements an...
Web accessibility for municipalities - How to meet compliance requirements an...Web accessibility for municipalities - How to meet compliance requirements an...
Web accessibility for municipalities - How to meet compliance requirements an...Intelliware Development Inc.
 

More from Intelliware Development Inc. (18)

The Challenges of Agile Adoption
The Challenges of Agile AdoptionThe Challenges of Agile Adoption
The Challenges of Agile Adoption
 
Intelliware's Agile Adoption Checklist
Intelliware's Agile Adoption ChecklistIntelliware's Agile Adoption Checklist
Intelliware's Agile Adoption Checklist
 
Conducting Agile Retrospectives
Conducting Agile Retrospectives Conducting Agile Retrospectives
Conducting Agile Retrospectives
 
Agile Testing - What is it?
Agile Testing - What is it?Agile Testing - What is it?
Agile Testing - What is it?
 
Agile Room Team Dynamics
Agile Room Team DynamicsAgile Room Team Dynamics
Agile Room Team Dynamics
 
Agile Project Estimating
Agile Project EstimatingAgile Project Estimating
Agile Project Estimating
 
Agile Release & Iteration Planning
Agile Release & Iteration PlanningAgile Release & Iteration Planning
Agile Release & Iteration Planning
 
Agile Story Writing
Agile Story WritingAgile Story Writing
Agile Story Writing
 
7 Myths of Agile Development
7 Myths of Agile Development7 Myths of Agile Development
7 Myths of Agile Development
 
What is Agile Development?
What is Agile Development?What is Agile Development?
What is Agile Development?
 
UX – A Way of Thinking, Lessons from the Real World
UX – A Way of Thinking, Lessons from the Real WorldUX – A Way of Thinking, Lessons from the Real World
UX – A Way of Thinking, Lessons from the Real World
 
Everyone can learn to code: a starter's guide to software development
Everyone can learn to code: a starter's guide to software developmentEveryone can learn to code: a starter's guide to software development
Everyone can learn to code: a starter's guide to software development
 
The HL7 Games: Catching FHIR - Healthcare Standards after v3
The HL7 Games: Catching FHIR - Healthcare Standards after v3The HL7 Games: Catching FHIR - Healthcare Standards after v3
The HL7 Games: Catching FHIR - Healthcare Standards after v3
 
21 Compelling Software Development Facts & Figures: Software Stats
21 Compelling Software Development Facts & Figures: Software Stats21 Compelling Software Development Facts & Figures: Software Stats
21 Compelling Software Development Facts & Figures: Software Stats
 
Agile Room Dynamics
Agile Room Dynamics   Agile Room Dynamics
Agile Room Dynamics
 
Agile Estimating
Agile Estimating Agile Estimating
Agile Estimating
 
2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise
2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise
2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise
 
Web accessibility for municipalities - How to meet compliance requirements an...
Web accessibility for municipalities - How to meet compliance requirements an...Web accessibility for municipalities - How to meet compliance requirements an...
Web accessibility for municipalities - How to meet compliance requirements an...
 

Recently uploaded

Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 

Recently uploaded (20)

Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 

Agile Testing

  • 1. Agile Testing BC Holmes @bcholmesdotorg © 2015 Intelliware Development Inc.
  • 2. What you’ll learn in this presentation: • Why do we use Agile testing? • What Agile testing isn’t • What Agile testing is: unit testing and test-driven development (TDD) • High-level properties of good tests • Testing in different languages • Test suites and code coverage • Using mock objects to help isolate units • Beyond unit testing © 2015 Intelliware Development Inc.
  • 3. Design • A test usually provides a concrete usage scenario that helps a developer think about the following when writing code: • What is the code expected to do? • How will the code be set up and executed? • What other pieces of code are needed as collaborators, and how will the code interact with them? • Especially good at helping to write code that is loosely coupled. 3© 2015 Intelliware Development Inc. Why do we use Agile testing?
  • 4. Why do we use Agile testing? Focus/Rhythm • Unit tests provide an easy way for a developer to focus on a particular coding task. • Clear and fast feedback if the code is working or not. • Always clear what to do next: • Either fix a failing test or write a new test as a prelude to adding functionality. 4© 2015 Intelliware Development Inc.
  • 5. What Agile testing isn’t Agile Testing is not a “phase”. • In traditional methodologies, testing is a phase of the project that happens after coding. • In Agile methodologies, coding, refactoring and testing are tightly inter-related tasks and can’t be separated. A testing “phase” that’s months, weeks or even days in the future provides very slow feedback to developers. • Faster feedback gets failure information to developers while the details of the code implementation is still fresh in their minds. 5© 2015 Intelliware Development Inc.
  • 6. What Agile testing isn’t (continued) Agile testing is not a replacement for quality assurance (QA) testing. • Agile testing is a practice to help developers create better code. • Agile testing is intended to improve the quality (design, defects, etc.) of the final code deliverables. • That might mean that you have a lower need for QA, but not necessarily. 6 It’s noteworthy that Lisa Crispen’s book, Agile Testing, is principally about the role of dedicated QA-style testers on Agile projects, rather than the testing practices of Agile developers. © 2015 Intelliware Development Inc.
  • 7. What Agile testing is: unit testing and test-driven development © 2015 Intelliware Development Inc.
  • 8. Test-driven development (TDD) TDD is one of the earliest forms of Agile testing, and the most commonly implemented types of Agile testing. It’s a style of programming in which three activities are tightly interwoven: coding, testing (in the form of writing unit tests) and design (in the form of refactoring). • Write a "single" unit test describing an aspect of the program. • Run the test, which should fail because the program lacks that feature. • Write "just enough" code, the simplest possible, to make the test pass. • "Refactor" the code until it conforms to the simplicity criteria. • Repeat, "accumulating" unit tests over time. 8 Source: Agile Alliance © 2015 Intelliware Development Inc.
  • 9. Origins 9© 2015 Intelliware Development Inc.
  • 10. What is a unit test? “In computer programming, unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures are tested to determine if they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application. […] In object-oriented programming, a unit is often an entire interface, such as a class, but could be an individual method. Unit tests are short code fragments created by programmers… during the development process.” 10 Source: Wikipedia © 2015 Intelliware Development Inc.
  • 11. The TDD process 11 Commit code Create a unit test Execute the Test Fix the code so that the test runs Execute the Test Refactor the code Run all tests Automated build (includes running tests) © 2015 Intelliware Development Inc.
  • 12. Creating a simple unit test in Java • Unit tests are most commonly created using the JUnit framework. • Imagine this scenario: we’re writing code to calculate mortgage payments. 12© 2015 Intelliware Development Inc.
  • 13. Create code that tests a specific expectation 13© 2015 Intelliware Development Inc.
  • 14. Run the unit test • In this example, we’re using Eclipse’s built-in JUnit test support to run the unit test. • The red bar indicates that our test doesn’t yet pass successfully. • Note how the test name appears to clarify which test has failed. • The name gives an indication of the expected behaviour. 14© 2015 Intelliware Development Inc.
  • 15. Fix code and rerun • The developer should write enough code to make the test pass. • The green bar indicates that all the expected behaviour is correctly implemented. 15© 2015 Intelliware Development Inc.
  • 16. Rules about tests • Often, once the tests are green, the developer’s next step is to refactor code. • Refactoring involves improving the design of existing code. • Make it more readable, increase the efficiency, or remove duplication. • The tests help to ensure that the developer hasn’t broken any functionality during the refactoring. • Run all tests before committing or pushing code in to the source code repository. • If there are any broken tests, you should not commit. • Automated build processes should run all of the tests as an indication of the validity of the build artifacts. 16© 2015 Intelliware Development Inc.
  • 17. Some high-level properties of good tests © 2015 Intelliware Development Inc.
  • 18. Representative: Of events that are likely to be encountered by the user. (Not necessarily “commonly”, but likely). Hacking attempts, for example, might be likely, but not common. Non-redundant: The test shouldn’t reproduce the work of another test. Motivating: Your client will want to fix the problem exposed by this test. Properties of good tests Power: A test should reveal problems when they exist. Valid: When the test states that there’s a problem, it is a genuine problem. Value: Tests should reveal problems that the client cares about. Credible: The test should be trusted to actually test the things that people expect it to test. 18 Source: Cem Kaner © 2015 Intelliware Development Inc.
  • 19. Coverage: The test exercises a part of the code that isn’t already handled by another test. Easy to evaluate: It should be relatively easy to determine whether the test has passed or failed. Insightful: A good test should reveal things about our assumptions. Properties of good tests (continued) Performable: Designing a test that can’t actually be performed is useless. Maintainable: If the end product changes, it’s important to be able to update the tests. Repeatable: It should be easy and inexpensive to execute the test again and/or reuse it as appropriate. 19 Source: Cem Kaner © 2015 Intelliware Development Inc.
  • 20. Cost: the cost to create/execute/maintain the test should compare favourably to the value. Opportunity Cost: The test obviates the need to perform some other work. Supports troubleshooting: If the test fails, it should help the programmer identify the problem. Appropriately complex: No more complex than necessary. Accountable: Can you explain why the test exists, and can you demonstrate that it was executed? 20 Source: Cem Kaner © 2015 Intelliware Development Inc. Properties of good tests (continued)
  • 21. Testing in different languages © 2015 Intelliware Development Inc.
  • 22. Common unit test frameworks Java • JUnit, TestNG. .Net • Microsoft Unit Testing Framework and NUnit. JavaScript • Mocha, Jasmine, Unit.js, Nodeunit, QUnit, JSUnit, and many others. iOS / Objective-C • XCUnit (successor to OCUnit). Python • Nose, unittest (a.k.a. PyUnit). 22© 2015 Intelliware Development Inc.
  • 23. Unit testing with JavaScript and Mocha.js Slightly different syntax from JUnit, but most concepts are comparable. 23© 2015 Intelliware Development Inc.
  • 24. Executing Mocha.js on the command line Most JavaScript unit test frameworks are command-line-based. 24© 2015 Intelliware Development Inc.
  • 25. Unit testing with C# and Microsoft’s unit testing tools Again, slightly different syntax, but same basic concepts. 25© 2015 Intelliware Development Inc.
  • 26. Visual Studio’s built-in test support 26© 2015 Intelliware Development Inc.
  • 27. Testing with Objective-C and XCUnit 27© 2015 Intelliware Development Inc.
  • 28. XCode’s built-in support for XCUnit 28© 2015 Intelliware Development Inc.
  • 29. Successful execution 29© 2015 Intelliware Development Inc.
  • 30. Key insights Unit testing in a variety of languages (and test frameworks) is largely the same. • Test a specific function and give it a descriptive name. • Set up some necessary classes and/or data. • Invoke the function/method under test. • Check/assert that calculated values match expectations. Most test runner tools use red and green indicators to tell developers the current state of the tests. 30© 2015 Intelliware Development Inc.
  • 31. Test suites and code coverage © 2015 Intelliware Development Inc.
  • 32. Test suites Over time, as more and more tests are created, a sizeable amount of the application is backed by unit tests that are executed many times a day to ensure that previously-created functionality still works. • Hundreds or even thousands of unit tests are not uncommon for a single application. As more and more tests are added, the amount of time it takes to execute the tests increases. • If that amount of time is too long, developers will start becoming discouraged from running the tests regularly. • A few seconds is awesome. • Less than 30 seconds is still pretty good. • A few minutes isn’t terrible. • More than that is likely to be irritating. 32© 2015 Intelliware Development Inc.
  • 33. Code coverage Some languages/environments have tools that can calculate the amount of your application’s code that gets executed during the running of the unit test suite. • These tools are called “code coverage” or “test coverage” tools. High coverage usually indicates that the application is well-tested, and that usually results in developer confidence that they can change the application and not break the existing functions. • How high is high enough? There are a lot of factors and not all projects are the same, but 75% or 80% coverage is often used as a starting goal. 33© 2015 Intelliware Development Inc.
  • 34. Some stuff is hard to test Visual output • Does a web page look attractive? Is an animation jerky or glitchy? Is one component of a web page covering or obscuring another component? • Graphical output — especially image-based. • Example: a class that outputs a bar chart as a PNG image. Code that’s date/time-driven or based on timers • But if you parameterize the date/time information, you can often mitigate the difficulty. Legacy code • The best time to start unit testing code is at the beginning of a project. • Legacy code, especially tightly-coupled stuff, is harder to make testable. 34© 2015 Intelliware Development Inc.
  • 35. Using mock objects to help isolate units © 2015 Intelliware Development Inc.
  • 36. Mock objects: dealing with collaborators “In object-oriented programming, mock objects are simulated objects that mimic the behaviour of real objects in controlled ways. A programmer typically creates a mock object to test the behaviour of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behaviour of a human in vehicle impacts.” 36 Source: Wikipedia © 2015 Intelliware Development Inc.
  • 37. Tools for working with mock objects Usually involves a mock framework • Java • Mockito, Jmock • JavaScript • Sinon.js • Objective-C • OCMock 37© 2015 Intelliware Development Inc.
  • 38. Example We want to test functionality related to renewing a mortgage. • Renewing a mortgage should be based on same payment type, but current interest rate. Mortgage collaborates with a class that provides the current interest rates. • But we’re currently testing the renew functionality, not the providing of interest rates. Let’s try an example using Java and Mockito. 38© 2015 Intelliware Development Inc.
  • 39. 39 Need a special test runner © 2015 Intelliware Development Inc.
  • 40. 40© 2015 Intelliware Development Inc.
  • 41. Additional thoughts Mock object frameworks provide a powerful way to ensure that you’re testing only a single unit at a time. • Helps isolate an individual unit. If the configuration of your mock object starts to get complex or messy, that’s an indication that your class is too tightly intertwined with the mock object’s class. • Remember: loosely-coupled classes are easier to test, and usually a better design choice. 41© 2015 Intelliware Development Inc.
  • 42. Defining your units A “unit” is often a class or small collection of related classes. • Anything not contained in that “unit” is a dependency or collaborator. • We usually create mock objects to take the place of the dependency/collaborator when we build the unit test. Consider special case: a class that reads data from a database. • In Java, such classes are often referred to as “Data Access Objects” or DAOs. • Key question: does the “unit” that you’re testing include the database? • Or should the database be considered a dependency/collaborator? 42© 2015 Intelliware Development Inc.
  • 43. The case for “no” • Unit tests that connect to the database are often slower than most other unit tests. • Both because of set up and because of I/O. • You need to consider the contents of the database: does your test expect certain records? How do they get there? What if those contents are changed? Managing the initial state or “home state” of the database is a non-trivial exercise. My gut is telling me “maybe” The case for “yes” • It’s often hard to mock out an entire database API. • Including the database allows you to test more: object- relational mapping configuration, query correctness, etc. • If you use database features such as triggers or stored procedures, this might be the only way you can test those. 43© 2015 Intelliware Development Inc.
  • 44. Database tests Don’t get hung up on the name. • Whether or not they’re “unit” tests, it’s often fruitful to include tests that touch the real database. Dealing with “Home State” is often worth the initial investment. • Home state is a version of the database (or other resource) that contains the data that the tests expect. 44© 2015 Intelliware Development Inc.
  • 45. Approaches to home state Restore the database prior to running tests. • Always brings the data back to home state, but might take time. Have a separate database specifically for unit tests to use. • But need to apply necessary table definition changes as the project evolves. Don’t let unit tests change the state of the database. • Rollback any changes or undo database changes when the tests finish. • Doesn’t help if the same database is used for ad-hoc testing. Try to minimize the expectations. • Not always possible or easy. Home state management isn’t easy, but the benefits are worth it. 45© 2015 Intelliware Development Inc.
  • 46. Beyond unit testing © 2015 Intelliware Development Inc.
  • 47. Beyond unit testing Although Agile testing is often described in terms of creating unit tests, there are other forms of testing that can prove useful for an agile project. Common test types: • Integration Tests: tests that integrate a number of units, to ensure that the parts interact with one another properly. • UI Tests: tests that automate interaction with a UI and the complete application codebase to ensure that all parts function together properly. • Performance Tests: tests that automatically capture information about the response time of the application, possibly under load. • Static Analysis Tests: tests that analyze code, looking for violations of coding conventions and development rules. • Acceptance Tests: tests that demonstrate to the customer that the requested functionality has been implemented. 47© 2015 Intelliware Development Inc.
  • 48. Integration testing Sometimes, the integration between multiple units is sufficiently complex that it’s fruitful to test it. • Especially true of application-specific code that needs to be integrated with and configured in major frameworks. Examples: • Ensure that a certain number of classes are correctly configured and wired together in a Spring configuration file. • Ensure that a SOAP interface has been correctly configured to send or receive the necessary data. The goal is to integrate no more parts than absolutely necessary. 48© 2015 Intelliware Development Inc.
  • 49. Integration tests (continued) Because more parts need to be set up and initialized, integration tests may take longer than other types of tests. • Integration tests might end up being run less frequently. Still interested in this question: “Do the integration tests run quickly enough that we can expect the developers to run them prior to synching with source control?” • A “yes” answer provides more value than a “no” answer, but a “no” answer can still be helpful. 49© 2015 Intelliware Development Inc.
  • 50. UI tests Can be considered a special case of integration tests — essentially integrating all of the parts. Examples: • Web UI Tests. • Launch the full application in a web server. • Selenium is a very commonly-used web UI test tool. • Mobile UI Tests • There are many approaches to building mobile apps. • Native, HTML5 or Mobile Application Development Platforms (MADPs) like Worklight, Kony or Appcelerator Titanium. • As a result, no one mobile UI test tool has become de facto standard, so mobile UI testing is still an emerging discipline. 50© 2015 Intelliware Development Inc.
  • 51. Performance tests • If one of the requirements (user stories) of your application involves performance targets, testing is the ideal way to ensure that those targets are met. • While Agile developers often caution against premature performance optimization, it’s also not necessarily a good idea to wait until the end of a project to test performance. • Performance testing often tests the integration of many of the parts of the application, rather than just individual units. • We frequently instrument applications to gather performance metrics, and run a suite of performance tests that can give us a performance checkpoint with every build. 51© 2015 Intelliware Development Inc.
  • 52. Automated performance test report Three types of data: • What’s the current performance, at the highest level (see diagram)? • What’s the current performance at different layers of the application (Service Layer, DAO Layer). • What the historical performance? 52© 2015 Intelliware Development Inc.
  • 53. Static analysis tests • Developers tend to think of functional business requirements as the things that drive unit tests. • Unit tests can additionally be built around non-functional requirements or even development rules or standards. • Examples: • Organization has a web standard to use relative units (e.g.: rems) rather than pixel units (px) in web page style sheets (CSS). • Write a unit test that scans all of the CSS and fails if px units are found. • Architectural standard that Java code should not have cyclical package dependencies. • Write a unit test that fails if package cycles are found. 53© 2015 Intelliware Development Inc.
  • 54. Static analysis tests (continued) • Provides proactive identification of problems, rather than after-the-fact need for clean-up. • Interesting consequence: • Tests continue to enforce rules as more code or more developers are added to the project. • Developers can’t say, “nobody told me about that rule!”. 54© 2015 Intelliware Development Inc.
  • 55. Acceptance tests • An acceptance test is a description of a scenario that demonstrates the expected behaviour of a software component. • Ideally, the acceptance test is recorded in a way that’s readable by a customer (and developers), but still supports automated execution. • Several tools such as JBehave or Cucumber, attempt to make acceptance tests readable while still providing automated execution. • Acceptance Testing is often tied to the idea of “Behaviour Driven Development”. • Emphasizes “specifications” and “scenarios”. • Many BDD proponents like the “Given-When-Then” structure. • Given a particular context, when an action is taken, then a particular result is expected. 55© 2015 Intelliware Development Inc.
  • 56. 56© 2015 Intelliware Development Inc. About Intelliware Development Inc. Intelliware is a custom software, mobile solutions and product development company headquartered in Toronto, Canada. Intelliware is a leader in Agile software development practices which ensure the delivery of timely high quality solutions for clients. Intelliware is engaged as a technical partner by a wide range of organizations in sectors that span Financial Services, Healthcare, ICT, Retail, Manufacturing and Government. /company/intelliware-development-inc- /intelliware.inc /intelliware_inc /GooglePlusIntelliware www.intelliware.com
  • 57. © 2015 Intelliware Development Inc. Check out other entries in our Agile methodology series 57