Archive for March, 2008

Computer Science Research and Software Development(Engineering)

Sunday, March 30th, 2008

Some areas of computer science are well researched.  Think of computer graphics (SIGGRAPH), AI, or even programming languages - these areas are all well researched in the academic community.  Not only are they well researched but the reasearch being done in these areas provides great benefit to the industry.

Software Development (or Engineering), however, is not.  The ACM has a special interest group dedicated to the study of Software Engineering but from what I have seen most the research that is conducted under this group is, to put it bluntly, irreveleant.  The problem is that software engineering can’t be isolated like a ray tracing algorithm can.  Software engineering is about people and processes and what works and what doesn’t work – none of which are easy to measure or test.

I am currently attempting to write a paper on Test-Driven Development and Behaviour-Driven development.  It is for my undergraduate senior seminar (a capstone class – kind of) and is supposed to be based on peer-reviewed research.  The problem is that the peer-reviewed research is lagging behind practice by several years.  There has been some scholarly research done on test-first software development (TDD) but not too much.  There has been some research done on specific aspects of software testing but again, not too much.

As easy as it would be to say “the academic institution has failed”, I can’t. I understand why little research has been done on TDD and why none has been done on BDD. It is hard.

Imagine that you are a researcher who wants to see if BDD is “better than” TDD.  First define “better than” as reducing the number of defects in a released software system and reducing the amount of time to design and implement a software system.  To get a point of reference we will need to be able to measure how large a “software system” is.  While hard, this is doable software engineers have come up with all sorts of metrics – pick one (or an aggregate of a couple) and stick with it.  Next we need to find huge group of software development teams – some need to be using TDD and some need to be using BDD.  Before they all start projects we have to have them (or us) measure the size of the projects that they are about to start.  We need to judge their compitency using either TDD or BDD.  Then we have to follow all the teams throughout the development process observing how things go.  After the software is released we can measure how much time each project took.  We also need to start tracking software defects as the life of each software system goes on.

Once we gather all this data we can do some math and statistics and figure out which practice is better. Right?  Well… maybe.  The first issue is that in order for there to be any confidence in this study we would need to study hundereds if not thousands of software development teams in order to balance out the different sizes of projects, the different environments that they systems are being developed in, and the skill levels of the different teams. Then you have to take other things into consideration: Is there a bias against BDD since it is a newer methodology and the teams using it have less experience with it?  Is there a bias against TDD because more advanced and experienced teams will move to BDD quicker? Like I said, it is hard.  Measuring something as simple seeming as “is TDD or BDD more effective?” turns out to be an amazingly large undertaking.

There doesn’t seem to be an easy answer to this – hopefully academic research in the area of software engineering will progress but only time will tell.

An indexed foreach for .aspx Web Forms

Tuesday, March 11th, 2008

 Nick blogged about why ASP.Net Repeaters Suck the other week and talked about using foreach loops in your .aspx.  I love this and have been doing it for a while – the strong typing and consice syntax is great.  However, sometimes I need format data based on odd and even rows…

 <table>
   <tr class='Row'><td></td></tr>
   <tr class='AltRow'>...</tr>
</table>

To accomplish this I created a helper function in the page code behind:

protected void Foreach<T>(IEnumerable<T> enumerable, Proc<T, int> action){
 int i = 0;
 foreach(T t in enumerable){
    action(t, i);
  i++
}
}

Then in the .aspx

<%Foreach(People, (person, i) => { %>
  <tr class='<%=i%2==0 ?  "Row" : "AltRow"%>'><td><%=person.FullName%></td></tr>
<%});%>

Just what I needed!

/console for Remote Desktop fails in Windows XP Service Pack 3 RC2

Saturday, March 8th, 2008

I often use the /console option in Remote Desktop to connect to an existing session.  Generally I leave my desktop logged in and locked at work – if I need to access any files on it remotely I can VPN into my works network and use Remote Desktop to connect to “computername.work.edu /console” and it will connect to my existing session. It’s great, because it means I can leave VS or SQL Server Management Studio open and acces my work right from where I left off.

However, after installing the latest RC of SP3 on my laptop, I can no longer connect from my  laptop to my desktop.  I can’t find a work around and have downgraded back to SP2 and am happily Remoting again :)

Singularity – RELEASED ON CODEPLEX

Wednesday, March 5th, 2008

 Microsoft’s managed operating system Singularity was released into codeplex yesterday:Singularity RDK – Home.  This is quite exciting and will surely make for some great code reading.  Another .NET managed OS: Cosmos.

IEBlog : Microsoft's Interoperability Principles and IE8

Monday, March 3rd, 2008

From: IEBlog : Microsoft’s Interoperability Principles and IE8

We’ve decided that IE8 will, by default, interpret web content in the most standards compliant way it can. This decision is a change from what we’ve posted previously.

I have been really encouraged by Msft lately. Sure, they are evil, I know; but the great job they seem to be doing with ASP.NET MCV and this reversal both show that they aren’t pure evil.