JsTestDriver First Impressions

I’m currently trying to get some unit tests written around a bunch of JavaScript code and I’m using JsTestDriver to do it. So far, I’m pretty impressed though there are some little gotchas here and there. It’s been a really good framework for basic testing assuming you aren’t doing a ton of work with other libraries like Prototype.js and script.aculo.us which of course I am. I’m sure there are ways around it but it’s going to take some digging to figure out what they are.

One minor thing that has been different for me from the documentation is that when I try to run tests, I need to specify the server explicitly on the command line even though I have a server running and a browser captured. The documentation says you can do this:

java -jar JsTestDriver.jar --tests all


However, I’ve found that I need to do:

java -jar JsTestDriver.jar --tests all --server http://localhost:9876

Where the server value may be different according to what server you started up.

Now I’m off to figure out how I can mock some of the Prototype.js dependencies.

Baby Steps

This week, President Obama proposed regulatory changes that would limit big banks, implicitly those that received the guarantee of a government backstop during the crash last year, from investing for profits using their own hedge-funds or proprietary trading desks. This would be an excellent first step in reining in the power that the JP Morgans and Goldman Sachs of the world wield over our economy and political landscape. It is unfortunate that Obama waited 12 months before listening to Paul Volcker, losing precious political capital in the process. 12 months ago, the banks were beholden to the President and the American people. We essentially owned them and should have taken steps then to limit their power.

Instead, we let them pay back TARP and gain monstrously atrocious profits this year, making money by sucking cash from the tit of the Federal Reserve and refusing to then lend it out to the people who actually needed it. The banks are now emboldened to go right back to business as usual as they came through 2008 learning only the lesson that the government will make sure they do not fail no matter what the consequence. They have not been punished, not even reprimanded for behavior that sucked the life out of the American and global economy.

“While the financial system is far stronger today than it was one year ago, it is still operating under the exact same rules that led to its near collapse,” Mr. Obama said. “My resolve to reform the system is only strengthened when I see a return to old practices at some of the very firms fighting reform; and when I see record profits at some of the very firms claiming that they cannot lend more to small business, cannot keep credit card rates low, and cannot refund taxpayers for the bailout.”

This is exactly right, something that is a direct result of not reining in the banks 12 months ago. Now, the regulation has little chance of emerging from Congress with any teeth. It will die a death of 536 pricks, bled to death on the floor of the institution created to represent the people.

Of course, proprietary trading wasn’t the cause of the financial collapse, at least not the root one and that is a point many on the right are making now. But this isn’t designed to fix the problem, it’s a first step down the road of reforming the entities that currently have all the power in the American economy. There are those on the right who will moan about frightening the stock market but the market needs to be frightened because it is currently nothing more than a Ponzi game played with our money. Rising from the depths of last year inside of 12 months during the worst economic collapse since 1929 is silly. The stock market gains are largely smoke and mirrors using money that the Federal Reserve has created out of thin air. It cannot continue and the longer it goes on, the worse the responding fall will be.

This regulation will be difficult to implement as Yves at Naked Capitalism details. But it would be a much needed baby step down the road of reform and true recovery. As long as the big banks can find comfort in explicit government backing while remaining unpunished for poor decisions and risky behavior, they will continue to act in exactly the same way they have been acting for 10 years. We cannot have true recovery until the Goldman Sachs of the world, parasites on true creation of wealth, have been reined in.

More reading: Jesse
Perhaps there is some hope

Successful Configuration Management Using Git

I am just beginning to play around with Git and so far I’m pretty happy with it. One thing I love about it is that the concept of branching is just part of the model. Branching is critical to successful software configuration management (SCM) and it’s a topic that strikes fear into the heart of any developer who has never done it. The idea of having all these branches that you have to eventually merge and bugs to fix and AAAAHHHHHHH!

Sigh. Of course this comes from the fact that most of our SCM tools have been craptacular at dealing with branches and merging. This craptacularness is built in to most of them because of the centralized server concept (though Perforce is spectacular, the opposite of craptacular, at branching and merging). On top of that, most Microsoft developers first and often only exposure to SCM is SourceSafe which is like driving a Pinto for your entire life. SCM in a robust environment is necessarily complex but it doesn’t have to be impossible and using the right tools changes the game. The new distributed source control tools like Git and Mercurial (which I have a soft spot for since it’s written in Python) are the future of decent development practices.

All this comes from reading a great article detailing how to use Git successfully to manage software development. The author details exactly how his team has been using Git to successfully branch and manage software changes. I haven’t begun to need all the ideas that his team is using but I hope to one day. Plus I thought my audience of 4 might find it useful.

Political Discourse Olberman Style

Man, the leftist elites are flipping out. It must be hard waking up to the realization that democracy involves “the people” and not “you telling the riff-raff what they ought to do”. Congratulations to Scott Brown this morning but more importantly, congratulations to the people of Massachusetts who went to the polls in unprecedented numbers yesterday for a special election sending a message to incumbents across the land in both parties that they are vulnerable if they no longer represent their constituents. Democracy and liberty aren’t dead yet in the Republic.

Review Of Amy’s View At Theatre Three

As part of our ongoing effort to seem cool, trendy and urbane, the missus and I went to see Amy’s View at Theatre Three last night as part of our season ticket package there. Overall, the show was a good one with some solid character portrayals by Connie Coit and Danielle Pickard.

Amy’s View is a play written by the British playwright Sir David Hare. The original cast included Judi Dench so it certainly has that going for it. It seems to be pretty well written and has some thought provoking themes running through it, most notably the contrast between the theater and popular shows and media on television and film. The protagonist is Amy, a level headed woman who has fallen in love with Dominic, the main antagonist as it turns out. Amy’s mother Esme is a noted actress in the London theater scene who seems to disapprove highly of Dominic. Dominic is a critic/filmmaker who is at constant odds with both Amy and Esme.

The show is slow to start but picks up quickly after the first scene. An interesting theme that runs through the show is how all the major conflicts are resolved outside the actual acting and the audience is left to see how the characters cope sometimes years after the conflict. This is a little disconcerting and for me, takes away from the ability to identify with characters by becoming involved in how they deal with actions in their lives.

The play’s second act is certainly the strongest though the ending feels as though the playwright got tired of writing this particular play and just pushed it out the door.

The characters are mostly well played though Dominic seems to have only one emotion, anger and it is expressed at a constant volume level, jet airplane. That is unfortunate since the conflict of the play is necessarily controlled by Dominic and it would be nice to see a slightly more nuanced interpretation. I haven’t read the play so maybe this is all intentional. Sonny Franks plays Esme’s would be suitor Frank and as long as you haven’t seen “I Love You, You’re Perfect, Now Change”, he does an able job. I could only see him singing “Sex and The Married Couple” but that’s probably more the fault of this reviewer than it is the actor himself.

Overall, I’d say this play is a Glenlivet in the scotch scale of reviews (something I just made up) and is worth taking in on a Friday or Saturday night.

Making It Easy To Learn Programming

Glenn Reynolds talks about a shortage of geeks and one of his readers comments that a key contribution to this is when computers stopped shipping with BASIC. Glenn makes the plea to computer makers to include BASIC on the computers as a public service. Of course, Macs already ship with both Python and Ruby, surely superior languages to BASIC and excellent learning languages as well.

On a Mac, all you have to do is fire up a terminal (Apple Key + Space Bar and then type “Terminal”), type “python” in the new terminal and you have a place to start learning programming. Work through the Python tutorial and you’re well on the way to becoming a novice Python programmer.

Of course, on a Windows machine you’re going to have to do a little more work because, well, it is Windows after all.