TATFT
Joren
@joren
TDD
Why?
Test what?

• Test what should happen

• Test what should NOT happen
Red green refactoring
• Add a test

• Run all tests

• Write Some code

• Run the tests again

• Refactor code

• Start ov...
Regression tests

• Change environment

• Change code

• Is everything still working?
Different levels of testing

• Unit

• Functional

• Integration/BDD
Unit testing

• Most basic

• Database level

• Validations
Functional testing


• Lifecycle of objects

• Controllers
BDD
Integration tests - BDD

• Overall application functionalities

• Tell a story

• Walk through your application
Tell a story
Feature: Authenticating
 In order to ensure safety of our app
 As a developer
 I want be sure authentication ...
Test data

• Mock, stub

• Fixtures

• Factories
Tools
Cruisecontrol
Git blame
Cucumber, Selenium
Any questions?
Upcoming SlideShare
Loading in …5
×

Tatft

1,386 views

Published on

Why you should write tests for your application.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,386
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Tatft

  1. 1. TATFT
  2. 2. Joren
  3. 3. @joren
  4. 4. TDD
  5. 5. Why?
  6. 6. Test what? • Test what should happen • Test what should NOT happen
  7. 7. Red green refactoring • Add a test • Run all tests • Write Some code • Run the tests again • Refactor code • Start over again
  8. 8. Regression tests • Change environment • Change code • Is everything still working?
  9. 9. Different levels of testing • Unit • Functional • Integration/BDD
  10. 10. Unit testing • Most basic • Database level • Validations
  11. 11. Functional testing • Lifecycle of objects • Controllers
  12. 12. BDD
  13. 13. Integration tests - BDD • Overall application functionalities • Tell a story • Walk through your application
  14. 14. Tell a story Feature: Authenticating  In order to ensure safety of our app  As a developer  I want be sure authentication can't be compromised Scenario: Authenticating with wrong password  Given I've created a user for my reseller account "Openminds"  When I go to the homepage And I fill in the following: | Login    | me@example.com | | Password | foobar         | And I press "Log in"  Then I should see "Couldn't log you in"
  15. 15. Test data • Mock, stub • Fixtures • Factories
  16. 16. Tools
  17. 17. Cruisecontrol
  18. 18. Git blame
  19. 19. Cucumber, Selenium
  20. 20. Any questions?

×