Scott Muc

More Muc Than You Can Handle

Book Review - the Art of Unit Testing by Roy Osherove

In a recent splurge I purchased 4 books from Manning Press with one of them being The Art of Unit Testing by Roy Osherove.

I would categorize myself as relatively new to unit testing. My first hands on testing was when I took the Nothing but .Net bootcamp with JP Boodhoo but he emphasized BDD style tests. I saw the benefit of BDD but didn’t feel I had the know how to implement them properly. About 3 months ago I started writing tests in a more unit test like fashion and things started clicking.

Riding the Lines-Of-Code Rollercoaster

Lines of code has always been a poor guide in measuring developer productivity. I’m currently reading Scott Rosenberg’s Dreaming In Code and came across and interesting quote.

“Atkinson [ed: Bill] had just completed rewriting a portion of the Quickdraw code, making it more efficient and faster. The new version was 2000 lines of code shorter than the old one. What to report? He wrote the number -2000” – Rosenberg

I couldn’t help but smile when I read that. I have felt that some of my best coding successes are when I eliminate lots of code. This probably pushes Test Driven Development (TDD) as a great practice even further. Lately I’ve been a bit stricter by doing TDD. This means that I’m writing a lot more code, but as I get my tests passing I start refactoring and remove much of the code that’s written. For every couple hundred lines of code I write, I eventually remove 50-80% of it as I glean knowledge from all the code I previously wrote.

It appears that LOC Rollercoaster development is an artifact of TDD and it’s a great ride!

Unit Testing Domain Persistence With NDbUnit

Ever since I’ve begun using NHibernate the number one thing that’s caused me a lot of headaches is learning how to properly map my domain objects. Even the most basic mappings I wrote had bugs simple because I overlooked trivial items. This made me realize that I could save a lot of time and hassle if I unit tested by data access layer.

Ever since I’ve begun using NHibernate the number one thing that’s caused me a lot of headaches is learning how to properly map my domain objects. Even the most basic mappings I wrote had bugs simple because I overlooked trivial items. This made me realize that I could save a lot of time and hassle if I unit tested by data access layer.

When 1 Does Not Equal 1

I’m starting to get comfortable with NHibernate but I’ve been cowboy coding it without any testing framework to let me know if my mappings are really doing what I think they are doing. I’m starting to get tired of manually interacting with my applications to see if things work so I’ve begun the course of starting database integration testing. For the most part, it’s all about testing my mapping files.

My Developer Resolutions for 2009

I’ve never made any New Years resolutions before. This year I’m going to break that trend simply to create a checklist of tasks to keep me on track. I easily get distracted, but having to check things off a list is a sure way for me to stay focused.

Not wanting to over do it, I made goals that are easily attainable. Hopefully upon completion I’ll get more ambitious the next time around.

Handy Web Path Concatenation Code

Lot of web developement code is spent concatenating path snippets and I always hated having to deal with slashes. I wanted a function that was consistent with its return type, and very loose in its parameter requirements. I ended up with the following:

Top 5 Things I Cannot Compromise in Web Development

Over the past few months I’ve realized that I’m a stubborn mule when it comes to certain aspects of web development. After some internal reflection I’ve come up with my top 5 things I strongly feel that I won’t compromise on in the web development process. These items are just for the presentation layer, I’m loaded with issues deeper into the development stack.

It Is Good to Laugh at Your Old Code

One of the things I love about my job is the ability to see myself grow as a developer. I’m glad I can laugh at my old code because if I can’t then I’m definitely not improving my skillset.

JS Builder Exceptions With Multiline JS Strings

I’m creating an automated build process and one of the items in the build is to build an external resource which is a java script library. The javascript is contained in multiple files and I want to concatenate them into one script. I found a very useful tool called JS Builder which has a command line executable which I can use to automate the construction of this javascript file.