ScottD's Musings

C#, .NET, ASP.NET, Automated Unit Testing, Middle Tier Development, and various topics!

News

<script src="http://jobburner.com/adclient.ashx?/0/6" type="text/javascript"></script>

Visual C# MVP

»telligent Bloggers

.NET Community

About Me

Blogs I Read

Cool Utilities

Lists - Others

Lists - Scooter's

Microsoft Events

Other Posts

December 2004 - Posts

Great Post - An xP Development Team Room

Check this out - a breakdown of a team room for an Extreme Programming (xP) development team using!  This would be a good setup for any methodology!  Maybe we'll try something like this at »telligentsystems!

http://www.scissor.com/resources/teamroom/

(From Naumar Leghari's Blog, Thanks Naumar)

Images for my "Unit Testing with Whidbey" Article

As reported here, my first article covering Unit Testing with Whidbey was published in the December, 2004 issue of .NET Developer’s Journal.   (Web-based article,  Entire Issue PDF)

 

First, I was psyched to see that the article was referenced on TestDriven.net and has been viewed almost 1500 times on the Sys-con.com website! 

 

Article Image/Figure Update:

In my previous post, I mentioned that the images were not on the web-based article, but that is incorrect.  The links to the pictures are there (under the author bio), but are horribly out of focus. 

 

Here are some links to the images in the article, and a few others that were omitted, but show some cool stuff…

 

Images From Article: Additional Images
Great Breakdown of NHL & NHLPA's stances

Check out Mike Heika's breakdown of the issues between the NHL & NHLPA.

http://www.dallasnews.com/sharedcontent/dws/spt/hockey/stars/stories/121804dnspoheikacol.33e71.html

What really stood out to me was the player's 24% salary cut - which seemed huge until you look @ the numbers.  The benefit to the league dramatically falls within 3 years. 

After reading this, I've come to the conclusion that there is NO WAY we're going to have hockey in 2005! :(

Posted: Dec 23 2004, 10:06 AM by Scott Dockendorf | with no comments
Filed under:
Send emails using ASP.NET & WebHost4Life.com?

Has anyone been able to send emails programattically using ASP.NET on a website hosted at for the shared hosting company WebHost4Life?

Their tech support has been anything but helpful, providing ZERO guidance on what utilities to run ON THEIR SERVERS, rather stating that they do not offer any programming support! 

I've tried using System.Web.Mail, ASPMail, and CDONTS to no avail. 

If anyone got this to work, please let me know how! 

Thanks in advance! 

- Frustrated Scooter

Posted: Dec 23 2004, 09:42 AM by Scott Dockendorf | with 11 comment(s)
Filed under:
NHL Season to be decided by Jan 14th

OK, I know I haven't had many posts lately, but things at Telligent are a boomin!

For the NHL fans that are going nuts like me, ESPN just put up an article that states that if there is no resolution by Jan 14th, Gary Bettman will ask the NHL board of governors to cancel the entire 2004-2005 season.
http://sports.espn.go.com/nhl/news/story?id=1951882

This was inevitable, and part of the negotation process, I'm sure.  But, if it works to get talks back up and running, that's a good thing IMO.

This was an interesting item from the article:

"No North American sports league has lost an entire season to a labor dispute, and the Stanley Cup has been awarded every year since 1919 when a flu epidemic wiped out the final series between Montreal and Seattle."
Personally, I think that the owners and players won't budge from their stances, and all play will be lost for the season.  Makes you wonder if the NHL will ever come back in it's current state.
Posted: Dec 22 2004, 11:26 PM by Scott Dockendorf | with no comments
Filed under:
Gamers: EA & NFL Reach Exclusive Licensing Agreement

http://www.gamespot.com/news/2004/12/13/news_6114977.html

Gamers - Say goodbye to any competition for the Madden series!  EA Sports has reached an exclusive rights agreement with NFL & Players, Inc for 5 years.  During this time, EA receives solve rights to NFL teams, stauioums, and players.  This affects action, simulation, arcade-style, and manager games made for PCs, consoles, and handhelds (Nintendo DS Sony PSP.  The only platforms NOT covered are mobile phones or internet-based games!

 

NHL Owners Just Don't Get It!

I was optimistic until now... I'm now convinced that we're not going to see any NHL for a long time, even into next season. 

Check out Scott Burnside's great article on the situation:
http://sports.espn.go.com/nhl/columns/story?id=1946499

From the article:
"Bettman followed the predictable path of rejecting the players' association's proposal of last week and followed it with an equally predictable counterproposal that included a salary cap, which was predictably rejected by the players' association. "

IMO - the Owners made a senseless offer that did nothing to help the situation.  They basically took the NHLPA's offer, and added a 34.6 to 38.6 salary cap!!!!!! 

I LOVE Scott's last sentence...
"What remains between them, a seemingly immovable object, is this notion of who is responsible for the future of the game. Perhaps the next step toward putting aside children's games is the public acknowledgement that this is the owners' mess and that it is up to the players to clean it up."

Way to go Scott!  Keep up the great writing...

Say Goodbye to the NHL Season

http://sports.espn.go.com/nhl/news/story?id=1945492

Well, it looks like the NHL season is done! The league is set to reject the NHLPA's offer, but should provide a counteroffer sometime today.

Both sides are vehemently sticking to their beliefs regarding a salary cap.  The NHL will only accept one, the NHLPA has no interest in putting one in place. 

I'm curious if the NHL's proposal includes any concessions on their part, or if it will simply echo it's hardline stance since the lockout began, over 89 days ago!  At least the NHLPA seem interested in barganing (probably because they've felt the pain of missed paychecks).  Personally, at least the NHLPA is trying to make something happen.  I'll reserve judgement until we see what the owners have to respond with.

Personally, I just want them to work together to come to a solution.  There are things that need to be changed on both side, and I don't really favor one or the other.  I'm just sick of the constant bickering, personal attacks, and non-movement (last week's proposal was the 1st since September).  I know it's "utopian view", and isn't realistic - but lock yourselves in a room and don't leave until a deal is done!!!!!!  In the immortal words of Charlie Brown - AARGH!!!!!!!!!

GAME ON!  PLEASE?!?!?!?!

 

Posted: Dec 14 2004, 09:32 AM by Scott Dockendorf | with no comments
Filed under:
NHL Lockout Update: Players offer 24% Paycut - Owners to Respond Next Tuesday

I don't know about you, but the NHL lockout is KILLING me!!!!!  It's such a shame that this has to happen to such great game, because the longer this thing drags on, the more fans they will have to try and win back.  It's not even like Hockey is nearly as popular as Football, Basketball or Baseball either - this lockout has made people realize that they can live without hockey, and that STINKS! 

Well, after months of silence (why can't they lock themseleves in a room and work out a deal), the NHLPA met with the NHL yesterday to discuss the NHLPA's recent proposal.   It appears that the players have finally made a full fledged attempt at saving the season, by providing many concessions,including a 24% paycut.

Even better yet - you can read the NHLPA's proposal here - highlights (HTM) or full (PDF)

Here's Commissioner Gary Bettman's response

As long as they are doing this in good faith and are willing to work out a deal, I'm happy.  To me, it's been nothing but chest pounding, muscle flexing up to this point.

12-1-2004 Talk Follow-Up: Test Driven Development & .NET (Plano .NET User Group)

I want to thank everyone for taking the time out to attend 12/1/2005’s PDNUG meeting, where I presented a talk about “Test Driven Development & .NET”.    I was psyched to see everyone who attended, and hoped that the session helped those who are interested in TDD in any fashion.  I truly believe in this approach, and I hope that was evident during the talk.

 

Downloads & References:

 

 

Follow-Up from Q&A:

Here are some Follow-Up Items as a result of questions & comments raised during and after the talk:

 

#1 - Nunit & Testing Multithreaded Objects (I did not find out this person’s name)

 

Q:   How does NUnit play/work with multithreaded objects?

 

A #1:   NUnit - In Nunit 2.1, the Nunit.Framework.Assert method does not respond well while in a threaded environment.  .NET Rock Star – Peter Provost found a way around this problem by catching an exception from on the worker thread, and pass it back to the main thread (which will report successfully to NUnit).  Check out his blog post @ http://www.peterprovost.org/archive/2004/11/03/2051.aspx .

 

A #2:  Check out MBUnit, http://mbunit.tigris.org/ , which has built-in support for multi-threaded objects.

 

 

#2 - Re: Xml Configuration Settings for TestSuites (From Rich Denis)

 

Q:   I use the .NET System.Configuration.AppSettings class to retrieve settings in an XML file.  Where do I put this logic in a Nunit suite.

 

A: During the session, I documented that you can place these entries in NunitGui’s app.config file, since NUNITGUI.EXE is a .NET assembly.

 

However – Rich Denis told me about an easier method:

 

 “If you have a MyTestAssebmly.dll then you create a MyTestAssembly.dll config file and place it in the same folder as the test assembly.  This is a bit different than I told you last night since I said to make a config file for the tested assembly not the testing assembly.  I hope this helps.”

 

It does work – like a champ!  Here is a sample C# NUnit Test with a config file.  Follow these steps to verify:

 

  1. Create a C# Class Assembly
  2. Set a reference to Nunit.Framework.dll
  3. Add an app.config file, and change the file to reflect the following: 

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

      <appSettings>

            <add key="MySetting" value="MyValue"/>

      </appSettings>

</configuration>

 

  1. Add the following code to the Class1.cs file

using System;

using NUnit.Framework;

 

namespace HelloConfig

{

       public sealed class ConfigReader

       {

              public ConfigReader()  {

              }

 

              public static string GetConfigSetting(string key)  {

                     return System.Configuration.ConfigurationSettings.AppSettings.Get(key);

              }

 

       }

 

       [TestFixture]

       public class ConfigReaderTestFixture

       {

              public ConfigReaderTestFixture() {

              }

 

              [Test]

              public void GetConfigSettingPostiveTest()  {

                     string key = "MySetting";

                     string expectedValue = "MyValue";

                     string actualValue = "";

 

                     actualValue = ConfigReader.GetConfigSetting(key);

                     Assert.IsTrue(expectedValue == actualValue,

                           String.Format("Values were NOT equal, expected '{0}' actual '{1}'", expectedValue, actualValue)

                           );

              }

 

              [Test]

              public void GetConfigSettingNegativeTest()  {

                     string key = "SettingNotThere";

                     string expectedValue = "MyValue";

                     string actualValue = "";

 

                     actualValue = ConfigReader.GetConfigSetting(key);

                     Assert.IsFalse(expectedValue == actualValue,

                           String.Format("Values were equal the keys exist.  It should have NOT been present., expected '{0}' actual '{1}'", expectedValue, actualValue)

                           );

              }

 

       }

 

}

  1. Build the project. 
  2. Now manually move the app.config into the bin\debug folder with the name “HelloConfig.dll.config”
  3. Now test with NUnit.  You should find that both tests pass successfully (i.e. the values were and were not read from the config file as expected)

 

Thanks Rich!

 

 

#3 - MBUnit Rocks!  If you want Assertions – you got ‘em! (from Rich Denis)

MBUnit is another TDD xUnit Framework, which is now part of the TestDriven.net VS.NET add-in.  It provides an extremely rich Assertion model, including Arrays, collection, compiler, serialization, Security, Reflection, Text, Performance, Data, XML, web

 

Check out these links

 

Thanks Rich!

 

#4 – Various TDD/Process-Related Questions (From Vince Blasberg)

Here are my takes on Vince’s questions – please add comments to this post, if you have answers

 

Q: Will the code be optimized at all in release mode?

A: Your test suite (class library) will be optimized (between Debug & Release builds) as normal, but nothing outside of that.  As we discussed, keep in mind that your unit test code should execute in your environments, only as a test.  This code should not be executed on a regular basis.   Because of this, you shouldn’t have to worry about optimized code (boy that statement really sounds funny!)

 

This kinda leads me to a recommendation mentioned during the talk - storing all Test & Test Suites in a completely separate assembly, instead of mixing TestSuites with production code, in the same assembly.  In the example of deploying to production, you could deploy all your code, execute your test (potentially in NAnt NUnit2Report task), and interrogate on the test results.  If all tests pass, then you could remove your test suite assembly from production.  If you encounter problems in production, you could request a change control to place the test harness back in production, and re-run your tests – to try and determine what might have caused the problem.  Just a way to keep your production environment “cleansed” of obsolete or non-production code.

 

Q: Won’t some of the in-function tests prevent the optimizing compiler to inline some functions since they will add code and push the IL code past the 32 byte auto-inline mark?

A: Yes, it would.  Good observation.

 

Q:  Are the NUnit tests limited to just two, a one-to-one comparison and an exception expected?

A:  Not at all.  My demos showed just a single one-to-one comparison, and I’ll change that for the next talk.  J  The test structure is completely up to you, and should be driven by your functional & technical requirements, as well as security intrusion attempts.  You really have no limits here. 

 

Q: Developers must be good at adding verifications where needed.  Can these unit test products perform tests in the same call to make current non-unit testing verifications part of the test?  In other words, we can check for null parameters and IsLoggedIn type functions but the logical tests that must be done must be duplicated to perform unit testing.   Unit tests must be reproduced every time a function is overloaded, making the test coding process work every time.  Making an attribute on a function to insert and perform certain tests may help somehow and avoid repetitive test coding.  Without something simpler, changed function signatures and new overloads cause more work that may not get tested unless the developer looks at a prior function and add everything as they should.

A:  Good observations.  Yes, if a developer adds a new overloaded method, it is their responsibility to write the associated tests for this new method.   

 

Q: After a long night, if a developer wanted to make all green lights instead of red ones on the next morning’s build, all they have to do is comment out tests for QA to see a shippable product.  ( Bad )

A:  Yes, this would be very bad.  I can’t deny that there still is a little human element to TDD, but isn’t’ there in many development projects. J  In Extreme Programming, this should be caught due to the framework’s pair-programming model.

 

There are software solutions to help solve this problem (I believe).  Basically, the way to solve this automatically is to place a threshold level for the code coverage results calculated during the tests.  If your tests did not meet the code coverage threshold amounts, then the developer couldn’t check in the code.  There are problems with that idea, because the threshold values are a moving target depending on where the developer is in the process.   I know there is logic like this in VSTS, and there might be in SourceGear’s Vault (not sure at this time).   I don’t know if PVCS or other popular source control applications have similar capabilities. 

 

 

 

More Posts Next page »