• Save
Test-Driven Development for TYPO3 @ T3CON12DE
Upcoming SlideShare
Loading in...5
×
 

Test-Driven Development for TYPO3 @ T3CON12DE

on

  • 618 views

 

Statistics

Views

Total Views
618
Views on SlideShare
618
Embed Views
0

Actions

Likes
2
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \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 Test-Driven Development for TYPO3 @ T3CON12DE Presentation Transcript

  • 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- module)
  • The phpunit extension has it allphpunit (TYPO3 extension) PHPUnit (PEAR package) Testrunner Testrunner (back-end- module) (CLI module)
  • The phpunit extension has it allphpunit (TYPO3 extension) PHPUnit (PEAR package) Testing framework for FE & DB Testrunner Testrunner (back-end- module) (CLI module)
  • 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(); /** @test */ lifeIsGood();
  • The life cycle unit test of a new FooTest(); setUp(); /** @test */ lifeIsGood();
  • The life cycle unit test of a new FooTest(); setUp(); /** @test */ lifeIsGood(); tearDown();
  • The life cycle unit test of a new FooTest(); setUp(); /** @test */ lifeIsGood(); tearDown();
  • The life cycle unit test of a new FooTest(); setUp(); /** @test */ lifeIsGood(); tearDown();
  • 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 the method. setTitleSetsTitle
  • Use meaningful unit test names Name the behavior. classCanBeInstantiatedMention the method. setTitleSetsTitle Name the setSizeWithZeroThrowsExceptionpreconditions. hasTitleForEmptyTitleReturnsFalse
  • Use meaningful unit test names Name the behavior. classCanBeInstantiatedMention the method. setTitleSetsTitle Name the setSizeWithZeroThrowsExceptionpreconditions. hasTitleForEmptyTitleReturnsFalse Dont‘t use "works" or "correctly".
  • Use meaningful unit test names Name the behavior. classCanBeInstantiatedMention the method. setTitleSetsTitle Name the setSizeWithZeroThrowsExceptionpreconditions. hasTitleForEmptyTitleReturnsFalse Dont‘t use "works" or measureFrubbleWorksCorrectly "correctly".
  • Use meaningful unit test names Name the behavior. classCanBeInstantiatedMention the method. setTitleSetsTitle Name the setSizeWithZeroThrowsExceptionpreconditions. hasTitleForEmptyTitleReturnsFalse Dont‘t use "works" or measureFrubbleWorksCorrectly "correctly".