Thursday, September 16, 2004

Image that you could open the designer, drag and drop a few test case, and run them with minimal writing... now take a look at this:

(Download a demo solution at http://blog.dotnetwiki.org/downloads/DragAndDropUnitTesting.zip )

posted on Friday, September 17, 2004 4:52:00 AM UTC  #    Comments [20]
Monday, June 06, 2005 5:26:30 PM UTC
Wow... this blog has made me decide that I want to focus on software testing for my masters degree :P
<br>
<br>Great stuff..
Jerrad Anderson
Monday, June 06, 2005 5:26:31 PM UTC
Interresting topic. If I can give you a suggestion, try digging model based testing....
Jonathan de Halleux
Monday, June 06, 2005 5:26:31 PM UTC
Not sure what it buys you. Wouldn't it be better to have a test container derived from Component as your drag target?
<br>You could have a wizzard that creates you TestContainer derived class then you could drag your tests onto the canvas. But, as I said, it doesn't count for much of the work required for writing a test - maybe just a better way to browse them. Maybe potentially in the future it could fire off GUIs to generate tests on based on reflection and IL analysis.
JoeW
Monday, June 06, 2005 5:26:31 PM UTC
Actually, what I'm thinking about is to take advantage of the &quot;data binding&quot; potential of the designer:
<br>
<br>drag a test,
<br>drag a data source,
<br>bind both together,
<br>and boom, you got data based testing...
Jonathan de Halleux
Monday, June 06, 2005 5:26:31 PM UTC
ISerializable
Monday, June 06, 2005 5:26:32 PM UTC
Peli's Blog
Monday, June 06, 2005 5:26:32 PM UTC
Rob Caron's Blog
Monday, June 06, 2005 5:26:32 PM UTC
Peli's Blog
Monday, June 06, 2005 5:26:32 PM UTC
ISerializable
Monday, June 06, 2005 5:26:33 PM UTC
If you guys would stop putting all those damn bugs in your code, we wouldn't need all this testing!
Jeff Atwood
Monday, June 06, 2005 5:26:33 PM UTC
Jeff,
<br>
<br>There 2 explanations for bugs: human factor and Halting Theorem. Do your homework.
<br>
Jonathan de Halleux
Monday, June 06, 2005 5:26:33 PM UTC
Weak coffee also. ;)
Graeme Foster
Monday, June 06, 2005 5:26:33 PM UTC
Hello!
<br>
<br>I've downloaded <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a> via command line as specified. I then added the components within <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a>.Framework.DLL and <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a>.Forms.DLL to the VS Toolbox.
<br>
<br>Whenever I try to add a TestCaseComponent instancen, I get an error message saying, that there has been an exception when creating an instance of <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a>.Framework.ComponentModel.TestCaseComponent. The exception was &quot;Constructor for type <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a>.Framework.ComponentModel.TestCaseComponent could not be found&quot;. Any hints what might go wrong here?
<br>
<br>Thanks,
<br>
<br>Christian
Christian Gudrian
Monday, June 06, 2005 5:26:34 PM UTC
Make sure your component has a default constructor. I don't support the constructor with IContainer yet.
Jonathan de Halleux
Monday, June 06, 2005 5:26:34 PM UTC
Btw, don't add <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a>.Forms.dll, it contains the controls for the <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a>.GUI. All the component are in <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a>.Framework
Jonathan de Halleux
Monday, June 06, 2005 5:26:34 PM UTC
At first I tried to add the TestCaseComponent to a VS generated standard component. That failed.
<br>
<br>Then I tried to copy the code from your demo video above, which did not include a standard constructor. That failed as well.
<br>
<br>Now my code looks like this:
<br>
<br>using <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a>.Framework.ComponentModel;
<br>
<br>namespace MbUnitTest
<br>{
<br> public class TestComponent :
<br> ComponentFixtureBase
<br> {
<br> public TestComponent()
<br> {
<br> }
<br> }
<br>}
<br>
<br>And it still fails.
<br>
<br>Am I missing something?
<br>
<br>Christian
<br>
Christian Gudrian
Monday, June 06, 2005 5:26:35 PM UTC
Well you have no tests! To simplify things, I've created a mini solution that contains a component and a test.
<br>You can download it at <a target="_new" href="http://blog.dotnetwiki.org/downloads/DragAndDropUnitTesting.zip">http://blog.dotnetwiki.org/downloads/DragAndDropUnitTesting.zip</a>
Jonathan de Halleux
Monday, June 06, 2005 5:26:35 PM UTC
I can only load the source files. The projects files are generated with a version of VS which is newer than mine. Which one would that be? I though VS 2003 is the most recent version.
<br>
<br>Christian
Christian Gudrian
Monday, June 06, 2005 5:26:35 PM UTC
I'm using the VC# Express 2005 beta. The project in itself is not important.
<br>
<br>Open DragAndDropFixture.cs and put it in your 2003 project.
Jonathan de Halleux
Monday, June 06, 2005 5:26:35 PM UTC
Scooter's Musings
Comments are closed.