SlideShare una empresa de Scribd logo
1 de 52
Unit testing for the
TYPO3 4.x core
Brush-up on unit testing   What has happened so far?




How you can use it now     How TYPO3 will benefit
Brush-up on unit testing   What has happened so far?




How you can use it now     How TYPO3 will benefit
Have you already
    unit-tested
                   today?
Have you already
    unit-tested
                   today?
Manual testing is cumbersome
Automated
testing is
fast
Unit tests for the
Seminar Manager
   extension
More than
2400 tests
Less than
90 seconds
(or 3 minutes
      on my laptop)
Verify your code with
unit tests
Catch regressions
Create a safety net
    for refactoring
Brush-up on unit testing   What has happened so far?




How you can use it now     How TYPO3 will benefit
The PHPUnit extension
now can run tests
for the Core
The PHPUnit extension
now can run tests
for the Core


        (I‘ll show you)
Survey in the
dev newsgroup
Survey in the
dev newsgroup
  tslib_TCEmain


   tslib_content


       t3lib_div


t3lib_TStemplate

                   0   1   2   3   4   5   6
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)
Proof-of-concept
unit tests for TCEmain
More tests
have been added
More tests
             have been added
  t3lib_cache_backend_*
                     t3lib_div
          t3lib_cache_Manager
t3lib_cache_frontend_*
            t3lib_extmgm
Brush-up on unit testing   What has happened so far?




How you can use it now     How TYPO3 will benefit
Write unit tests to
learn how some parts
     of the core work
Write unit tests to
learn how some parts
     of the core work
Write unit tests to
learn how some parts
     of the core work
        Let‘s do it!
Write unit tests before
you fix a bug
Make sure your changes
   don‘t break anything
Before
refactoring,
 write tests
     for the
    affected
        code
Brush-up on unit testing   What has happened so far?




How you can use it now     How TYPO3 will benefit
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
TCEmain will get
    more tests
TCEmain will get
              more tests
Time planned for
writing unit tests:
TCEmain will get
              more tests
Time planned for
writing unit tests:

   2 months
More knowledge on
    bad smells in the code
Too many
dependencies
Too many
    direct API calls
Too many
    direct API calls
Monster
    methods
Read more
on this
More knowledge on
Bugs that slip past
manual testing
 (but can be found with unit tests)
More
knowledge
   on



         bugs in lower levels
  (because you are testing in the GUI)
More knowledge on
   remote regressions
More knowledge on




   masked regressions
More knowledge on
       extreme cases
More knowledge on
         extreme cases



testing with
1000 000 records
Writing unit tests
is a lot of work.




            (Tell me something new.)
Rules for
  PHPCodeSniffer
   for finding these
    bugs and smells
            quicker
Brush-up on unit testing   What has happened so far?




How you can use it now     How TYPO3 will benefit
Questions?
Thank you.

Más contenido relacionado

La actualidad más candente

Re Sharper4vs Plain Visual Studio2008
Re Sharper4vs Plain Visual Studio2008Re Sharper4vs Plain Visual Studio2008
Re Sharper4vs Plain Visual Studio2008
Christian Palm
 
Coderetreat @Sibiu 2012 08 18
Coderetreat @Sibiu 2012 08 18Coderetreat @Sibiu 2012 08 18
Coderetreat @Sibiu 2012 08 18
Adi Bolboaca
 
Coderetreat @Vienna 2013 06 08
Coderetreat @Vienna 2013 06 08Coderetreat @Vienna 2013 06 08
Coderetreat @Vienna 2013 06 08
Adi Bolboaca
 

La actualidad más candente (20)

Python loops
Python loopsPython loops
Python loops
 
Refactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENGRefactoring legacy code driven by tests - ENG
Refactoring legacy code driven by tests - ENG
 
Re Sharper4vs Plain Visual Studio2008
Re Sharper4vs Plain Visual Studio2008Re Sharper4vs Plain Visual Studio2008
Re Sharper4vs Plain Visual Studio2008
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy code
 
Tdd - introduction
Tdd - introductionTdd - introduction
Tdd - introduction
 
Defencive programming
Defencive programmingDefencive programming
Defencive programming
 
10control statement in c#
10control statement in c#10control statement in c#
10control statement in c#
 
Loops
LoopsLoops
Loops
 
Software Engineering - RS3
Software Engineering - RS3Software Engineering - RS3
Software Engineering - RS3
 
Defensive programming
Defensive programmingDefensive programming
Defensive programming
 
Coderetreat @Sibiu 2012 08 18
Coderetreat @Sibiu 2012 08 18Coderetreat @Sibiu 2012 08 18
Coderetreat @Sibiu 2012 08 18
 
Doing the Impossible
Doing the ImpossibleDoing the Impossible
Doing the Impossible
 
Tdd with python unittest for embedded c
Tdd with python unittest for embedded cTdd with python unittest for embedded c
Tdd with python unittest for embedded c
 
Clean Unit Test Patterns
Clean Unit Test PatternsClean Unit Test Patterns
Clean Unit Test Patterns
 
RubyTesting
RubyTestingRubyTesting
RubyTesting
 
Loops c++
Loops c++Loops c++
Loops c++
 
Static Code Analysis and Cppcheck
Static Code Analysis and CppcheckStatic Code Analysis and Cppcheck
Static Code Analysis and Cppcheck
 
PVS-Studio and static code analysis technique
PVS-Studio and static code analysis techniquePVS-Studio and static code analysis technique
PVS-Studio and static code analysis technique
 
Coderetreat @Vienna 2013 06 08
Coderetreat @Vienna 2013 06 08Coderetreat @Vienna 2013 06 08
Coderetreat @Vienna 2013 06 08
 
Loops in C Programming Language
Loops in C Programming LanguageLoops in C Programming Language
Loops in C Programming Language
 

Destacado (8)

Stand das im Handbuch?
Stand das im Handbuch?Stand das im Handbuch?
Stand das im Handbuch?
 
Test-driven Development for TYPO3
Test-driven Development for TYPO3Test-driven Development for TYPO3
Test-driven Development for TYPO3
 
Stand das im Handbuch?
Stand das im Handbuch?Stand das im Handbuch?
Stand das im Handbuch?
 
Objektorientierte Programmierung mit extbase und fluid
Objektorientierte Programmierung mit extbase und fluidObjektorientierte Programmierung mit extbase und fluid
Objektorientierte Programmierung mit extbase und fluid
 
Test-Driven Development for TYPO3
Test-Driven Development for TYPO3Test-Driven Development for TYPO3
Test-Driven Development for TYPO3
 
TDD & Best Practices mit TYPO3
TDD & Best Practices mit TYPO3TDD & Best Practices mit TYPO3
TDD & Best Practices mit TYPO3
 
Test-Driven Development ... und mehr
Test-Driven Development ... und mehrTest-Driven Development ... und mehr
Test-Driven Development ... und mehr
 
Test-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DETest-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DE
 

Similar a Unit testing for the TYPO3 4.x core

Similar a Unit testing for the TYPO3 4.x core (20)

Software Testing, Everyone's responsibility
Software Testing, Everyone's responsibilitySoftware Testing, Everyone's responsibility
Software Testing, Everyone's responsibility
 
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerFaster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
 
ABAP Code Retreat Frankfurt 2016: TDD - Test Driven Development
ABAP Code Retreat Frankfurt 2016: TDD - Test Driven DevelopmentABAP Code Retreat Frankfurt 2016: TDD - Test Driven Development
ABAP Code Retreat Frankfurt 2016: TDD - Test Driven Development
 
ABAPCodeRetreat Frankfurt 2016 - TDD with ABAP
ABAPCodeRetreat Frankfurt 2016 - TDD with ABAPABAPCodeRetreat Frankfurt 2016 - TDD with ABAP
ABAPCodeRetreat Frankfurt 2016 - TDD with ABAP
 
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in FlexassertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
 
Solving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous TestingSolving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous Testing
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
DevOps - Boldly Go for Distro
DevOps - Boldly Go for DistroDevOps - Boldly Go for Distro
DevOps - Boldly Go for Distro
 
Dot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel TettelarDot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel Tettelar
 
STAMP, or Test Amplification to DevTestOps service, OW2con'18, June 7-8, 2018...
STAMP, or Test Amplification to DevTestOps service, OW2con'18, June 7-8, 2018...STAMP, or Test Amplification to DevTestOps service, OW2con'18, June 7-8, 2018...
STAMP, or Test Amplification to DevTestOps service, OW2con'18, June 7-8, 2018...
 
Exploratory testing
Exploratory testing Exploratory testing
Exploratory testing
 
Testing In Django
Testing In DjangoTesting In Django
Testing In Django
 
Automated tests
Automated testsAutomated tests
Automated tests
 
Review of an open source unit test tool- Cucumber_Presentation
Review of an open source unit test tool- Cucumber_PresentationReview of an open source unit test tool- Cucumber_Presentation
Review of an open source unit test tool- Cucumber_Presentation
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In Action
 
Why test with flex unit
Why test with flex unitWhy test with flex unit
Why test with flex unit
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Why unit testingl
Why unit testinglWhy unit testingl
Why unit testingl
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Performance Analysis of Idle Programs
Performance Analysis of Idle ProgramsPerformance Analysis of Idle Programs
Performance Analysis of Idle Programs
 

Más de Oliver Klee

Más de Oliver Klee (6)

Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)
 
Test-driven Development mit TYPO3
Test-driven Development mit TYPO3Test-driven Development mit TYPO3
Test-driven Development mit TYPO3
 
Persönliches Zeitmanagement mit Getting Things Done (GTD)
Persönliches Zeitmanagement mit Getting Things Done (GTD)Persönliches Zeitmanagement mit Getting Things Done (GTD)
Persönliches Zeitmanagement mit Getting Things Done (GTD)
 
Everything you need to know about the TYPO3 Security Team (T3DD10)
Everything you need to know about the TYPO3 Security Team (T3DD10)Everything you need to know about the TYPO3 Security Team (T3DD10)
Everything you need to know about the TYPO3 Security Team (T3DD10)
 
Unit testing for the TYPO3 4.x core (T3DD10)
Unit testing for the TYPO3 4.x core (T3DD10)Unit testing for the TYPO3 4.x core (T3DD10)
Unit testing for the TYPO3 4.x core (T3DD10)
 
GPG Workshop
GPG WorkshopGPG Workshop
GPG Workshop
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Unit testing for the TYPO3 4.x core

Notas del editor