![]() |
|
Spaces home Render's spaceProfileFriendsBlogMore ![]() | ![]() |
2006 Tech Ed Update - Visual Studio Coding and Testing EnhancementsFinally, some pure code stuff.
Microsoft is making everything easier to code, but is making a coder's job MUCH MORE DIFFILCULT, imho.
(ask me if you dont understand what imho means) Observe the below...
Code Analysis:
Microsoft has built into VS 2005 Team System Edition new Unit Test Tools. Let me say right off the bat, YES Microsoft will automatically generate new projects and test harnesses for methods with a simple right click. If you make a method Add(int x, int y), microsoft will make a test harness and project with a simple right click. In the test harness you can add stuff like expected results and test code to induce failures (But you don't have to, the tool will try to figure that out as well). Asserts are built in, and you get cool views of what passed and what didn't. Hook up VS Team Foundation, and you can add rules to not allow check-ins unless the unit tests pass. Very cool stuff. So easy to do that it should be a requirement of all code built on VS2005. Easier to code, but more stuff the coder should worry about. It's a good thing, but Microsoft made it so easy that you can't get away with not doing it. :(
Code Coverage:
VS2005 will "temporarily inject" code into your projects and then run code coverage tests. These tests tell you what code is and isn't executed. You can't really get 100% code coverage (Microsoft optimizes some loops and collection stuff under the covers), but it is useful making sure that you cover all possible code paths, and modify unit test scripts as necessary. Again, VS2005 makes it so easy, you can't get away with not doing it. Ugh.
Code Profiling:
VS2005 has FxCop BUILT IN. VS2005 will profile your finished code, and then tell you stuff like "this function is deprecated" or "this method is too complex" or "you have a string literal in your code (hard coded string)". It even hooks up to the MSDN Library so you click on the recommendation and Microsoft tells you how to fix it. It's completely customizable and you set the level of profiling you want. After profiling, you can set certain stuff to ignore, and turn certain warnings into actual errors. All very very cool stuff. Plug in Team Foundation Server and you can share profiling rules and not allow check in unless it passes the profiler tests. I don't like this AT ALL, but it definitely guarantees quality of code and this can only be good.
Here is a good place to mention that when you find a defect, or need a task done, or just want code quality improved, you can create "work items" for yourself or other developers and force them to address it in order to check in code. This all needs Team Foundation Server, but it really really promotes team development in a way that is so much more automated. Using this stuff really cuts down on developer back and forth and dramtically improves the quality of the code as well as drastically reducing testing time. Of course, the other side of the coin is that developers need to be smarter and understand more concepts, not dumber and coding is easier. Well, thank goodness I don't code anymore HAHAHA (just kidding).
Comments (5)
Add a commentTrackbacksThe trackback URL for this entry is: http://renderinfo.spaces.live.com/blog/cns!DBC5240E4E5966FB!111.trak Weblogs that reference this entry |
|
|