From the mind of an IT professional
Thoughts, projects, other random ideas and sometimes just braindump.

Checklist For A Reliable Load-Test
Setting up a load-test that produces results you can rely on is not that simple. But without realistic test-results you cannot be sure that your application handles sudden increases of traffic, rapid spikes or even the initial go-live. And you cannot estimate at which number of users you should scale up your hardware. Both details are very important to keep the application running at all times and guarantee that no revenue or developer sleep is lost because of outages.

Why Apache Benchmark Is Not Enough
You are working for months on a new web application or e-commerce system and usually a few weeks or just days before the launch a complete enough feature set is running on a production-like system so that you can run a realistic load-test. Hopefully providing you with accurate picture of the performance of your future system. What should you do, and why is Apache Benchmark usually not sufficient?

Testing the Untestable
A long time ago I wrote a blog post about Testing file uploads with PHP where I have used a CGI PHP binary and the PHP Testing Framework (short PHPT), which is still used to test PHP itself and PHP extensions. Since the whole topic appears to be still up-to-date, I would like to show a different approach how to test a fileupload in PHP in this post. This time we will use PHP's namespaces instead of a special PHP version to test code that utilizes internal functions like is_uploaded_file() or move_uploaded_file().

Introduction To Page Objects
A while ago we wrote about writing acceptance tests (end-to-end tests) with Mink and PHPUnit. While this is a great set of tools for various applications such tests tend be susceptible to changes in the frontend. And the way they break is often hard to debug, too. Today I will introduce you to Page Objects which can solve some of these problems. The basic idea behind a Page Object is that you get an object oriented representation of your website. The Page Objects maps the HTML (or JSON) to an object oriented structure you can interact with and assert on. This is more initial work then than writing tests with PHPUnit and Mink directly, but it can be worth the effort.

Software Metrics 101 - Weighted Method Count (WMC)
The Weighted Method Count or Weighted Method per Class metric was orginally defined in A Metrics Suite for Object Oriented Design by Chidamber & Kemerer. The WMC metric is defined as the sum of complexities of all methods declared in a class. This metric is a good indicator how much effort will be necessary to maintain and develop a particular class. There are three slightly different definitions of the WMC, where each definition uses another metric as a measure of the methods' complexity. Possible complexity values are * McCabe's Cyclomatic Complexity …

Software Metrics 101 - Number of Public Methods (NPM)
The Number of Public Methods or NPM metric was orginally described in the fundamental book Object-Oriented Software Metrics of Lorenz and Kidd. The NPM metric The NPM metric belongs to the group of simple count software metrics. This means that this value simply reflects the number of public methods declared in a class. A high NPM value can be an indicator for two different bad smells in the design of a software. First it can be a signal for a class that is to complex and has too many responsibilities in the analyzed software system…

Code Coverage with Behat
There is generally no point in having code coverage for Behat test cases because of their nature - The purpose of an acceptance test is to assert a certain behavior of an application, not to technically test a piece of code. Therefore, there is no point in checking for uncovered code pieces in order to write a Behat test for it.That said, there is still a scenario where you want to peek at code coverage of Behat tests - When creating them as wide-coverage tests before starting to refactor legacy code.

Software Metrics 101 - Class Size (CSZ)
The Class Size or CSZ metric is a another measure for the complexity and size of a class. In many publications and books this metric is frequently referenced with the abbreviation CS. The definition and detailed description of this metric can be found in The Optimal Class Size for Object-Oriented Software paper by Khaled, Benlarbi, Nishith & Shesh.

Software Metrics 101 - Class Interface Size (CIS)
The Class Interface Size or CIS metric is measure of the public services that a class provides. This metric was orginally defined in the QMOOD model [1] by Bansiya & Davis. The orginal version of the CIS metric was defined as the number of public methods that a class provides. Each of these methods can be seen as a service where surrounding application can send messages to or receive messages from a class.