Tdd Primer

Embed Size (px)

DESCRIPTION

Introductory talk focusing on TDD in the larger context of software test automation

Citation preview

  • 1. Test-driven development primer Test-driven development primer Robert Munteanu http://robert.muntea.nuhttp://robert.muntea.nu@rombert

2. Who I am$DAYJOB FOSS Adobe Experience MantisBT Management Mylyn Connector for Apache Sling MantisBT Apache JackrabbitMylyn Connector forReview Board Apache FelixApache Slinghttp://robert.muntea.nu@rombert 3. Agenda Intro to automated testing of software Test-driven development Top-down Test-driven development General industry practices around testinghttp://robert.muntea.nu@rombert 4. Not on the agenda Performance testing Fuzzing Security testing Internationalization and localisation testing GUI-driven testing ( play and record )http://robert.muntea.nu@rombert 5. I. Role of testing in software productsTesting workflowshttp://robert.muntea.nu@rombert 6. Testing workflows Developer ships code to tester for validationhttp://robert.muntea.nu@rombert 7. Testing workflows Developer fully automates testinghttp://robert.muntea.nu@rombert 8. Testing workflows Developer and QE developer and QE tester work togetherhttp://robert.muntea.nu@rombert 9. Testing workflows My code works, dammithttp://robert.muntea.nu@rombert 10. Testing automation Supported by a testing framework Your favourite language probably has it Makes it easy to separate the test code from the production codehttp://robert.muntea.nu@rombert 11. Testing automationhttp://robert.muntea.nu@rombert 12. Testing automationThis is what you usually get at development timehttp://robert.muntea.nu@rombert 13. Types of testsThe testing pyramid is a popular way of classifying testshttp://robert.muntea.nu@rombert 14. Unit tests Small, self-contained No external dependencies Fastest type of test ( under 1 second ) Should be the bulk of your testhttp://robert.muntea.nu@rombert 15. Service tests Larger tests Usually interact with external systems SQL-based tests are a good examplehttp://robert.muntea.nu@rombert 16. UI tests Application instance up and running Interacts with the UI rather than in-process Most programatic UI testing uses Seleniumhttp://robert.muntea.nu@rombert 17. Q&AEnd of first session, your questions?http://robert.muntea.nu@rombert 18. Test-Driven development Rapid feedback for your changes Ensures implementation and API are minimal Safety net when refactoring or making other changes (YAGNI) Saves everyone time and moneyhttp://robert.muntea.nu@rombert 19. Cost of fixing bugshttp://robert.muntea.nu@rombert 20. Test-Driven Development Hands-OnNote to self switch to Eclipsehttp://robert.muntea.nu@rombert 21. Test-Driven Development Hands-OnNote to self switch to Eclipsehttp://robert.muntea.nu@rombert 22. Test-Driven Development Classes are not always used in isolation, how does that work with TDD?http://robert.muntea.nu@rombert 23. Test-Driven Development Hands-On Dude, remember Eclipse?http://robert.muntea.nu@rombert 24. Q&AEnd of second session, your questions?http://robert.muntea.nu@rombert 25. Test-Driven developmentTime to go up the pyramid a bithttp://robert.muntea.nu@rombert 26. Test-Driven Development Hands-Onhttp://robert.muntea.nu@rombert 27. Test-Driven developmentAnd finally, top of the pyramidhttp://robert.muntea.nu@rombert 28. Test-Driven Development Hands-Onhttp://robert.muntea.nu@rombert 29. Q&A End of third session, your questions?http://robert.muntea.nu@rombert 30. Code qualityTest code quality is the same as production code quality Fast Stable Meaningfulhttp://robert.muntea.nu@rombert 31. Code coverage Measure it, know your weak points Dont obsess over percentageshttp://robert.muntea.nu@rombert 32. Automate, automate, automate Dont rely only on your IDE for tests Make sure it works with a build tool Make sure it works on other machines as wellhttp://robert.muntea.nu@rombert 33. Automate, automate, automatehttp://robert.muntea.nu@rombert 34. Automate, automate, automatehttp://robert.muntea.nu@rombert 35. Automate, automate, automatehttp://robert.muntea.nu@rombert 36. Q&AEnd of fourth session, your questions?http://robert.muntea.nu@rombert 37. Resourceshttp://google.comhttp://robert.muntea.nu@rombert 38. Thank you Robert Munteanuhttp://robert.muntea.nuhttp://robert.muntea.nu@rombert