« May 2003 July 2003 »
blog header image
# Software Politics

Yeah, not much here for a bit. I've been resting my brain this long weekend (Happy Birthday Canada) and reading a lot about the RSS v. Echo stuff. I don't have much to add on the debate though, I'm just an observer -- I've merely scratched the surface.

It's kind of like watching a fight after the bars let out. You want to get as close as you can to see the action but not so close that you get socked in the nose.

People find it strange that political issues seem to be dominating the discussion. I don't. Engineers seem to forget pretty quickly that software has a lot to do with politics and their managers insulate them from it every day. Now that they are knee deep in politics it seems as though they don't know how to deal with it efficiently.

posted at June 30, 2003 at 01:13 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (5)

# No Mic? Use Headphones

Want to have an audio conversation on an instant messenger client but don't have a mic? Hook a pair of headphones into the mic jack on the back of your computer and talk into them. I don't know how it works, but it does!

posted at June 26, 2003 at 10:42 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (2)

# Tweaks Ahoy!

I've been dragging my feet getting my blog templates set up -- eventually the whole site will look like the index. I only have so many hours I can give to web fiddling. :)

... but I did manage to put in something I've wanted for a while: recent comments. Scroll down the middle column to see them.

posted at June 26, 2003 at 12:15 AM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (0)

# Coverage Isn't a Silver Bullet

Don't get me wrong -- I like code coverage. You just have to understand what you're looking at.

Code coverage tells you what lines of program code that your tests hit. It doesn't tell you that you have perfect software when your tests run 100% green and you have 100% coverage. All that means is that your tests cover what's been implemented.

Often bugs include what hasn't been implemented. Have you covered error possibility 14 in your code? Is feature ABC in the codebase yet? These are easy questions to answer if you know how to read the tests ... but that is difficult. Compounding this problem is that your test's intentions may be correct but the test implementation could be wrong. Don't think that only your program code has bugs in it -- your tests do too. However, you could always just test your tests and test your test's tests .... etc. (please don't do this, I'm kidding)

Good tests and program code are like two playing cards resting against each other: if either are wrong the test still fails. Sometimes though you get a situation where a bug is symmetrical on both sides and the test passes anyway. These tests can give you a false sense of security and are usually only found when someone else tries to use the API in a real life situation or during a code/test audit.

Tests that have poor asserts can also give you a false sense of security. Say you have a function that returns an array: Widget[] getWidgets(int parameter). If you are testing on a known set of Widgets in your unit test, you'll expect a specific array to be returned by this function. Someone may write the test

assertEquals(3, getWidgets(42).length);

and it will pass. But what were the three widgets? Were they the right three widgets? Were they in the correct order? Do we care about order? Relaxed testing like this can result in really hard to find bugs when someone else comes along and trusts the getWidgets() method too much.

I'm finding that unit tests are really hard to manage. Not only is it difficult to discover the intent of the test, but also what part of the program code it actually exercises. But we put up with these disadvantages because having tests that we have to figure out is still better than having no tests at all.

However, it would be nice if I could go one method at a time in an IDE like Eclipse and see in one perspective:

  • The tests I am using for that method and a brief synopsis of what each of them cover (in plain English or shorthand)
  • If I click on a test I see the code coverage for that method (and I can select multiple or all tests in the list) overlayed on the code.
  • The IDE tells me if a test overlaps another test or if the test does a subset of another test so that I can have the simplest set of tests possible to increase agility (see XP)
  • I can execute the tests on a per-method basis. Better yet, Eclipse does the compiling and code coverage analysis on the fly while I write the tests (ie. program code on top view and test code on bottom view).
The reason I say per-method is because this is what I find I'm typically dealing with when I write and implement an API: I usually go one method at a time because it's easiest to keep it all in my brain. If I jumped back and forth a lot I'd probably just confuse myself. Sure, I delegate to other functions inside the one I'm writing but at that time I think of them at a high level of abstraction. I don't need to concern myself with their details.

So that would be nice. Anyone want to write me an Eclipse plugin?

posted at June 25, 2003 at 06:48 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (0)

# Code Coverage

Think that just because you use JUnit and test-driven development that your code is well tested? Actually, probably not.

One of the key tenets of XP is that no line should be in your code that isn't necessary. If you take a line out of your code it should break at least one test. If it doesn't, delete it or write more tests!

So you could spend your time deleting lines and then running the test suite to see if it breaks ... but who wants to do that? That's where a code coverage tool like jcoverage comes in.

Coverage tools work by marking the compiled code so that lines can be counted by the number of times they are executed. Then you can run your test suite over this modified version of your compiled code to see where the test suite hits and where it misses (see picture). You can even see which specific lines of code you forgot to cover.

Then you have a choice: write the tests that cover those lines or decide they are useless and remove them. Some lines are impossible to get to -- a silly example would be:

if (x < 10) {
   y += 1;
   if (100 < x) {
      System.out.println("Am I getting here?");

You would never get to the println(). When you refactor complicated code over and over it's hard to tell when you've cut a chunk of code off and made it impossible to execute. That cruft can be removed to simplify what's left.

So your tests test your code and coverage tools examine your tests. It's a great way to keep on top of the quality of your tests and your code. So get a code coverage tool! If you have the means I highly recommend picking one up ... it is so choice.

posted at June 23, 2003 at 01:04 AM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (4)

# I Hit the Pin?

O.-O.F.L.A. 2003
Sponsored by / Commandité par Lucien Brisebois - Lawyer/Avocat

The Story: 130 yard uphill par 3 and the green was pretty steep. So I decided to hit an easy 7-iron. I ended up hitting it about 3/4 speed and it started a little right and came back left (I had been slicing all day and I'm left-handed). It bounced on the green and looked like it just passed the pin. One of the guys in the group behind said that it hit the pin, but I couldn't be sure.

We get to the green and I find my ball mark, about 6 feet short of the hole about a foot to the right. The ball was about 3 feet away from the pin and to the left. I guessed that it may have hit the pin from the right and bounced back to the left. This hole was the "closest to the pin" hole for the tournament. The previous closest was about 6 feet away, so I marked my name down.

It was a best ball tournament and we had four chances for birdie. We missed all four putts. Haha, yeah. We finished the tournament -2.

I ended up winning a small trophy and a Mizuno putter (7008). It's right-handed so it's going to my bro.

I also birdied the first hole I played -- not bad for the first round of the year. :)

posted at June 20, 2003 at 08:39 AM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (5)

# Project Tools

AudioMan progress is going well. We have a bunch of new features on the way for alpha S2, due at the end of the month.

I've been adding features, but I've also been working on aspects of project management. I worked a term at Rational writing test cases and closing bugs as a Quality Engineer, so I saw how the big boys do their process. For AudioMan we needed a process 10 times lighter and 20 times stronger. We don't have the people or the time to iterate that much.

So first we bring in the de-facto JUnit testing framework for Java. We actually didn't have to do much to use it because it's integrated right into Eclipse now. JUnit lets us specify how we expect our components to react to input so as soon as we break our components we know about it. The down side? Your code is only as good as your tests -- the rest is faith and luck (AKA traditional software development). Some of us have even been writing our tests first, with some very good results.

Next we have Ant, a build tool to replace makefiles with XML. Ant is a great tool but suffers from a lack of sample code out there on the 'Net and immature plugin support in Eclipse. It lets us build the project, run the JUnit tests, make JUnit reports and make the distribution ZIP file to post on the web site -- once you have it set up, of course.

We've been using a Bugzilla bug repository to track enhancement requests and defects. I've been taking feedback from alpha users and putting it right into Bugzilla. Then at meetings we can look through all of the ideas and prioritize the next iteration. Bugzilla does the job quite well for a web-based tool, but it is definitely not as fully-featured as some other products like Rational ClearQuest.

Jim and I are also looking at a code coverage tool named jcoverage. It inserts bytecode into our compiled classes and tracks which lines and branches are executed during the test runs. Then we can immediately see poorly tested areas of the code and add more tests.

Finally we are using CVS as the source code repository because a) it's free - as in beer and freedom and b) support for CVS is gorgeously integrated into Eclipse.

Eclipse itself is becoming an indispensable tool. I'm starting to get used to the refactoring support, which is a pain when it's missing from other editors like Notepad and VS.NET. It's nice to know that while I'm programming in the zone I don't have to think of the perfect name for a class, I can just name it something and go back later and easily rename all references to it without using a global Find/Replace. Of course there are more advanced refactoring features in Eclipse, I just haven't been brave enough to try them. heh

So Eclipse, Bugzilla and JUnit are the only ones that are in the developers faces all of the time. Ant probably won't be touched much once it's set up and jcoverage will be just a reporting tool. So I think the process is still lightweight yet quality controlled enough to ensure a good end product. The hard thing is balancing quality control while providing the opportunity to be creative and agile (responsive to changing requirements). Box the developers in too much with rules or give them too much paperwork and you'll take all of the fun out of it ...

... and that's what programming is all about, right?

Hello? :)

posted at June 17, 2003 at 01:48 AM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (4)

# Google is Suboptimal

Let me give you some background first ...

So I'm programming with Eclipse and its Ant plugin and ran into a problem -- it didn't work. It complained:

[javac] BUILD FAILED: file:C:/[ECLIPSE_DIR]/workspace/[PROJECT_DIR]/build.xml:32: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

So I did a search on Google. Nothing useful. I did some digging and finally found the answer. I thought other people might appreciate the answer so I blogged it. From my hit counter I noticed I was getting about 30 people a day with the same problem, reading my solution. Great -- I'm helping people and Google was the vehicle.

Nuh uh, says Google. As soon as the blog post left my main page, it left Google's index. Gone completely. Not on page 100, just gone. There was even a direct link to that post on my Recent Entries list (until this post because the list only holds 10) and Google still didn't find it.

The funny thing is that the next time Google scans this index page people will be able to Google for the problem again because I reproduced the error text on this post. Sheesh.

So what is Google up to? Do they know my site is a MoveableType blog and they are ignoring my entire archive (which is linked off the index)? Is this their way of reducing "blognoise"? If it is, it's not working too well. Even people that want to find REAL help from a blog can't find it anymore and strangely my index is still in the Google index and still blognoise. I understand that blog noise is a big problem but this is no way to fix it.

My mission isn't to crap on Google -- I love Googling. I just want them to know something is definitely wonky. If you need motivation to fix it, how's this: The MSN search doesn't filter my blog archives and people can find the Star Wars kid. Wait, is that a good thing? :)

posted at June 15, 2003 at 10:39 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (4)

# There Are Only Two XULs

Some interesting things being discussed in light of a recent chat comment by a Microsoft employee about the discontinuation of IE as a standalone application post-Longhorn.

This makes sense though. If you read this blog, you know I think that browser development has plateaued. So where to go next? Deeply integrate the browser into the OS GUI -- so deep it uses the same renderer as traditional WinForms (which will probably be pumped through Direct X and hardware accelerated like Mac OS X -- need those flying and fluttering windows, yaknow). That is what I think Microsoft will do.

Take a look at what the Mozilla-as-a-platform offers and imagine an OS like that. Mozilla can render itself -- enter chrome://navigator/content/ in the Mozilla address bar to see. So not only can Mozilla render web pages it also renders applications using a markup language named XUL (pronounced ZOOL).

So Microsoft will make their own flavour of XUL -- but they will probably one-up Mozilla by allowing DHTML in their XUL and XUL in their DHTML, enabling a hybrid of WinForms and WebForms. Picture web pages that have custom menus and status bars and stand-alone applications with DHTML in them for free (no Internet Explorer in a COM object necessary). It will all be XML and the renderer will sort it out.

The .NET WinForm editing in VS.NET is already just a bunch of nested elements with properties. How long would it take to convert that to a XUL-like language? XML might be harder to read than a property editor but it's easier to see the nesting to layout things properly -- which is why I like XUL so much.

.NET has support for JScript.NET as well, which is a lot like the JavaScript the Mozilla project uses to call lower level C++ modules from the GUI through XPCOM. With .NET you wouldn't need the COM mess ... your lower-level application code in C# could be called directly with JScript.NET. Nice.

So I see the lines between "application" and web page blurring. Microsoft is spending two years developing Longhorn so it will take even longer for the open source community to catch up, a nice side benefit (see .NET and Mono). Should be interesting to see what they come up with. I guess we'll find out at the PDC ... it's fun to predict though. :)

posted at June 12, 2003 at 02:40 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (6)

# Herd Behaviour

I don't want to spam Scoble's comments any more, so I'll post here. :) He says in his comments:

No one had to upgrade from DOS. No one has to upgrade to Longhorn. Microsoft will, however, try to make it compelling for you to do that.
Of course they don't have to. No one has to have a TV these days but most people do so they can watch Animaniacs. They need to have Windows because they want to surf the web in a browser. Peer pressure, man. It's not just for teenagers anymore.

You compel your users to upgrade by dangling the content carrot in their faces. Then they honestly believe they "have to" have email. They have to have a web browser. These fringe things become part of their daily lives and are now a requirement -- like electricity. The turning point comes when you think of how your life would be drastically different without Technology X. Wow, where would we be?

So you have to upgrade. Who wants to lose the rat race? Not Joe User, that's for sure.

posted at June 12, 2003 at 12:45 AM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (2)


Sun is entering the XML for UI game with JDNC. They will make it open source this fall on javadesktop.org.

Raible and the XUL announce mailing list seem to think XUL will be more successful.

Personally I really like XUL's ease of layout but I'm waiting for a few things. The Gecko Runtime Environment has to mature. Gecko is what you need to render a XUL GUI so it's important. I'm not even sure of its status at this point but the recent change in the Mozilla development roadmap will probably give more focus to the GRE. Gecko's memory footprint also needs to improve.

What I'm really waiting for is the Javascript to Java interface for XUL. XUL-based GUIs use Javascript to communicate with the actual application code that does the grunt work. In Mozilla, this is done with XPCOM and C++. I should be able to make Java calls cleanly from JavaScript -- none of this COM garbage. As soon as that happens I'll be playing with XUL for sure.

So what happens to SWT? Maybe the best of the layout advantages from XUL and the JFace conveniences from SWT can combine somehow. All I know is that XUL is far far easier to layout GUIs with.

Maybe the Eclipse team can write SWT in JavaScript. ;) Heh, it's probably more likely that the Gecko Runtime Environment team would add support to write in Java instead of JavaScript in XUL code. Now that would be interesting.

posted at June 11, 2003 at 04:10 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (1)

# Learning from Mistakes

InformationWeek reports on the flak Wired has been getting for posting the Slammer source code online and also in print in the July issue.

I suppose it depends on which side of the fence you sit on. If you are in the business of protecting systems of course you don't like viruses. You'd probably rather they didn't exist at all ... isn't that ironic since that's likely half your job?

But I sit on the software side of the fence. I see viruses as exploits of poorly written code. To me the blame lies with the software companies, too eager to release product and code too complicated to verify 100%.

So why is educating people about exploits so bad? If we teach people how to learn from common mistakes they will slowly disappear. If not because of these fresh U of C graduates' careful coding style than from the increased fear from software companies that we must be more secure or people won't use our software.

So let the crackers tear apart the code and try to write exploits. If they're learning something why can't the software companies learn something too?

posted at June 10, 2003 at 06:00 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (0)

# HTTT Released

posted at June 10, 2003 at 08:54 AM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (0)

# May the Schwartz Be With You

From my hit counter it looks as though my explanation of the Ant plugin problem was needed pretty badly. I'll try to post more things stuff like that to help people out. I knew that Google-juice would help me do good instead of evil. ;)

posted at June 10, 2003 at 01:01 AM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (0)

# AudioMan Goes Alpha

Thanks to some hard work by Jim our fourth year project is ready to debut. Meet AudioMan alpha UPDATE: (no longer posted, sorry).

AudioMan is going to be a digital music organizer with support for major music formats. We will gauge what types of organization people want by their participation in testing and their comments. In the current alpha version of AudioMan you can:

- Include MP3 files into your collection
- Include a directory (recursive dive into) of MP3s into your collection
- Browse the collection by artist and album
- Edit id3v1.1 tags

If you want to see features in AudioMan or have comments send an email to feedback(at)ryanlowe(dot)ca.

PS> 168 JUnit tests

posted at June 10, 2003 at 12:43 AM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (4)

# School Project

I've been working quite a bit on the school project, which ends in December. I don't know what the exact release plan is (and I don't want to speak for the group) but we will probably be releasing our first public milestone soon and announcing the project. It will be at the pre-alpha/alpha stage -- not that many features yet.

The project is written in Java using the Standard Widget Toolkit (SWT) and the Eclipse IDE.

I updated the project's Bugzilla defect tracking system but backed up the mySQL database before I did it, just in case. I was a little surprized when I saw the simplicty of the backup: SQL code. CREATE TABLE ... and INSERT INTO .... Sometimes things are so obvious you just have to say "duh!".

posted at June 07, 2003 at 12:00 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (1)

# Soda Popinski

Warning label (complete with symbol!) on a bottle of Stewart's Orange N'Cream Soda:


I don't know how they expect you to drink the thing ...

posted at June 05, 2003 at 01:02 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (2)

# Ant and JAVA_HOME

I'm writing this in my blog so it will get Googled. I tried searching for a solution to this problem and came up empty.

If you are using the Ant Eclipse plug-in and get the following error message

[javac] BUILD FAILED: file:C:/[ECLIPSE_DIR]/workspace/[PROJECT_DIR]/build.xml:32: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

you are using the wrong Java Virtual Machine (JVM) with Eclipse. Ant goes ahead and uses the javac from the JVM Eclipse is using no matter what you put in the compiler attribute. This is bad because Eclipse uses the first Java VM it finds on your computer's PATH variable.

In my case I installed the Java Runtime Environment (JRE) before the Java Software Development Kit (SDK) and Eclipse was using the JRE by default. Ant doesn't work with the JRE.

So you have to tell Eclipse to run using the SDK so that Ant can use the SDK. To do this make a shortcut to eclipse.exe and change the target to:

[ECLIPSE_DIR]\eclipse.exe -vm [SDK_DIR]\bin\javaw.exe

Where [ECLIPSE_DIR] and [SDK_DIR] are the full paths to the Eclipse and Java SDK directories respectively.

Update THU 15:43 This is going to be fixed soon according to the Ant Component's plan for Eclipse 3.0.

posted at June 04, 2003 at 04:44 PM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (79)

# MiniBlog

I'm liking the blog w/ MiniBlog format. Like I was saying to Jim the other day, it lets me post the articles and media stuff that I like while keeping my main blog free of short posts. As you can see most of my recent blog posts have been a few paragraphs long and that's definitely an inprovement.

I took the bold date titles out and the MiniBlog doesn't dominate the eye like it used to. It's just a little less dominant than the main blog, which is good.

I've noticed not a lot of people are commenting on the MiniBlog though -- maybe because people didn't know that the [0]'s were comment counts. :) That's understandable because it's not a very good visual cue but I'm pretty real estate-limited with what I can put in there. I added a title attribute to the comment links to give a tooltip but it's still not that great. What I'd like to do more is make a MiniBlog post and then make the first comment myself, which may help start discussion like regular blog posts do.

Update 13:11 You're right Jim, it does look a lot better on a CRT. Outside of changing my colour scheme to something with more contrast I don't really know what I can do about that. :) I will make sure that the text is readable even if the table boundaries aren't visable.

posted at June 02, 2003 at 10:06 AM EST
last updated December 5-, 2005 at 02: 2 PM EST

»» permalink | comments (3)

Search scope: Web ryanlowe.ca