SlideShare a Scribd company logo
1 of 21
Download to read offline
0Nicole Cordes, T3DD16 - Unit tests for dummies
Unit tests for dummies
ยป Introduction
ยป Basics
ยป Hands on
1Nicole Cordes, T3DD16 - Unit tests for dummies
Introduction
2Nicole Cordes, T3DD16 - Unit tests for dummies
INTRODUCTION
โ€žWho is that girl?โ€œ
ยป Nicole Cordes
ยป working at CPS-IT GmbH in Berlin
ยป community activity since 2011
ยป Core and Security Team member
ยป contributing to multiple public extensions
ยป Slack: @IchHabRecht
ยป Twitter: @IchHabRecht
ยป Mail: typo3@cordes.co
3Nicole Cordes, T3DD16 - Unit tests for dummies
Basics
4Nicole Cordes, T3DD16 - Unit tests for dummies
BASICS
โ€žWhy do I need unit tests?โ€œ
ยป verify your code does what you expect
ยป manual testing is slow and cumbersome
ยป automate testing is fast and cool
ยป new changes donโ€™t break existing functionality
ยป keep others from breaking your code
ยป safety net for refactorings
5Nicole Cordes, T3DD16 - Unit tests for dummies
BASICS
โ€žWhat are you talking about?โ€œ
test case
test
test
test
test
assertion
assertion
assertion
6Nicole Cordes, T3DD16 - Unit tests for dummies
BASICS
โ€žWhat are you talking about?โ€œ
Processing of a test case
ยป find all tests within the class
ยป call dataProvider and store return values
ยป call one test after another
7Nicole Cordes, T3DD16 - Unit tests for dummies
BASICS
โ€žWhat are you talking about?โ€œ
The life cycle of a test
ยป create an object of the test class
ยป call `setUp` method (protected!)
ยป objects and environment can be prepared
ยป call one test
ยป call `tearDown` method (protected!)
ยป objects and environment can be cleaned up
8Nicole Cordes, T3DD16 - Unit tests for dummies
Hands on
9Nicole Cordes, T3DD16 - Unit tests for dummies
USE CASE
โ€žext_testing aka blog_exampleโ€œ
10Nicole Cordes, T3DD16 - Unit tests for dummies
RUNNING TESTS
โ€žHow to run tests from CLI?โ€œ
ยป clone TYPO3 core
ยป run `composer install`
ยป use the cloned core for your development
ยป run `typo3_src/bin/phpunit -c typo3/sysext/core/Build/UnitTests.xml typo3conf/ext/ext_testing`
11Nicole Cordes, T3DD16 - Unit tests for dummies
RUNNING TESTS
โ€žHow to run tests within PhpStorm?โ€œ
ยป set up PHP version for your project
12Nicole Cordes, T3DD16 - Unit tests for dummies
RUNNING TESTS
โ€žHow to run tests within PhpStorm?โ€œ
ยป set up configuration
13Nicole Cordes, T3DD16 - Unit tests for dummies
RUNNING TESTS
โ€žHow to run tests within PhpStorm?โ€œ
ยป add environment variable
14Nicole Cordes, T3DD16 - Unit tests for dummies
RUNNING TESTS
โ€žHow to run tests within PhpStorm?โ€œ
ยป run test class or single test
15Nicole Cordes, T3DD16 - Unit tests for dummies
GENERATED TESTS
โ€žWhy should generated tests be deleted?โ€œ
ControllerTest
ยป due to Extbase all generated actions are very small
ยป aggregate information and passing it to the view
ยป test if data is visible (= assigned correctly) is not part of unit testing
ยป acceptance testing
ยป all those tests should be rewritten as functional tests (see you on Sunday ๏Š)
16Nicole Cordes, T3DD16 - Unit tests for dummies
GENERATED TESTS
โ€žWhy should generated tests be deleted?โ€œ
ModelTest
ยป generated tests simply test getter and setter
ยป no need to test getter and/or setter as long as they donโ€™t implement functionality
17Nicole Cordes, T3DD16 - Unit tests for dummies
CODING REAL UNIT TESTS
โ€žHow does real unit testing work?โ€œ
I
ยป no own logic means no need for unit tests
ยป we donโ€™t need to test the core
ยป tests for Extbase are done within the core
ยป no need for unit tests doesnโ€™t mean no need for other kinds of testing!
18Nicole Cordes, T3DD16 - Unit tests for dummies
CODING REAL UNIT TESTS
โ€žHow does real unit testing work?โ€œ
II
ยป add own logic
ยป add test case for your class
ยป add white- and blacklist tests
ยป switch to dataProvider and think about edge cases
19Nicole Cordes, T3DD16 - Unit tests for dummies
CODING REAL UNIT TESTS
โ€žHow does real unit testing work?โ€œ
III
ยป add more advanced logic
ยป add test case for your class
ยป remove coupling to external dependencies (mocking)
ยป define test expectations
ยป switch mocks to prophecies to be more verbose on decoupling
20Nicole Cordes, T3DD16 - Unit tests for dummies
Thank you
for your attention!

More Related Content

What's hot

Spock Framework
Spock FrameworkSpock Framework
Spock FrameworkDaniel Kolman
ย 
Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516SOAT
ย 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX EcosystemAndres Almiray
ย 
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing EventsDevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing EventsDevOps_Fest
ย 
ReactJS for Programmers
ReactJS for ProgrammersReactJS for Programmers
ReactJS for ProgrammersDavid Rodenas
ย 
TDD CrashCourse Part5: Testing Techniques
TDD CrashCourse Part5: Testing TechniquesTDD CrashCourse Part5: Testing Techniques
TDD CrashCourse Part5: Testing TechniquesDavid Rodenas
ย 
Java Libraries You Canโ€™t Afford to Miss
Java Libraries You Canโ€™t Afford to MissJava Libraries You Canโ€™t Afford to Miss
Java Libraries You Canโ€™t Afford to MissAndres Almiray
ย 
Smarter Testing With Spock
Smarter Testing With SpockSmarter Testing With Spock
Smarter Testing With SpockIT Weekend
ย 
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum
ย 
Implicit and Explicit waits in Selenium WebDriwer, how to.
Implicit and Explicit waits in Selenium WebDriwer, how to.Implicit and Explicit waits in Selenium WebDriwer, how to.
Implicit and Explicit waits in Selenium WebDriwer, how to.Yaroslav Pernerovsky
ย 
Automated Abstraction of Flow of Control in a System of Distributed Software...
Automated Abstraction of Flow of Control in a System of Distributed  Software...Automated Abstraction of Flow of Control in a System of Distributed  Software...
Automated Abstraction of Flow of Control in a System of Distributed Software...nimak
ย 
EclipseMAT
EclipseMATEclipseMAT
EclipseMATAli Bahu
ย 
Unit/Integration Testing using Spock
Unit/Integration Testing using SpockUnit/Integration Testing using Spock
Unit/Integration Testing using SpockAnuj Aneja
ย 
groovy & grails - lecture 11
groovy & grails - lecture 11groovy & grails - lecture 11
groovy & grails - lecture 11Alexandre Masselot
ย 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGuillaume Laforge
ย 
iOS Unit test getting stared
iOS Unit test getting starediOS Unit test getting stared
iOS Unit test getting staredLiyao Chen
ย 

What's hot (20)

Spock Framework
Spock FrameworkSpock Framework
Spock Framework
ย 
Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516
ย 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
ย 
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing EventsDevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
ย 
Thread dumps
Thread dumpsThread dumps
Thread dumps
ย 
ReactJS for Programmers
ReactJS for ProgrammersReactJS for Programmers
ReactJS for Programmers
ย 
TDD CrashCourse Part5: Testing Techniques
TDD CrashCourse Part5: Testing TechniquesTDD CrashCourse Part5: Testing Techniques
TDD CrashCourse Part5: Testing Techniques
ย 
Java Libraries You Canโ€™t Afford to Miss
Java Libraries You Canโ€™t Afford to MissJava Libraries You Canโ€™t Afford to Miss
Java Libraries You Canโ€™t Afford to Miss
ย 
Smarter Testing With Spock
Smarter Testing With SpockSmarter Testing With Spock
Smarter Testing With Spock
ย 
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
ย 
WebDriver Waits
WebDriver WaitsWebDriver Waits
WebDriver Waits
ย 
Implicit and Explicit waits in Selenium WebDriwer, how to.
Implicit and Explicit waits in Selenium WebDriwer, how to.Implicit and Explicit waits in Selenium WebDriwer, how to.
Implicit and Explicit waits in Selenium WebDriwer, how to.
ย 
Automated Abstraction of Flow of Control in a System of Distributed Software...
Automated Abstraction of Flow of Control in a System of Distributed  Software...Automated Abstraction of Flow of Control in a System of Distributed  Software...
Automated Abstraction of Flow of Control in a System of Distributed Software...
ย 
Automation puzzlers
Automation puzzlersAutomation puzzlers
Automation puzzlers
ย 
Spock
SpockSpock
Spock
ย 
EclipseMAT
EclipseMATEclipseMAT
EclipseMAT
ย 
Unit/Integration Testing using Spock
Unit/Integration Testing using SpockUnit/Integration Testing using Spock
Unit/Integration Testing using Spock
ย 
groovy & grails - lecture 11
groovy & grails - lecture 11groovy & grails - lecture 11
groovy & grails - lecture 11
ย 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
ย 
iOS Unit test getting stared
iOS Unit test getting starediOS Unit test getting stared
iOS Unit test getting stared
ย 

Viewers also liked

Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnitThomas Zimmermann
ย 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practicesnickokiss
ย 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated TestingLee Englestone
ย 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration TestingDavid Berliner
ย 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesDerek Smith
ย 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPTsuhasreddy1
ย 
Fluid Security
Fluid SecurityFluid Security
Fluid Securitycpsitgmbh
ย 
Hooks
HooksHooks
Hookscpsitgmbh
ย 
TYPO3 Caching
TYPO3 CachingTYPO3 Caching
TYPO3 Cachingcpsitgmbh
ย 
Using evolutionary testing to improve efficiency and quality
Using evolutionary testing to improve efficiency and qualityUsing evolutionary testing to improve efficiency and quality
Using evolutionary testing to improve efficiency and qualityFaysal Ahmed
ย 
TYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup DayTYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup Daycpsitgmbh
ย 
Managing Projects With HomeSpot
Managing Projects With HomeSpotManaging Projects With HomeSpot
Managing Projects With HomeSpotDerek Smith
ย 
Robot Chickens! How a Netduino runs our backyard chicken coop
Robot Chickens!  How a Netduino runs our backyard chicken coopRobot Chickens!  How a Netduino runs our backyard chicken coop
Robot Chickens! How a Netduino runs our backyard chicken coopDerek Smith
ย 
Building data driven mobile apps with phone gap and webapi
Building data driven mobile apps with phone gap and webapiBuilding data driven mobile apps with phone gap and webapi
Building data driven mobile apps with phone gap and webapiDerek Smith
ย 
Unit testing
Unit testingUnit testing
Unit testingSlideshare
ย 
What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014Derek Smith
ย 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit PresentationAnimesh Kumar
ย 
Zawรณd tester. Wprowadzenie.
Zawรณd tester. Wprowadzenie.Zawรณd tester. Wprowadzenie.
Zawรณd tester. Wprowadzenie.Radoslaw Smilgin
ย 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And MockingJoe Wilson
ย 

Viewers also liked (20)

Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
ย 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
ย 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
ย 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
ย 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
ย 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
ย 
Fluid Security
Fluid SecurityFluid Security
Fluid Security
ย 
Hooks
HooksHooks
Hooks
ย 
TYPO3 Caching
TYPO3 CachingTYPO3 Caching
TYPO3 Caching
ย 
Using evolutionary testing to improve efficiency and quality
Using evolutionary testing to improve efficiency and qualityUsing evolutionary testing to improve efficiency and quality
Using evolutionary testing to improve efficiency and quality
ย 
TYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup DayTYPO3 Contribution Bootup Day
TYPO3 Contribution Bootup Day
ย 
Managing Projects With HomeSpot
Managing Projects With HomeSpotManaging Projects With HomeSpot
Managing Projects With HomeSpot
ย 
Robot Chickens! How a Netduino runs our backyard chicken coop
Robot Chickens!  How a Netduino runs our backyard chicken coopRobot Chickens!  How a Netduino runs our backyard chicken coop
Robot Chickens! How a Netduino runs our backyard chicken coop
ย 
Building data driven mobile apps with phone gap and webapi
Building data driven mobile apps with phone gap and webapiBuilding data driven mobile apps with phone gap and webapi
Building data driven mobile apps with phone gap and webapi
ย 
Unit testing
Unit testingUnit testing
Unit testing
ย 
What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014
ย 
Junit
JunitJunit
Junit
ย 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit Presentation
ย 
Zawรณd tester. Wprowadzenie.
Zawรณd tester. Wprowadzenie.Zawรณd tester. Wprowadzenie.
Zawรณd tester. Wprowadzenie.
ย 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
ย 

Similar to Unit tests for dummies

How and what to unit test
How and what to unit testHow and what to unit test
How and what to unit testEugenio Lentini
ย 
Testing, Learning and Professionalism โ€” 20171214
Testing, Learning and Professionalism โ€” 20171214Testing, Learning and Professionalism โ€” 20171214
Testing, Learning and Professionalism โ€” 20171214David Rodenas
ย 
How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)Felix Geisendรถrfer
ย 
Creating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersCreating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersPaul Balogh
ย 
Test-Driven Design Insights@DevoxxBE 2023.pptx
Test-Driven Design Insights@DevoxxBE 2023.pptxTest-Driven Design Insights@DevoxxBE 2023.pptx
Test-Driven Design Insights@DevoxxBE 2023.pptxVictor Rentea
ย 
SPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic librarySPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic libraryAdaCore
ย 
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red TeamWhat is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red TeamMITRE ATT&CK
ย 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Danny Preussler
ย 
Gallio Crafting A Toolchain
Gallio Crafting A ToolchainGallio Crafting A Toolchain
Gallio Crafting A ToolchainConSanFrancisco123
ย 
Python testing like a pro by Keith Yang
Python testing like a pro by Keith YangPython testing like a pro by Keith Yang
Python testing like a pro by Keith YangPYCON MY PLT
ย 
Machine Learning Infrastructure
Machine Learning InfrastructureMachine Learning Infrastructure
Machine Learning InfrastructureSigOpt
ย 
Mocking vtcc3 - en
Mocking   vtcc3 - enMocking   vtcc3 - en
Mocking vtcc3 - envgrondin
ย 
How to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindHow to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindAndreas Czakaj
ย 
Behaviour Driven Development and Thinking About Testing
Behaviour Driven Development and Thinking About TestingBehaviour Driven Development and Thinking About Testing
Behaviour Driven Development and Thinking About Testingdn
ย 
Bdd and-testing
Bdd and-testingBdd and-testing
Bdd and-testingmalcolmt
ย 

Similar to Unit tests for dummies (20)

How and what to unit test
How and what to unit testHow and what to unit test
How and what to unit test
ย 
Testing, Learning and Professionalism โ€” 20171214
Testing, Learning and Professionalism โ€” 20171214Testing, Learning and Professionalism โ€” 20171214
Testing, Learning and Professionalism โ€” 20171214
ย 
How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)
ย 
TDD a piccoli passi
TDD a piccoli passiTDD a piccoli passi
TDD a piccoli passi
ย 
Creating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersCreating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with Testcontainers
ย 
Test-Driven Design Insights@DevoxxBE 2023.pptx
Test-Driven Design Insights@DevoxxBE 2023.pptxTest-Driven Design Insights@DevoxxBE 2023.pptx
Test-Driven Design Insights@DevoxxBE 2023.pptx
ย 
Effective Benchmarks
Effective BenchmarksEffective Benchmarks
Effective Benchmarks
ย 
SPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic librarySPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic library
ย 
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red TeamWhat is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
What is ATT&CK coverage, anyway? Breadth and depth analysis with Atomic Red Team
ย 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)
ย 
Gallio Crafting A Toolchain
Gallio Crafting A ToolchainGallio Crafting A Toolchain
Gallio Crafting A Toolchain
ย 
Test driven development
Test driven developmentTest driven development
Test driven development
ย 
Python and test
Python and testPython and test
Python and test
ย 
Python testing like a pro by Keith Yang
Python testing like a pro by Keith YangPython testing like a pro by Keith Yang
Python testing like a pro by Keith Yang
ย 
Machine Learning Infrastructure
Machine Learning InfrastructureMachine Learning Infrastructure
Machine Learning Infrastructure
ย 
5. DFT.pptx
5. DFT.pptx5. DFT.pptx
5. DFT.pptx
ย 
Mocking vtcc3 - en
Mocking   vtcc3 - enMocking   vtcc3 - en
Mocking vtcc3 - en
ย 
How to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindHow to write clean & testable code without losing your mind
How to write clean & testable code without losing your mind
ย 
Behaviour Driven Development and Thinking About Testing
Behaviour Driven Development and Thinking About TestingBehaviour Driven Development and Thinking About Testing
Behaviour Driven Development and Thinking About Testing
ย 
Bdd and-testing
Bdd and-testingBdd and-testing
Bdd and-testing
ย 

Recently uploaded

Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
ย 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...SUHANI PANDEY
ย 
Top Rated Pune Call Girls Daund โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
ย 
Call Now โ˜Ž 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now โ˜Ž 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.soniya singh
ย 
Call Now โ˜Ž 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now โ˜Ž 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
ย 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...roncy bisnoi
ย 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
ย 
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft DatingDubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Datingkojalkojal131
ย 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
ย 
VVVIP Call Girls In Connaught Place โžก๏ธ Delhi โžก๏ธ 9999965857 ๐Ÿš€ No Advance 24HRS...
VVVIP Call Girls In Connaught Place โžก๏ธ Delhi โžก๏ธ 9999965857 ๐Ÿš€ No Advance 24HRS...VVVIP Call Girls In Connaught Place โžก๏ธ Delhi โžก๏ธ 9999965857 ๐Ÿš€ No Advance 24HRS...
VVVIP Call Girls In Connaught Place โžก๏ธ Delhi โžก๏ธ 9999965857 ๐Ÿš€ No Advance 24HRS...Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
ย 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
ย 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
ย 
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...Diya Sharma
ย 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceEscorts Call Girls
ย 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...tanu pandey
ย 

Recently uploaded (20)

Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
ย 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
ย 
Top Rated Pune Call Girls Daund โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund โŸŸ 6297143586 โŸŸ Call Me For Genuine Sex Servi...
ย 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
ย 
Call Now โ˜Ž 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now โ˜Ž 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
ย 
Call Now โ˜Ž 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now โ˜Ž 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
ย 
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
ย 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
ย 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
ย 
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft DatingDubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
ย 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
ย 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
ย 
VVVIP Call Girls In Connaught Place โžก๏ธ Delhi โžก๏ธ 9999965857 ๐Ÿš€ No Advance 24HRS...
VVVIP Call Girls In Connaught Place โžก๏ธ Delhi โžก๏ธ 9999965857 ๐Ÿš€ No Advance 24HRS...VVVIP Call Girls In Connaught Place โžก๏ธ Delhi โžก๏ธ 9999965857 ๐Ÿš€ No Advance 24HRS...
VVVIP Call Girls In Connaught Place โžก๏ธ Delhi โžก๏ธ 9999965857 ๐Ÿš€ No Advance 24HRS...
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
ย 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
ย 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
ย 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
ย 
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
โ‚น5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] ๐Ÿ”|97111...
ย 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
ย 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
ย 

Unit tests for dummies

  • 1. 0Nicole Cordes, T3DD16 - Unit tests for dummies Unit tests for dummies ยป Introduction ยป Basics ยป Hands on
  • 2. 1Nicole Cordes, T3DD16 - Unit tests for dummies Introduction
  • 3. 2Nicole Cordes, T3DD16 - Unit tests for dummies INTRODUCTION โ€žWho is that girl?โ€œ ยป Nicole Cordes ยป working at CPS-IT GmbH in Berlin ยป community activity since 2011 ยป Core and Security Team member ยป contributing to multiple public extensions ยป Slack: @IchHabRecht ยป Twitter: @IchHabRecht ยป Mail: typo3@cordes.co
  • 4. 3Nicole Cordes, T3DD16 - Unit tests for dummies Basics
  • 5. 4Nicole Cordes, T3DD16 - Unit tests for dummies BASICS โ€žWhy do I need unit tests?โ€œ ยป verify your code does what you expect ยป manual testing is slow and cumbersome ยป automate testing is fast and cool ยป new changes donโ€™t break existing functionality ยป keep others from breaking your code ยป safety net for refactorings
  • 6. 5Nicole Cordes, T3DD16 - Unit tests for dummies BASICS โ€žWhat are you talking about?โ€œ test case test test test test assertion assertion assertion
  • 7. 6Nicole Cordes, T3DD16 - Unit tests for dummies BASICS โ€žWhat are you talking about?โ€œ Processing of a test case ยป find all tests within the class ยป call dataProvider and store return values ยป call one test after another
  • 8. 7Nicole Cordes, T3DD16 - Unit tests for dummies BASICS โ€žWhat are you talking about?โ€œ The life cycle of a test ยป create an object of the test class ยป call `setUp` method (protected!) ยป objects and environment can be prepared ยป call one test ยป call `tearDown` method (protected!) ยป objects and environment can be cleaned up
  • 9. 8Nicole Cordes, T3DD16 - Unit tests for dummies Hands on
  • 10. 9Nicole Cordes, T3DD16 - Unit tests for dummies USE CASE โ€žext_testing aka blog_exampleโ€œ
  • 11. 10Nicole Cordes, T3DD16 - Unit tests for dummies RUNNING TESTS โ€žHow to run tests from CLI?โ€œ ยป clone TYPO3 core ยป run `composer install` ยป use the cloned core for your development ยป run `typo3_src/bin/phpunit -c typo3/sysext/core/Build/UnitTests.xml typo3conf/ext/ext_testing`
  • 12. 11Nicole Cordes, T3DD16 - Unit tests for dummies RUNNING TESTS โ€žHow to run tests within PhpStorm?โ€œ ยป set up PHP version for your project
  • 13. 12Nicole Cordes, T3DD16 - Unit tests for dummies RUNNING TESTS โ€žHow to run tests within PhpStorm?โ€œ ยป set up configuration
  • 14. 13Nicole Cordes, T3DD16 - Unit tests for dummies RUNNING TESTS โ€žHow to run tests within PhpStorm?โ€œ ยป add environment variable
  • 15. 14Nicole Cordes, T3DD16 - Unit tests for dummies RUNNING TESTS โ€žHow to run tests within PhpStorm?โ€œ ยป run test class or single test
  • 16. 15Nicole Cordes, T3DD16 - Unit tests for dummies GENERATED TESTS โ€žWhy should generated tests be deleted?โ€œ ControllerTest ยป due to Extbase all generated actions are very small ยป aggregate information and passing it to the view ยป test if data is visible (= assigned correctly) is not part of unit testing ยป acceptance testing ยป all those tests should be rewritten as functional tests (see you on Sunday ๏Š)
  • 17. 16Nicole Cordes, T3DD16 - Unit tests for dummies GENERATED TESTS โ€žWhy should generated tests be deleted?โ€œ ModelTest ยป generated tests simply test getter and setter ยป no need to test getter and/or setter as long as they donโ€™t implement functionality
  • 18. 17Nicole Cordes, T3DD16 - Unit tests for dummies CODING REAL UNIT TESTS โ€žHow does real unit testing work?โ€œ I ยป no own logic means no need for unit tests ยป we donโ€™t need to test the core ยป tests for Extbase are done within the core ยป no need for unit tests doesnโ€™t mean no need for other kinds of testing!
  • 19. 18Nicole Cordes, T3DD16 - Unit tests for dummies CODING REAL UNIT TESTS โ€žHow does real unit testing work?โ€œ II ยป add own logic ยป add test case for your class ยป add white- and blacklist tests ยป switch to dataProvider and think about edge cases
  • 20. 19Nicole Cordes, T3DD16 - Unit tests for dummies CODING REAL UNIT TESTS โ€žHow does real unit testing work?โ€œ III ยป add more advanced logic ยป add test case for your class ยป remove coupling to external dependencies (mocking) ยป define test expectations ยป switch mocks to prophecies to be more verbose on decoupling
  • 21. 20Nicole Cordes, T3DD16 - Unit tests for dummies Thank you for your attention!