Starting Tiler: SCRUM & TFS11

For developing Tiler I choose Windows 8 as OS. I’ve installed it on a separate partition on my personal pc so I could use Hyper-V for running virtual machines. Microsoft has released a cool Virtual Machine with demo scripts to try out VS11( (Visual Studio 11 Application Lifecycle Management Virtual Machine and Hands-on-Labs / Demo Scripts) and it works really nice on Windows 8.

If you don’t want the hassle of installing it to a second partition you can also install it as a Virtual Machine and then do a native boot. Scott Hanselman blogged about it: How To Guide to Installing and Booting Windows 8 Consumer Preview off a VHD.

I have to say I was first a little lost in the new interface. But after looking around for a bit I’m starting to like it. There are a lot of improvements compared to the developer preview. One blog that helped me with getting started is Getting around in Windows 8. Especially the keyboard shortcuts help when using Windows 8 on a regular, not touch based, pc.

The installation process of Team Foundation Server 11 and Visual Studio 11 Ultimate went smoothly. One thing that bugged me was that I couldn’t select the options I wanted to install with Visual Studio. All languages and options are installed by default. But there is already a future request for Microsoft to change this!

Setting the scene

During the development of Tiler I will try to highlight as many new features of both Visual Studio and Team Foundation Server as possible. The first things you will probably notice are some big interface changes in both Team Foundation Server and Visual Studio.

In Team Foundation Server, the web interface has undergone a complete restyle. I have to say I’m really happy with it. Some of our testers and managers who are using the web interface of TFS 2010 complain regularly about it. As you can see the new interface is a lot nicer:

Local workspaces

One other thing that is greatly improved in TFS 11 is the support for local workspaces.
Previously the server was leading and every time we wanted to checkout an item we
had to report this to the server. Simple things like editing your web.config from
notepad are a real pain and can only be done when the file is checked out by Visual
Studio.

TFS11 adds local workspaces. Files are no longer read only and you can make changes
locally without contacting the server. The new Pending Changes window supports this
local workspaces idea by automatically detecting changes on your file system. The
general rule is that if you are having less then 100,000 files and don’t need a
locking workflow, local workspaces is the best choice.

When launching Visual Studio, the biggest change is the color scheme. Personally, I like the ‘black and white’ style. When coding, the IDE is less distracting and I can focus more on my code and on what’s really important.

Starting Tiler

Creating a new Team Project is easy. Just hit Connect To Team Foundation Server and connect to your local server and then use the new Team Explore to create the project.

SCRUM & TFS

The new Web Interface for TFS has some nice capabilities for configuring our SCRUM
project. You can configure your project schedule, backlog and sprints.

First of all I’m going to define the releases and sprints. I’ve chosen to configure
only Release 1 with a duration of three months and three sprints which each take one month. I can always add more when it’s needed.

Now it’s important to create our product backlog and see how far we can come in
those three months.

Product backlog

When thinking about the product backlog for Tiler, I have to see myself as the product owner. What are the most important features and how can I make sure that I can have some working code in as little time as possible.

Why Scrum?

SCRUM is one of the Agile Project Management process. Microsoft is more and more
supporting the whole Application Lifecycle Management and SCRUM is an important
part in it.

SCRUM has a couple of important concepts.

First off all, there is the product owner. He represents the end users and other stakeholders. The product owner defines what’s important and which features should be developed.

While a product owner is the ‘user-side’  of scrum, the ScrumMaster is responsible for the team. He keeps track of the whole SCRUM process and makes sure the team can be as productive as possible. If there are any problems the ScrumMaster will try to fix them.

In a waterfall approach we would now be starting with defining all the features that are necessary for Tiler. This would be a tedious process that will take a lot of time. One of the biggest problems is that on most projects it’s impossible to know everything upfront. While developing Tiler, the requirements will get clearer. Scrum is an agile process, which means you anticipate change and deal with in the best way possible.

That’s why scrum uses the idea of a product backlog. A product backlog is a prioritized list of desired features or changes to the product. Everything on the backlog should have an actual value for the end user. This helps with making sure that we build the most important things first and that we don’t build anything that’s not interesting for a customer.

A scrum team functions trough sprints. Sprints are short periods of time where a team takes the most important items from the backlog. A sprint starts with a meeting where the product owner explains the top items from the product backlog to the team. The team then splits those items in manageable tasks and creates a sprint backlog. During the sprint the team communicates often with each other trough a daily meeting. At the end of the sprint the team looks back at what they have accomplished and tries to improve what they are doing.

For Tiler I want to use some concepts of SCRUM. I’m going to create a product backlog
and a sprint planning to give some direction to the project and to make sure I have
something working as fast as possible.

I came up with the following items as a start:

The idea is that I want to get a working interface as fast as possible. If a player can start a new game and see some tiles on his screen we have a foundation for our other features. Picking a tile if you don’t have any possible moves is something that’s easily added once a basic UI is in place. After that it would be nice if a player could make a move!

Once we have finished these features you can play a nice game of Tiler on your own.  After that we should get some user registration in place. Some way to login and invite other players.

And then we get to the computer player. Developing the AI for Tiler will be quite a challenge and I’m planning on doing this in small, discrete steps. After the AI is somewhat in place, the player can ask for hints while playing a game. Starting a practice game will then finally allow me to secretly use my phone while playing against my wife so the AI can help me beat here.

At least, that’s the basic idea I have now. The whole idea of SCRUM is that requirements will definitely change. While working on Tiler I’m sure the requirements will become more elaborate and I will discover some things I never thought of. For now, I have at least a rough path in mind that can guide me while developing Tiler. Having a basic UI in place as fast as possible will make sure that I don’t get dragged in complicated but unusable AI behavior.

Planning Sprint 1

For the first sprint I want to start with the top two items of the product backlog. In TFS this means I drag and drop the first two items to Sprint 1. The iteration path in the product backlog is automatically updated.

When looking at the contents of Sprint 1, there is a new button at the top:

Capacity planning is a new feature in Team Foundation Server that helps you with defining how much time each team member can spend on your project. These numbers are then used to calculate the statistics for your sprint so you can easily see if some team members have to much (or to less!) work assigned to them. If you notice that a sprint has to much work, you can easily reschedule by moving items to the next sprint and all team member statistics will update in real time.

For now I have broken down the two backlog items for Sprint 1 into my sprint backlog:

Next time, I will start working on ‘Create basic architecture’ so I can get started on developing Tiler.

TechQuiz Question 3: Nullable boxing

Why does Foo<int?> throw an exception?

   1:  static void Foo<T>() where T : new()
   2:  {
   3:      T t = new T();
   4:      Console.WriteLine("ToString: " + t.ToString()); 
   5:      Console.WriteLine("GetHashCode: " + t.GetHashCode()); 
   6:      Console.WriteLine("Equals: " + t.Equals(t)); 
   7:      Console.WriteLine("GetType: " + t.GetType());
   8:  }
   9:   
  10:  public void Main()
  11:  {
  12:      Foo<int>();
  13:      Foo<int?>(); // Exception thrown
  14:  }
 

Answer

int? is a nullable type. T t = new T(); returns a Nullable<int> with a value of 
null. If we have a look at the definition of Nullable<T> we find the following:

   1:  [Serializable]
   2:  public struct Nullable<T> where T : struct
   3:  {
   4:      public Nullable(T value);
   5:   
   6:      public static explicit operator T(Nullable<T> value);
   7:      public static implicit operator Nullable<T>(T value);
   8:   
   9:      public bool HasValue { get; }
  10:      public T Value { get; }
  11:   
  12:      public override bool Equals(object other);
  13:      public override int GetHashCode();
  14:      public T GetValueOrDefault();
  15:      public T GetValueOrDefault(T defaultValue);
  16:      public override string ToString();
  17:  }

As you can see, Nullable<T> overrides ToString, GetHashCode and Equals. Calling these methods on a nullable type is save will give you a nice result.

But GetType is another story. GetType only exists on the base class Object and cannot be overridden. When calling GetType on a Nullable<T>, your item is boxed to Object.

   1:  int i = 123;
   2:  // The following line boxes i.
   3:  object o = i;  

If you have a Nullable<T> with a value of null and you box it to object you get null 
back. Think of it like having a null value being boxed to a null reference. And calling GetType() on null gives you an exception!

Welcome to my blog

Hi there, welcome to my new blog. This is a short introduction to who I am and what this blog is about.

Who am I?
 
My name is Wouter de Kort. I’m a developer living in the Netherlands and I’m working as a Software Architect and Technical Trainer for the .NET platform.
I’m active on Stackoverflow to keep myself up to date and I try to read as much as possible about development with a focus on architecture, .NET, unit testing and the entity framework.
So why this blog?
 
I’m starting this blog to share some of the things I learn during my day-to-day job for a reference for myself and others. I also want to use it to get some feedback on ideas I’m working on and I hope it will become an active place for sharing ideas.
What not?
 
This blog will mostly be about technical content, not about personal stuff.