PHP T-Day 2014 Review

After visiting conferences in Zurich and Manchester I was very glad to find out that one great event called PHP T-Day will take place in my hometown Belgrade in Serbia.

The event was organized by local PHP community called PHP Serbia. Although I am one of the founders of that organization I must admit I did not take part in organizing the event itself. Especially because I know how much time and energy consuming it is, I would like to use this occasion to congratulate everyone involved for organizing this great event.

Before the first PHP Serbia conference, that was last year, there was a survey which indicated that not too many developers are working on automated tests for their applications. Therefore the main topic for this event was testing PHP code. I especially liked the choice of speakers for this conference, amongst them were Sebastian Bergmann the creator of PHPUnit and Michelangelo Van Dam, a well known PHP community leader.

The first talk was given by Sebastian Bergmann himself and the talk was labeled Moving Fast Without Deploying Broken Things. First thing Sebastian told us is that he was amazed by the number of people that showed up which indicated that people are actually very interested in this topic. The talk started with a joke, apparently Erik Meijer who is a well known software architect said in another conference that “TDD is for pussies” and that writing test is waste. That turned out to be a joke and Erik wanted to use it to point out the importance of testing software. Sebastian progressed with an advice that everyone should find the smallest scope that can be tested and start from that. He then talked about various levels of testing, end to end testing with Mink and Behat, integration testing and unit testing. The talk was finished with three important characteristics of every test. These are be high fidelity, resilience and high precision. It was a nice talk covering all important aspects of testing in PHP.

20141122_103430

The next talk was I walk in the shadow of valley of tests by Srdjan Vranac. The talk was opened by Srdjan presenting slides where he searched for certain terms on Google and presented the results to us. One point from this talk was that there is a long way from someone wanting to test something to actually having meaningful and useful tests. Programmers should always look for a way to improve and one interesting place for that is www.cyber-dojo.org where there are many common programming challenges which can be solved in many programming languages. There were some more metaphors which emphasized the importance of acceptance testing and continuous integration. Generally a great motivational talk.

Vranac

Luka Muzinic was next with his talk Codeception, because tests can have frameworks too. As the talk label suggested it was a talk with a goal to familiarize the audience with Codeception testing framework. After a short intro, it was clear that one of Codeception’s goals is to provide means for non tech people to write tests in an easy way. Luka showed us how easy it is to install Codeception and to get started. Then there were some typical use cases, as well as some real examples. Codeception provides an easy way to check everything quickly on one web application and that was clear after this presentation.

Ivan Habunek had a talk about Travis CI labeled Testing open source projects with Travis CI. It was a presentation of a very popular hosted continuous integration tool called Travis. Some configuration options were explained and a few of them very interesting. Some of these were running tests of multiple versions of PHP or allowing failures when needed. Apart from notifying on email upon error, Travis can even notify on IRC. A script for deploying applications after successful tests can also be set. I am definitely looking forward to trying Travis.

Active Collab is a well known tool and the leader of company Area 51 that maintains it Ilija Studen was next. The talk was named Narrative, API testing for a pragmatist. It’s evident that everyone hates writing API docs and Ilija made it clear in a funny way. It is possible to use tests to generate the docs and to skip the boring part of writing docs. The tool that he and his colleagues created does exactly that. The idea is to write requests in JSON format which are then run against an API. This provides tests for an API as well as docs which are in the same file. Ilija was also interested in finding out if there is interest for this tool in public, therefore he invited everyone to take part in this project.

Sasa Stamenkovic from KnpLabs who is taking part in various Symfony related projects is the only one who had two talks at this conference. The first one was Story BDD with Behat where Sasa explained some BDD basics and the term refactoring which is changing existing code without modifying external behavior. Gherkin the Domain Specific Language for describing software behaviour was also mentioned in this presentation. After a few examples there was a live coding session where the goal was to write the Linux ls command using BDD methodology which proved to be a great example. That was very interesting because everyone was able to see how it actually works. His second talk was Spec BDD with PHPSpec which was mostly about PHPSpec tool which can be used for specifying application functionalities. Sasa then compared TDD and BDD which are basically very similar terms with one difference being that TDD is about testing existing behavior where BDD is about expectations. There was another live coding session that went great and was very informative. One important point from this session is that if code is already written there is no need for PHPSpec, it’s meant to be used before any code is created.

Sasa

The best and most useful talk of the conference in my opinion was Your code are my tests by Michelangelo van Dam. It was a story about Michelangelo’s journey to cover some existing random legacy app from Github app with tests. He gave some practical advice when he started, the most memorable one to me was “Whenever you need to var_dump, write a test” and it was actually said by a legendary programming guru Martin Fowler. There are many benefits of testing, some of them are direct feedback and making code more easy to refactor. Michelangelo kept audience’s attention by asking people from the audience about their opinion on current topic which I think is a good strategy for keeping everyone’s attention. What was particularly interesting in this talk was a step by step approach in testing the legacy app. This talk could have lasted for hours so Michelangelo only picked some interesting parts from that project. One of them was testing private constructor for which he had to use reflection and Sebastian Bergman said that there already is a way to do that in PHPUnit although he is not very proud of it because there actually is no need to directly test private properties or methods.

The last speaker was Darko Fabijan and his talk was Continuous Delivery 101. It was a mixture of talking about general continuous integration concepts and presenting a tool Darko and his colleagues created called Semaphore which is a hosted continuous integration tool. Fast deployment actually motivates developers and plays a role in developer happiness. One important aspect is that deployment on all stages should be done with one click. At the end Darko gave away a few Semaphore app licences to the audience.

I am sure this conference played an important role in raising awareness of the importance of software testing. I don’t think there are much conferences that are dedicated solely to testing therefore I think it is a big step in improving overall software quality in PHP world. PHP Serbia team made a great effort to ensure that everything is running smoothly. I am really looking forward to PHP T-Day 2015.

Would you like to recommend this article to your friends or colleagues?
Feel free to share.

facebooktwittergoogle_plusredditlinkedin

Article "PHP T-Day 2014 Review" has 1 response

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

*