Mitch Etter’s Weblog

February 26, 2011

Publishing Coverage in TFS 2008 and Visual Studio 2010

Filed under: .NET — mitchetter @ 5:49 am

In my last post, I described the process I followed to build, run tests and produce coverage results with .NET 4 and TFS Build 2008. It fell short of showing coverage results in the build summary in Visual Studio (specifically Visual Studio 2010). I only got as far as copying the coverage report to the build drop folder.

This isn’t good enough. Practically, another developer would view the build summary in Visual Studio, see the test results but not see any coverage report. This person would most likely assume that no coverage report has been generated, get frustrated and move on. For the coverage report to provide any value to the development team, it needs to not stay isolated in the build drop folder. It needs to be seen. I saw two places for the coverage results to go to make it’s integration with Visual Studio near seamless: in the build summary and with the test results. (more…)

February 19, 2011

TFS Build 2008 with .NET 4

Filed under: .NET — mitchetter @ 2:33 am

I had the recent experience of setting up builds with TFS 2008 that build .NET 4 projects. The requirements were that each build would 1) build the solution, 2) run the tests and 3) generate a coverage report. The process was very arduous because the TFS build process isn’t well documented and has limited customization. One thing I had going for me, though, was that the tests are written on the MsTest framework, which plays nice with TFS builds.

These are the steps that I went through: (more…)

February 2, 2011

First Entity Framework Impressions

Filed under: .NET — mitchetter @ 5:14 am

During the past couple weeks at work, I’ve been migrating a solution from NHibernate to Entity Framework. I’ve been learning a lot, and it’s been quite enjoyable. There are some things I like about Entity Framework, but there are some things that I’ll miss from NHibernate. There are also some issues with the Entity Framework that I’ve been having.

There are several bright spots I’ve been seeing from using the Entity Framework.

  1. I like how you can use a designer to create the entity classes and map them to table. It makes it so easy. It retrieves a lot of the schema from the database for you, which is nice.
  2. The code generation is nice. It creates the classes for me. There’s also options to pre-compile queries to boost performance.
  3. The entity framework can create self-tracking entities that keep track of changes as you make them. This is something I have wished for.

I’ve gotten used to NHibernate over the past four years of using it; so naturally, I would miss it. True, there was a steep learning curve at the beginning. I learned things such as the mapping syntax, HQL and remembering to marking the .hbm.xml files as embedded resources (that last one gets me every time). But after all that, there’s practically no schema that NHibernate can’t handle. There are a couple features from NHibernate that I miss.

  1. I miss absolute control. NHibernate will let you configure it however, but it just may not work when you run it. On the other hand, the Entity Framework is very strict on what changes it will allow (especially in the designer), which is very much like Microsoft. For example, it insists that the schema is not configurable and should only come from the database.
  2. I miss NHibernate’s relationship mapping. Once the relationship is set up in the mapping file correctly, it’ll work no matter what’s thrown at it (inserts, updates and cascading deletes). With entity framework, there a few extra steps involved (especially with the cascading deletes).

Because entity framework is very new, there are still some big issues in using it. Some of it may be from using an Oracle database, but that shouldn’t matter.

  1. Every time you update the entity model from the database you have to close the designer and open it in XML to add the StoreGeneratedPattern=”Identity” to every primary key column reference. It’s very annoying. I’m guessing Microsoft will include a fix for this in the next Visual Studio service pack.
  2. There’s a defect in the class generation template for self-tracking entities. There’s a scenario wherein the namespace (containing periods) of the child class is used as part of a method name, and it doesn’t compile. For this, I had to edit the template.
  3. There’s not much configuration with how connections are used. By default, a new connection is used every time there’s a save to the database. This quickly consumes the connection pool. I’m not sure what to do for this yet. I wish there was smarter connection management out-of-the-box.

November 30, 2010

Key File Opener

Filed under: Uncategorized — mitchetter @ 9:03 pm

I like using the Microsoft Enterprise Library cryptography framework for data encryption. It provides some dependency injection, support for protected keys and some very nice utilities. The problem I’ve found with it is that it has limited support for migrating the protected key files. Sure, you can use their configuration utility that opens the .config file, but it often reformats the configuration file to the point that it’s hard to read. I usually end up creating a dummy configuration file to use with the enterprise library configuration utility, and then I copy the changed elements over to the actual configuration file. Then once you create the key file, it’s difficult to recover the original encryption key (maybe on purpose).

Therefore, I created a windows desktop application that can open the keys in their various formats. The application can also save the key into the various formats. You can download the source here. I wrote it with version 5.0 of the Microsoft Enterprise Library, .NET 4.0 and Visual Studio 2010. I made the assumption that the user know a little about how Enterprise Library stores the keys. It’s still in development and a little rough; so, use it at your own risk.

November 5, 2010

F# vs. C# lines metric

Filed under: .NET — mitchetter @ 5:52 pm

I’ve been reading documentation on F# lately. It sounds really cool, but it just rubs me the wrong way when people start comparing it with C#. I understand the differences that F# is a functional-orientated language and C# is object-orientated. Each have their own advantages and disadvantages in various situations.

But what really gets my goat is when people compare lines of code between the two because they inflate the C# line count. One, they introduce unnecessary methods, properties, etc. Two, braces on their own line are included in the line count. Three, they suddenly forget about anonymous delegates and lamda statements. Let’s look at this F# example (I got this one from http://2009.scandevconf.se/db/FSharp-Intro-v1.ppt):

(more…)

November 3, 2010

Buyable Cars

Filed under: Uncategorized — mitchetter @ 3:51 am

Below is a list of cars that I would not only oogle over but I might actually own at some point in time. Sure, there are many exotic cars that I would enjoy owning, but I have no means of acquiring them. These cars I could actually drive off the lot without having to get arrested.

  • Subaru WRX. This is the car I currently drive. You can call me biased, but I love it!
  • Toyota Tacoma. Everyone needs a truck at some point. This is a versatile moving machine, but it doesn’t make you feel guilty for hauling just a lawn mower. This may be my next vehicle purchase.
  • Inifiniti G37x Coupe. This is just an all-around sexy car. I don’t know how they get the exhaust note so spot-on. It’s purr-fect.
  • Lexus IS 250
  • Acura TSX
  • Nissan Altima 2.5 Coupe. I like the lines on the back-end of the coupe better than the sedan.
  • Honda Fit. Yes. I said the Fit. There is always elegance in simplicity and versatility, and it has both. Also, I really like that the front seats meet the back seat to create a set of easy chairs.
  • Honda Crosstour or Acura ZDX. The curves on the hatch really catch my eye.
  • Infiniti FX35
  • Acura RDX. Yay turbo!
  • Nissan Xterra

September 4, 2010

Time Management

Filed under: Uncategorized — mitchetter @ 6:29 pm

I recently had a promotion at my job, and my new position requires me to do more and different things. This means that what time I had is even more scarce. Therefore, I need some sort of time management.

The last .NET user group meeting that I attended inspired me to try a new method in time management. The presentation there was about how to be a good developer. One of the stories in that presentation was about development team who had a board of priorities with the tasks listed on sheets of paper. This inspired me to create my own board of priorities that I posted on my cubicle wall. I put it on my wall to let everyone know what my queue of tasks are. I put my tasks on note cards and place them into one of three categories: Doing, Need To and Want To. I think these categories are pretty self-explanatory. I’ve tried it for couple weeks now, and it’s been working out. Nobody has tried to mess with it yet, and it’s a constant reminder of what I have on my plate. I think I’ll keep doing it.

Another point about time management that I wanted to mention is something one of my co-workers mentioned to me. He boiled time management down to a “Punnett Square”. Do you remember doing that in Jr. High science class when you were learning about genetics? Though, this doesn’t have do with genetics. My co-worker said that the one axis is importance (important and not important) and the other is urgency (urgent and not urgent). You would then classify your task in one of four squares. My own personal twist on this idea is as follows. First of all, the tasks in the not important and not urgent square practically don’t exist. They shouldn’t receive any of my attention. Secondly, the tasks in the important and urgent square are what I should be doing presently. Thirdly, my effort for the tasks in the important and not urgent square should be spent trying to make them more urgent. This means that I’m trying to see whether they would eventually be important and urgent enough to be what I’m working on. Then for the tasks in the final square (not important and urgent), my effort should be spent trying to make them less urgent meaning they would eventually go away.

Punnett of Priorities

June 8, 2010

My Firefox Add-Ons

Filed under: Web — mitchetter @ 6:13 pm

I’ve always loved Firefox. It’s been the spear-head to the browser revolution giving rich features to the end-user. With its market share growing above 20%, it’s putting the Internet Explorer leviathan in its place. But the thing that I love the most about Firefox is the multitude of add-ons you can get for it.

Here are the extensions that I have currently installed in Firefox. Most of them tend to be very techie. I have them somewhat ordered from most frequently used to least frequently used.

(more…)

February 26, 2010

soapUI

Filed under: Programming, Testing, Web — mitchetter @ 7:39 pm

It’s annoying sometimes when there is only a live version of a web service and no test versions. It inhibits the testing of code that integrates with the web service because your best option, many times, is to test connected to the live service, and you don’t want to mess too much with live data (especially if it belongs to a client). I found a tool today that helps with this issue. It simulates a web service given a wsdl. It’s called soapUI (http://www.soapui.org/). I found it fairly easy to use, and it can be used on the command-line (http://www.soapui.org/userguide/commandline/mockrunner.html). The only down-side to it so far is that it requires java to be installed.

February 1, 2010

Windows 7

Filed under: Uncategorized — mitchetter @ 5:55 pm

I recently got a new laptop at work with Windows 7. At first, I was skeptical about running a new operating system from Microsoft. Any operating system fresh out the doors from Microsoft has always had problems with security, stability and performance. But I’ve been refreshingly surprised. I haven’t had any problems with stability or performance (security is yet to be seen), and the new layout is growing on me. I really like the new task bar. I like how you can pin programs to it (as a replacement of the quick launch area). It seems that every time I start to miss how something is done in Windows XP, I find some new better way to do it in Windows 7.

Older Posts »

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.