Mathias Brandewinder on .NET, F#, VSTO and Excel development, and quantitative analysis / machine learning.
by Mathias 6. October 2009 06:09

Silicon Valley Code Camp version 4.0 took place this week-end, and was a big success, judging by the numbers and the happy faces. Congratulations to Peter Kellner and the team for a tremendous organization!

Personally, I wanted to give a big thank-you to the people who attended my session on Test-Driven Development – and for bearing with my voice, which was pretty shaky. I got sick this week and wasn’t sure until Saturday evening if I could do it, because on Thursday my voice was totally gone. I think I had more herbal tea with honey this week than in my entire life, but you guys made it all worth it: I had a great time giving my presentation, and you guys rocked!

As I said during the session, the theory behind TDD is pretty succinct, so there isn’t much in the slides themselves worth posting. Instead, I thought I would list a few pointers:

NUnit: you can find it here. I recommend checking out the Quick Start page, which covers most of what you need to start writing unit tests. I have written a post on data-driven tests here.

While we are talking about tools, I haven’t presented it during the session, but I really like TestDriven.Net. There is a free community version for your personal use. It’s a Visual Studio add-on which allows you to run and debug your tests from Visual Studio.

Even though it’s a Java book, and this session was for .NET developers, I really recommend Kent Beck’s book Test-Driven Development by Example. It’s very easy to read, and will get you started on the right foot. It’s also very well written – one of my favorite books!

The other book I recommend is the Art of Unit Testing, by Roy Osherove. I just finished it, and I wish I had it with me a few years ago, when I began writing tests seriously :) The book is technically about unit testing and not TDD, and it is a .NET book. I highly recommend it, it is chock-full of good advice, and covers way more than just testing.

That’s it! If you are interested in either the slides or code, let me know, and I’ll gladly post them, too. In the meanwhile, thanks again for coming, and… happy testing!

by Mathias 13. November 2008 18:29

Thanks to you guys who attended my session on VSTO at Silicon Valley Code Camp 2008! This was the first time I gave a talk on VSTO, and I really enjoyed the discussion and questions.

I have put the code I presented up for download here; it includes the TicTacToe "engine", the add-in itself, the installer, and the Excel workbook. As a result, the download is somewhat big - sorry! The purpose of the code was to keep things simple and understandable, and it could definitely be tightened up. Specifically, it is very optimistic in the way it is accessing the data in the workbook: adding some checks for whether a workbook/worksheet are open would be highly recommended... Let me know if you have questions or comments!

by Mathias 11. November 2008 12:21

Thank you to all of you who attended my session on test-driven development for C# developers at Silicon Valley Code Camp 2008!

Here are my slides and, more importantly, the code I presented during the session. In order to get it to work, you will need to install NUnit on your machine first. Besides the unit tests for City, there are 3 files in the folder "Tests". RowTestIllustration is an example of how to use RowTest to pass different set of values to the same test; note the using statement "using NUnit.Framework.Extensions". SetupIllustration shows how the method marked "SetUp" runs before each test method is executed. Finally, "MockIllustration" shows how you can use mocks to easily create instances that satisfy an interface, and verify that the class you are testing conforms to a specified behavior when interacting with that interface.

That's it! Let me know if you have questions or feedback. 


Comment RSS