SlideShare ist ein Scribd-Unternehmen logo
1 von 29
CODE COVERAGE FOR
TOTAL SECURITY IN
APPLICATION MIGRATIONS
How to prepare for and confirm with confidence that your application is
working as intended after a major migration.
https://joind.in/talk/e386f
SR. WEB APPLICATION ARCHITECT
DANA H LUTHER
@danaluther
dluther@envisageinternational.com
https://www.linkedin.com/in/danaluther/
WHAT IS ENVISAGE?
Envisage International Corporation is an international education marketing
company serving students and schools around the world. Our student-
focused sites offer relevant information, targeted tools, unique resources and
valuable products for international students and educators.
ESLdirectory
THE AGE OLD QUESTION….
When do we upgrade?!
OMG … PHP7 is
OUT!!
Did you see the
new Bootstrap?!
Ooh .. Look a
MySQL update!
Uh, guys, this site is
behind by 2 full Bootstrap
versions…
Look at all the
new features in
Yii2!
Ugh – have you seen
this? It’s still in
columnal…
Wow, look at these
includes…with more
includes in them…
THE TIPPING POINT
As long as the risks outweigh the rewards, you’ll never upgrade. All things
being equal … you probably won’t upgrade. You have to tip the scales.
LETS DO IT!
Don’t wait until the balance tips because you’ve added
‘threat of impending doom’
to the reward side of the equation!
Eh, I don’t
know…
Risk Reward
Increase your reward … or minimize your risk? Which is easier??
Cost
HOW DO WE MAKE IT LESS RISKY?
Testing suites with Code Coverage!
Our test suites can answer the following questions:
How will we make things better?
• What was the performance improvement?
• What do we tell ‘the boss’ when s/he asks what the
potential risks are?
Will we BREAK anything?
• Infrequently used features?
• Custom JavaScript or CSS?
• All previous functionality should be present and
working as intended!
OK SO WE NEED TO TEST …
HOW DO WE DO THAT?
Codeception has supported modules for the following frameworks, to
name a few, built in:
• Symfony
• Laravel
• WordPress
• Joomla
• Yii
• Zend Framework
Codeception Tests with --coverage
http://codeception.com/
WHAT ARE WE GOING TO
COVER?
• No, not all the things … but close!
• 80-100% coverage is the goal!
START WITH A CLEAN SLATE
The biggest job is actually going to come *before* you do your migration.
Before we upgrade, we need 80-100% Coverage with (ideally) all tests in the Green!
Have something you know isn’t working? Document it!
DOWNLOAD CODECEPTION
Add the composer requirement, and run composer update (if you do not have Codeception globally
installed).
http://codeception.com/quickstart
./vendor/bin/yiic webapp ./
INSTALL CODECEPTION> ./vendor/bin/codecept bootstrap
Default codeception.yml
SAMPLE
CODECEPTION.YML
Mileage may vary :p
SAMPLE UNIT.YML FILE
Using the modules, this unit test is updated to use the Yii2 module, and enable the orm, email and fixture
elements of that model.
SAMPLE FUNCTIONAL.YML FILE
For the functional test suite, you will probably need some additional modules and helpers.
Ensure that your configuration files are pointing to the proper test server locations.
SAMPLE
ACCEPTANCE.YML
FILE
Using the WebDriver module for the
acceptance tests allows us to test the
pages with JavaScript enabled.
Need help getting your configuration
right for your framework? Check the
‘Case Study’ section of the
Codeception website for specifics on
your framework.
http://codeception.com/for/yii
RUN THE SUITE!
> ./vendor/bin/codecept run
… Meh … but it works!
Move the existing PHPUnit tests to the
new tests/unit/ folder and try again…
> php –S localhost:8080
Make sure your local webserver is running before you try to run the suite!
FIXTURE DATA
Your tests are only as good as the data that
you’re using!
False Sense of Security:
• Using ”1” as the ID for everything (No!!)
• Checking for a result without checking the
details of the result (Also No!!)
Use Fixtures specific to your Needs:
• Alternate fixtures for detailed scenarios
• Fixtures take time to load!! Large fixture data
sets should only be included where
necessary.
FAKED FIXTURE DATA https://github.com/fzaninotto/Faker
composer require fzaninotto/faker
ORGANIZE
• The @group tag:
• Modules
• Client/API Systems
• Issue based
• Filesystem Structure
> codecept run --group=EGI-1125
> codecept run --group=newsletter
> codecept run --skip-group=api
> codecept run unit pax/
> codecept run unit pax/:FindAll
RUN YOUR TEST SUITE WITH
COVERAGE
>codecept run unit --coverage --coverage-html
DON’T OVERDO IT
The @covers tag is a love/hate relationship.
http://codeception.com/docs/11-Codecoverage
😀😡😭😍
REVIEW COVERAGE OUTPUT
GOT IT ALL COVERED? SWEET, LET’S DO THIS!
WHAT’S OUR DEV. BOX SETUP?
Docker
If you’re running in a Docker
environment, and you want to test
against various versions of PHP or
MySQL, then your job is easy!
Just swap out your Docker images for
PHP or MySQL for the version you
want to test. Relaunch your image
and run your tests.
Virtual Machine
If you are using a VM for your testing
environment, without Docker, then
your upgrade process is going to be
a little trickier, and it’s a good idea to
get a solid snapshot of your VM state
before you start apt-get upgrading
your PHP, MySQL or whatever.
Dev Machine
If your dev machine is your localhost,
you don’t really have much room for
going backward if things don’t
proceed well, unless you’re happy to
play with restoring nightly backups.
Aaand… go!
Whether it’s an apt-get update, a composer update, or whatever the case may be, this is the point at which the actual
system migration should occur – then we’re back to testing!
THE UPGRADE / REVIEW LIFECYCLE
Refactor/
Update
Test
Refactor/
Update
Test
Refactor/
Update
Test
Upgrade
underlying system
Test for green!
TEST SUITE STATUS CHECK
Errors and Failures?
• Cycle back through unit by unit to
focus on addressing the issues
revealed by the tests.
• Leverage the @group tags to
narrow your focus down to specific
test groups
All Green?
• Go for the –coverage-html check,
and if you’re still all green with 80-
100% coverage, then you can give
the green light to releasing the
upgrade to production!
👍 GOOD TO GO!
Once all your tests are showing green across the board and coverage is
confirmed at 80-100%, you're ready to deploy your upgrade to production
and can say with CERTAINTY that your new system is compatible and ready to
go!
• You’ve had a dry run of the upgrade process
• All features are covered and passing:
• No nasty surprises at launch.
• Everyone goes home on time!
• Clients are all happy! (or not, is there such a thing?)
QUESTIONS?
DANA H LUTHER
@danaluther
dluther@envisageinternational.com
https://www.linkedin.com/in/danaluther/
https://joind.in/talk/e386f

Weitere ähnliche Inhalte

Was ist angesagt?

Appium mobile web+dev conference
Appium   mobile web+dev conferenceAppium   mobile web+dev conference
Appium mobile web+dev conference
Isaac Murchie
 

Was ist angesagt? (20)

Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola Paolucci
 
Unikernels and another way of secure cloud computing
Unikernels and another way of secure cloud computingUnikernels and another way of secure cloud computing
Unikernels and another way of secure cloud computing
 
Beyond the Release: CI That Transforms Organizations
Beyond the Release: CI That Transforms OrganizationsBeyond the Release: CI That Transforms Organizations
Beyond the Release: CI That Transforms Organizations
 
Build 2017 - B8093 - Nextgen UWP app distribution: Building extensible, strea...
Build 2017 - B8093 - Nextgen UWP app distribution: Building extensible, strea...Build 2017 - B8093 - Nextgen UWP app distribution: Building extensible, strea...
Build 2017 - B8093 - Nextgen UWP app distribution: Building extensible, strea...
 
Appium mobile web+dev conference
Appium   mobile web+dev conferenceAppium   mobile web+dev conference
Appium mobile web+dev conference
 
Async webdriverjs
Async webdriverjsAsync webdriverjs
Async webdriverjs
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the Cloud
 
Moving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life StoryMoving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life Story
 
Sauce Labs for Visual Studio Team Services & TFS
Sauce Labs for Visual Studio Team Services & TFSSauce Labs for Visual Studio Team Services & TFS
Sauce Labs for Visual Studio Team Services & TFS
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Selenium and Open Source Advanced Testing
Selenium and Open Source Advanced TestingSelenium and Open Source Advanced Testing
Selenium and Open Source Advanced Testing
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
 
Comparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End TestingComparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End Testing
 
Colorful world-of-visual-automation-testing-latest
Colorful world-of-visual-automation-testing-latestColorful world-of-visual-automation-testing-latest
Colorful world-of-visual-automation-testing-latest
 
Selenium Camp 2016 - Kiev, Ukraine
Selenium Camp 2016 -  Kiev, UkraineSelenium Camp 2016 -  Kiev, Ukraine
Selenium Camp 2016 - Kiev, Ukraine
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with Cypress
 
Selenium conference, 2016
Selenium conference, 2016Selenium conference, 2016
Selenium conference, 2016
 
Cross browser testing
Cross browser testingCross browser testing
Cross browser testing
 
Automatic Functional Testing with Selenium and SauceLabs
Automatic Functional Testing with Selenium and SauceLabsAutomatic Functional Testing with Selenium and SauceLabs
Automatic Functional Testing with Selenium and SauceLabs
 

Andere mochten auch

Andere mochten auch (20)

SunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLSunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQL
 
Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017Debugging Effectively - SunshinePHP 2017
Debugging Effectively - SunshinePHP 2017
 
Engineer - Mastering the Art of Software
Engineer - Mastering the Art of SoftwareEngineer - Mastering the Art of Software
Engineer - Mastering the Art of Software
 
Dip Your Toes in the Sea of Security
Dip Your Toes in the Sea of SecurityDip Your Toes in the Sea of Security
Dip Your Toes in the Sea of Security
 
A World Without PHP
A World Without PHPA World Without PHP
A World Without PHP
 
Learn To Test Like A Grumpy Programmer - 3 hour workshop
Learn To Test Like A Grumpy Programmer - 3 hour workshopLearn To Test Like A Grumpy Programmer - 3 hour workshop
Learn To Test Like A Grumpy Programmer - 3 hour workshop
 
Amp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pagesAmp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pages
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
JWT - To authentication and beyond!
JWT - To authentication and beyond!JWT - To authentication and beyond!
JWT - To authentication and beyond!
 
A recommendation engine for your php application
A recommendation engine for your php applicationA recommendation engine for your php application
A recommendation engine for your php application
 
PHP UK 2017 - Don't Lose Sleep - Secure Your REST
PHP UK 2017 - Don't Lose Sleep - Secure Your RESTPHP UK 2017 - Don't Lose Sleep - Secure Your REST
PHP UK 2017 - Don't Lose Sleep - Secure Your REST
 
Docker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHPDocker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHP
 
PHP Benelux 2017 - Caching The Right Way
PHP Benelux 2017 -  Caching The Right WayPHP Benelux 2017 -  Caching The Right Way
PHP Benelux 2017 - Caching The Right Way
 
Adding 1.21 Gigawatts to Applications with RabbitMQ (Bulgaria PHP 2016 - Tuto...
Adding 1.21 Gigawatts to Applications with RabbitMQ (Bulgaria PHP 2016 - Tuto...Adding 1.21 Gigawatts to Applications with RabbitMQ (Bulgaria PHP 2016 - Tuto...
Adding 1.21 Gigawatts to Applications with RabbitMQ (Bulgaria PHP 2016 - Tuto...
 
Hack the Future
Hack the FutureHack the Future
Hack the Future
 
Amp your site an intro to accelerated mobile pages
Amp your site  an intro to accelerated mobile pagesAmp your site  an intro to accelerated mobile pages
Amp your site an intro to accelerated mobile pages
 
Zend Framework Foundations
Zend Framework FoundationsZend Framework Foundations
Zend Framework Foundations
 
php[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Up
 
Create, test, secure, repeat
Create, test, secure, repeatCreate, test, secure, repeat
Create, test, secure, repeat
 
Presentation Bulgaria PHP
Presentation Bulgaria PHPPresentation Bulgaria PHP
Presentation Bulgaria PHP
 

Ähnlich wie Code Coverage for Total Security in Application Migrations

From 0 to DevOps in 80 Days [Webinar Replay]
From 0 to DevOps in 80 Days [Webinar Replay]From 0 to DevOps in 80 Days [Webinar Replay]
From 0 to DevOps in 80 Days [Webinar Replay]
Dynatrace
 
Slides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetingsSlides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetings
10n Software, LLC
 
PHP North-East - Automated Deployment
PHP North-East - Automated DeploymentPHP North-East - Automated Deployment
PHP North-East - Automated Deployment
Michael Peacock
 
Kelly potvin nosurprises_odtug_oow12
Kelly potvin nosurprises_odtug_oow12Kelly potvin nosurprises_odtug_oow12
Kelly potvin nosurprises_odtug_oow12
Enkitec
 

Ähnlich wie Code Coverage for Total Security in Application Migrations (20)

SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
From 0 to DevOps in 80 Days [Webinar Replay]
From 0 to DevOps in 80 Days [Webinar Replay]From 0 to DevOps in 80 Days [Webinar Replay]
From 0 to DevOps in 80 Days [Webinar Replay]
 
Adrian marinica continuous integration in the visual studio world
Adrian marinica   continuous integration in the visual studio worldAdrian marinica   continuous integration in the visual studio world
Adrian marinica continuous integration in the visual studio world
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Slides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetingsSlides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetings
 
Best practices for implementing CI/CD on Salesforce
Best practices for implementing CI/CD on SalesforceBest practices for implementing CI/CD on Salesforce
Best practices for implementing CI/CD on Salesforce
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Confoo-Montreal-2016: Controlling Your Environments using Infrastructure as Code
Confoo-Montreal-2016: Controlling Your Environments using Infrastructure as CodeConfoo-Montreal-2016: Controlling Your Environments using Infrastructure as Code
Confoo-Montreal-2016: Controlling Your Environments using Infrastructure as Code
 
PHP North-East - Automated Deployment
PHP North-East - Automated DeploymentPHP North-East - Automated Deployment
PHP North-East - Automated Deployment
 
Automated Deployment
Automated DeploymentAutomated Deployment
Automated Deployment
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
Kelly potvin nosurprises_odtug_oow12
Kelly potvin nosurprises_odtug_oow12Kelly potvin nosurprises_odtug_oow12
Kelly potvin nosurprises_odtug_oow12
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
 
Frontend testing of (legacy) websites
Frontend testing of (legacy) websitesFrontend testing of (legacy) websites
Frontend testing of (legacy) websites
 
Agility Requires Safety
Agility Requires SafetyAgility Requires Safety
Agility Requires Safety
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 
Prescriptive System Security with InSpec
Prescriptive System Security with InSpecPrescriptive System Security with InSpec
Prescriptive System Security with InSpec
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
 
Harman deepak v - agile on steriod - dev ops led transformation
Harman  deepak v - agile on steriod - dev ops led transformationHarman  deepak v - agile on steriod - dev ops led transformation
Harman deepak v - agile on steriod - dev ops led transformation
 

Mehr von Dana Luther

Mehr von Dana Luther (12)

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
How to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHPHow to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHP
 
Keep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DIKeep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DI
 
Integrated Feature Management - Using Feature Flags - PHPSerbia
Integrated Feature Management - Using Feature Flags - PHPSerbiaIntegrated Feature Management - Using Feature Flags - PHPSerbia
Integrated Feature Management - Using Feature Flags - PHPSerbia
 
Integrated Feature Management - Using Feature Flags - MidwestPHP
Integrated Feature Management - Using Feature Flags - MidwestPHPIntegrated Feature Management - Using Feature Flags - MidwestPHP
Integrated Feature Management - Using Feature Flags - MidwestPHP
 
Integrated Feature Management - Using Feature Flags - SunshinePHP
Integrated Feature Management - Using Feature Flags - SunshinePHPIntegrated Feature Management - Using Feature Flags - SunshinePHP
Integrated Feature Management - Using Feature Flags - SunshinePHP
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
 
Converting your DEV Environment to a Docker Stack - ZCOE18
Converting your DEV Environment to a Docker Stack - ZCOE18Converting your DEV Environment to a Docker Stack - ZCOE18
Converting your DEV Environment to a Docker Stack - ZCOE18
 
Converting Your DEV Environment to a Docker Stack
Converting Your DEV Environment to a Docker StackConverting Your DEV Environment to a Docker Stack
Converting Your DEV Environment to a Docker Stack
 

Kürzlich hochgeladen

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 

Kürzlich hochgeladen (20)

UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 

Code Coverage for Total Security in Application Migrations

  • 1. CODE COVERAGE FOR TOTAL SECURITY IN APPLICATION MIGRATIONS How to prepare for and confirm with confidence that your application is working as intended after a major migration. https://joind.in/talk/e386f
  • 2. SR. WEB APPLICATION ARCHITECT DANA H LUTHER @danaluther dluther@envisageinternational.com https://www.linkedin.com/in/danaluther/
  • 3. WHAT IS ENVISAGE? Envisage International Corporation is an international education marketing company serving students and schools around the world. Our student- focused sites offer relevant information, targeted tools, unique resources and valuable products for international students and educators. ESLdirectory
  • 4. THE AGE OLD QUESTION…. When do we upgrade?! OMG … PHP7 is OUT!! Did you see the new Bootstrap?! Ooh .. Look a MySQL update! Uh, guys, this site is behind by 2 full Bootstrap versions… Look at all the new features in Yii2! Ugh – have you seen this? It’s still in columnal… Wow, look at these includes…with more includes in them…
  • 5. THE TIPPING POINT As long as the risks outweigh the rewards, you’ll never upgrade. All things being equal … you probably won’t upgrade. You have to tip the scales. LETS DO IT! Don’t wait until the balance tips because you’ve added ‘threat of impending doom’ to the reward side of the equation! Eh, I don’t know… Risk Reward Increase your reward … or minimize your risk? Which is easier?? Cost
  • 6. HOW DO WE MAKE IT LESS RISKY? Testing suites with Code Coverage! Our test suites can answer the following questions: How will we make things better? • What was the performance improvement? • What do we tell ‘the boss’ when s/he asks what the potential risks are? Will we BREAK anything? • Infrequently used features? • Custom JavaScript or CSS? • All previous functionality should be present and working as intended!
  • 7. OK SO WE NEED TO TEST … HOW DO WE DO THAT? Codeception has supported modules for the following frameworks, to name a few, built in: • Symfony • Laravel • WordPress • Joomla • Yii • Zend Framework Codeception Tests with --coverage http://codeception.com/
  • 8. WHAT ARE WE GOING TO COVER? • No, not all the things … but close! • 80-100% coverage is the goal!
  • 9. START WITH A CLEAN SLATE The biggest job is actually going to come *before* you do your migration. Before we upgrade, we need 80-100% Coverage with (ideally) all tests in the Green! Have something you know isn’t working? Document it!
  • 10. DOWNLOAD CODECEPTION Add the composer requirement, and run composer update (if you do not have Codeception globally installed). http://codeception.com/quickstart ./vendor/bin/yiic webapp ./
  • 11. INSTALL CODECEPTION> ./vendor/bin/codecept bootstrap Default codeception.yml
  • 13. SAMPLE UNIT.YML FILE Using the modules, this unit test is updated to use the Yii2 module, and enable the orm, email and fixture elements of that model.
  • 14. SAMPLE FUNCTIONAL.YML FILE For the functional test suite, you will probably need some additional modules and helpers. Ensure that your configuration files are pointing to the proper test server locations.
  • 15. SAMPLE ACCEPTANCE.YML FILE Using the WebDriver module for the acceptance tests allows us to test the pages with JavaScript enabled. Need help getting your configuration right for your framework? Check the ‘Case Study’ section of the Codeception website for specifics on your framework. http://codeception.com/for/yii
  • 16. RUN THE SUITE! > ./vendor/bin/codecept run … Meh … but it works! Move the existing PHPUnit tests to the new tests/unit/ folder and try again… > php –S localhost:8080 Make sure your local webserver is running before you try to run the suite!
  • 17. FIXTURE DATA Your tests are only as good as the data that you’re using! False Sense of Security: • Using ”1” as the ID for everything (No!!) • Checking for a result without checking the details of the result (Also No!!) Use Fixtures specific to your Needs: • Alternate fixtures for detailed scenarios • Fixtures take time to load!! Large fixture data sets should only be included where necessary.
  • 18. FAKED FIXTURE DATA https://github.com/fzaninotto/Faker composer require fzaninotto/faker
  • 19. ORGANIZE • The @group tag: • Modules • Client/API Systems • Issue based • Filesystem Structure > codecept run --group=EGI-1125 > codecept run --group=newsletter > codecept run --skip-group=api > codecept run unit pax/ > codecept run unit pax/:FindAll
  • 20. RUN YOUR TEST SUITE WITH COVERAGE >codecept run unit --coverage --coverage-html
  • 21. DON’T OVERDO IT The @covers tag is a love/hate relationship. http://codeception.com/docs/11-Codecoverage 😀😡😭😍
  • 23. GOT IT ALL COVERED? SWEET, LET’S DO THIS!
  • 24. WHAT’S OUR DEV. BOX SETUP? Docker If you’re running in a Docker environment, and you want to test against various versions of PHP or MySQL, then your job is easy! Just swap out your Docker images for PHP or MySQL for the version you want to test. Relaunch your image and run your tests. Virtual Machine If you are using a VM for your testing environment, without Docker, then your upgrade process is going to be a little trickier, and it’s a good idea to get a solid snapshot of your VM state before you start apt-get upgrading your PHP, MySQL or whatever. Dev Machine If your dev machine is your localhost, you don’t really have much room for going backward if things don’t proceed well, unless you’re happy to play with restoring nightly backups. Aaand… go! Whether it’s an apt-get update, a composer update, or whatever the case may be, this is the point at which the actual system migration should occur – then we’re back to testing!
  • 25. THE UPGRADE / REVIEW LIFECYCLE Refactor/ Update Test Refactor/ Update Test Refactor/ Update Test Upgrade underlying system Test for green!
  • 26. TEST SUITE STATUS CHECK Errors and Failures? • Cycle back through unit by unit to focus on addressing the issues revealed by the tests. • Leverage the @group tags to narrow your focus down to specific test groups All Green? • Go for the –coverage-html check, and if you’re still all green with 80- 100% coverage, then you can give the green light to releasing the upgrade to production!
  • 27. 👍 GOOD TO GO! Once all your tests are showing green across the board and coverage is confirmed at 80-100%, you're ready to deploy your upgrade to production and can say with CERTAINTY that your new system is compatible and ready to go! • You’ve had a dry run of the upgrade process • All features are covered and passing: • No nasty surprises at launch. • Everyone goes home on time! • Clients are all happy! (or not, is there such a thing?)