Sunday, August 2, 2009

Technical Preview – Typemock Isolator with “Typhoon”

it’s been quiet here for a while, so we’ve decided to show you what we’ve been working on.

This installer contains the two next productivity features of Isolator: InteliTest and Testomatic. They are intended to make tests even easier than you can get with Isolator today.

InteliTest is a code-completion tool, which creates the Isolate.Fake.Instance statements for you. It’s very simple and you’re bound to hit it when you open a parenthesis. It’s more impressing when you do a Swap.NextInstance and then it completes the fake definition for you.

Testomatic is a code generation tool in a  test wizard style. You start off with an integration test. You right-click on the Testomatic context menu, and the wizard begins. It runs your test until it hits a NullRefernceException. It then offers a suggestion to fake what caused that exception( this is called a decision point, the user needs to decide what to do next). Even better, it shows you the stack of calls, with their code preview. You can decide where to return a fake value on each method of the stack. Once you pick the suggestion, it adds the correct code, builds the test and runs it again. If it hits a method that returns a value type (or a string) on a fake, it asks what to return. It continues the code-build-run cycle until the tests completes.

It’s quite cool, seeing it works. And now you can try it out for yourselves. You’re the first to see it outside this office, and we like to get as much feedback as we can, before moving on. So hit us with bugs, features, ideas. We’re open for business.

You can download it from here. Here are the limitations so far:

  • Requires DXCore latest version. You can download it from here.
  • Works with MSTest only.
  • Works for public statics and future objects (objects created inside the production code). Does not for objects created inside the test context.
  • Cannot set a decision for non-public and generic methods.
  • Does not support TestInitialize – decision points not raised from calls inside Initialize
  • If we get a decision point with a stack that has a method we cannot inject on because we haven't faked something up the stack, we still offer the advice and if the user selects it we inject code for the top method in the stack.
  • If the test project has been changed (added reference, for instance), and not saved before running Testomatic, we offer to save the csproj. If the user cancels, VS may crash.
  • We suggest decision points we cannot support, such as faking System.Object as a recursive fake. We should not offer decisions on stuff we can't support – mscorlib, lambdas, etc
  • We have a problem intercepting recursive fake returns on future (Swap.All) instances

Go ahead and try it. And give us feedback. We love feedback.

19 comments:

  1. You forgot to link in the DXCore installer ;)

    ReplyDelete
  2. Hey Gil,

    I've just installed it on my machine but I didn't see anything change. I've got no new context menus, nothing special happened with the parenthesis or anything.

    I *think* I'm running the latest version is DXCore (I only have the free version of Refactor installed though).

    Could you maybe do a small vid-cast of how to use it for those of us who seem to stuff up :P

    ReplyDelete
  3. @Slace & all,

    You can get CodeRush with DxCore at http://www.devexpress.com. You need to download the whole installer - in the installation dialog you can opt to install only DxCore (which is free) or any other package (only DxCore is required for the new features).

    If you installed DxCore after installing this Isolator version, you can still deploy the DxCore plugin by running ProductivityPluginDXInstaller.exe from your Isolator install dir. Please let me know if this works for you. The new features (a context menu item and auto-completion options in method argument lists) are only available in mstests.

    ReplyDelete
  4. I've got CodeRush Xpress (http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/) which uses DxCore (or so I believe).

    I do have DxCore listed in my extensions of VS, and it is a line-item in Add/ Remove programs...

    ReplyDelete
  5. OK, DxCore does seem to be properly installed. Can you make sure the Typemock plugin is loaded? You can do it through the VS DevExpress menu -> Tool Windows -> Plugin Manager and press the little properties icon on the toolbar. Do you see Typemock.Productivity.dll in the plugin list?

    ReplyDelete
  6. That's where I seem to be hitting a snag, I don't have any menu for DevExpress, which is (obviously) confusing me.

    I know CodeRush Xpress works, I use it all the time, but I don't know if the plugin engine is supported in the free version, I thought it was :(

    ReplyDelete
  7. We are using the full CodeRush download, and installing only DxCore. I would expect the same to work with the Xpress version, as DxCore is listed under there as well. I will ask DevExpress whether our usage scenario is supported in the free Xpress edition.

    Thanks for reporting this!

    ReplyDelete
  8. Thanks Doron, please keep me in the loop, I was really wanting to have a try of this new tool

    ReplyDelete
  9. With MSTest-only support I can mess around with it a little, but everything we do for production is in NUnit so I won't be able to try it out on any of the larger projects we have (which is my real testbed for stuff like this).

    Is there a notion of having a plugin model so developers could add support for test frameworks you don't support out of the box? That would be win-win: Devs get the support they want without having to wait; you guys get free dev work out of the community.

    ReplyDelete
  10. Just confirmed with some DevExpress reps on Twitter that the CodeRush Xpress does NOT put the DevExpress menu into VS.

    You can get to the plugin manager a different way, though, I think: Ctrl+Shfit+Alt+O brings up the Options screen (or so I'm told - I don't have CodeRush Xpress, I have the full version).

    Inside the Options screen, navigate to Core/Plug-in Manager. (You will need to have the options "Level" set to "Expert" to see this. Look in the bottom left corner of the Options dialog to see the "Level" it's set to.)

    ReplyDelete
  11. There is a registry hack explained here to enable you to display the DevExpress menu.

    In RegEdit, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Developer Express\CodeRush for VS\9.1 and set the HideMenu DWORD value to 0.

    ReplyDelete
  12. Travis - Thanks, that got it opening

    Doron - It's not listed as a plugin, I tried running the tool you suggested (it said the Shortcut_Code_Typemock.ini file already exists, so I renamed it and re-ran it) and it still doesn't appear. do I need to put the Typemock.Productivity.dll into the plugin folder for DxCore?


    For the record I think having support for CodeRush Xpress would be great, I know a number of devs using it. The reason I don't have the full version is that I haven't found a need for it. I know a lot of VS shortcuts/ tricks and can achieve pretty much all I need without a hard-core plugin.

    ReplyDelete
  13. @Slace - I tried this locally and the add-in does seem to be supported in the Xpress edition. This means to me that there's been a deployment issue on your machine - we'll contact you on our support channel to get this conversation offline.

    @tillig - NUnit support is of course planned. Just put in your votes for this and other features so we know what's important for you.

    ReplyDelete
  14. Hi,

    I am eager to try out all the new features, but
    1. I use Resharper, not dev-express
    2. I use NUnit, not MSTest

    I would rather have these two problems resolved before I test further.

    ReplyDelete
  15. @Soon Hui - You can install just the DXCore plugin engine and it does not hamper ReSharper. I believe the important bit is the DXCore plugin engine, it just happens to also come with CodeRush Xpress.

    ReSharper doesn't really have quite the robust plugin model that DXCore does, (and it also costs, while DXCore is free) so I don't know that I'd be looking for a ReSharper version of this functionality any time soon.

    ReplyDelete
  16. @Soon - the same Resharper/NUnit thing for me here. I'd like to give Typhoon a try but (if possible) don't want to mess with CodeRush installations and, again, I wouldn't be able to try it on our real tests as they're NUnit. A plugin model seems the way to go, as Travis mentioned.

    @Travis - DXCore is free but apparently making it working implies certain voodoo dancing - and for R# users, employing R# directly would be a big benefit.

    @Doron - so you looked into R# and found that it doesn't provide everything you need? Reason I ask because if it is technically possible to use R# with Typhoon, I can volunteer to write an open source plugin to bridge the too.

    ReplyDelete
  17. I'd like MbUnit to be supported as well.. Perhaps some API/Guide/Extension point so that authors/users of other test frameworks could write an adapter? I guess something could be written for CThru as well?

    Is VB.Net supported?

    ReplyDelete
  18. I am also NUnit user, no problem for me to install DXCore, but in order to try this stuff on our real tests, I need suppor for NUnit that I used in VS together with TestDriven.NET.

    ReplyDelete
  19. We all need more support on major testing frameworks like Nunit,mbunit cannot try it with no support

    ReplyDelete

Note: Only a member of this blog may post a comment.