Test-Driven Development for TYPO3 @ T3CON12DE

972 views

Published on

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

No Downloads
Views
Total views
972
On SlideShare
0
From Embeds
0
Number of Embeds
2
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
  • 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".

    ×