This is a slide deck for a discussion about Test Driven Development (TDD) and Acceptance Test Driven Development (ATDD) and starting to explore the differences between them. Get some insight into why we use them and the advantages and disadvantages of both, as well as, get a better understanding of which should be used where and when. By the end of the session you should be well along the path to TDD vs. ATDD enlightenment.
2. - Business Improvement Consultant, Agile Practitioner
- Innovator, Life Hacker, Maker
- Professional Snowboard Instructor
TDD vs. ATDD
A little about me…
4. Seeding A Question -
TDD vs. ATDD
Would you prefer to…
build the thing right
or build the right thing?
5. Before we get into the “Which, When & Where” first
lets cover the high level “What & Why” of each to
understand the base differences.
TDD vs. ATDD
What -
6. TDD or Test Driven Development is a software
development approach where a developer writes a
test before writing any code. The test is then be used
to build only the code needed to pass it. Once the
new code passes the test, it can then be refactored to
an acceptable standard as needed.
TDD vs. ATDD
What -
7. TDD ensures that the source code is thoroughly
unit tested and helps lead to modularized, flexible
and extensible code. By focusing on writing only
the code necessary to pass the tests, we are
inherently making the design simple and clear.
TDD vs. ATDD
What -
8. ATDD or Acceptance Test Driven Development is
also a software development approach where the
tests are written before the code. However, these
tests are generally written and supported by the
testers or stakeholders.
TDD vs. ATDD
What -
9. ATDD ensures that the folks creating the system
(i.e., the developers) identify the appropriate code
to write, that is, code that reflects the outcomes
desired. It is meant to ensure that the business
value of the system is being met.
TDD vs. ATDD
What -
10. BDD or Behavior Driven Development has a very
similar context to ATDD, however these tests tend
to be driven out by the developers themselves. For
today’s talk we’ll consider them one and the same,
as they both intend to achieve the same goal.
TDD vs. ATDD
What -
11. The shared practice of - Red - Green - Refactor
TDD vs. ATDD
Visualizing Them -
12. - Using the blank side of the 3x5 card in front of you as an example.
- Spend a couple minutes brainstorming ways that the following
requirement could be TDD’d.
- “I need parallel lines drawn on one side of a 3x5 card.”
- Discuss ideas as a group.
- Assert the card orientation.
- Assert first line direction.
- Assert first line length.
- Assert second line length.
- Assert second lines distance away from the first.
- Assert the color of the lines.
- etc…
- Flip the card over.
- Discuss how the ruled side of the card has already been ATDD’d for us.
TDD vs. ATDD
Experimentation Exercise -
13. Scope Creep.
From what you ask…
TDD vs. ATDD
Why -
PROTECTION!
Anything and Everything!
Changing Requirements.
Missed Requirements.
& most importantly… YOURSELF!
Goldplating.
14. - To help us build in small, incremental and
iterative steps.
- Supply us with really fast feedback and a more
direct path to our failure points. (Think 2 lines
over 2000)
- Provide us with a security blanket, protecting us
from changes in the future.
- Supply us with living documentation that
changes as the system does.
TDD vs. ATDD
Why -
15. With TDD the purpose is to assert that the
product, system or process is being built
correctly. It’s testing the independent small
units or objects to make sure each works as
intended.
It depends on your testing purpose…
TDD vs. ATDD
Which, When & Where -
16. With ATDD however, the intent is broader, as the
purpose is to assert that the product, system or
process being built is actually correct. It’s a
mechanism to facilitate the conversation
between developers and product owners about
the requirements and validate the expected
business value is met.
It depends on your testing purpose…
TDD vs. ATDD
Which, When & Where -
17. ATDD is often considered a superset of TDD, not
a replacement for it. If your goals are only to
assert the validity of the independent small units
or objects then TDD should suffice.
It also depends on your testing goals…
TDD vs. ATDD
Which, When & Where -
18. Yet, if your goals are to also focus on the
expectations of your users/stakeholders, then
ATDD should be used preceding TDD. You’re no
longer starting with small unit tests, but rather
you’re documenting executable specifications
that prove out the product, system or process.
TDD vs. ATDD
Which, When & Where -
It also depends on your testing goals…
19. x
TDD Pro TDD Con ATDD Pro ATDD Con
Complex X X
Verbose X X
Reuse/Inherit X X
Plain Text X X
Maintainable X X
Creates Focus X X
TDD vs. ATDD
Advantages & Dis-Avantages
20. Tools used for TDD…
- Unit Frameworks
- JUnit (Java)
- xUnit or nUnit (C, .Net, etc…)
Tools used for ATDD…
- Cucumber, SpecFlow, JBehave, Fit/FitNesse
Tools used for either/both…
- RSpec (Ruby)
- Jasmine (JavaScript)
- Selenium (Web)
TDD vs. ATDD
A Few Common Tools
21. Code Katas -
Helps hone skills through practice and repetition.
- cyber-dojo.org
- codekata.com
- Robert C. Martin
(Uncle Bob)
Clean Coder Series
TDD vs. ATDD
Ways To Learn & Support
22. TDD vs. ATDD
Ways To Learn & Support
Pair Programming -
Drives shared knowledge and collective understanding.
Allows for focused learning in collaboration with an
instant feedback loop.
- Across the experience:
• Expert with Expert
• Expert with Novice
• Novice with Novice
- Amongst the team:
• Business with Development
• Development with Testing
• Testing with Business
23. TDD vs. ATDD
Ways To Learn & Support
Online Training -
skillshare - Master real-world skills with
hands-on projects. Hundreds of online
classes to chose from.
pluralsight - A rich library of full-length
online training courses for developers
and IT pros, created by the best authors
in the industry.
Local Training -
Ann Arbor Code Craftsman Saturdays (CodeRetreats) - Every month, on
the 2nd Saturday, software devs of every level get together for a full day
of pairing, test driving, food, and fun. No presentations, no vendors,
and no recruiters, just software craftspeople learning from each other.
Your Local User Groups ????
24. • A simple view towards the difference could be
that ATDD is looking at it from “Outside In”
where as TDD is looking at it from the “Inside
Out”.
• With respect to aspects like…
- Code Craftsmanship
- Test Coverage
- Cyclomatic Complexity
- etc…
it’s my belief that a high value is usually put on
TDD, but we usually lack in what ATDD offers.
TDD vs. ATDD
Noteworthy Points
25. Would you prefer to…
build the thing right
or build the right thing?
Both of course!
It’s just knowing which to use where and when.
ATDD
TDD
So to answer our original seeded question…
TDD vs. ATDD
Answering The Question
27. Business Solutions Consultancy
For those who value... value.
Clients collaborate with us to solve
business problems.
The first step is figuring out how we can
either make or save them money.
BUSINESS AGILITY