September 2011 - Posts

Recent announcements for Windows 8 development is not including JavaScript with HTML5 has opened up Windows development for more developers. I wanted to see where testing for JavaScript is standing and was surprised at the variety of frameworks out there. Back in the days when I was trying to do web testing with WatiN, it was painful, especially when a browser had to be loaded for those tests. My interest was around JavaScript testing w/o need to load a browser. QUnit looked very good, but it still required an actual browser. Also, in a CI scenario, I wanted to be able to use a command line/tool execution style.

I have ran into Chutzpah test runner. Great wrapper for QUnit executing w/o need for a browser. More than that, it doesn’t require that standard QUnit shell HTML file for output, which makes tests execution simple and straight forward – execute command line test runner on the scripts folder.

Successful tests execution

image

Failed tests execution

image

This is perfect! Not only runs w/o browser, but also nicely fits to run with CI on a server.

The test runner also comes with a Visual Studio addin to run JavaScripts tests within IDE.

This is the one that I found that nailed it for what I needed. Are there other tools that can do the same and more?

It’s 5772 New (Jewish) Year tomorrow. I wish everyone Shana Tova.

In general, NIHS (Not Invented Here Syndrome) is a negative for your core business. Trying to re-invent something that already exists and probably does the job 10 times better. But what happens when an existing tool doesn’t do it better, or it is not customizable to your business, or it’s something that you’d pay wa-a-a-y too much just to use a fraction of what it can?

I ran into an old post from Joel Spolsky and tend to agree. Also, something that sales people are not concerned about, in some cases testability is not possible with out-of-the-box products, leaving your product blindly trust that it’s working.

Bottom line – I am not advocating for building it all. On contrary, if you can leverage an existing library/tool/product, do it. Just don’t sacrifice what your core business will rely on and find out that it’s missing.

First impression is always important. I have decided to install Windows 8 in a virtual environment. Even though running it “natively” on a hardware is a better experience, I still wanted to see how well the hardware requirement was slimed down. Also, I have a very old idea of working in a VM box only, but it was always not a simple goal to achieve with Windows and Visual Studio being such a RAM / recourses pigs. This time around things looked very…. impressing.

First, I have defined my system as a single 1, single core machine, with only 2GB of RAM. Installation was very quick. UI is simplified and clean. It took less than Windows 7 to load and was really fast.  Over time fast loading time can disappear, But for that, seems like Windows 8 has an option – refresh windows installation w/o affecting user files. How good it is I don’t know, but worth trying out.

image

I really loved the fact that account created for logging into the Windows could be either a local account or my existing Live ID account – handy.

Using tiles interface w/o a touch computer is a bit weird in the beginning, yet easy to get used to. Page Up/Down Home/End keys scroll the screen.

Tiles is like an alternative view of the windows menu. Instead of the regular Windows Button with the traditional menu you get to switch between the tiles view and the conventional desktop view, which is very similar to Windows 7.

image

Hardware utilization (keep in mind this is a very limited virtual machine) wasn’t bad at all after 15 minutes of playing around.

image

And I really loved what was done with the task manager

image

Loading Visual Studio .NET 11 was a blast! Literally a few seconds. I do not remember VS taking up that little memory since… ever. Exciting. Unfortunately, due to the fact that this is a preview only, Metro applications is all I could get from the new project menu. At least I am glad that testing is there. And do you see JavaScript getting a first-class citizenship? That’s neat.

image

XAML (WPF) is the default UI. That felt very familiar. Blend properties window was right in VS – handy.

I am very impressed with the responsiveness and simplicity. Can’t wait to get the release bits and install it on the real hardware.

PS: to install Win8 on VMWare, I used this tutorial

A few years ago I have blogged about Singletonitis. Another place, different people, yet the same problem appears again – singletonitis. The issues I have outlined back then where

1. Testing

2. Difficulty to replace implementation

3. Requirement to track all the location where Singleton is utilized once we need to replace it.

I’d like to look into these again and re-address this ‘disease’ so to speak.

Testing (for Design Verification)

Testing is important. Maybe back then (2008) some would argue, but not today. But what this testing is for? To confirm that implementation adheres to the desired design. And, as a side effect, to have a safety net. The why not to test singleton implementation and be done? The headache with singleton is not about singleton itself, but other code/components that rely on it. Yes, these days you could use tools like Moles and Typemock, but why would you if you could DESIGN your code properly to begin with?

To me it is more about team decision on code design and collaboration. Imagine the following two scenarios:

Scenario 1: John – “I will work on the UserSession and provide you (Mike) with the contract”. Mike – “Sounds good, I’ll throw into that contract a few methods I need, when you get to implement it, lets talk”.

Scenario 2: John – “I will work on the UserSession that will do This and That”. Mike – “I will work on the component and will require UserSession, but don’t know if I need This, That, or Whatever”.

Can you spot where singletonitis thrives? Absolutely, in the team that works in silos and throws stuff over the fence. In the scenario where collaborative work is observed, need for “utility-like” classes is drastically low. After all, why would I create waste that is not used by anyone.

Other Issues

Other issues (#2,#3) are insignificant and easily solved just by following #1. Testing leads to better code design, it leads to contracts, contracts lead to design-by-contract, allowing principles like Inversion of Control (IoC) and Dependency Injection (DI). Gladly, these days, we have enough tools and knowledge among developers to recognize it (Ninject, AutoFac, Castle, Unity, etc).

So the next time you see code  where Signleton is abused – cure it.

Watching Build event I couldn’t not to smile. Microsoft is not always getting it right, but it looks like this time around they bet on a stronger horse. When .NET was released, ASP.NET was an attempt to bring desktop development to the web. Not the best approach. This time around, web development is coming to the desktop. Sounds interesting, and quite promising.

What would I look like with excessive weight… Hilarious! Another reason to watch eating habits and exercising Smile

clip_image002

More Posts