DCSIMG
June 2009 - Posts - SRL Group

SRL Group

This blog is about Team System, QA and Development methodologies and more...

VSTS Resources

Team System Bloggers

June 2009 - Posts

What Is A Good Build Machine?

When I come to work with customers on builds first I ask where the build machine is.

Most chances that I will get one of the following three answers:

  1. It is on my Team System server.
  2. It is on my computer.
  3. It is on one of the developers computer.

All three situations are wrong when it comes to build machines.

What is a good build machine and where to install it?

My opinion is to put it on a “clean” computer that has no more then the minimum that is required for the compilation of the application and for running all the required tests.

The required tests are first all the Unit Tests made for the target application, in addition to that a team can require that more tests for example “Sanity Tests” will be executed as well.

So what is the minimum that is required for this “clean” computer?

The minimum is all the applications, DLLs, Compilers etc. when it comes to software and the minimum hardware that is required for the compilation.
When it comes to tests you will need to have the “Test Engine” installed on the build machine too.

It is important to keep the build machine has clean as possible, so when the build fails you will know that the cause doesn’t lies in something that is installed on the computer.

Back to the answers I get, it is now obvious why all three situations are wrong, all three situations are build machines that runs on a computer with a different purpose.
The first one is a server that runs the TFS and all its additions, and the other two are development computers.

What do you think?

Have Fun!!!

This post was also published in my personal blog here.

Error: TFS55030 When Running RenameDT Command

“ERROR: TF55030: Rename Data Tier failed.  Please verify that the supplied Data Tier name is a valid Team Foundation Data Tier name, that the Data Tier can be accessed on the network and that you have administrative rights.”

Most chances that the problem is because you have shutdown your old TFS.

In order to fix the problem just load your old TFS and rerun the command.

In case that doesn’t help run the following command line:

Set TfsDetailedErrors=1

Rerun the RenameDT command, now you will get more details on the error so you can troubleshot the problem.

Have Fun!!!

This post was also published in my personal blog here.

How To Create A Branch In Team System 2008

Before I start with the how to create a branch step by step guide, I like to remind that creating a branch should be done by a SCM (Software Configuration Management) plan and not when ever you “feel” like creating a branch. It is very important to manage your branches or else you will have a big pile of branches that no one knows there purpose.

After saying that here is the step by step guide:

The demonstration will be for a demo project called "Web Sites".

Step 1: Right click the source folder that is candidate for Branch.

Step 2: Choose the Branch option

clip_image002

Step 3: Change the "Target" field to contain the Source Control path for the new branch.
By the SCM (Software Configuration Management) plan of this demo the path should contain the version number of the branch and it should be located in the "Test" folder.

Step 4: Make sure that the "Branch from version" field shows "Latest Version" in order to "branch" from the latest available version of code.

Step 5: Click the "OK" button.

clip_image004

Note: The “Create local working copies for the new branch” checkbox is optional, if checked it will automatically creates a new folder for the branch locally.

Step 6: Now you have the branch ready in the "Test" folder with the name "3.0 Web Sites" but it is a local copy and will not be shown by other users until you will check in the changes. Right Click the new Branch and choose the "Check In Pending Changes…" option.

clip_image006

Step 7: Add your comment and click the "Check-In" button

That is all, you have a new branch.

Have Fun!!!

This post was also published in my personal blog here.

New Blog Announcement

I like to announce a new blog I have.

Until now I have posted to the SRL Blog, now I have just opened a new blog, you can see it here.

The topics I will post there are the same topics, the blog is about Team System, QA methodologies, Development methodologies and more...

I hope you will keep enjoying my posts.

Have Fun!!!

WMI Scripts For Changing Physical Path Of IIS Virtual Directory

A customer asked me to write him a script that will set physical directories for his IIS virtual directories.

What was the motivation for that?

  • The customer worked with none dynamic URLs.
  • The customer started to work with SCM (Software Configuration management) plan.
  • Part of the SCM plan is a way to manage versions.
  • The customer is working with source control as a result he gets to situations where developers works on different versions simultaneously.

In simple words you get to a situation where you work on the same web project from different locations on your hard drive.

The problem is that you can have only one virtual directory for each URL in IIS.

Now that the motivation is clear lets look at the solution: I needed to create a batch file that will automatically change the physical mapping of the virtual directories.

In order to get the job done I used a WMI scripts.

The first thing I did was to search for a solution in Google just to find out there are many results and none to fit what I needed.

After a few phone calls to good friends of mine: Leon Lengleyben and Roy Elimelech we got to the solution.

  • To get all the parameters we used the sample in here.
strComputer = "LocalHost"
Set objIIS = GetObject("IIS://" & strComputer & "/W3SVC/1/ROOT/[Virtual Directory Name]")
 
Wscript.Echo "Access Flags: " & objIIS.AccessFlags
Wscript.Echo "ASP Errors to NT Log: " & objIIS.AspErrorsToNTLog
Wscript.Echo "Access SSL Flags: " & objIIS.AccessSSLFlags
Wscript.Echo "ASP Exception Catch Enabled: " & _
    objIIS.AspExceptionCatchEnable
Wscript.Echo "Anonymous Password Sync: " & objIIS.AnonymousPasswordSync
Wscript.Echo "ASP Log Error Requests: " & objIIS.AspLogErrorRequests
Wscript.Echo "Anonymous User name: " & objIIS.AnonymousUserName
Wscript.Echo "ASP Processor Thread MAximum: " & _
    objIIS.AspProcessorThreadMax
Wscript.Echo "Anonymous User Password: " & objIIS.AnonymousUserPass
Wscript.Echo "ASP Queue Connection Test Time: " & _
    objIIS.AspQueueConnectionTestTime
Wscript.Echo "Application Allow Client Debugging: " & _
    objIIS.AppAllowClientDebug
Wscript.Echo "ASP Queue Timeout: " & objIIS.AspQueueTimeout
Wscript.Echo "Application Allow Debugging: " & objIIS.AppAllowDebugging
Wscript.Echo "ASP Request Queue Maximum: " & objIIS.AspRequestQueueMax
Wscript.Echo "Application Friendly Name: " & objIIS.AppFriendlyName
Wscript.Echo "ASP Script Engine Cache Maximum: " & _
    objIIS.AspScriptEngineCacheMax
Wscript.Echo "Application Isolated: " & objIIS.AppIsolated
Wscript.Echo "ASP Script Error Message: " & objIIS.AspScriptErrorMessage
Wscript.Echo "Application OOP Recover Limit: " & _
    objIIS.AppOopRecoverLimit
Wscript.Echo "ASP Script Error Sent to Browser: " & _
    objIIS.AspScriptErrorSentToBrowser
Wscript.Echo "Application Package ID: " & objIIS.AppPackageID
Wscript.Echo "ASP Script File Cache Size: " & objIIS.AspScriptFileCacheSize
Wscript.Echo "Application Package Name: " & objIIS.AppPackageName
Wscript.Echo "ASP Script Language: " & objIIS.AspScriptLanguage
Wscript.Echo "Application Root: " & objIIS.AppRoot
Wscript.Echo "ASP Script Timeout: " & objIIS.AspScriptTimeout
Wscript.Echo "Application WAM Clsid: " & objIIS.AppWamClsid
Wscript.Echo "ASP Session Maximum: " & objIIS.AspSessionMax
Wscript.Echo "ASP Allow Out-of-Process Components: " & _
    objIIS.AspAllowOutOfProcComponents
Wscript.Echo "ASP Session Timeout: " & objIIS.AspSessionTimeout
Wscript.Echo "ASP Allow Session State: " & objIIS.AspAllowSessionState
Wscript.Echo "ASP Buffering On: " & objIIS.AspBufferingOn
Wscript.Echo "ASP Codepage: " & objIIS.AspCodepage
Wscript.Echo "ASP Enable Application Restart: " & _
    objIIS.AspEnableApplicationRestart
Wscript.Echo "ASP Enable ASP HTML Fallback: " & _
    objIIS.AspEnableAspHtmlFallback
Wscript.Echo "ASP Enable Chunked Encoding: " & objIIS.AspEnableChunkedEncoding
Wscript.Echo "ASP Enabled Parent Paths: " & objIIS.AspEnableParentPaths
Wscript.Echo "ASP Track Threading Model: " & objIIS.AspTrackThreadingModel
Wscript.Echo "ASP Enable Typelib Cache: " & objIIS.AspEnableTypelibCache
Wscript.Echo "Authentication Flags: " & objIIS.AuthFlags
For Each strError in objIIS.HttpErrors
    Wscript.Echo "HTTP Error: " & strError
Next
Wscript.Echo "Authentication Persistence: " & objIIS.AuthPersistence
Wscript.Echo "HTTP Expires: " & objIIS.HttpExpires
Wscript.Echo "Cache Control Custom: " & objIIS.CacheControlCustom
For Each strPics in objIIS.HttpPics
    Wscript.Echo "HTTP Pic: " & strPics
Next
Wscript.Echo "Cache Control Maximum Age: " & objIIS.CacheControlMaxAge
Wscript.Echo "HTTP Redirect: " & objIIS.HttpRedirect
Wscript.Echo "Cache Control No Cache: " & objIIS.CacheControlNoCache
Wscript.Echo "Cache ISAPI: " & objIIS.CacheISAPI
Wscript.Echo "Logon Method: " & objIIS.LogonMethod
Wscript.Echo "Content Indexed: " & objIIS.ContentIndexed
For Each strMap in objIIS.MimeMap
    Wscript.Echo "MIME Map: " & strMao
Next
Wscript.Echo "Create CGI with New Console: " & _
    objIIS.CreateCGIWithNewConsole
Wscript.Echo "Path: " & objIIS.Path
Wscript.Echo "Create Process as User: " & objIIS.CreateProcessAsUser
Wscript.Echo "Pool IDC Timeout: " & objIIS.PoolIdcTimeout
Wscript.Echo "Default Document: " & objIIS.DefaultDoc
Wscript.Echo "Default Document Footer: " & objIIS.DefaultDocFooter
Wscript.Echo "Realm: " & objIIS.Realm
Wscript.Echo "Default Logon Domain: " & objIIS.DefaultLogonDomain
For Each strHeader in objIIS.RedirectHeaders
    Wscript.Echo "Redirect Header: " & strHeader
Next
Wscript.Echo "Directory Browse Flags: " & objIIS.DirBrowseFlags
For Each strScriptMap in objIIS.ScriptMaps
    Wscript.Echo "Script Map: " & strScriptMap
Next
Wscript.Echo "Don't Log: " & objIIS.DontLog
Wscript.Echo "SSI Exec Disable: " & objIIS.SSIExecDisable
Wscript.Echo "Enable Document Footer: " & objIIS.EnableDocFooter
Wscript.Echo "Enable Reverse DNS: " & objIIS.EnableReverseDns
Wscript.Echo "UNC Password: " & objIIS.UNCPassword
For Each strHeader in objIIS.HttpCustomHeaders
    Wscript.Echo "HTTP Custom Header: " & strHeader
Next
Wscript.Echo "UNC User Name: " & objIIS.UNCUserName
Wscript.Echo "Upload Read-Ahead Size: " & objIIS.UploadReadAheadSize
  • To change a parameter we used the sample from here.
strComputer = "LocalHost"
Set objIIS = GetObject("IIS://" & strComputer & "/W3SVC/1/ROOT/[Virtual Directory Name]")

objIIS.[Parameter Name] = [New Value]
objIIS.SetInfo

Have Fun!!!

How To Get A File History In TFS Source Control Using Code

A project I am doing these days requires me to get file history changesets using the API.

Sounds like a simple task right?

Apparently there is not a lot of reference to that in Google, so after almost throwing my computer out of the window (More than once I most admit) I found the answer.

Add the following references to your using list:

using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
using System.Collections;
using System.Windows.Forms;

The example function is very simple it gets a change and shows message boxes of all the changesets that have a change for the specified file up to the change transferred to the method.

Note: Change the [Server Name] with your TFS name.

public void GetChangesetsOfFile(Change theChange)

    {  

      //Query History parameters

      TeamFoundationServer tfs new TeamFoundationServer
                   
("[Server Name]");

     
VersionControlServer VCServer =
                    (VersionControlServer)tfs.GetService
                    (typeof(VersionControlServer));
 

      int changeId = (theChange.Item.DeletionId != 0) ?
                   
theChange.Item.ChangesetId - 1 : 
                     theChange.Item.ChangesetId;

      ChangesetVersionSpec version = new 
                            ChangesetVersionSpec(changeId);

      ChangesetVersionSpec versionFrom = new
                          
 ChangesetVersionSpec(1);

      string path = theChange.Item.ServerItem;

 

      //Query History Command

      IEnumerable changesets = VCServer.QueryHistory(path,
               version, 0, RecursionType.None, null,
               versionFrom, LatestVersionSpec.Latest,
               int
.MaxValue, true, false);

 

      foreach (Changeset cSet in changesets) 
     
        MessageBox.Show(cSet.Changes
            [0].Item.ChangesetId.ToString()); 
     
    }

I hope I could help.

Have Fun!!!

New Codeplex project: “Team System Guides”

I am happy to announce a new Codeplex project that gathers Team System guides both for Team System 2008 and for Team System 2010.

You can see the site here.

All guides are in word or PDF formats so you can download and print them.

Have Fun!!!

When To Stop Testing An Application?

I have seen many answers to this question, all talking about matrixes, what should I test, How should I test etc.

Not many answers to this question talked about the overall process of development, the bigger picture…

The testing process is part of much bigger picture of development that involves the developers, testers, managers, stockholders, marketing and more.

Lets start with what stops the development in general, that will be the time to market of course, no product no matter how good it is will worth anything if it wont be sold.

When we come to manage a project we slice the time from the day we start the project until the day we need to deliver, these slices will contain planning, development, testing and more depends on the methodology we are using.

Now we got left with the testing slice in the project, the best thing to do with it is to develop a good testing plan that will use all the testing methods, risk management, resources management, bugs management, matrixes etc.

One thing that I recommend without getting in to the methodology that you will use is when there is a code freeze date have enough time for one more regression cycle to reduce the chance of having a show stopper bug in one of your main functions when the product is released.

We can see that the answer to the question “When to stop testing an application?”  is very simple, when the time runs out.

When do you stop testing?

Have Fun!!!

How To Manage A Project When Politics Involved

There where times when I believed that managing a good project involves only pure professionalism, but with time I found out that a good project manager should also have high social skills as well in order to be a good project manager or in that case a good manager in general.

Lets say that you need to deliver a project but the expected result varies depends on the stakeholder you ask, what would you do than?

This is a very difficult situation when you are about to fail no matter what the results of the project will be.

My advice for you in these situations is to gather all the stakeholders in one room or at least in a meeting that will gather them all and to decide together on the scope and objectives of the project.

The result of the meeting if managed correctly can bubble up all the disagreements and solutions will start to arise.

Hopefully that will solve the problem, it is important to put objectives for this meeting and to send it in advanced to all the participants so the time will not be spent on explaining the goals of the meeting.

Have Fun!!!