lördag 28 mars 2009

Learning Unit Testing and TDD

Hello world!

As you might have noticed, this blog don't get updated too often. I thought I'd make a change to that and blog about TDD and Unit Testing from a newbies perspective. I don't think I have a full overview of TDD and Unit Testing, so alot of the statements and topics discussed here will probably be false, myths or otherwise wrong. My intent is then to look back at this post in the future when I feel that I've mastered TDD and Unit Testing (if I ever do) and see how much smarter I became... or something along those lines.

The reason I want to learn Unit Testing is because:
  • I believe in learning new things evolves you as a person.
  • I believe that Unit Testing can make your code cleaner and better.
  • I believe that Unit Testing can help decrease technical debt, a common problem.
  • I believe that Unit Testing is part of agile processes, which I also want to learn.
  • I want to see what the fuzz is all about.
  • I like challanges, especially when I've beaten the challange.
  • It's development, right? What else can I say? :)
So far I haven't really found any good places to start learning Unit Testing & TDD. I've looked around MSDN for articles but somehow I feel I am missing out on the big picture. 

There are numerous questions going on in my head at the same time;
  • Is Unit Testing applicable on Game developement?
  • Where do I start? 
  • Is Unit Testing synonymous to TDD?
  • What is a Hello world! Unit Test example like? 
  • How do I apply Unit Testing in practice, in live projects? 
  • What can be Unit Tested, and what should be Unit Tested?
  • How can I come up with an sample project that can and should be Unit Tested?
Currently I am still searching for a place to start. Working with Unit Tests at MSDN is the place I'll spend my time this afternoon before I go visit my girlfriend off town. I have still to come up with some simple unit testing project and work with it, to get my toes wet. If anyone out there reads this and has the knowhows, please help me get up to speed if you care. It would really be apprechiated :) 

Right, I'm off. 
I have laundry to take care of and after that I'll try to get more focus on Unit Testing.

måndag 22 september 2008

Windows Application Development Series 1

Hello world.

I haven't really contributed to application development at all in my past. I have mostly been coding games, game engines, experimenting with software design and patterns, creating simple tools such as map editors and so on. One thing that came to me a while ago was that it would be nice to learn how to write proper applications. You know, stuff that actually fulfills a purpose to an everyday computer user.

Windows Application Development Series 1
Okay, so here I sit and wonder about what to write. Let's start with this; As an aspiring game programmer, you are often faced with a challange to write small game clones such as Pong, Tetris and perhaps Pacman to learn, and gain experience, about game programming. Now, I must say I haven't done Tetris or Pacman (I did do Pong though). I still think I understood the purpose of those annoying "small challanges". In fact, I think it is a good place to start for new game programmers.

But what about application programming? Is there a 'Notepad-Pong' version for us who want to create everyday applications? I haven't found any such tips, that is for sure, so I threw a question at stackoverflow asking people about various challanges that would be nice for a newbie application developer.

I must say I got quite nice responses and I chose to create a simple file encryptor. At the bare minimum, the application should handle two different algorithms, write and read encrypted data to/from file and finally have a simple user interface (I chose AES and DES, two synchronous encryption algorithms).
  • I have completed implementing encryption/decryption of AES and DES. Also, I will be looking into creating a system for people to write their own algorithms to use within the application.
  • File I/O is currently supported, but I need to create a proper file format to allow for different extensions from third party developers. In fact, all is handled by streams, which means that I should write a library so other developers can benefit from this for other uses. Perhaps encrypted internet chat, or plugins to their own software.
  • I haven't made any nice user interface. I want the application to be as slim and easy for the user as possible. I am thinking adding items to the right click menu in windows along with an "archive program" to view/process encrypted content.
All this blogging is bogging me down. I will keep news updated.