Your SlideShare is downloading. ×
Test-DrivenDevelopment for TYPO3   Oliver Klee, 2012-10-04     typo3-coding@oliverklee.de
Unittests?
Manual testing is cumbersome
Automatedtesting isfast
Unit tests for the Realty Manager   extension
more than1600 tests
in less than 60    seconds
Verify that your codedoes what you expect
Make sure that yourchanges won‘t break           anything
Keep        other codersfrom breaking your code
Don‘t break anythingeven in complex projects
Create asafety net   for refactoring
Green feels good!
Green feels good!
Know   your  tools
The phpunit extension             has it all
The phpunit extension               has it allphpunit (TYPO3 extension)
The phpunit extension               has it allphpunit (TYPO3 extension) PHPUnit (PEAR package)
The phpunit extension               has it allphpunit (TYPO3 extension) PHPUnit (PEAR package) Testrunner (back-end-  modu...
The phpunit extension               has it allphpunit (TYPO3 extension) PHPUnit (PEAR package) Testrunner    Testrunner (b...
The phpunit extension               has it allphpunit (TYPO3 extension) PHPUnit (PEAR package)  Testing framework for FE &...
Let‘s getsome terms  straight
Two testsmeet in a  bar ...
Two testsTest   meet in a         bar ...
Two tests  Test      meet in aAssertion     bar ...
Two tests  Test      meet in aAssertion     bar ...  Test  Test
Two tests  Test      meet in aAssertion     bar ...  Test  TestTest case
Two tests  Test      meet in aAssertion     bar ...  Test  TestTest caseTest case
Two tests  Test       meet in aAssertion      bar ...  Test  TestTest caseTest caseTest suite
The   life cycle unit test               of a
The   life cycle unit test               of a
The   life cycle unit test               of a                      new FooTest();
The   life cycle unit test               of a                      new FooTest();
The   life cycle unit test               of a                      new FooTest();                           setUp();
The   life cycle unit test               of a                      new FooTest();                           setUp();      ...
The   life cycle unit test               of a                      new FooTest();                           setUp();      ...
The   life cycle unit test               of a                      new FooTest();                           setUp();      ...
The   life cycle unit test               of a                      new FooTest();                           setUp();      ...
The   life cycle unit test               of a                      new FooTest();                           setUp();      ...
Code   test-first
Code   test-first
Code   test-firstwritetest
Code   test-firstwritetest
Code    test-firstwrite          writetest           code
Code    test-firstwrite          writetest           code
Code    test-firstwrite          writetest           code
Code    test-firstwrite          writetest           code                       refactor
Code    test-firstwrite          writetest           code                       refactor
Use   meaningful           unit test   names
Use   meaningful                          unit test   namesName thebehavior.            classCanBeInstantiated
Use   meaningful                            unit test   names Name the behavior.             classCanBeInstantiatedMention...
Use   meaningful                                 unit test   names  Name the  behavior.                 classCanBeInstanti...
Use   meaningful                                 unit test   names  Name the  behavior.                 classCanBeInstanti...
Use   meaningful                                   unit test   names  Name the  behavior.                   classCanBeInst...
Use   meaningful                                   unit test   names  Name the  behavior.                   classCanBeInst...
Test-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DE
Upcoming SlideShare
Loading in...5
×

Test-Driven Development for TYPO3 @ T3CON12DE

510

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
510
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "Test-Driven Development for TYPO3 @ T3CON12DE"

    1. 1. Test-DrivenDevelopment for TYPO3 Oliver Klee, 2012-10-04 typo3-coding@oliverklee.de
    2. 2. Unittests?
    3. 3. Manual testing is cumbersome
    4. 4. Automatedtesting isfast
    5. 5. Unit tests for the Realty Manager extension
    6. 6. more than1600 tests
    7. 7. in less than 60 seconds
    8. 8. Verify that your codedoes what you expect
    9. 9. Make sure that yourchanges won‘t break anything
    10. 10. Keep other codersfrom breaking your code
    11. 11. Don‘t break anythingeven in complex projects
    12. 12. Create asafety net for refactoring
    13. 13. Green feels good!
    14. 14. Green feels good!
    15. 15. Know your tools
    16. 16. The phpunit extension has it all
    17. 17. The phpunit extension has it allphpunit (TYPO3 extension)
    18. 18. The phpunit extension has it allphpunit (TYPO3 extension) PHPUnit (PEAR package)
    19. 19. The phpunit extension has it allphpunit (TYPO3 extension) PHPUnit (PEAR package) Testrunner (back-end- module)
    20. 20. The phpunit extension has it allphpunit (TYPO3 extension) PHPUnit (PEAR package) Testrunner Testrunner (back-end- module) (CLI module)
    21. 21. The phpunit extension has it allphpunit (TYPO3 extension) PHPUnit (PEAR package) Testing framework for FE & DB Testrunner Testrunner (back-end- module) (CLI module)
    22. 22. Let‘s getsome terms straight
    23. 23. Two testsmeet in a bar ...
    24. 24. Two testsTest meet in a bar ...
    25. 25. Two tests Test meet in aAssertion bar ...
    26. 26. Two tests Test meet in aAssertion bar ... Test Test
    27. 27. Two tests Test meet in aAssertion bar ... Test TestTest case
    28. 28. Two tests Test meet in aAssertion bar ... Test TestTest caseTest case
    29. 29. Two tests Test meet in aAssertion bar ... Test TestTest caseTest caseTest suite
    30. 30. The life cycle unit test of a
    31. 31. The life cycle unit test of a
    32. 32. The life cycle unit test of a new FooTest();
    33. 33. The life cycle unit test of a new FooTest();
    34. 34. The life cycle unit test of a new FooTest(); setUp();
    35. 35. The life cycle unit test of a new FooTest(); setUp(); /** @test */ lifeIsGood();
    36. 36. The life cycle unit test of a new FooTest(); setUp(); /** @test */ lifeIsGood();
    37. 37. The life cycle unit test of a new FooTest(); setUp(); /** @test */ lifeIsGood(); tearDown();
    38. 38. The life cycle unit test of a new FooTest(); setUp(); /** @test */ lifeIsGood(); tearDown();
    39. 39. The life cycle unit test of a new FooTest(); setUp(); /** @test */ lifeIsGood(); tearDown();
    40. 40. Code test-first
    41. 41. Code test-first
    42. 42. Code test-firstwritetest
    43. 43. Code test-firstwritetest
    44. 44. Code test-firstwrite writetest code
    45. 45. Code test-firstwrite writetest code
    46. 46. Code test-firstwrite writetest code
    47. 47. Code test-firstwrite writetest code refactor
    48. 48. Code test-firstwrite writetest code refactor
    49. 49. Use meaningful unit test names
    50. 50. Use meaningful unit test namesName thebehavior. classCanBeInstantiated
    51. 51. Use meaningful unit test names Name the behavior. classCanBeInstantiatedMention the method. setTitleSetsTitle
    52. 52. Use meaningful unit test names Name the behavior. classCanBeInstantiatedMention the method. setTitleSetsTitle Name the setSizeWithZeroThrowsExceptionpreconditions. hasTitleForEmptyTitleReturnsFalse
    53. 53. Use meaningful unit test names Name the behavior. classCanBeInstantiatedMention the method. setTitleSetsTitle Name the setSizeWithZeroThrowsExceptionpreconditions. hasTitleForEmptyTitleReturnsFalse Dont‘t use "works" or "correctly".
    54. 54. Use meaningful unit test names Name the behavior. classCanBeInstantiatedMention the method. setTitleSetsTitle Name the setSizeWithZeroThrowsExceptionpreconditions. hasTitleForEmptyTitleReturnsFalse Dont‘t use "works" or measureFrubbleWorksCorrectly "correctly".
    55. 55. Use meaningful unit test names Name the behavior. classCanBeInstantiatedMention the method. setTitleSetsTitle Name the setSizeWithZeroThrowsExceptionpreconditions. hasTitleForEmptyTitleReturnsFalse Dont‘t use "works" or measureFrubbleWorksCorrectly "correctly".

    ×