views:

584

answers:

3

We are writing a relatively heavyweight C# GUI with some syncFusion(GUI framework) components. I would like to add client logging capability that QA could later use to playback client events in order to analyze bugs or other workflow the client used in production.

Does such a ready made module for record and playback of all client keystrokes, mouse events etc. exist? (C++ module might work too if it can easily be integrated into the windows C# client.)

I would also like to use the logs generated for analysis of what features of the client were used the most and what features are rarely ever used in order to decide what bugs should get priority and what features should be dropped/enhanced? So basically I'd like the client to write a log to local disk or over the network back to server.

I am also somewhat worried about performance, some hit is acceptable, but any idea how much would logging of every event degrade the client performance?

Point here is to have logging of all client events in production, not QA testing per-se.

Edit based on Aydsman's comments: After reading old similar discussion as well as Benji's site looks like there is lot of interest in this type of "dashboard", but no open or closed product or solution exist at this time. I posted a question on the status on Benji's site, but site looks rather quiet, no responses since June. Benji's ideas are more or less exactly what I was looking for, but no product seems to exist yet, which is rather surprising, I suppose lack of existing products means implementing such a system must be more complicated than I initially thought. Will keep looking and hope to find something later.

A: 

Why write code, when you can buy a product to perform automated GUI testing?

kenny
I added this to question: Point here is to have logging of all client activity in production, not QA testing per-se. I am trying to find what features the production users are using.
Ville M
@Ville M, OK, clear now after the rewrite. Perhaps you can configure one channel of log4net (apache) to use for client input capture. Playback, you would write custom.
kenny
log4net sounds like a good idea for how to get the log from client back to server, but more crucially, how would I capture/log all the client events? Is there a generic solution that you can just "plug-in" into the .net client or do I have to write bunch of logging code myself?
Ville M
The logging is all configurable, with multiple channels going out to different sources (UDP, SMTP, database, xml, trace, etc...). Check it out at http://logging.apache.org/log4net/index.html.
kenny
OK, thanks, I have used log4J before and this looks similar. I should have left the word "logging" out since that's simple. What I'd like is a module which "injects" into C# app and records every event for later playback (kind of like keylogger but for this QA purpose). Heard of such a tool? Link?
Ville M
No, not a tool. With log4net I was imagining the log as a stream you would parse out the form, mouse and key clicks and call the form events directly.
kenny
A: 

Have you heard of log4net? I have used it on a small scale in one project- it may suit your needs. I have also done some research into Aspect-Oriented and IoC techniques for logging. There is some performance impact depending on the particular technique, but it can make the maintenance of logged code easier. The Spring.NET port for the Spring Framework offers some options for general purpose, method-level logging. You could use some combination of these to generate "script" files of activity, and a "replay" module that could read and re-execute logged actions in a test environment.

Dave Swersky
+1  A: 

As has been alluded to by other posters here, there are commercial products that do this sort of thing. If you want to write your own you need to create what is called a System Hook DLL. This can be done in C++ fairly simply. If you create one, you can probably integrated it easily using pinvoke. In fact, I would start by look at pinvoke.net for people who have already done something similar.

A hook DLL allows you to intercept all mouse and keyboard events. You can also inject mouse and keyboard events. So if you put these two together: intercept = record, and inject = playback.

Here's a good list of articles to get you started: Code Project Hook DLLs

dviljoen
or people can use this one: http://msdn.microsoft.com/en-us/magazine/cc163617.aspxIt's pretty slick.
Jason D