Freigeben über


Object test bench rocks!

You ever get that feeling when you stumble across something truly mind-blowing and you want to blog about it instantly? You feel that you need to just tell someone how cool something is? Well, I've just had such an experience and the cause is a new Visual Studio feature called Object Test Bench.

Though I'm a pretty hard core Visual Studio user, there are always new features that I keep discovering, especially in Whidbey. I've been hacking away at a prototype of an idea I've had when all of a sudden, I had a problem which a lot of us run into.

 I had a bunch of code which I wanted to try and execute and test. However, the way my program worked, I had to write a bunch of other code to load data and feed it into the code I had finished writing. Let's call the method I have finished writing FooBar (in reality, it is a bunch of methods).

I could lay out the data structures by hand but that would prove painful. Also, since this was a Winforms project, I would be writing a lot of code just to be able to *test* my code. I was about to start typing out code to layout the data structures necessary for FooBar to work when I suddenly remembered a series of blog posts from Partha about Object Test Bench (start here - he has put up screenshots as well). I opened up his blog post and started digging around. Within 10 minutes, I was shaking my head in disbelief. I am truly blown away!

Object Test Bench is a new feature in Visual Studio 2005 which lets you visually execute code and play around with objects (read Partha's blog for a better and funnier description :-) ). Such tools have existed for other languages before (the Lisp REPL was probably the predecessor for all these tools) but in terms of Microsoft development tools, this is truly a first.

Here are the key OTB features which I've stumbled on in the last 2 hours  (see Partha's blog and MSDN for the full list of groovy things you can do)

  • Construct objects and execute code visually. You can right click on a class and say 'Create Instance' and right click on an instance and invoke one of its methods
     
  • This visual execution of code has full debugging support - you can hit breakpoints while you're invoking a method from the GUI, for example.
     
  • OTB ties in with the immediate window. So if you're tired of the right-clicking and invoking methods, you can type in code to execute inside the immediate window, just as you would do inside a Lisp/Scheme REPL.

Though this tool seems to be primarily aimed at exploring APIs and at academia, I'm already calculating the hours and hours of time I'll save by using this tool. I've probably saved a couple of hours already!

Some really cool people are writing C# REPLs but what caught me by surprise is that VS now packs a REPL - with turbo-chargers!

Enough gushing and back to work. :-)

Comments

  • Anonymous
    August 01, 2005
    I think this can be summed up rather nicely

    Welcome to the 1970s
  • Anonymous
    August 01, 2005
    Let me know when VS makes it as far as 1980 in terms of development power. From this description, it's not quite there yet.
  • Anonymous
    August 01, 2005
    The previous comments say it all. Microsoft is re-inventing poorly technology that has been around for 30+ years
  • Anonymous
    August 01, 2005
    I see what you're saying (and James - I know that Smalltalk has done a lot of this :-)).

    But look at the scope of this feature - across languages, integrated with the IDE and the underlying VM too. For example, each .net object being invoked here might be written in a different language.

    Also, let me know when others catch up to VS in terms of the designers, intellisense and all the other tools that are present inside VS.
  • Anonymous
    August 03, 2005
    See http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3300561536
  • Anonymous
    August 05, 2005
    Isaac - if this is an argument about static languages vs dynamic languages, then I concede defeat for I'm a VBScript/Lisp/Scheme/Python/Ruby guy at heart. However, if it is about VS vs Smalltalk, then we're comparing apples to oranges - and I don't think James intended this to be an argument about who has the better IDE.