开发者

When developing Visual Studio add-ins, what testing options are there beyond manual testing?

I'm in the process of developing a Visual Studio add-in for a project at work, and have found debugging and testing it to be pretty tedious. So far, it appears to require the launching of a second instance of Visual Studio and manual execution of the 开发者_JAVA技巧add-in code. What techniques and/or tools are available for automating this sort of add-in testing?


The only way your add-in will be testable is if you design it to be testable. Typcially when writing a Visual Studio Add-In / Package / MEF component I divide my code into 2 projects.

  1. Actual Core Engine which has little or no dependency on Visual Studio
  2. The actual Add-In which uses the Bridge pattern to expose the core engine

#1 is clearly testable by normal mechanisms and should represent the majority of your code.

#2 is a little more unwieldy to test but not terribly so. Visual Studio's API is entirely interface based and hence can be easily mocked. It takes a bit of leg work but it can certainly be done to enough of an extent to test your code.


There are dedicated single user testing tools out there, like SilkTest and TestPartner, but they tend to be very expensive, so I suggest you check out Automise, which can be used to automate repetitive tasks, and has a 30 day free trial. It comes from the same people who do the excellent FinalBuilder build tool.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜