A few words on bugs and software quality

From time to time I see bugs in the code and I start thinking "really? is it possible that no one noticed that bug before? am i the first person to see this code?". I thought it might be worth writing a little post on what helps me to deal with bugs and software quality in general and what are the common pitfalls in developer's thought process. Although it is not a very extensive post i hope it may inspire some developers to try new approaches :-)

In general it is extremely rare for me to commit bugs that would make it into production (maybe less than one a year? hard to say as it is really rare). To be honest I can't remember a serious issue with my code for last 5 years.

How to automate testing of a mobile domain redirections with jmeter

There are many ways to implement mobile version of your website but easiest and probably cleanest one is to use mobile subdomain.

Once you have your mobile website you want to implement an automated test suite to be able to regression test the functionality after every release. You also want the test suite to be easy to configure and run it against test environment. In perfect world you want the test suite to run as part of the continous integration setup. Jmeter allows for all of that and is free. As a huge fan of jmeter i recommend you download it and play around with it as soon as possible.

In this article I describe how to create a test suite for mobile website redirects, you can also download my jmeter test plan and customise it to test your own websites.

How to build jmeter from sources in eclipse

Jakarta jmeter is an awesome tool. I deeply encourage to experiment with it. If you want to see more details on how it is implemented or write your extension it may be worth compiling it from sources on your machine.

Here is a quick guide how to setup a eclipse project and what to do to build jmeter from sources and run it locally.

A great way to mock chained calls in PHPUnit

Few days ago i had to write a groovy test for a java class and i had a long chain of calls to mock. I was not sure how to test it nicely and i started wondering is there a nicer way to do it in PHP. Usually in PHP there is a nice way to do almost anything :D

Review - The art of application performance testing

Personally i think it is a good book but it lacks details, tools and practical solutions. Reading the book is quite enjoyable and it definitely contains a lot of useful tips and tricks.

What i liked the most is the fact that the book is meaty and condensed down to less than 150 pages. I really like books that are focused so i was not disappointed here.

The thing that author covers really well is the analysis and preparations of the testing plan and processes around it. You will read a lot about what to consider, how to prepare your self, what to check etc. There are also some useful checklists.

Java MouseClicker - Automated mouse movement and clicking tool

I needed a simple tool to automate mouse movements and delays on my PC. I like playing with Java so i wrote a simple one in a few hours.

Its a really simplistic app and it might have some bugs so please be understanding :-) But i could not find any free tool that would do exactly what i wanted to i thought i could share it to the public. Maybe someone will find it useful.

If you like it and want to modify it for your needs i think i might send you source code.

Setting up mouse control sequence

So to see mouse position click on track button, you can stop tracking if you are done. Then you move mouse where you want on the screen and write down location. Then write up a script like this:

Jmeter used to playback Apache access logs to generate live-like server load

Jmeter is a very useful tool for not only performance tests but also for automation of all sorts of web tests. Its not as powerful as selenium when it comes to ajax etc but it still allows to login, keep session and execute any sequence of http calls.

In addition to ab (apache benchmark) and curl it comes in handy when you want to stress test your applications to see the capacity and possible bottlenecks.

Excluding parts of PHP code from code coverage report

A funny thing happened to me the other day when i noticed a new operator (adnotation) supported by php unit.

So there apparently is a way to ignore parts of the PHP code from code coverage report.

If you put comments like below around some code it wont be counted at all during code coverage.

Static methods and variables in PHP are bad - they are a real pain in the test!

First of all, i was never a fan of static calls and variables as i always thought they cause problems. Using a lot of statics you might experience values leaking through different parts of application and you cant isolate functions (cron/testing/overrided environments). In general the encapsulation is gone and coupling explodes.

What i did not realize until this year, was the fact how difficult it is to create new unit tests for code filled with static calls and references. Its just impossible to deal with code that calls stuff like this:

How to enable apc extension under command line php interface (Debian and Ubuntu)

PHP has a very useful extension for caching op codes as well as custom values from php code. The problem is that it does need additional parameter to be enabled in the command line interface (unit tests or cron scripts).

Syndicate content

About the author

Artur Ejsmont

Hi, my name is Artur Ejsmont,
welcome to my blog. I am a passionate software engineer living in Sydney and working for Yahoo!

Web Scalability for Startup Engineers

If you are into technology, you can order my book Web Scalability for Startup Engineers on Amazon. I would love to hear what are your thoughts so please feel free to drop me a line or leave a comment.

Follow my RSS