Prezi

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in the manual

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

TDD

No description
by Gianfranco Alongi on 21 November 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of TDD

TDD
One of the 17 behind the Agile Manifesto,
also the creator of XP, and Agile Software Development in general.
What is TDD?
A Development Practice that turns testing into
a Design activity.
Tests are written before the code.
Unit Tests Are?
A unit test is an automated piece of code that invokes a unit of work in the system and checks a single assumption about the behavior of that unit of work.
Properties of Unit Tests
Test-driven development (TDD) is a way
of managing fear during programming
Small.
Only test one Thing.
Uses Self Explanatory Data.
Runs Quickly.
Serves as Documentation.
FIRST principle
Fast
Independent
Repeatable
Self Checking
Timely
Good Unit Tests are
GREEN
Three Laws of TDD
Kent Beck
Unit Tests
You may not write production code until you have written a failing Unit Test.
You may not write more of a Unit Test than is sufficient to fail.
You may not write more production code than is sufficient to pass the currently failing test.
The TDD Cycle
Add a Failing Unit Test
Add minimal amount of code
to produce a failing Test.
Refactor
Remove duplication.
Improve Readability.
The TDD cycle again
Externalize & crystallize your thoughts
Add a failing Unit Test
Be the customer of your own code. Write the tests you would like to see.
Make The Test Pass
Add the minimal amount
of code to make the test pass.
Make the Test Pass
Make it work
Focus on making it work.
Committing any sins.
Avoid gold plating.
Make it Pretty
You should not feel ashamed if this source was put on display for the whole world.
Refactor
TDD is a skill like any other
Must be practiced
TDD is easy to get going with, but it can be hard to know which tests are the right ones.
It can also be tricky to know which should be the first test.
References
Test-Driven Development - By Example.
Kent Beck

Growing Object-Oriented Software, Guided By Tests
Steve Freeman and Nat Pryce

Clean Code - A Handbook Of Agile Software Craftsmanship
Robert C. Martin

The Clean Coder - A Code of Conduct for Professional Programmers
Robert C. Martin

http://artofunittesting.com/definition-of-a-unit-test/
Roy Osherove
See the full transcript