Archive for January, 2009

Repeat after me: Test Driven Development is about design, NOT testing!

Friday, January 30th, 2009

A few weeks back while listening to .NET Rocks Episode 408, I cringed so badly when I started hearing Dr. James Whittaker, who is, apparently, in charge of Visual Studio Team System's testing tools (which I surmise includes the oft-admonished MS Unit Testing framework), talk about test driven development and his gripes about it.

Right then and there I saw it: Microsoft's attitude about test driven development has been totally wrong, precisely because they were asking the worst possible person about it. Whittaker is the worst person to talk about test driven development, because he's focused on testing.

Microsoft failed to understand, outright, that test driven development is NOT about testing.

Scott Bellware responded to Whittaker's statements via the Hanselminutes podcast, wherein he offered The Last Word On Test Driven Development on Episode 164. There, he questions (at around 5:30 into the podcast) "why test-driven development is coming out of a conversation about software quality and software quality tools":

I think it's quite sad though that no matter [how much we tell people] that TDD is about design rather than testing, that it never really sank in...

Questions about software quality are damaged when we let them fall over into conversations about test driven development...

The goal with [TDD] isn't really a unit testing goal although we're borrowing unit testing tools to achieve the goal... [We're almost like] "demonically" possessing unit testing to achieve other needs.
["The Last Word on TDD" on Hanselminutes]

I said as much when someone asked on Stack Overflow whether TDD takes focus away from design. In my response, I stated that it's precisely the opposite -- that, once again, TDD is all about software design:

If done right, Test Driven Development IS your design tool.

[...]

Test Driven Development, done right, should make developers highly aware of design pitfalls like tight coupling, violations of DRY (don't repeat yourself), violations of SRP (Single Responsibility Principle), etc.

If you write passing code for your tests for the sake of passing your tests, you have already failed: you should treat hard to write tests as signposts that make you ask: why is this done this way? Why can't I test this code without depending on some other code? Why can't I reuse this code? Why is this code breaking when used by itself? ["Does TDD take away focus from design?" on Stack Overflow]

The reason why I don't take this misconception lightly is because this realization came to me the hard way -- I was part of a project wherein Test Driven Development was grossly misunderstood by previous members of the project:

There was... a failure to recognize that TDD is not about tests, it's about design. The rampant case of singleton abuse in the unit tests made this obvious: instead of the test writers thinking "WTF are these singleton = value; statements doing in my tests?", the test writers just propagated the singleton into the tests. 330 times.

The unfortunate consequence is that the build server-enforced testing was made to pass, whatever it took["When TDD goes red" on Dotnet @ Kape ni LaTtEX]

The attitude Microsoft took regarding this issue explains a lot why testing is an add-on "luxury" feature to Visual Studio, which you pay extra for, and not part of its core features out-of-the-box, and on top of that made it definitely illegal to implement in Visual Studio Express. Hiring a testing expert to implement a software design engineering guide lead to the inevitable misrepresentation of the value of TDD.

Unfortunately, treating TDD as a luxury feature gives the impression to hobby and professional software developers alike that test driven design is nothing but a bell and a whistle in Visual Studio -- which it is not. Test driven development is a paradigm in software development, and to many it has become a fundamental way of ensuring that code for software of any size and complexity is flexible and maintainable and remains that way.

So repeat after me: TDD is about design. It's NOT about unit tests. Tell that to the every developer who asks what TDD is all about, and to every developer who thinks TDD is about testing.

Enriching ASP.NET applications with jQuery — Slides and Code

Sunday, January 25th, 2009

I'd like to thank everyone who attended the MSDN Session I conducted a week and a half ago, entitled Enriching ASP.NET applications with jQuery. Again I'd like to apologize that I wasn't able to show a genuine DB-backed app to them ('coz my SQL Server installation got fried for some reason) and my backup plan of showing off StackOverflow.com's jQuery goodness was a fail owing to a lousy internet connection (my fault, not Microsoft's). I still hope, however, that those who attended learned something and enjoyed the demos nonetheless.

You could download the presentation and code here:

As such, this talk was based mainly on Stephen Walthef's talk at the Microsoft PDC 2008. If you'd like to check his presentation out as well, you can find it here: jQuery and ASP.NET AJAX Demo Code.

Working through first quarter MS events of 2009

Monday, January 12th, 2009

I'm starting this new year with a bang with lots of activities lined up speaking about new stuff on ASP.NET!

The year starts with MSDN Session: Enriching ASP.NET Applications with jQuery on January 15th, 6-8PM, at Microsoft Philippines office in 6750 Ayala Ave., Makati City. I'm gonna speak about jQuery, an open source lightweight JavaScript library which works with Visual Studio 2008 and is going to be shipped by Microsoft for Visual Studio 2010. Click on the link to register.

That talk will be reprised on Jan 20 and 21, where newly minted MVP Eduardo Lorenzo and I will join forces to speak in Subic, Zambales and Clark Field, Pampanga.

Finally, on February 26, I am honored to be one of the speakers for the biggest developer event in the Philippines: Web Ramp Up. There I would talk about "Coding4Fun: Facebook, YouTube, Twitter and other Social Network Apps with Silverlight and WPF". Click on the link for information on how to register and purchase tickets.

Hope to see you in these events!

Silver bullets and resumes

Monday, January 5th, 2009

I was looking at the calendar this morning and I realized that I've already surpassed the longest period I've employed with a particular company. My second software developer post was at Philippine National Bank, and I stayed for 1 year and 9 months. I have been with Cormant for longer than that starting last Friday, with no plans or itching to jump ship and leave just yet.

I'm very happy about it -- finding an organization that would nurture me, let me grow, and tolerate my occasional delinquencies (I tend to be naughty sometimes) was difficult, and it almost drove me crazy into depression at one point. Sometime last year however, I was fortunate to have needed to update my resume not because I was going to apply for a new job (although I did bite this one interview), but because I got promoted. This year, I really hope I would only be updating my resume for the exact same reason.

Speaking of resumes, a few months back Max Pool of {codesqueeze} came out with a nice resume writing series he called 3 Days To Building a Perfect Resume. As I've also dabbled in some resume writing advice, I found his articles very informative, expounding a lot on several of my own key points, as well as adding several other ideas I haven't thought of. If you're writing your tech resume for the first time, or are looking to improve upon a resume that doesn't seem to work, his series is a must read. (more...)