Skip to main content

Unit testing and style

Had a moderate amount of fun playing with Parasoft's.Test today - it generates N-Unit tests from your .NET code. The tests it generates aren't super clever - it won't be able to tell what your functions actually supposed to do (as Simon said - "If it can do that why doesn't it just write the code for you already!") - but it does do a huge amount of testing of types and looking for null exceptions etc. I fed it a pretty small project (12 Classes) and it produced about 1630 various tests - 400 of which failed... I figure that if we fix them, we've got better code right? It also provides stubs for you to fill in based around your business function. I think it's worth spending some more time with it.

Ooh - Picasa V2 is out! Go and get it now. If you have a digital camera and a Windows PC - you really, really need this program. It's wonderfully designed with just the right functions to manage all your digital photographs, without confusing you with any wierdo nerdy computer crap.. Whatever you're using to manage your photos now, I guarantee you will throw away - Or I'll personally give you double the price of Picasa back...

Comments

Popular posts from this blog

Easter at Blackhead

Camping out on the headland, miles from anywhere. Big swell, off-shore winds, clear crisp nights and smoke from the wood fire. Sometimes it's so rewarding to get out from under the pressure of your life and just be a family of humans.

How to rename an XML Node in C#

This was driving me crazy - here's an easy cut and paste solution to not being able to use the DOM to rename a node for lazy developers like me: public static XmlNode RenameNode (XmlNode node, string namespaceURI,string qualifiedName) { if (node.NodeType == XmlNodeType.Element) { XmlElement oldElement = (XmlElement) node; XmlElement newElement = node.OwnerDocument.CreateElement(qualifiedName, namespaceURI); while (oldElement.HasAttributes) { newElement.SetAttributeNode(oldElement.RemoveAttributeNode(oldElement.Attributes[0])); } while (oldElement.HasChildNodes) { newElement.AppendChild(oldElement.FirstChild); } if (oldElement.ParentNode != null) { oldElement.ParentNode.ReplaceChild(newElement, oldElement); } return newElement; } else { return null; } ...

Democracy in Action...

I have to vote in the US Senate Election Tomorrow. Okay, I don't have to vote, but being an Australian American, voting is something we do. Australia has compulsory voting, which I am overwhelmingly supportive of. People often assume that the point of compulsory voting is to somehow educate people about politics - to force them to have an opinion. The reality has nothing to do with voters, and everything to do with ensuring good governance - By forcing politicians to care about every voter, rather than just the ones who can be bothered to go down to the poll both and vote, it means that politicians are consequently forced to address the needs of all the citizens in the country. Under a non compulsory voting system, it's mainly the wealthy and educated who vote. I was a little shocked to find out that part of the aim of the campaign advertisements that have been confusing me for the last month on TV is not to encourage voters to vote for one candidate or another, but to discou...