Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Unit testing for the TYPO3 4.x core

3,064 views

Published on

Published in: Technology

Unit testing for the TYPO3 4.x core

  1. 1. Unit testing for the TYPO3 4.x core
  2. 2. Brush-up on unit testing What has happened so far? How you can use it now How TYPO3 will benefit
  3. 3. Brush-up on unit testing What has happened so far? How you can use it now How TYPO3 will benefit
  4. 4. Have you already unit-tested today?
  5. 5. Have you already unit-tested today?
  6. 6. Manual testing is cumbersome
  7. 7. Automated testing is fast
  8. 8. Unit tests for the Seminar Manager extension
  9. 9. More than 2400 tests
  10. 10. Less than 90 seconds
  11. 11. (or 3 minutes on my laptop)
  12. 12. Verify your code with unit tests
  13. 13. Catch regressions
  14. 14. Create a safety net for refactoring
  15. 15. Brush-up on unit testing What has happened so far? How you can use it now How TYPO3 will benefit
  16. 16. The PHPUnit extension now can run tests for the Core
  17. 17. The PHPUnit extension now can run tests for the Core (I‘ll show you)
  18. 18. Survey in the dev newsgroup
  19. 19. Survey in the dev newsgroup tslib_TCEmain tslib_content t3lib_div t3lib_TStemplate 0 1 2 3 4 5 6
  20. 20. t3lib_TCEmain needs it badly „t3lib_TCEmain, t3lib_refindex, t3lib_BEfunc The first one should keep you busy for a month :D“ (post by Dmitry)
  21. 21. Proof-of-concept unit tests for TCEmain
  22. 22. More tests have been added
  23. 23. More tests have been added t3lib_cache_backend_* t3lib_div t3lib_cache_Manager t3lib_cache_frontend_* t3lib_extmgm
  24. 24. Brush-up on unit testing What has happened so far? How you can use it now How TYPO3 will benefit
  25. 25. Write unit tests to learn how some parts of the core work
  26. 26. Write unit tests to learn how some parts of the core work
  27. 27. Write unit tests to learn how some parts of the core work Let‘s do it!
  28. 28. Write unit tests before you fix a bug
  29. 29. Make sure your changes don‘t break anything
  30. 30. Before refactoring, write tests for the affected code
  31. 31. Brush-up on unit testing What has happened so far? How you can use it now How TYPO3 will benefit
  32. 32. Diploma thesis at the University of Bonn „Unit testing as a way to detect design flaws and hidden bugs in existing TYPO3 code“ Planned total time: 6 months
  33. 33. TCEmain will get more tests
  34. 34. TCEmain will get more tests Time planned for writing unit tests:
  35. 35. TCEmain will get more tests Time planned for writing unit tests: 2 months
  36. 36. More knowledge on bad smells in the code
  37. 37. Too many dependencies
  38. 38. Too many direct API calls
  39. 39. Too many direct API calls
  40. 40. Monster methods
  41. 41. Read more on this
  42. 42. More knowledge on Bugs that slip past manual testing (but can be found with unit tests)
  43. 43. More knowledge on bugs in lower levels (because you are testing in the GUI)
  44. 44. More knowledge on remote regressions
  45. 45. More knowledge on masked regressions
  46. 46. More knowledge on extreme cases
  47. 47. More knowledge on extreme cases testing with 1000 000 records
  48. 48. Writing unit tests is a lot of work. (Tell me something new.)
  49. 49. Rules for PHPCodeSniffer for finding these bugs and smells quicker
  50. 50. Brush-up on unit testing What has happened so far? How you can use it now How TYPO3 will benefit
  51. 51. Questions?
  52. 52. Thank you.

×