SlideShare a Scribd company logo
1 of 23
Regression Testing with Symfony
Tools and techniques for building your test suite
Introducing the speaker




              Joachim Unger
              @joeywannabe


              Symfony Explorer since 2.0
              Web Developer since 2010
              Former scientist at ABB Robotics


              Software Developer @LittleBird GmbH
              Berlin
Part 1: Exploring the techiques

   Regression Testing
   Test granularities in web projects
   Basic design patterns
   Symfony test components
   Behaviour Driven Development
   Continuous Integration
   Lessons learned
Regression Tests

   Discover new software bugs (regression)
   Verify bugfixes on existing functionality
   Validate changes against other components
   Include rerunning previously run tests
   Run on each code change
   Ensure product quality
   Minimize risks
Types of Regression Tests

 Progressive Regression Tests
    Specification has changed
    Code has been changed
      > Add new test cases
 Correcting Regression Tests
    Specification has not changed
    Test code changes against existing test cases
Regression Tests in web projects

 Defined test strategy
 Test-Driven Programming
   Tests for all code changes (e.g. bugfixes)
   Tests have to be up-to-date
   Continuous Refactoring
 Automated Test Suite
   Run on each code change
   Smoke, Acceptance and Unit Tests
   Continuous Integration
Software Quality


                         Functional Quality
                            Error-free execution of application
                            Strongly influences user acceptance
  Browser

                         Structural Quality
 Controller   View          Design and structure of code
              Utility       Loose coupling of components
                            Ensures extensibility of code
  Model
 ORM/DBAL
Unit Tests



    Assert that the result of
    foobar(“foo“) is “bar“.



   Verify functionality of single component
   Allow safe refactoring of code parts
   Must run successfully on each change
   Test is written with/before code
Acceptance Tests




                              Check that a click on button
                          „Put on shopping cart“ puts the item
                                 into the shopping cart

   Verify the functional requirements
   Ensure the overall application usability
   Test specification provided by stakeholder
Smoke Tests




                  Check that the url of a product page
                    is really showing a product page


 Verify the overall application functionality
 Good to identify crucial bugs
Separation Of Concerns

 Separation of task in independent blocks
    Loose coupling between components
    Heavy use of dependency injection

  Browser
                          MVC as an example
                             Model: Exchange and storage of data
                             View: Representaton of data
  Controller   View
                             Controller: Application Logic
               Utility


   Model
                          Decoupling of unit tests
 ORM/DBAL
Inversion Of Control

 Removal of static assignments
   Framework only works with abstraction of components
   Object graph is instantiated dynamically
 Separation of execution and implementation
Unit Testing in PHP

 phpunit: Status quo for testing in PHP
    Created by Sebastian Bergmann
    Originated as port of Junit
    Supports various features / extensions
 Framework for embedding tests in application
    Execution as test suite for an project
    Mocking of injected objects
    Code & coverage analysis
 Various functions for test assertions
Test Components in Symfony

 Unit Tests
     Enforce usage of dependency injection
     Testing of DBAL, model and relations
     Testing of components, utility classes
     Mocking of dependencies
 Functional Tests
   Testing page reachability
   Testing of page content and links
   Easy utilization for smoke tests
  http://symfony.com/doc/current/book/testing.html
Behaviour Driven Development

   Enhancement to Test-Driven Development
   Introduced by Dan North in 2006
   Tests act as functional specification
   Missing link between developer and stakeholder
       Justify functional requirements at beginning
       Software developed against functional specification
       Specified in a formal language (no experts needed)
       Clear focus on functionality
BDD Test Specification


    Scenario: Put item in shopping cart
    Given the case, the customer wants to buy a movie
       And his shopping cart is empty
       And there are 2 movies in stock
    When he puts the item in the shopping cart
    Then the item should show up in the shopping cart
       And the shopping cart counter should show 1
       And 1 movie should be in stock
BDD Testing Bundles



 Behat
 Bundle
            Integration of Behat into Symfony

  Mink
 Bundle     Integration of Mink into Symfony

 Behat      Test Engine for executing Gherking test case

  Mink      Encapsulation of different browser drivers
  Gherkin   Formal language to describe test cases
Other Testing Bundles

 DoctrineFixturesBundle
   Preparation of test data sets
 LiipFunctionalTestBundle
   Simplifies preparation and execution
   Utilizes DoctrineFixturesBundle
 PSSMockeryBundle (Symfony2MockerExtension)
   Mocking of services in DIC
   Demarcation of tests
Continuous Integration

 Continuous process to apply quality control
 Various CI Systems available
    Bamboo, Jenkins, CruiseControl
 Successfull development process for CI
      Direct feedback -> Short execution times
      Frequent checkins
      Commits to trunk
      Automated test chain
      Automated deploy -> Continuous delivery
Continuous Integration




                                             Automated Build
                                                Smoke Tests
                                                Unit Tests
                 Periodical Build
                                                Syntax Tests
                    Smoke Tests                Coding Standards
                    Unit Tests                 Copy/Paste Detection
                    Syntax Tests               Documentation
                    Coding Standards
                    Copy/Paste Detection
                    Documentation
                 +   Acceptance Tests
                 +   Other intensive tests
Favoured Test Suite

 Test-Driven Development
    Testing influences whole development process
    Loose coupling of components
 Test chain according to granularities
      Smoke Tests: Routes, Firewalls (Reachability)
      Unit Tests: Modular components, Utility classes
      DBAL Tests: Entity, Relations and Repository
      BDD Tests: User Interface (Usability)
 Continuous Integration System
    Triggers test chain on each commit
    Verifies state before final deploy
Lessons learned

   Commitment to TDD needed
   Testing influences software design
   Testing takes its time
   Quality can hardly be achieved later on
   Full test coverage almost unachievable
   Regression tests need automated test suite
   Testing only way to ensure software quality
Questions



            Questions regarding the practical
            usage probably covered in part 2

More Related Content

What's hot

Continuous Integration to Shift Left Testing Across the Enterprise Stack
Continuous Integration to Shift Left Testing Across the Enterprise StackContinuous Integration to Shift Left Testing Across the Enterprise Stack
Continuous Integration to Shift Left Testing Across the Enterprise StackDevOps.com
 
Software testing tools (free and open source)
Software testing tools (free and open source)Software testing tools (free and open source)
Software testing tools (free and open source)Wael Mansour
 
Rational Functional Tester
Rational Functional TesterRational Functional Tester
Rational Functional TesterRavi Anand
 
Programming skills for test automation
Programming skills for test automationProgramming skills for test automation
Programming skills for test automationRomania Testing
 
Practical unit testing in c & c++
Practical unit testing in c & c++Practical unit testing in c & c++
Practical unit testing in c & c++Matt Hargett
 
Testing Tool Evaluation Criteria
Testing Tool Evaluation CriteriaTesting Tool Evaluation Criteria
Testing Tool Evaluation Criteriabasma_iti_1984
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing ToolsDr Ganesh Iyer
 
Introduction to Gauge
Introduction to GaugeIntroduction to Gauge
Introduction to Gaugevodqancr
 
Test automation lessons from WebSphere Application Server
Test automation lessons from WebSphere Application ServerTest automation lessons from WebSphere Application Server
Test automation lessons from WebSphere Application ServerRobbie Minshall
 
Integrate UFT with Jenkins Guide
Integrate UFT with Jenkins GuideIntegrate UFT with Jenkins Guide
Integrate UFT with Jenkins GuideYu Tao Zhang
 
Automation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional TesterAutomation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional TesterVijayChowthri Nagaprakasham
 
Keyword Driven Automation
Keyword Driven AutomationKeyword Driven Automation
Keyword Driven AutomationPankaj Goel
 
An exploratory study of the state of practice of performance testing in Java-...
An exploratory study of the state of practice of performance testing in Java-...An exploratory study of the state of practice of performance testing in Java-...
An exploratory study of the state of practice of performance testing in Java-...corpaulbezemer
 
Software+struc+doc
Software+struc+docSoftware+struc+doc
Software+struc+docG.C Reddy
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software TestingMohammed Moishin
 

What's hot (17)

Continuous Integration to Shift Left Testing Across the Enterprise Stack
Continuous Integration to Shift Left Testing Across the Enterprise StackContinuous Integration to Shift Left Testing Across the Enterprise Stack
Continuous Integration to Shift Left Testing Across the Enterprise Stack
 
Software testing tools (free and open source)
Software testing tools (free and open source)Software testing tools (free and open source)
Software testing tools (free and open source)
 
Rational Functional Tester
Rational Functional TesterRational Functional Tester
Rational Functional Tester
 
Programming skills for test automation
Programming skills for test automationProgramming skills for test automation
Programming skills for test automation
 
Practical unit testing in c & c++
Practical unit testing in c & c++Practical unit testing in c & c++
Practical unit testing in c & c++
 
Testing Tool Evaluation Criteria
Testing Tool Evaluation CriteriaTesting Tool Evaluation Criteria
Testing Tool Evaluation Criteria
 
Testing
TestingTesting
Testing
 
Agile test practices
Agile test practicesAgile test practices
Agile test practices
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing Tools
 
Introduction to Gauge
Introduction to GaugeIntroduction to Gauge
Introduction to Gauge
 
Test automation lessons from WebSphere Application Server
Test automation lessons from WebSphere Application ServerTest automation lessons from WebSphere Application Server
Test automation lessons from WebSphere Application Server
 
Integrate UFT with Jenkins Guide
Integrate UFT with Jenkins GuideIntegrate UFT with Jenkins Guide
Integrate UFT with Jenkins Guide
 
Automation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional TesterAutomation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional Tester
 
Keyword Driven Automation
Keyword Driven AutomationKeyword Driven Automation
Keyword Driven Automation
 
An exploratory study of the state of practice of performance testing in Java-...
An exploratory study of the state of practice of performance testing in Java-...An exploratory study of the state of practice of performance testing in Java-...
An exploratory study of the state of practice of performance testing in Java-...
 
Software+struc+doc
Software+struc+docSoftware+struc+doc
Software+struc+doc
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
 

Similar to Regression Testing with Symfony

Model For Applying Unit Test
Model For Applying Unit TestModel For Applying Unit Test
Model For Applying Unit TestHieu Le Trung
 
Automated testing - how?
Automated testing - how?Automated testing - how?
Automated testing - how?Markko Paas
 
03 test specification and execution
03   test specification and execution03   test specification and execution
03 test specification and executionClemens Reijnen
 
Back to basics - PHPUnit
Back to basics - PHPUnitBack to basics - PHPUnit
Back to basics - PHPUnitSebastian Marek
 
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...Mohammed Kharma
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD123abcda
 
Unit testing
Unit testing Unit testing
Unit testing dubbu
 
Microsoft Stack Visual Studio 2010 Overview
Microsoft  Stack   Visual Studio 2010 OverviewMicrosoft  Stack   Visual Studio 2010 Overview
Microsoft Stack Visual Studio 2010 Overviewrfennell
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated TestingLee Englestone
 
Neil Tompson - SoftTest Ireland
Neil Tompson - SoftTest IrelandNeil Tompson - SoftTest Ireland
Neil Tompson - SoftTest IrelandDavid O'Dowd
 
Manual Testing Questions
Manual Testing QuestionsManual Testing Questions
Manual Testing QuestionsUser1test
 
Glossary of Testing Terms and Concepts
Glossary of Testing Terms and ConceptsGlossary of Testing Terms and Concepts
Glossary of Testing Terms and Conceptsmqamarhayat
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sitesjoelabrahamsson
 
Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Mohamed Taman
 
Testy dymne, integracyjne i jednostkowe w Laravel
Testy dymne, integracyjne i jednostkowe w LaravelTesty dymne, integracyjne i jednostkowe w Laravel
Testy dymne, integracyjne i jednostkowe w LaravelLaravel Poland MeetUp
 

Similar to Regression Testing with Symfony (20)

Model For Applying Unit Test
Model For Applying Unit TestModel For Applying Unit Test
Model For Applying Unit Test
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Automated testing - how?
Automated testing - how?Automated testing - how?
Automated testing - how?
 
03 test specification and execution
03   test specification and execution03   test specification and execution
03 test specification and execution
 
Back to basics - PHPUnit
Back to basics - PHPUnitBack to basics - PHPUnit
Back to basics - PHPUnit
 
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
Unit testing
Unit testing Unit testing
Unit testing
 
Testing strategies
Testing strategiesTesting strategies
Testing strategies
 
Microsoft Stack Visual Studio 2010 Overview
Microsoft  Stack   Visual Studio 2010 OverviewMicrosoft  Stack   Visual Studio 2010 Overview
Microsoft Stack Visual Studio 2010 Overview
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
Neil Tompson - SoftTest Ireland
Neil Tompson - SoftTest IrelandNeil Tompson - SoftTest Ireland
Neil Tompson - SoftTest Ireland
 
Manual Testing Questions
Manual Testing QuestionsManual Testing Questions
Manual Testing Questions
 
Glossary of Testing Terms and Concepts
Glossary of Testing Terms and ConceptsGlossary of Testing Terms and Concepts
Glossary of Testing Terms and Concepts
 
Software testing ppt
Software testing pptSoftware testing ppt
Software testing ppt
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sites
 
Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.
 
Testy dymne, integracyjne i jednostkowe w Laravel
Testy dymne, integracyjne i jednostkowe w LaravelTesty dymne, integracyjne i jednostkowe w Laravel
Testy dymne, integracyjne i jednostkowe w Laravel
 
Testing concepts
Testing conceptsTesting concepts
Testing concepts
 

Recently uploaded

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Regression Testing with Symfony

  • 1. Regression Testing with Symfony Tools and techniques for building your test suite
  • 2. Introducing the speaker Joachim Unger @joeywannabe Symfony Explorer since 2.0 Web Developer since 2010 Former scientist at ABB Robotics Software Developer @LittleBird GmbH Berlin
  • 3. Part 1: Exploring the techiques  Regression Testing  Test granularities in web projects  Basic design patterns  Symfony test components  Behaviour Driven Development  Continuous Integration  Lessons learned
  • 4. Regression Tests  Discover new software bugs (regression)  Verify bugfixes on existing functionality  Validate changes against other components  Include rerunning previously run tests  Run on each code change  Ensure product quality  Minimize risks
  • 5. Types of Regression Tests  Progressive Regression Tests  Specification has changed  Code has been changed > Add new test cases  Correcting Regression Tests  Specification has not changed  Test code changes against existing test cases
  • 6. Regression Tests in web projects  Defined test strategy  Test-Driven Programming  Tests for all code changes (e.g. bugfixes)  Tests have to be up-to-date  Continuous Refactoring  Automated Test Suite  Run on each code change  Smoke, Acceptance and Unit Tests  Continuous Integration
  • 7. Software Quality  Functional Quality  Error-free execution of application  Strongly influences user acceptance Browser  Structural Quality Controller View  Design and structure of code Utility  Loose coupling of components  Ensures extensibility of code Model ORM/DBAL
  • 8. Unit Tests Assert that the result of foobar(“foo“) is “bar“.  Verify functionality of single component  Allow safe refactoring of code parts  Must run successfully on each change  Test is written with/before code
  • 9. Acceptance Tests Check that a click on button „Put on shopping cart“ puts the item into the shopping cart  Verify the functional requirements  Ensure the overall application usability  Test specification provided by stakeholder
  • 10. Smoke Tests Check that the url of a product page is really showing a product page  Verify the overall application functionality  Good to identify crucial bugs
  • 11. Separation Of Concerns  Separation of task in independent blocks  Loose coupling between components  Heavy use of dependency injection Browser  MVC as an example  Model: Exchange and storage of data  View: Representaton of data Controller View  Controller: Application Logic Utility Model  Decoupling of unit tests ORM/DBAL
  • 12. Inversion Of Control  Removal of static assignments  Framework only works with abstraction of components  Object graph is instantiated dynamically  Separation of execution and implementation
  • 13. Unit Testing in PHP  phpunit: Status quo for testing in PHP  Created by Sebastian Bergmann  Originated as port of Junit  Supports various features / extensions  Framework for embedding tests in application  Execution as test suite for an project  Mocking of injected objects  Code & coverage analysis  Various functions for test assertions
  • 14. Test Components in Symfony  Unit Tests  Enforce usage of dependency injection  Testing of DBAL, model and relations  Testing of components, utility classes  Mocking of dependencies  Functional Tests  Testing page reachability  Testing of page content and links  Easy utilization for smoke tests http://symfony.com/doc/current/book/testing.html
  • 15. Behaviour Driven Development  Enhancement to Test-Driven Development  Introduced by Dan North in 2006  Tests act as functional specification  Missing link between developer and stakeholder  Justify functional requirements at beginning  Software developed against functional specification  Specified in a formal language (no experts needed)  Clear focus on functionality
  • 16. BDD Test Specification Scenario: Put item in shopping cart Given the case, the customer wants to buy a movie And his shopping cart is empty And there are 2 movies in stock When he puts the item in the shopping cart Then the item should show up in the shopping cart And the shopping cart counter should show 1 And 1 movie should be in stock
  • 17. BDD Testing Bundles Behat Bundle Integration of Behat into Symfony Mink Bundle Integration of Mink into Symfony Behat Test Engine for executing Gherking test case Mink Encapsulation of different browser drivers Gherkin Formal language to describe test cases
  • 18. Other Testing Bundles  DoctrineFixturesBundle  Preparation of test data sets  LiipFunctionalTestBundle  Simplifies preparation and execution  Utilizes DoctrineFixturesBundle  PSSMockeryBundle (Symfony2MockerExtension)  Mocking of services in DIC  Demarcation of tests
  • 19. Continuous Integration  Continuous process to apply quality control  Various CI Systems available  Bamboo, Jenkins, CruiseControl  Successfull development process for CI  Direct feedback -> Short execution times  Frequent checkins  Commits to trunk  Automated test chain  Automated deploy -> Continuous delivery
  • 20. Continuous Integration Automated Build  Smoke Tests  Unit Tests Periodical Build  Syntax Tests  Smoke Tests  Coding Standards  Unit Tests  Copy/Paste Detection  Syntax Tests  Documentation  Coding Standards  Copy/Paste Detection  Documentation + Acceptance Tests + Other intensive tests
  • 21. Favoured Test Suite  Test-Driven Development  Testing influences whole development process  Loose coupling of components  Test chain according to granularities  Smoke Tests: Routes, Firewalls (Reachability)  Unit Tests: Modular components, Utility classes  DBAL Tests: Entity, Relations and Repository  BDD Tests: User Interface (Usability)  Continuous Integration System  Triggers test chain on each commit  Verifies state before final deploy
  • 22. Lessons learned  Commitment to TDD needed  Testing influences software design  Testing takes its time  Quality can hardly be achieved later on  Full test coverage almost unachievable  Regression tests need automated test suite  Testing only way to ensure software quality
  • 23. Questions Questions regarding the practical usage probably covered in part 2