Back in late 2006 I wrote my most ambitious JavaScript/game project so far: TankWar Online, which as you may guess from the name was about tanks, shooting stuff, and it had a real-time online game mode – as far as I know, the first such ever in a JS based game. Originally the game was made for an older version …
Unit testing 4: Mock objects and testing code which uses the database
After learning to write tests and some good testing practices, it’s now time to look at mock objects. When testing a class which needs an instance of another class to work, you do not want to depend on the other class too much. This is where mock objects come in – a mock object is a “clone” of an object, …
Unit testing 3: Writing tests for existing code
Now that you know what unit testing is and how to write and run tests, it’s time to look at writing tests in more depth. Today we’ll take an example class and write tests for it. We’ll also introduce some common testing methodologies.
How WidgetCity does a tile-based map using just CSS
My city building game, WidgetCity, displays the city as a table, each cell of a table representing one tile. The tile map is done purely using just CSS, and CSS classes. The map is also scrollable. How is this all done?
Unit testing part 2: Writing and running tests
Continuing from the unit test introduction, we will now continue and take a look at how to write tests and ways to run the tests.
Refactoring
Today I’d like to point out a bunch of good articles about refactoring – the process of improving code without changing the functionality. Sameer Borate has written four posts about the topic in his blog, and I encourage you to check them out: Refactoring: An introduction to PHP programmers Refactoring 1: Conslidate conditional expressions Refactoring 2: Extract method Refactoring 3: …
Unit testing: Introduction
Due to popular demand, I’ll be writing a bunch of posts on unit testing. In this post I’ll introduce unit testing: What it is, when it’s a good idea and when it might not be. I’ll also discuss a bit about what makes for a good unit test. Next week I’ll post a followup to this, which will be more …
What would you like to read about on CodeUtopia?
I haven’t had much ideas to write about lately, so how about this: You, my dear readers, get to tell me your favorite topic that you’d like to read/learn about. Is there a specific topic you would like me to write about? As long as it’s somewhat relevant to this blog’s past content, post your idea to the comments! – …
Should I try Git if Svn/CVS/other works for me?
I’ve been using Subversion for quite a while, and while it has some minor annoyances like complex merging, it never really bothered me. Then along comes Git, touting that it’s easy and that you’re stupid if you don’t use it. The technical stuff people said about it were impressing, but not enough to actually warrant trying it for me – …