Embracing TDD

Important information at the beginning :)

Roy Osherove is giving an hands-on TDD Masterclass in the UK, September 21-25. Roy is author of "The Art of Unit Testing" (http://www.artofunittesting.com/), a leading tdd & unit testing book; he maintains a blog at http://iserializable.com (which amoung other things has critiqued tests written by Microsoft for asp.net MVC – check out the testreviews category) and has recently been on the Scott Hanselman podcast (http://bit.ly/psgYO) where he educated Scott on best practices in Unit Testing techniques. For a further insight into Roy’s style, be sure to also check out Roy’s talk at the recent Norwegian Developer’s Conference (http://bit.ly/NuJVa). 

Full Details here: http://bbits.co.uk/tddmasterclass

My new Silverlight 3 Application

I recently launched my Silverlight 3 GraphRelaxing Sample that is capable of layouting graphs with random layout almost perfectly and automatically. All the user needs to do is enter a graph and wait for it to be layouted. The more nodes are on that graph the more time is required. I did this application in Java first but I wanted it to run on Silverlight, so that I would have the motivation to learn more about SL3. I figured there is no Java2D so I ended up writing a lightweight vector math framework that does the required calculations that the algorithm I use, which is Simulated Annealing by the way, needs to perform. Doing math stuff is kind of tricky because the algorithms you come up with could have some weird singularities that you did not think of. Kind of at the same time I was reading and listening into unit testing, so I decided to enforce myself doing “TDD”. I wanted to be able to “proof” that my math is working as expected and without strange behaviors. I am not sure I did it all correctly but I really tried to write tests first, fix only as much as the tests require to pass and design with many interfaces that I could stub out to break everything down into testable units. It was hard to not just go into production code and nail it but to write the test as a specification instead. It was fun though because at all time I knew that what I was working on at that moment worked! The tests proofed it and I liked this feeling. I also felt encouraged by Roy Osherove’s and Uncle Bob’s Sessions at NDC2009 that I watched online. I was feeling that I was becoming a better and more professional developer and this made me not to abandon this practice, which was new for me to do strictly. Now the application is done, I have 244 test cases and 100% code coverage. But this not what counts. The most valuable part is that I got used to testing. I got used to Silverlight 3 as well but the most advantages come out of doing the design the way that i can test it by writing its specification as a unit test. Now every code I write I am writing tests to it. I am not considering myself doing all this stuff right, but life is a learning process, right?

So if you have not already done so, check out the GraphRelaxing Silverlight Application on my website www.neokc.de. The App also support out of browser, which I like particularly. Here is the direct link: http://neokc.de/programme/silverlight/grs/grs.htm.

Please follow me on twitter as well: www.twitter.com/halllo.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s