Segomo Institute's Recommendations for Enterprise Programming in PHP
Founding Members:Michael Nelson,Ryan Byrd,Beau Scott,Roberto Mello
Table of contents
- Who we are
- When to (and not to) use PHP
- Development Tools (Setup)
- Overview (use good editor, agree on coding guidelines and naming conventions, etc.)
- Separate out Presentation Layer with a Templating System (Smarty,...)
- Version control (CVS)
- Debugger
- Project Principles
- Clean design -- start with a site map, define interactions, write tests, code, run tests
- Object orientation
- Abstract Database
- Security (register globals turned off), XSS proof & tested
- Standards Based (XML, SOAP, XHTML, etc.)
- Regular Code Reviews
- Project Planning
- Project requirements/specification
- Functional specification, Logicial spec, Entity-Relationship
- Time card/collaboration(forums/email/etc), project time trackers (phpproject)
- Project Elements
- Document code with phpDoc
- Event/Debug Logging
- Error reporting/logging
- Access control/logging
- Admin interface
- Scheduled backup for code/data
- Language modules (language independence)
- Up/response time monitoring
- Failover backup systems
- Standard look and feel w/ CSS
- Visitor statistics -- referrals, bad links
- Testing
- Manual testing in IE, Firefox
- Auto testing scripts (Function Tests, Web Tests, Stress Tests) (simpletest)
- Bug reporting/tracking (Double Choco Latte), web feedback forms
- Useability testing
Typical Enterprise Scenerio:
[DEVELOPMENT/TESTING]
- programmers use subversion to checkout code, make updates, test and check in code
- programmers create unit tests to check/verify each of their functions/methods Check every aspect of the function/method that could possibly fail. Before checking in code, the Unit Tests must run at 100 percent.
- on a development server there is a "development staging area" where everyone can go to see the lastest checked in development code
- all unit tests are run / code reviews completed
- automated functional tests are run (log into the system, perform a series of typical use cases, etc.) tests for the entire system must run at 100 percent
- performance tests (speed/load simulation) jmeter/siege/badboy on development
[STAGE CODE IS OFFICIALLY APPROVED AND TAGGED]
[PRODUCTION ROLLOUT(code complete)]
- production offline (maintenance mode)
- create release notes detailing new features and major bug fixes.
- the production database and production code is archived
- the production database structure is sync'd with the staging area's
- the production code is svn up'd
- all unit tests are run
- automated functional tests are run (log into the system, perform a series of typical use cases, etc.)
- performance tests (speed/load simulation) jmeter/siege/badboy
- go live
References: J. Scott Johnson's Software Engineering Practices for Large-Scale PHP Projects
(c) 2006. The Segomo Institute is a science and technology think tank founded in 2006 in Salt Lake City, Utah