Skip navigation.

Performance testing - still in the post-hoc ghetto of a test-driven world?

performance testing | test driven development
As some of you may recall, a couple of years ago I ran a workshop on Agile Performance testing.

You can find out more about this by searching for WOPR7.

The general theme, with the exception of one experience report, focused on post-hoc performance testing. A lot of work has been done over the last decade to advance functional test-driven development. When I say 'functional' I don't mean 'application level tests' (a.k.a. acceptance tests); I mean tests at the level of unit, acceptance and every level in between where these tests are concerned with functional behaviours (of the unit or the application respectively).

The only experience that looked at driving development with both functional and performance tests was from Antony Gorman. He'd implemented a .NET equivalent to JUnitPerf so that he could make sure that he could incorporate performance requirements into his tests. Feedback about performance was still important so post-hoc performance will still be required (just like post-hoc testing is useful to provide feedback and identify new tests worth automating).

Since then, with the exception of the release of the FIT Decorator all has been relatively quiet. Even still - I think that the FIT Decorator doesn't quite address the complexities of multi-path user experiences.

Despite these (limited) advances, performance testing still seems to live in a post-hoc ghetto of many test-driven teams, often building enormous amounts of technical debt and leaving performance concerns until way near the end of a release.

So, what's holding us back? I think that the community is still trying to get its collective head around functional acceptance test driven development (ATDD) and simply hasn't had the head-space to deal with performance too.

I feel that there is an increased interest in the idea of 'agile performance testing' on the horizon. Soon, we will need to start taking a look at how to effectively make it as much a part of the work we do in each iteration as functional tests. Jamie Dobson (not linked as I can't find his blog) was also at WOPR7 and presented an experience of how he ensured that an independent performance team got to provide feedback after each iteration but I see this as an intermediary step.

One of the problems we'll face - as we did with functional test tools - is the issue that they were designed for post-hoc testing not any kind of test-driven development.

As I pondered this issue today, I had a vision of the future of performance testing in a test-driven world.

I imagined iteration 1 - we have a story to have a home page and another to simply login. The team write application level functional tests for it. The business plan (or business case) knows that we have to have 20,000 visitors per day for this new service... half of which we expect to login between 9am and 10am.

The homepage and the login screen paths are represented with a simple UCML diagram. The names of the actions conform to actions also used by the functional tests. Behind our functional tests is a fixture and some corresponding 'fittings' that glue the functional test to our application. The 'fittings' make up a DSL and in this iteration comprises two Command' classes. A VisitHomePage class and a Login class.

The (yet to exist) tool that helps us to represent user-community usage of the application with UCML - allows us to specify distribution of users across the end-to-end path of simply visiting the homepage and logging in or simply visiting the homepage and abandoning the session. It utilises the 'Command' classes to interact with the application but decorates them with multi-threading capabilities, wait time distribution, input data for the user-names and passwords and many more characteristics - not least performance assertions.

Exploratory performance testing happens after the code is implemented (still within the iteration) and provides feedback on different load-profiles that we also need to include in our tests. These get added to the performance tests so that different load-profiles are accounted for. It also identifies that we need to account for some of the users getting the login wrong. The feedback also highlights that a brute-force attack on the login-page would bring the application to its knees - this is added to the backlog as a new story.

In iteration 2, we want to add a feature to find a book... We repeat the above, altering the UCML view of the application to accommodate the new story. Feedback finds new load-profiles and user-flows to consider.

This process repeats, iterating over the UCML representations as our understanding of the performance requirements grows and incrementally adding to the UCML representations as our understanding of the functionality grows. In both cases - driving the design of the code to meet both functional and performance requirements.


What's important is that there is huge potential for re-use of code across both the functional and performance requirements... there are numerous considerations to be factored in at the protocol level - but there is nothing stopping me from writing an HTTP engine and full browser engine (say - using Selenium) that can be used behind each command class (using polymorphism to instantiate the appropriate 'engine').

Unfortunately, the tools for this don't exist yet but all the building blocks are there. For example, we might take some inspiration from Brian Marick's work on visualising functional tests. We might take another piece of inspiration from FitDecorator... and so, I feel that the type of project I describe above isn't that far away - it just needs a project for which performance is really important in order that the time and people are made available to make it a reality...

Or... a visionary tools vendor/well-funded open source project to take an interest...

If you have the inclination and resources to make this a reality - let me know - I'd love to be a part of it.

I think you've misunderstood...

I didn't say that the tools was the main problem... I said it was one of the problems.

As alluded to in my original post - the real problem is that the community isn't demanding these features because not enough of the community understands them. Your comment is an illustration of that point - the lack of understanding.

Such as in your opening paragraph of your comment...

I don't think that tools are the main problem. You can implement unit performance testing, for example, in LoadRunner pretty straightforward. You can write a small test harness, etc.

I don't want to write unit-performance testing in LoadRunner. I don't want to leave my IDE to use some other tool...(That is one of the advantages of Microsoft's Team System but that's only valid if you're working on a .NET project... In fact you can add existing unit tests to your load-test suite in VS Team System's LoadTest).I want to write tests that are consumable by my customer. I want my test to be a UCML diagram decorated with assertions (new requirement for UCML - assertions)! I want this to be used by the test-code to drive my performance tests. The tool I use should offer me an API in the same language I'm using for my product without having to learn yet a new language and allow me collect performance metrics that I can assert against... either assert against current values or against mean values or Std Deviation values relative to my last test... I have a whole list of User Stories in my head for such a tool.

I think it's hard for people to understand where I'm coming from until they've spent time on a proficient XP team... driving development with acceptance tests - acceptance tests that are used to explore and expand the collective understanding of what capabilities the customer wants from the system (see my Internet Radio analogy).

So - the main problem is what I said... that people in test-driven or XP teams are still getting their head round functional acceptance tests - I know I coach teams in the practice... the paradigm shift is difficult for most. They don't have the head-space to get their heads round that and driving performance with performance tests. When they are ready to look at driving performance with tests the tools let them down and so far no one has decided that it is important enough to invest in doing something about it (as far as I can tell) - and thus performance testing remains in a post-hoc ghetto.

Antony Marcano

I don't think that tools are the main problem

I don't think that tools are the main problem. You can implement unit performance testing, for example, in LoadRunner pretty straightforward. You can write a small test harness, etc. Once upon a time I even wrote a paper about it. Of course, better free/inexpensive tools will help (we all know that price, for example, may be prohibitive for good commercial load testing tools even if they do the trick), but it is not what prevent unit performance testing.

The main reasons, I believe, are:

1) Performance has lower priority than functionality (until you get performance problems) and, in most projects, there is no budget for it (except, maybe, final validation test).

2) You need to change mentality from performance testing to performance engineering (again, we all know that terminology is vague here, perhaps it may be better wording for the idea). You need to translate end-user usage into component/unit-level usage, end-user requirements into component/unit-level requirements, etc. You need to go from record/playback to some kind of programming. You need to go from black/dark grey box testing to, say, "light grey".

lack of good universal load and functional test tools

Hi all,
I think one of the problems is that most commercial load testing tool vendors in the past have promoted a "record and replay approach" for load tests.

Reusing functional tests for load/performance tests can be done even with those "market leading" load testing tools. But believe me it's pretty hard, to do it in a maintainable way :]

Regards,
Markus Kohler (my Java performance blog)

Being iterative is just a part of it...

It's not just iterative... it is truly test-driven. The performance tests are among the tests that must pass for each story to be complete. The tests are written before we try to meet the performance needs. This will change the way the tool would work... it would not work the same as post-hoc performance testing tools... For example - record and playback wouldn't be an option...

If anyone did have the inclination to build a UCML tool - you would be the person I'd recommend as the product owner... I'd also want to be involved in that capacity too, however, to ensure that it supports the test-first vision I have in my head... Between the two of us I'm sure we'd help direct the creation of the perfect tool for the job...

Maybe we need to start an open source project, write a few user stories and create some examples - starting with the simplest possible UCML you could possibly create (e.g. single user-type visits a home page) and grow the complexity incrementally - Then see if anyone decides to pick up the development work... just a thought.

Antony Marcano

I've seen examples of your vision...

Though I agree that they are pathetically rare -- and I've not witnessed the realization of that vision on teams that affiliate themselves with TDD (or TFD, or Agile, or anything more descriptive than being "iterative").

If/when you find someone with the time/talent/motivation to build a tool that supports UCML, *please* loop me in. There is so much more to the visualization (that fits with and/or complements your vision) that I've never published because I don't have the faintest idea where to start in writing a tool. At various times I've built some demos/prototypes using things like macros in Visio, but they've never been the slightest bit functional -- just "gimmicks" to help others understand what's in my head.

--
Scott Barber
Chief Technologist, PerfTestPlus
Vice President & Executive Director, Association for Software Testing
Co-Author, Performance Testing Guidance for Web Applications
sbarber@perftestplus.com

Comment viewing options

Select your preferred way to display the comments and click 'Save settings' to activate your changes.