Posts

Going Linux, setting things up

And so it was. Burning Ubuntu 12.04 on a blank CD was the last action I performed using the Windows operating system, all Linux from now on.

Stardate who-cares, approaching a black hole

Image
I'm not quite sure how it all began, and whether natural selection had anything to do with it, but as far back as I can remember I've always developed for the Windows platform.

Getting your MSTEST unit test stdout to show in Jenkins

There is no easy way to say it, the default Jenkins plugin for publishing MSTEST results does not show a unit test's standard output when it fails .

Unit Tests - Help them, Help you

Image
Unit tests are sometimes thought of that cousin nobody likes and everybody can't wait for him to leave, although he gets invited regularly because, well, what are you going to do? - He's family. Whether we write unit tests because we believe in them, or because somebody insists that we do (be it your team leader, some agile guideline, the Pope, etc.), there are ways to make the end result more effective, and dare I say - fun.

MSTEST unit tests & deployment problems

Image
Every now and again you might require for some additional resources to be present in order for your unit test to properly execute. This seems as a reasonable requirement, and MSTEST has indeed addressed it with what goes by the name "Deployment". To configure deployment for your unit tests double click the "Local.testsettings" in your "Solution Items" folder, you should be able to see a "Deployment" option on the left side, allowing you to add files and folders to be copied alongside your unit tests. So far so good.

4 excuses to write poor quality code

Image
1. This module can't be unit tested, it's too [ insert-adjective-here ]. If it's too [ insert-adjective-here ], how do you even know it's working in the first place? And what about after we extend it with a new feature? 2. Breaking logic into methods incurs a performance hit. So does inheritance, and separation into classes. Does this mean your design should consist of a single class with a single method where all business logic is placed? 3. Commenting code is time consuming and hinders development. Same goes for going to the bathroom, but you don't see people skip that, do you? 4. Coding conventions are too rigid, I'll call my fields whatever I want. Now that's just an excuse to write ugly code.

Enhancing code readability

I'm a big fan of easily readable code, in fact, my appreciation for code that reads almost English has only grown over the years. Extension methods in C# allow for some nice tricks to take place in this regard.