<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Where did the time go? - Unit Testing</title>
    <link>http://blog.j-maxx.net/</link>
    <description>Brain Powered</description>
    <language>en-us</language>
    <copyright>Jeff Klawiter</copyright>
    <lastBuildDate>Mon, 30 Jun 2008 02:14:50 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>Jeff.Klawiter@sierra-bravo.com</managingEditor>
    <webMaster>Jeff.Klawiter@sierra-bravo.com</webMaster>
    <item>
      <trackback:ping>http://blog.j-maxx.net/Trackback.aspx?guid=a44088ce-bd6a-43b4-a978-cde26edb44f8</trackback:ping>
      <pingback:server>http://blog.j-maxx.net/pingback.aspx</pingback:server>
      <pingback:target>http://blog.j-maxx.net/PermaLink,guid,a44088ce-bd6a-43b4-a978-cde26edb44f8.aspx</pingback:target>
      <dc:creator>Jeff Klawiter</dc:creator>
      <wfw:comment>http://blog.j-maxx.net/CommentView,guid,a44088ce-bd6a-43b4-a978-cde26edb44f8.aspx</wfw:comment>
      <wfw:commentRss>http://blog.j-maxx.net/SyndicationService.asmx/GetEntryCommentsRss?guid=a44088ce-bd6a-43b4-a978-cde26edb44f8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">While I've heard lots about Unit Testing
for years now I've never been able to force myself to implement them. I've always
thought it'd take too much time. Time I could have spent writing code, getting work
done. Then I go the project I am on now. It is a large project with a very tight deadline.
A project that needs to marry different back end sources.<br /><br />
I've been put in charge of architecting the SQL Server back end and the entire middle
layer for data access and business objects. I'm using many things I've not had a chance
to use before at this scale (LINQ being the largest) in this project so there were
many unknowns. The front end may not been done for a bit and I needed to test my data
access functions. I decided to bite the bullet and write unit tests. 
<br /><br />
Normally I would write a small WinForms app to test the most important pieces. This
is a dirty approach but it's fast. The biggest hurdle in my mind for Unit Testing
was there was no quick way for me to implement and run the tests. Nunit is out there
and has some VS integration but whenever I tried it I got confused of where I needed
to go to get things done. 
<br /><br />
Now we have VS 2008 Pro with built in unit testing. While the testing framework included
I'm told is decent it's not as good as Nunit. I personally don't care about that.
The ability to go to the menu and create unit tests for methods or entire projects
on the fly is a godsend for me. VS will create a project for you, include tests for
any classes/methods you've selected out of all the projects in your solutions and
then do it's best to create close to complete tests. 
<br /><br />
You can easily step into debug any test and run one or many tests. All the results
are saved so they can be examined and compared. While the auto created tests need
to be completed I am starting to find that writing to test my code interface is getting
cleaner and more too the point. It's much more annoying to pass an object into a method
that may only need one or two properties on the object. It's better to make the parameters
basic types instead of complex. 
<br /><br />
The tests have to run against 2 different backends. While one of them will probably
not change (the SQL Server) the webservice may end up being replaced. These tests
will be invaluable for when that happens. We can then check to see if the new service
is acting correctly and if not pinpoint the issues. 
<br /><p></p><img width="0" height="0" src="http://blog.j-maxx.net/aggbug.ashx?id=a44088ce-bd6a-43b4-a978-cde26edb44f8" /></body>
      <title>Unit Testing for the first time</title>
      <guid isPermaLink="false">http://blog.j-maxx.net/PermaLink,guid,a44088ce-bd6a-43b4-a978-cde26edb44f8.aspx</guid>
      <link>http://blog.j-maxx.net/2008/06/30/UnitTestingForTheFirstTime.aspx</link>
      <pubDate>Mon, 30 Jun 2008 02:14:50 GMT</pubDate>
      <description>While I've heard lots about Unit Testing for years now I've never been able to force myself to implement them. I've always thought it'd take too much time. Time I could have spent writing code, getting work done. Then I go the project I am on now. It is a large project with a very tight deadline. A project that needs to marry different back end sources.&lt;br&gt;
&lt;br&gt;
I've been put in charge of architecting the SQL Server back end and the entire middle
layer for data access and business objects. I'm using many things I've not had a chance
to use before at this scale (LINQ being the largest) in this project so there were
many unknowns. The front end may not been done for a bit and I needed to test my data
access functions. I decided to bite the bullet and write unit tests. 
&lt;br&gt;
&lt;br&gt;
Normally I would write a small WinForms app to test the most important pieces. This
is a dirty approach but it's fast. The biggest hurdle in my mind for Unit Testing
was there was no quick way for me to implement and run the tests. Nunit is out there
and has some VS integration but whenever I tried it I got confused of where I needed
to go to get things done. 
&lt;br&gt;
&lt;br&gt;
Now we have VS 2008 Pro with built in unit testing. While the testing framework included
I'm told is decent it's not as good as Nunit. I personally don't care about that.
The ability to go to the menu and create unit tests for methods or entire projects
on the fly is a godsend for me. VS will create a project for you, include tests for
any classes/methods you've selected out of all the projects in your solutions and
then do it's best to create close to complete tests. 
&lt;br&gt;
&lt;br&gt;
You can easily step into debug any test and run one or many tests. All the results
are saved so they can be examined and compared. While the auto created tests need
to be completed I am starting to find that writing to test my code interface is getting
cleaner and more too the point. It's much more annoying to pass an object into a method
that may only need one or two properties on the object. It's better to make the parameters
basic types instead of complex. 
&lt;br&gt;
&lt;br&gt;
The tests have to run against 2 different backends. While one of them will probably
not change (the SQL Server) the webservice may end up being replaced. These tests
will be invaluable for when that happens. We can then check to see if the new service
is acting correctly and if not pinpoint the issues. 
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.j-maxx.net/aggbug.ashx?id=a44088ce-bd6a-43b4-a978-cde26edb44f8" /&gt;</description>
      <comments>http://blog.j-maxx.net/CommentView,guid,a44088ce-bd6a-43b4-a978-cde26edb44f8.aspx</comments>
      <category>Unit Testing</category>
    </item>
  </channel>
</rss>