Recently in Testing Category

ipc_2008.png

Aside from being a member of the advisory board of this years International PHP Conference, I will present one Full Day Workshop and one session at this year's edition of the International PHP Conference:

Quality Assurance in PHP Projects - In-Depth Best-Practises

Full Day Workshop

So you know PHPUnit, Selenium, phpUnderControl or CruiseControl and other tools to support testing efforts during your development process. But how does the puzzle of all those tools actually fit in your development process? During this Power Workshop Max Horváth and Wojciech Duda of studiVZ Ltd. will tell you about the everyday life at the Quality Assurance Business Unit. You will learn about best practices, which actually work and fit into an extremely fast moving iteration cycle at one of the biggest and fastest growing Social Networks in Europe. Talking about PHPUnit and Selenium, including tips on how to optimize using those tools, we will also show show you how you should integrate the testing process into your main development process, to be as lightweight and efficient as possible.

I will present this session together with my colleague Wojciech Duda.

Making Selenium Test Writing easier using a DSL

60 minutes Session

Implementing automated tests by using Seleniums API methods has several drawbacks. Selenium is great for what it does, providing a generic framework for testing a generic application. Using the Testing_SeleniumDSL framework, I will show you how to create your own Domain Specific Language (DSL), which would allow you to write tests in the language of your business rather than in Seleniums language.

I hope to see you in Mainz, Germany in late October!

While it's absolutly correct that direct access to private properties is strictly forbidden in PHP, it's quite disturbing that even reflection cannot do it when you're writing Unit Tests. Sometimes you just want to test whether a private property contains the correct data. With the normal visibility rules you cannot access those from your Unit Tests.

Luckily, as I just read at Tobias Schlitt's Blog, Derick Rethans committed a patch to the PHP 5.3 repository, which allows you to get things done quite easily. You still need to explicitly state that you want to access the value of a protected/private property through reflection by the new method setAccessible(). It's a good thing to avoid people doing stupid things accidentally, but you finally get the access to it.

PHP 5.3 you'll be able to access private properties like this:

But until we'll see a stable PHP 5.3, there we're many working "hacks", which worked for some versions of PHP 5.x - the most current one would be this:

This should get you up and running for PHP 5.2.5 ("older hacks" won't work).

So how could you use it?

I hope those lines of code will help you until PHP 5.3 arrives, as it helps our developers.

Update

As Sebastian points out in his comment to this post, PHPUnit has had support for testing private and protected attributes for quite a while. It can be used via:

I should be reading the documentation much more thoroughly next time (even though I must admit, that none of our developers has known this method, too).

Sometimes it seems writing tests with a good coverage is easier to be done than keeping your folks doing them, actually.

Truth be told, during the last four months our software developers had a rather easy life when it came to writing tests. We've been engineering our two platforms (with about 12 billion PI in January 2008) studiVZ and schuelerVZ from the ground up. We've also created our third platform, meinVZ.

With really tight timelines it's extremely hard to do extensive testing. Nonetheless we've been really succesful in (re)launching the platforms. But now it's time time to remind our engineers that we will extent our testing efforts again.

testing-motivation-01.jpgA few days ago Sebstian Bergmann contacted me via ICQ about a now very popular photo over at Mayflower GmbH.

After I saw this photo, I thought: "what a perfect match"! It's just a funny way to motivate our engineers even more. Just a few moments later the first copy was printed and attached to our QA walls.

Just a few days later Sebastian released another two motivating pictures that made their way onto our walls.

Sebastian: Thank you very much!

testing-motivation-02.jpgtesting-motivation-03.jpg

August 2008: Monthly Archives

Recent Activity

Sunday

  • I tweeted, "Let's continue working on the iPhone app ... but WTF does Apple keep the NDA?"
  • I tweeted, "Let's get some sleep - developing an iPhone application has been a lot of fun today ..."
Friday

  • I tweeted, "I'm off to the weekend - thanks god! And it's it's just another 11 days until the next holidays to southern spain ..."

More ...

Programming Blogs - BlogCatalog Blog Directory
Creative Commons License
This weblog is licensed under a Creative Commons License. blogoscoop

About this Archive

This page is a archive of recent entries in the Testing category.

PHPUnit is the previous category.

Find recent content on the main index or look in the archives to find all content.