Learning Unit Testing VII – Running and Redesigning

I can see this page 10 being a pretty big thorn in my side. After stating fairly clearly models can move up to their move rate under the ‘Moving’ heading, it then says A running fighter can move at double speed: 8″ rather than 4″, for example. This is going to have a fairly large …

IE9 Beta + VS2010, and a blog-reading tip

I’ve been experimenting with IE9 beta in work recently, and been finding it annoying when I go to show someone what I’ve been working on and need to refresh a page a couple of times after running it from Visual Studio 2010 before it ‘takes’, and will display the page and work properly. I’m getting …

Learning Unit Testing VI – Code Coverage

Before I get into finally finishing off that blasted page 10, I thought I’d go through a code coverage run to see how I was doing. Test Driven Development, see, everything should be covered by a test. 7.41% of the code is not covered by tests! I must be doing this wrong… Phew, that was …

Learning Unit Testing V – Refactoring Mistakes

I implied in the last post that I had made a mistake when I moved the MoveModel code into the Model class from the MovementManager class. Now, tests on the MovementManager class are actually testing functionality in the Model class. I also discovered that I am not properly testing the ‘GetDistanceFrom’ method with known data …

Learning Unit Testing IV – Diagrams and Mathematics

Programming uses maths. It’s hard to ignore sometimes, especially when modelling something that is inherently graphical and position based such as a game. I’ve decided to give the models three different position indicators – PositionX, PositionY and PositionZ. This will describe their exact position anywhere on the board – including on a ladder, a walkway …

Learning Unit Testing III – Emergent Design

So having seen the answers on my own StackOverflow question on TDD Design, I’ve decided to go ahead with the ‘emergent design’ crowd and see what happens. It appears that the refactoring and mid-stream redesigning is an integral part of the TDD process. It’ll all, of course, be described here (the process might be a …

Learning Unit Testing II – TDD vs. Traditional Design

As you can see, I’ve only done a small amount of Test-Driven Development so far. I notice that for small classes – so far, there’s only a very simple turn tracker – it’s easy to write a test first when there’s only very little code and no interaction with other classes. When things get a …

Learning Unit Testing I – The Basics

Right, so I’ve chosen my project and I’m ready to begin. I’ll skip past the introduction, straight to page 8 of the rulebook. The characteristics section. This is basically a class layout, nothing too heavy, so I’ll start off by creating Model.cs: class Model { public string Name { get; set; } public int WeaponSkill …

My Next Learning Project

I’ve long ago established that I learn best from doing things. Even if those ‘things’ never get anywhere, the journey through real problems helps me get a handle on what they are. My army list program got me through WPF, and then MVC. It’s faltered, since I don’t really have the enthusiasm for it that …

Validation and self-worth!

I had an answer accepted as the answer on Stack Overflow! I answered this question absolutely ages ago, not expecting it to go anywhere (the question had already been answered, but I felt it was a valid, different approach) but slowly, over the months, it’s been up-voted (until, I am pleased to say, it had …