PHP QA and Code analysis tools FYI

tmccormi wrote on Wednesday, July 28, 2010:

At OSCON I took a 4 hour tutorial on PHP QA topics and found the following tools that I think we should make use of …

1) PhpUnit (we are starting that but I’m not sure what our ‘standards’ should be)
2) Selenium - This tool records actions on a web browsers and produces PHPUnit tests that can be remotely rerun against multiple browsers and produce error reports
3) PHP Codesniffer - (phpcs) allows you to define rules for standard adherence and report on it (understands PHP version issues and code formats by default)
4) PHP Code duplication analysis - phpcd - compares code for identical lines to help promote moving duplicated code to classes/functions
5) PHP code analyzers - pdepend, phpmd - produces complexity reports, codesize, etc …
6) phpcb from phpqatools.org - consumes the output of above tools to produce pretty reports
7) hudson-ci.org - has a tool for graphically managing builds, kind of a super cron with built in stuff for how to send notices depending on the results, etc.
And …
for documentation
8) phpdoc or doxygen - both pull the docs from the source code and can produce browsable HTML sites.

I think we should look at configuring ‘phpcs’ for first pass code reviews to start with.

-Tony

acmoore wrote on Tuesday, August 03, 2010:

Hi Tony -

Thanks for putting in the time to pull these resources together. They look pretty exciting.

I’m about to commit some code to make the test suite that uses phpunit a little more useful. I’ll put together some documentation on it, too. I welcome suggestions and help on this.

I’m excited to read about these static analysis tools like phpcs and the others. I’ve found similar tools really useful in the past on other projects in other languages, and I think we could benefit from using some of them. I’ll look into ways of automating their use.

I have used Selenium in the past, and found it useful, but difficult to write good, maintainable tests for. I’m by no means an expert in it, though, so if you could show some ways to use it, I’d love it.

Sorry for the long delay in the reply here. I’m only working on openemr one day a week these days.

-Andy

rdhingra wrote on Wednesday, September 08, 2010:

For troubleshooting and performance analysis, consider looking at these as well:

1. fiddler2
2. Google chrome’s web developer add-on.

I have used both and fiddler2 worked very well.

rema@axim