VSTS Unit testing
This post is predominantly about unit testing, but first a little dilbert: It seems that everyone in a the software development field knows about dilbert, I am absolutely positive that Scott Adams works for my company and has been in many of our meetings. Well, sunday's dilbert describes in a single comic most of our projects. Here's a link: Sunday's Dilbert Its really kind of frightening how accurate that is at times.
On to unit testing, I've been playing with the Beta1 refresh that's available on MSDN Universal lately, the VSTS stuff in this build is very very cool. My favorite feature is the unit test generation feature. My biggest complaint so far is that there doesn't seem to be many options I've seen for the unit test generation stuff. For example, the class that i'm unit testing requires a call to an Initialize() function for it to work, It would be very cool if i could have a dialog upon unit test generation that would allow me to specify the correct way of creating the object. Ie, calling initialize(), passing some data etc.. Basically, for my three classes it generated 107 tests, and that's quite a few tests to go through and edit. Granted, i've got to edit them to add intelligence & functionality, but every little bit helps. I'm also wondering if it would be possible to have some sort of templating system? If i could supply a default template for unit tests to use and perhaps a project level template as well.
Another thing I've noticed, if you remove unit tests your test view isn't updated. I'm wondering if that could watch the unit test assembly and look for changes, if it changes then reload. Its not that big a deal to just hit reload but when i'm getting into the habit of compile unit tests, run tests, getting an error that testid {someid} cannot be found is confusing at times. Another idea, perhaps hitting run tests could automatically compile the unit test assembly if needed. It seemed like it was trying to do so, but wasn't in the end? This was confusing, I wasn't sure exactly what was supposed happen when i hit run tests (beyond running of the actual tests).
Great Work, VSTS looks awesome.