SlideShare a Scribd company logo
1 of 12
Download to read offline
The Modern Development Workflow
         Automate, Automate, Automate!




    Net Perspective, LLC.
    http://www.net-perspective.com/
Before We Get Started…
• I Am…
  o Daniel Cousineau
      • Lead Developer at Net Perspective, LLC
      • dcousineau@net-perspective.com
• We Are…
  o Full service web agency (development) firm based out of
    College Station, TX
• About This Topic…
  o The utilities presented are biased towards PHP and OSS
      • All are interchangeable with other languages and utilities
  o We are always improving and getting better
  o Constructive feedback always welcome


     Net Perspective, LLC.
     http://www.net-perspective.com/
Source Control
• More than 0 people on a project?
  o Extremely beneficial when with 2+ member teams
• SVN most popular
  o Integration with EVERYTHING
  o Showing its age
      • No native branching/tagging

• GIT: the up-and-coming superstar
  o Not as well integrated
  o Still new

     Net Perspective, LLC.
     http://www.net-perspective.com/
Unit Testing
• Old and Busted: GDB, New Hotness: TDD
  o Test Driven Development
  o Write tests first, code until all tests pass
• PHPUnit very popular
  o Based on the NUnit standard (JUnit sound familiar?)
• Our Goal? 100% Code Coverage
  o Means every line of source code should have been
    executed at least once when all tests completed
• Alternatives
  o SimpleTest, PHPT
     Net Perspective, LLC.
     http://www.net-perspective.com/
PHPUnit Example
class StringFunctionTest extends PHPUnit_Framework_TestCase
{
            protected $_fixture;

            //Run before each test
            public function setup()
            {
                        $this->_fixture = fopen(quot;./sample.txtquot;,quot;wquot;);
            }

            //Example test
            public function testStrToLower()
            {
                        //Object is constructed/destructed after each test
                        //Data saved to a fixture here is not preserved for the next test

                                $actual = strtolower(quot;SaMpLequot;);
                                $expected = quot;samplequot;;

                                $this->assertEquals($expected, $actual, 'comment here'); //
            }

            //Run after each test
            public function tearDown()
            {
                        fclose($this->_fixture);
            }
}




                Net Perspective, LLC.
                http://www.net-perspective.com/
Build Management
• Generating AutoDoc, running UnitTests, and
 packaging is BORING
  o “Laziness is the mark of a great developer” – Me
• Automate with Phing
  o Native PHP build system based on the popular Ant build
    system for Java
  o $ phing TARGET_NAME
      • Looks for build.xml which contains commands for the target
  o Tasks for running PHPDoc, PHPUnit, and…

     Net Perspective, LLC.
     http://www.net-perspective.com/
Phing Example
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<project name=quot;Latitudequot; default=quot;distquot; basedir=quot;.quot;>
      <target name=quot;testquot;>
                  <phpunit2 haltonfailure=“truequot; haltonerror=“truequot; printsummary=quot;truequot;>
                              <batchtest classpath=quot;${project.basedir}/libquot;>
                                           <fileset dir=quot;${project.basedir}/testsquot;>
                                                       <include name=quot;RouteTest.phpquot; />
                                                       <include name=quot;DispatcherTest.phpquot; />
                                           </fileset>
                              </batchtest>
                  </phpunit2>
      </target>

      <target name=quot;docquot; depends=quot;testquot;>
                  <phpdoc title=quot;Latitude API Documentation“ destdir=quot;${project.basedir}/docs/“ >
                               <fileset dir=quot;${project.basedir}/libquot; >
                                           <include name=quot;**/*.phpquot; />
                               </fileset>
                  </phpdoc>
      </target>

      <target name=quot;distquot; depends=quot;testquot;>
                  <tar destfile=quot;${project.basedir}/builds/latitude.tar.gzquot; compression=quot;gzipquot;>
                              <fileset dir=quot;${project.basedir}quot;>
                                          <exclude name=quot;**/.svnquot; />
                              </fileset>
                  </tar>
      </target>
</project>



           Net Perspective, LLC.
           http://www.net-perspective.com/
Database Versioning
• DBDeploy
  o Every change to the database structure is in its own .sql file
      • Each file contains the SQL to perform changes and SQL to roll back
        those changes
  o Revision information is stored in a table
  o Written in Java, Phing has a native port built in
  o Only version structure changes and default values
      • Don’t version test and sample data!




     Net Perspective, LLC.
     http://www.net-perspective.com/
DBDeploy Example
db/deltas/1-REVISION_COMMENT.sql
--//
CREATE TABLE `sample` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
  PRIMARY KEY (`id`) )
ENGINE = InnoDB;
--//@UNDO
DROP TABLE `sample`;
--//




              Net Perspective, LLC.
              http://www.net-perspective.com/
Continuous Integration
• Wraps everything up…
  o Ties in Versioning, Build Management, Unit Testing, [Auto
    generated Documentation, ] and Database Versioning
  o Xinc (http://xinc.eu) (a pure PHP solution)
      • CruiseControl would be the “original”
• What happens?
  o CI monitors SVN working copy
  o On update, run specified build script (Phing)
      • Phing generates UnitTest reports, API documentation, and archive files
      • Deployment code (upload to live server?)
      • UnitTest fails? Build fails
  o Store “artifacts” (generated reports, etc.) for each build

     Net Perspective, LLC.
     http://www.net-perspective.com/
Xinc Interface
Notice the Deliverable and Documentation artifacts




                 Net Perspective, LLC.
                 http://www.net-perspective.com/
In Conclusion
                                    Charts Are Useless




                                                         Pac Man
                                                         Blinky




Net Perspective, LLC.
http://www.net-perspective.com/

More Related Content

Recently uploaded

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Recently uploaded (20)

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Featured

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Modern Development Workflow

  • 1. The Modern Development Workflow Automate, Automate, Automate! Net Perspective, LLC. http://www.net-perspective.com/
  • 2. Before We Get Started… • I Am… o Daniel Cousineau • Lead Developer at Net Perspective, LLC • dcousineau@net-perspective.com • We Are… o Full service web agency (development) firm based out of College Station, TX • About This Topic… o The utilities presented are biased towards PHP and OSS • All are interchangeable with other languages and utilities o We are always improving and getting better o Constructive feedback always welcome Net Perspective, LLC. http://www.net-perspective.com/
  • 3. Source Control • More than 0 people on a project? o Extremely beneficial when with 2+ member teams • SVN most popular o Integration with EVERYTHING o Showing its age • No native branching/tagging • GIT: the up-and-coming superstar o Not as well integrated o Still new Net Perspective, LLC. http://www.net-perspective.com/
  • 4. Unit Testing • Old and Busted: GDB, New Hotness: TDD o Test Driven Development o Write tests first, code until all tests pass • PHPUnit very popular o Based on the NUnit standard (JUnit sound familiar?) • Our Goal? 100% Code Coverage o Means every line of source code should have been executed at least once when all tests completed • Alternatives o SimpleTest, PHPT Net Perspective, LLC. http://www.net-perspective.com/
  • 5. PHPUnit Example class StringFunctionTest extends PHPUnit_Framework_TestCase { protected $_fixture; //Run before each test public function setup() { $this->_fixture = fopen(quot;./sample.txtquot;,quot;wquot;); } //Example test public function testStrToLower() { //Object is constructed/destructed after each test //Data saved to a fixture here is not preserved for the next test $actual = strtolower(quot;SaMpLequot;); $expected = quot;samplequot;; $this->assertEquals($expected, $actual, 'comment here'); // } //Run after each test public function tearDown() { fclose($this->_fixture); } } Net Perspective, LLC. http://www.net-perspective.com/
  • 6. Build Management • Generating AutoDoc, running UnitTests, and packaging is BORING o “Laziness is the mark of a great developer” – Me • Automate with Phing o Native PHP build system based on the popular Ant build system for Java o $ phing TARGET_NAME • Looks for build.xml which contains commands for the target o Tasks for running PHPDoc, PHPUnit, and… Net Perspective, LLC. http://www.net-perspective.com/
  • 7. Phing Example <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?> <project name=quot;Latitudequot; default=quot;distquot; basedir=quot;.quot;> <target name=quot;testquot;> <phpunit2 haltonfailure=“truequot; haltonerror=“truequot; printsummary=quot;truequot;> <batchtest classpath=quot;${project.basedir}/libquot;> <fileset dir=quot;${project.basedir}/testsquot;> <include name=quot;RouteTest.phpquot; /> <include name=quot;DispatcherTest.phpquot; /> </fileset> </batchtest> </phpunit2> </target> <target name=quot;docquot; depends=quot;testquot;> <phpdoc title=quot;Latitude API Documentation“ destdir=quot;${project.basedir}/docs/“ > <fileset dir=quot;${project.basedir}/libquot; > <include name=quot;**/*.phpquot; /> </fileset> </phpdoc> </target> <target name=quot;distquot; depends=quot;testquot;> <tar destfile=quot;${project.basedir}/builds/latitude.tar.gzquot; compression=quot;gzipquot;> <fileset dir=quot;${project.basedir}quot;> <exclude name=quot;**/.svnquot; /> </fileset> </tar> </target> </project> Net Perspective, LLC. http://www.net-perspective.com/
  • 8. Database Versioning • DBDeploy o Every change to the database structure is in its own .sql file • Each file contains the SQL to perform changes and SQL to roll back those changes o Revision information is stored in a table o Written in Java, Phing has a native port built in o Only version structure changes and default values • Don’t version test and sample data! Net Perspective, LLC. http://www.net-perspective.com/
  • 9. DBDeploy Example db/deltas/1-REVISION_COMMENT.sql --// CREATE TABLE `sample` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT , PRIMARY KEY (`id`) ) ENGINE = InnoDB; --//@UNDO DROP TABLE `sample`; --// Net Perspective, LLC. http://www.net-perspective.com/
  • 10. Continuous Integration • Wraps everything up… o Ties in Versioning, Build Management, Unit Testing, [Auto generated Documentation, ] and Database Versioning o Xinc (http://xinc.eu) (a pure PHP solution) • CruiseControl would be the “original” • What happens? o CI monitors SVN working copy o On update, run specified build script (Phing) • Phing generates UnitTest reports, API documentation, and archive files • Deployment code (upload to live server?) • UnitTest fails? Build fails o Store “artifacts” (generated reports, etc.) for each build Net Perspective, LLC. http://www.net-perspective.com/
  • 11. Xinc Interface Notice the Deliverable and Documentation artifacts Net Perspective, LLC. http://www.net-perspective.com/
  • 12. In Conclusion Charts Are Useless Pac Man Blinky Net Perspective, LLC. http://www.net-perspective.com/