Archive

Posts Tagged ‘microsoft’

SharePoint Upgrade Issue

January 7th, 2010

I have faced a weired issue while upgrading SharePoint Server 2007 to SP1 on one of our development servers. Whenever I executed WSS and MOSS upgrade installer, it gives me error “detection failed, this could be due to corrupted installation”. I tried following to overcome the issue but none of them actually worked:

  • WSS SP1 wizard failed
  • KB941422 execution failed
  • Force upgrade with psconfig command line “psconfig -cmd upgrade -force” failed
  • “stsadm -o upgrade -forceupgrade -inplace” also failed
  • Disintegrated server from farm but it still failed

Read more…

SharePoint , , , , , ,

Test Driven Development (TDD)

October 18th, 2008
Having heard a lot about TDD and all the benefits we could achieve using it, I got the chance to compare different methodologies and their pros/cons. Let’s start by looking at some of our practices:

  • We start our implementation by writing some code.
  • Code is being saved in some repository like CVS, VSS etc.
  • Checking code at regular intervals.
  • Doing unit testing using some methodology
  • Build preparation on daily/weekly depending upon our criteria
  • Acceptance testing

The above process keeps on moving until we have our final release or the project we are working on is finished. Broadly speaking there is two types of tests:

  • Tests focused on technical aspects
  • Tests focused on business

Using TDD, we will be only testing technical aspects. For business functionality QA personnel should take care of all the scenarios. In the following diagram, you can find a little about what the whole process all about:

TDD image

In principle TDD says “write test before you program” but it has a little more insight like:
•    It pressurizes the developer to think about the module he is to program even before he writes it.
•    Indirectly, it introduces a level of design before we even write something, which is of course very good.
•    Using automated testing, we are awared at all the times where does our code stand at any the times.

Red / Green Refactor

  • Red factor says, write a test that fails.
  • Green says write code to make the test pass.
  • Refactor says improve the design so that code works as well as test passes.

Frameworks available for unit tests automation are Junit, Nunit, Microsoft Test Environment. For .Net environment NUnit and Microsoft Test System both could be used. We need to look at the pros and cons of both which will be presented in the sections below.

Tips for writing unit test

  • Tests we write should just test the functionality, we should not start programming in our tests making them more complex and useless as well.
  • All tests should be independent in themselves.
  • Prepare and destroy test data on start and end of the test

Comparison of NUnit and Microsoft Team System
In the following a comparison has been presented between NUnit and MS Team System.

NUnit

Team System Unit Test

Its the de-facto standard for unit tests in .NET but not available out of the box

Out-of-the-box integration with Team Foundation Server.

Already exists for several years now and it’s very stable

Less users

New releases and new features on a regular basis

Its not free and only available for the Team System editions of Visual Studio. There’s also no stand-alone test runner available. When our project lead or our functional analysts like to run some integration tests, they have to install one of the Team System editions of Visual Studio in order to do so.

It has a rich set of  assertions and extending assertions is possible.

It’s evolving its set of assertions and has associated issues as well.

Very good integration with all editions of Visual Studio

Test runs are very slow. One of the most important characteristics of a good unit test is that it’s fast.

It’s open-source

Less features than other unit test frameworks like NUnit. Less assertions, no inheritance of test fixtures to name a few.

It’s available for both .NET 1.1, .NET 2.0 or higher

Only available for .NET 2.0 or higher.

.Net , , , , ,


Copyright © 2006-2011 W@rfi