PHP Quality Assurance Workshop PHPBenelux

7,732 views

Published on

Tools to Improve and maintain your Quality Assurance in PHP Projects. Workshop given at PHPBenelux

Published in: Technology
1 Comment
6 Likes
Statistics
Notes
  • IT Pathshala, Noida-Sec-63, offers Guaranteed JOB with PHP Training Programs.

    PAY US ONLY IF YOU GET A JOB!

    CALL US - +91-9871350999 or +91-8800394970

    Technology Centre Address: H-110, Sector-63, Noida (UP)

    Program Highlights:

    - 100% Guaranteed Job – Don’t pay us if you don’t get a JOB!
    - Industry Ready Courses
    - LIVE International Project Experience
    - Exposure to corporate culture at our IT services facility
    - Networking & Interaction with Industry Experts
    - Training provided by reputed IT Company
    - Live Project Source Code made available in CD
    - Technology certification and experience letter at program completion
    - Online Study Content
    Program Takeaways:

    - GUARANTEED JOB in your technology domain
    - Live Major Project development
    - Experience Letter on Training Completion
    - Certification on Training Completion
    - Project Source Code available in CD

    CALL US - +91-9871350999 or +91-8800394970

    Our website: www.itpathshala.com
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
7,732
On SlideShare
0
From Embeds
0
Number of Embeds
145
Actions
Shares
0
Downloads
33
Comments
1
Likes
6
Embeds 0
No embeds

No notes for slide

PHP Quality Assurance Workshop PHPBenelux

  1. 1. Quality Assurance for PHP projects Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  2. 2. About me: <ul><li>Independent Consultant
  3. 3. Int. Conference Speaker
  4. 4. Book Author of Zend Framework 2.0 Cookbook
  5. 5. ZF Contributor since 2008
  6. 6. PHP Community active member </li></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  7. 7. Benefits <ul><li>Provides trust into your application
  8. 8. Builds up your confidence </li><ul><ul><li>Bug fixes
  9. 9. Feature implementations
  10. 10. Refactoring
  11. 11. Software Updates (php update, PEAR library update, …) </li></ul></ul><li>Stability makes you proud
  12. 12. Strokes your ego (you use Continues Integration tools)
  13. 13. Career opportunities (You follow the current market standards)
  14. 14. Managers like graphs and figures </li></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  15. 15. Apply the power and be a master of the project © Fanboy30 © Rob Blatt
  16. 16. Management <ul><li>Should give 100% support </li><ul><ul><li>Quality Assurance lead – Team Lead
  17. 17. Technical requirements
  18. 18. Deployment strategies </li></ul></ul><li>Receives: </li><ul><ul><li>More stable applications
  19. 19. Graphs and figures to support it
  20. 20. More and better documentation for replacement / outsourcing
  21. 21. Progress tracking </li></ul></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  22. 22. The Demo Application Prerequisites: <ul><ul><li>Git or SVN with Pre-commit hooks
  23. 23. PHP Tools
  24. 24. Doxygen (potential replacement for PHPDocumentor)
  25. 25. Phing
  26. 26. Jenkins (for Continues Integration) </li></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  27. 27. Common Pre-Commit Hooks <ul><li>Commit Message Level: </li><ul><ul><li>Commit message has a specific format </li><ul><ul><li>number of characters (not empty, or at least 10)
  28. 28. regex: ^([BUGFIX]|[FEATURE]|[TASK])+ (.+n+)+nbuild: #d+$ </li></ul></ul></ul></ul><li>File Level: </li><ul><ul><li>ascii filenames
  29. 29. file extensions </li></ul></ul><li>Code Level: </li><ul><ul><li>no Tabs
  30. 30. parse errors (php -l <file>)
  31. 31. PHP Codesniffer with certain standard </li></ul></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  32. 32. SVN Pre-Commit Hook Easy to install if root access, or at least subversion user access: <ul><li>Create a common hooks directory (reuse) </li><ul><li>Implement a pre-commit hook in the language of choice (#!/usr/bin/php)
  33. 33. Make the hook executable (744) and set right ownership (apache:subversion) </li></ul><li>In your PROJECT_PATH_TO_REPOS/hooks folder create a pre-commit file </li><ul><li>Point towards previous implemented general pre-commit hook(s) </li></ul><li>Enjoy </li></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  34. 34. Svnlook author, cat, changed, info SVN Pre-Commit Hook Works on revision $REPOS or transaction $TXN PHP Access $repos = $argv[1]; $txn = $argv[2]; Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  35. 35. SVN Pre-Commit Hook Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  36. 36. SVN Pre-Commit Hook Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  37. 37. SVN Pre-Commit in effect Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  38. 38. SVN Pre-Commit in effect Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  39. 39. Git Pre-Commit Hook Easy to install: <ul><li>Create a common hooks directory (reuse) </li><ul><li>Implement a pre-commit hook in the language of choice (#!/usr/bin/php)
  40. 40. Make the hook executable (744) </li></ul><li>In your PROJECT_PATH/.git/hooks folder create a pre-commit file </li><ul><li>Point towards previous implemented general pre-commit hook(s) </li></ul><li>Enjoy </li></ul>In contrast with svn, Git Hooks are CLIENT side Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  41. 41. PHP Tools <ul><ul><li>PHP depend (pdepend)
  42. 42. PHP Mess Detector (phpmd)
  43. 43. PHP Copy Paste Detector (phpcpd)
  44. 44. PHP Lines Of Code (phploc)
  45. 45. PHP Codesniffer (phpcs)
  46. 46. PHP Unit (phpunit)
  47. 47. PHP Code Browser (phpcb)
  48. 48. PHP Lint (php -l) </li></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  49. 49. PHP Tools Install <ul><ul><ul><ul><li>pear channel-discover pear.pdepend.org
  50. 50. pear channel-discover pear.phpmd.org
  51. 51. pear channel-discover pear.phpunit.de
  52. 52. pear channel-discover components.ez.no
  53. 53. pear channel-discover pear.symfony-project.com </li></ul></ul></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  54. 54. PHP Tools Install <ul><ul><ul><ul><li>pear install pdepend/PHP_Depend
  55. 55. pear install phpmd/PHP_PMD
  56. 56. pear install phpunit/phpcpd
  57. 57. pear install phpunit/phploc
  58. 58. pear install PHPDocumentor
  59. 59. pear install PHP_CodeSniffer
  60. 60. pear install --alldeps phpunit/PHP_CodeBrowser
  61. 61. pear install --alldeps phpunit/PHPUnit </li></ul></ul></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  62. 62. Doxygen <ul><ul><li>What: Generate Documentation From Source Code
  63. 63. Benefits: </li><ul><ul><li>Actively maintained, in contrast with PHPDocumentor </li></ul><ul><li>Visualize relationships between your code (+ graphviz)
  64. 64. Various output formats </li></ul></ul><li>Install: </li><ul><ul><li>Binary distributions for all major operating systems
  65. 65. Packages for linux </li></ul></ul></ul></ul>http://doxygen.org/ Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  66. 66. Phing <ul><ul><li>What: PHP project build system, build tool based on Apache Ant
  67. 67. Benefits: </li><ul><ul><li>Written in PHP, so you can flavor it (maybe even contribute)
  68. 68. If your server can handle PHP it can handle Phing </li></ul></ul><li>Install: </li><ul><ul><li>$> pear config-set preferred_state alpha
  69. 69. $> pear install --alldeps phing/phing
  70. 70. $> pear config-set preferred_state stable </li></ul></ul><li>Potential Problems: </li><ul><ul><li>The correct commands => try first outside phing
  71. 71. Memory </li></ul></ul></ul></ul>http://www.phing.info Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  72. 72. Jenkins <ul><ul><li>What: the leading open-source continuous integration server
  73. 73. Benefits: </li><ul><ul><li>Large plugin base (+300)
  74. 74. Active Community </li></ul></ul><li>Install: </li><ul><ul><li>binaries and packages readily available </li></ul></ul><li>Potential Problems: </li><ul><ul><li>What plugins to install (Phing, Mantis, PHP Tools, ...)
  75. 75. Build Configuration learning curve </li></ul></ul></ul></ul>http://jenkins-ci.org Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  76. 76. Deployment <ul><ul><li>Strategies: </li><ul><li>Who </li><ul><ul><li>developers, release manager, team lead, Jenkins, ... </li></ul></ul><li>What </li><ul><ul><li>nightly builds, successful builds, ... </li></ul></ul><li>Where </li><ul><ul><li>deployment to what kind of server </li></ul></ul><li>When </li><ul><ul><li>off-peak traffic, critical, release cycle </li></ul></ul></ul></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  77. 77. Deployment <ul><ul><li>Strategies: </li><ul><li>How </li><ul><ul><li>Roll back mechanisms, switchable </li></ul></ul><li>Transfer </li><ul><ul><li>rsync, ftp, tar, phar </li></ul></ul><li>Permissions </li><ul><ul><li>folders, files </li></ul></ul><li>user rights </li><ul><ul><li>folder, files </li></ul></ul></ul></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  78. 78. Additional Resources <ul><ul><li>http://svnbook.red-bean.com/
  79. 79. http://git-scm.com/documentation
  80. 80. http://qualityassuranceinphpprojects.com/
  81. 81. http://www.phing.info/docs/guide/stable/
  82. 82. https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins
  83. 83. http://jenkins-php.org/
  84. 84. irc.freenode.net #jenkins, #phing </li></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  85. 85. Sources and Codes <ul><ul><li>Slides: http://slideshare.net/NickBelhomme
  86. 86. Source: https://github.com/NickBelhomme/SVN-Commit-Hooks </li></ul></ul><ul><ul><li>Contact: </li><ul><li>mail: [email_address]
  87. 87. twitter: @NickBelhomme
  88. 88. facebook: NickBelhomme
  89. 89. irc (freenode ##php, #php_bnl, #zftalk): NickBelhomme </li></ul></ul></ul>Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011
  90. 90. Lets enjoy the Demo © Chris Devers Nick Belhomme PHP Software Architect + conference speaker + book author 29 June 2011

×