Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any good tools or tips for fuzz testing Windows forms applications? [closed]

I'm maintaining a ~300K LOC C# legacy thick-client application with a Windows.Forms interface. The app is full of little bugs and quirks. For example, I recently discovered a bug where if a users edits and tabs (not clicks) through cells on a DataViewGrid, and leaves the a certain cell selected, the app gets an "Object reference not set to an instance of an object" exception. I discover (or get a bug report of) something new like this about every week or two. I've had enough, and was thinking of trying some sort of fuzz testing on the application to try to ferret out undiscovered issues.

If I roll-my-own fuzz testing, I'd assume I at least need to be able to generate test harnesses that run pieces of my app (main window, FormX, FormY, FormZ, ...) independently and try to inject events into them.

I was trying to look for tools suited for this, but so far have come up with nothing for Win Forms. (There seems to be no shortage of fuzz testing tools for web apps, however).

Any helpful ideas?

like image 317
Ogre Psalm33 Avatar asked May 28 '10 12:05

Ogre Psalm33


People also ask

Which steps has to be followed for implementing fuzzing in his application?

Step 1: Recognition of the target system. Step 2: Recognition of the inputs. Step 3: Fuzzed data Generation. Step 4: Test Execution using fuzzy data.

Is fuzz testing a functional testing?

Fuzz testing is an automated or semi-automated testing technique which is widely used to discover defects which could not be identified by traditional functional testing methods.

What is fuzz based testing?

Definition. Fuzz testing or fuzzing is an automated software testing method that injects invalid, malformed, or unexpected inputs into a system to reveal software defects and vulnerabilities. A fuzzing tool injects these inputs into the system and then monitors for exceptions such as crashes or information leakage.


1 Answers

I always like the idea of the Gremlins test tool, used on Palm handhelds. It generated random tap events to flush out UI programming bugs. You could do the same in your app, generating millions of mouse down and up events at random locations. You'll need to P/Invoke PostMessage() and use Control.GetChildAtPoint() to generate the window handle for the WM_LBUTTONDOWN/UP messages. Application.DoEvents() in your test loop to get the event handlers to run.

like image 190
Hans Passant Avatar answered Nov 10 '22 04:11

Hans Passant