Tuesday, 27 October 2009

The other side of IBM

Last week was full of 'firsts' for me. It started with my first ever commit to an Apache project . This was a career milestone for me, I will be writing a lot more about that project in the future, but not in this post.

The other 'firsts' were all associated with BarCamp London which ran from Saturday morning through to Sunday evening at IBM's Southbank location. It was the the first time I had ever been to BarCamp and I was enormously impressed by the level of organisation. I've been to a few big conferences and they could learn a lot from the BarCamp organisers who pulled the whole event together in their spare time.

The other side of IBM
Image courtesy of Adewale Oshineye - check out his other photos of the event
here

It was also the first time that IBM UK has ever hosted a BarCamp and it's hard to describe the level of nervousness that was permeating the corporate psyche prior to the event. As it happens, apart from one small(s) problem, the weekend went entirely smoothly. So many people helped to pull this together that I can't list them all. I will however mention three companies that I bet no-one else will talk about, G4S, Johnson Controls and Compass . Their employees were on site for much of the weekend ensuring that the building was safe to sleep in, kept clean and comfortable and that people were fed. Well done!

I think IBM gained a great deal of respect for trusting BarCamp to use their premiere London location knowing that they would be entertaining clients there on Monday. The developers from IBM who attended also gained from meeting a different and diverse set of people. When you work for a big company it's too easy to develop a language and way of communication that only makes sense inside the company - getting out once in a while at least makes you realise you are becoming institutionalised.

Someone asked me why I got involved with organising BarCamp - it's a simple answer. I've seen so many complex problems solved by bringing highly technical and creative people together and allowing them time to communicate. Sadly there aren't that many places where 200+ people can meet and share ideas. IBM has a great location which is not often used at weekends, how could I not have got involved?

Friday, 31 July 2009

Does my PHP app run on Project Zero?

As the PHP implementation in Project Zero gets more complete it's possible to run quite a few significant applications. It would be nice to know in advance how likely it is that a PHP application would run on Project Zero - without investing a whole lot of time in trying to run it. Well, now you can.

There is a new Project Zero application which will scan your application and tell you whether it thinks it will run on Project Zero. The way it does this is to extract information from the Project Zero PHP parser - for instance it finds out the names of functions that are declared in the application and compares them with the names of functions that are invoked. If the application scanner finds that a function is invoked by the application but is not declared by it, it uses function_exists() to figure out if it is implemented in Project Zero's PHP. Similar analysis is carried out for classes and methods in the application.

The instructions for extracting and running the scanner are here. They assume that you already have a working version of Project Zero.

One of the reasons that I wrote this was that I wanted to figure out if PHPUnit would run on Project Zero. This led to a horrible chicken and egg situation in that I can't write PHP without PHPUnit and most of the scanner is written in PHP. In the end I had to inch forward on both tasks simultaneously, with the final benefit that I worked out how to use PHPUnit at the same time as writing the scanner. The instructions for running PHPUnit are here. I'm not claiming full support for PHPUnit in Project Zero - but there is enough to be able to test PHP classes as you write them.

The application scanner can't say definitely whether an application will run or not, this is because it is using static analysis. However it gives enough information to be able to tell whether it's worth trying or whether you should mail the Project Zero team with your scan results and ask them when they think they will have support for your app :-)

Wednesday, 8 July 2009

On no! Not more tests!

One of the problems with the incredible level of success of the PHP TestFest is that PHP gets more tests, 887 more to be precise.

Well, isn't that the point? Yes, but it's beginning to take *forever* to run them which is a bad thing and as TestFests get bigger and better this will only get worse.

A year or so ago I started worrying about this, then I met Stefan Priebsch at IPC and made him worry about it too. Together we started a project to re-factor the code that runs tests (run-tests.php) so that it could run tests in parallel.

In May we had a prototype going, it ran most of the tests in sequence. It still doesn't have all of the capability of run-tests.php but it was enough for our PHP GSOC student (Georg Gradwohl) to start writing and integrating code that would run groups of tests in parallel.

Yesterday I ran some tests on my dual core lap top - this isn't a proper benchmark and I had all sorts of other stuff going on too...but here they are:



The chart shows the time taken to run 7700 tests with the current code (old), new code sequentially (seq) and the new code with increasing numbers of parallel tasks (para). As you can see we are able to run this sample in about half the time taken by the code that is used at the moment. There is still a long way to go with this but I'm happy to say that a couple of people have started to check out the code and try and run it. At the moment this only works on *ix, supporting Windows is on the TODO list.

With the help of the 'many hands' of the PHP community I'm quietly confident that by the time PHP gets all the tests it needs we will have something that will run them efficiently :-)

Friday, 29 May 2009

PHP TestFest - one more month to go!

Groups from all over the world have contributed 554 new tests for PHP since April 1st 2009. Of these, 327 have already been moved into PHP's CVS (thanks Felipe!). The results of running tests on a Linux 32 bit platform can be seen here (sorry about the colour scheme), the user groups who have contributed are also listed. We also run the tests on a 64 bit Linux platform here, but this only runs PHP5.3 and PHP5.2.

I also ran some coverage tests recently to try and work out how much of a difference we were making overall. This turned out to be far more problematic than I had thought it would be. The main issue was one that Felix had already found, ccache and lcov do not coexist happily. It turns out that there is a check for this in the php configure script - but unfortunately the debian way of installing ccache is simply to link it to gcc, which by-passes the check in configure. Oh well.

The before TestFest coverage data shows an overall line coverage of 70.4%, a run from the 28th May shows a line coverage of 72.3% in total. There are minor differences in the number of lines but I think this is to be expected. It's interesting to look at the areas where I know groups have been concentrating their efforts - for example the line coverage of ext/ldap has increased 8.5% to 89.1%! Check curl, date, dom, ftp, gettext, intl, posix, reflection, sockets, spl, sqlite3, xmlwriter and xsl for other TestFest related increases in coverage.

I'll rerun the coverage tests regularly in future. I should perhaps mention that I know that ext/imap statistics are missing and that's because we don't yet have the ability to run the ext/imap tests on the system that is being used for TestFest. I will fix this in the next week or so - if you see anything else that doesn't look right please email me and I'll fix it, or better still, email php-qa@lists.php.net :-)

Thursday, 7 May 2009

PHP TestFest ramps up!

It feels like a long time since we started on this road in February 2009. So much has happened since then ... and now we are two days away from the 9th May when several European groups will run events.

We have 22 groups registered in all, Munich and Quebec have already run successful events.

As tests are written they are being checked into a subversion repository - local organisers have admin rights and can add users from their groups. Once every hour we check tests out SVN and run them using PHP52, 53 and 6. The results are displayed here

It's great to see user groups helping out with PHP development in this way - I'm just amazed and humbled by the enthusiasm and talent of PHP users.

I also want to thank our sponsors, although I'm not even sure that I know who all of them are :-). The ones I do know are Microsoft (who are making office space available and providing access to Windows machines), IBM (also making office space available and of course allowing me some time to work on this), and Ibuildings. Ibuildings are a major sponsor in Europe, they are buying lunch for the PHP NorthWest group, they have funded some cute PHP TestFest mugs for the London group...and much more. At the end of TestFest I'd like to do a round up of every company who helped us - so if you are sponsoring something, don't be shy, let me know!


From now until the end of June the user groups will be writing tests, after that we'll count up and commit tests in PHPs CVS - I have strong feeling that this year's test fest is going to be a massive success!

Monday, 6 April 2009

PHP and SAP

Last Saturday Robin, Ant and I went to London to the SAP Inside Track. We had an amazing day on so many levels! Ant had prepared a demo showing how to use the PHP implementation in WebSphere sMash to access data from SAP, but as we went up to London on 06:18 (!) train we really had very little idea what to expect.

The meeting got under way in the usual unconference style with attendees choosing the talks. Two things became clear pretty quickly, this was an incredibly interesting group of people and they had some very cool stuff to talk about. Dennis Howlett made a short video of the attendees which nicely captures spirit of the event.

Ant and Robin did a great demo of sMash, Dennis Howlett made another short video interview with Robin. Ant spent the whole of the lunch time having an intensive SAP lesson from Gregor Wolf - Ant is now officially our SAP expert!

I learnt a huge amount (I know a lot more about SAP than I did) I particularly enjoyed the talk about ESME by Darren Hague. ESME is a twitter-like project but designed with business applications in mind - I can see a lot of potential here.

All in all - it was a great day and I'm looking forward to the next SAP event.

Thursday, 2 April 2009

PHP TestFest 2009 Kicks Off

So here we are at the beginning of the 2009 TestFest. There are currently 16 PHP user groups intending to participate, these are pretty widely distributed from Brazil, the USA and Europe.

The test repository is open for submissions to registered groups from today (see here and here for information and instructions. Join the freenode #phptestfest IRC channel and follow phptestfest on twitter.

Let's go!