Archive for January, 2009

Task Estimator Design Iteration #1

Wednesday, January 28th, 2009

I've been forced to step away from this for the past several days because of work commitments with my real job, but I wanted to take a moment to throw up (pun intended) the first iteration of my design for the task estimator.? I don't actually like it at all, so expect to see further iterations coming soon.

I've left a number of things out – notably the serialization and GUI – but this is the core engine as it exists right now. Ugly, huh? This is about as far as I've had a chance to take the design so far due to other demands on my time, but I remain ever hopeful that my schedule will free up “in just another day or two”… Of course, it looks like I'll be traveling again next week, so maybe I'll have a chance to work on it then.

If you are interested, I have been working on the design in Visual Studio 2008's Class Designer tool.? It is very cool, and very helpful since it will automatically generate these classes for you.? Plus, with the addition of the Modeling Power Toy, you can export the image out as an image map, as I've done here.

If you are using Visual Studio and aren't using this tool yet, for shame!? All you need to do to get started is add a class diagram to a project.? Visual Studio will automatically analyze the project and create the diagram based on your existing code.? Of course, you can also start with an empty class diagram and do all your class design work from there.? That is what I'm currently doing.? I find that it is much easier to change my class design and structure when I am simply editing a diagram.? When I have to actually dig into the code to make these types of sweeping changes, I find it much more difficult to resist the code's inertia (things tend to be “good enough”)…

Website Theme v1.1

Saturday, January 24th, 2009

I can never seem to leave things well enough alone…? In that vein, I have changed the site’s theme again.? I moved the links and menus over to the right so that the content takes center stage (since the site is in English, and English reads left-to-right, it makes sense to have the most important items on the left, which in my case is my content…)

I have also finally gotten around to solving a pesky little CSS problem that was causing me no end of trouble.? I am by no means an expert in CSS (I have all of about a week of experience in it), but I am slowly learning all the little quirks.? Originally, I had a problem with getting my menu and content to float together.? One or the other would always show up on top, with lots of empty space where I had expected it to sit.? My original workaround used the old standby of tables to force the elements to float in a horizontal line, but I never really liked the solution

Fortunately, when I was working on moving the search box into the right hand corner, I ran across the solution – it involved setting the appropriate margin to cover the fixed width item, and then using a wrapper element with a negative value for the same margin.? When all was said and done I could float a fixed width element in line with a variable width element that would expand or contract to fit the screen.? Very nice.

Unfortunately, when I tried to apply the same trick to my content block, the content would not expand to fill the screen.? It would expand as large as needed, but no larger.? In my desire to fix this, I tried a number of things, but eventually stumbled across removing the float for the inner element.? Since the wrapper element was already float’ed correctly, the inner element could remove the float and fill the entire space available.

The final issue that I encountered was that in my original design I could not click any of the links in my menu.? So quick investigation showed that the problem was that my wrapper element was occluding the menu element.? Since the occluded portion was transparent, you could correctly see the menu, but Firefox would not allow you to click on any of the links, since you were technically clicking on the content element.? This was fixed by ensuring that the menu element was displayed *after* the content element.? A simple re-arrangement of the HTML and the menu element becomes the top-most element, and all the links become active again.

So that’s it.? The new theme in a nutshell.? I’m hoping to learn and understand even more CSS as I work on the new main Code in Review site, so stay tuned.

AddThis vs AddToAny

Saturday, January 24th, 2009

So I recently decided to remove the AddThis button that allowed folks to share this site in a wide variety of ways.? Essentially, while I really liked the service, they decided to require Adobe Flash in order to track usage and record statistics.? Since I have no other Flash objects on my site, I thought it was best to avoid the confusion that could come from requiring it for a simply JavaScript button.

Over the past few days I've ben looking for a replacement and eventually I decided on Add to Any (http://www.addtoany.com).? It appears to behave in much the same way as my old AddThis button, but doesn't require Flash.? I'm hopeful that this widget will work out better than the last one.

?

** EDIT **

I have posted a more detailed comparison along with a side-by-side example of the two widgets.

Updated Theme

Friday, January 23rd, 2009

I’m slowly working through my TODO list, and I finally got around to tweaking my theme to move the search box up into the upper left where it belongs.? I also adjusted a couple of other things, and removed some items I don’t use.? As always, you can find it on my download page if you like it.

“Add This” and the Ubiquity of Flash

Thursday, January 22nd, 2009

This is beginning to annoy me.

In the interest of making it easy to bookmark and save links to this site, I have been using a service from AddThis.? It is very convenient in that all you have to do is go and fill out a quick little form and the site will provide you a handy little button that expands out to a bunch of different web sites, all ready to add a bookmark to your site.

This is great.? I am all for anything that helps my visitors return to the site.

What is annoying is that apparently this simple little button requires Flash.

In my personal browsing I use 2 browsers.? I use Firefox for my general browsing, and Internet Explorer for those sites that have “special” requirements (my polite way of saying those that don’t work in Firefox).? Since I generally find sites that rely on Flash to be annoying (if for no other reason than my back button on the browser never seems to work right), I don’t install it on my primary browser.? But there are legitimate uses for Flash, so I install it on IE.

Ever since I have signed up for AddThis, Firefox has been complaining to me that a component on my web site requires Flash.? It took me a while to connect it to the AddThis button since the button appears to work just fine without it.? So why exactly does this service require Flash?? I don’t know, but in the meantime I guess I’ll remove it until they can figure out a better way.? Perhaps I’ll throw together something that can do the same thing without Flash.? Its the principal of it after all…

** EDIT **

After a bit more digging, I found this little tidbit in the FAQ:

The menu uses Flash to get an accurate count of unique users of your AddThis Menu for usage reporting. No personal information is collected.

** EDIT 2 **

I found an even more informative post about this.? Apparently it is tied to their acquisition and the systems in use by their new owners.? For now, I have decided to remove the button – I had a few questions about what exactly I was using Flash for, and there really doesn’t appear to be a need for it.? So to avoid the appearance of something strange happening, the button has been removed – sorry!? If something changes in the service, I’ll be sure to add it back as soon as this issue is resolved.

Waist deep in new site

Thursday, January 22nd, 2009

So I’ve finally gotten around to working on the new site (http://www.codeinreview.com/).? Its still very much a work in progress but should look very familiar…? :)

I have a small vision for the site, including integrating the task estimation tool I’ve been working on.? So the key bit now is for me to get back to work on the tool – I’ve been unfortunately distracted by a number of different items, but I expect to get back on track this weekend.? In the meantime I’ve been mulling over some different designs in my head, and I think its time to start writing them down and see what falls out.

Stay tuned!

Screwed that one up….

Wednesday, January 21st, 2009

I guess this can serve as a lesson in what I’ve been saying for a while now – never change code you don’t understand.? Or perhaps just as importantly, if you do, always keep a backup…

So I’ve been playing around with the website for the last few days.? This is my first experience with asp.net development, so I’m trying to get used to the model.? I’ve always used PHP for my personal website, and my only professional web development experience (Expedia.com) used C++ and a custom markup solution.? Anyway, I decided to play around with the web.config file.? Change some settings, do some things like that to “improve” the site.? This all worked magically on my development setup, so I decided to migrate the changes to the live site.

Big mistake.

Essentially, I lost my connection to the database.? On top of it, I had forgotten my database user and password…? My hosting provider has a backup solution, but they wanted to charge me to get access to it, so I was a little bit concerned.? Fortunately, with a little bit of digging, I was able to get my user/password back, and then using that and some handy setup guides, I was able to recreate the correct settings for the site.? I even managed to apply the changes I originally wanted to since I finally understood what they were actually doing.

I guess in the end, it was a good experience, but most importantly, I know have an exact copy of my site and all its data safely tucked away on a removable drive, so the next time I decide I’m smarter than someone else, I’ll be able to recover when I’m eventually proven wrong.

Working on a few things

Thursday, January 15th, 2009

So I’m going to go dark for a few days here.? There are a couple of reasons – one is that I want to take the time to put together a first cut at the estimation tool.? Don’t worry, I’ll post the updates for everyone to see, but I want to set aside the next few days to iron out the details of the design and put together a mock-up of how I want it to work.

I have also decided that I need to generalize the Subversion Hook I wrote for work.? A few more situations have come up that are demanding a more flexible solution than I threw together the other night, so I’m going to work on a generic solution in my own time and post it on here when its complete.

So, I’ll be back on Monday or Tuesday, hopefully with some new goodies to play with.

Subversion, Command Line, and Redirecting the Standard Output

Tuesday, January 13th, 2009

I'm going to interrupt my estimation tool project in order to comment about an interesting mini-project that I finished last night.? Being a big fan of code reviews, I have recently managed to convince my team at work to require reviews for all code checked into the main repository.? Once I had everyone on board, I used a handy subversion hook provided by our review tool to enforce our new review policy.? This has worked well for the past month or two, until just recently when our project began to move into the pre-release testing phase.

The problem is that we have a large number of test models and the inability to commit new models without a review was beginning to hold up our progress on testing.? So it was requested that I exclude the test model directory from the review requirement.? It sounded pretty simple, so the first thing I tried was to look at the hook provided by our review tool to determine if I could have it exclude files or directories.? Unfortunately, it couldn't.? A quick web search turned up nothing resembling the hook I needed, so this left me with only one basic recourse – write my own.? Besides, it was an interesting diversion from my usual responsibilities.

Since we use subversion, setting up the hook was simple.? Essentially, I edited the pre-commit template to first call my own custom application that would determine if the changes being committed could be excluded from the review requirement.? If they could not be excluded, I called the review hook.? Simple, except I still had to figure out how to find out which files were being changed and figure out how to access that information programmatically.

The first problem was easy – SVNLook was made for just this occurrence.? With it you can discover a wealth of information about a given transaction.? The problem is that it is a command-line application that writes its output to Standard Out.? Of course, I know all about the theory of redirecting the standard output and so forth, but having spent my entire career doing graphical desktop and web-based applications, I had never had the chance to actually attempt it.

Fortunately, C# makes the entire process ridiculously easy:

????? System.Diagnostics.Process svnLook = new System.Diagnostics.Process();
????? svnLook.StartInfo.FileName = "svnlook.exe";
????? svnLook.StartInfo.UseShellExecute = false;
????? svnLook.StartInfo.RedirectStandardOutput = true;
????? svnLook.Start();
????? string output = svnLook.StandardOutput.ReadToEnd();

?

That's all there is to it.? The local variable “output” holds the entire output of the svnlook program.? The ReadToEnd method is useful because it blocks until the stream is closed, allowing you to block until the execution is complete.

There are other ways to do this (such as using the System.Console.SetOut method), but this was by far the easiest method I found.? Note that you must set the UseShellExecute property to false if you redirect the standard output, otherwise you will get an invalid operation exception (according to the documentation).

All things told, it was a refreshing change of pace for me, and a fun way to spend an hour or so at work.? I may even write and post a full-featured hook one of these days (of course, I'd probably use a different language to make it as portable as possible). In the meantime, I guess I should get back to my own mini-project…

So What Do My Estimates Look Like?

Monday, January 12th, 2009

Just to give you an idea of how I go about estimating things, here are my rough estimates for the 5 features I selected earlier.? You might notice that my estimates don't take into account everything I had listed in the features.? This was a conscious decision on my part to drop and or defer some functionality until later.? In the end, it goes back to wanting to keep the first iteration as small and nimble as possible.? That way I can adjust the tool to fit how I work iteratively – as I adapt to the tool, I can adapt the tool to what I want without worrying about large code changes.

Feature #1

I should be able to enter in a task, a length of time, and an indication of the range I think is possible
Total Time ~ 6 hours
  • Create Task class (2 hours total)
    • Create Data Members (1 hour)
      • Contains estimate in hours
      • Contains task name
      • Contains low/high estimate in hours
      • Contains list of child tasks
    • Create Methods (1 hour)
      • Adjust name
      • Adjust estimate with low and high estimates
  • Create Task Editor (4 hours total)
    • Enter new task (1 hour)
    • Edit existing task's name (1 hour)
    • Edit estimate in hours(1 hour)
    • Edit low/high estimate as percentage [0-100]. (1 hour)

Feature #2

I should be able to create child tasks.
Total Time ~ 7 hours
  • Update Task class (3 hours total)
    • Add Child Tasks (1 hour)
    • Add methods to add/remove a child (1 hour)
    • Add methods to automatically update estimates (1 hour)
  • Display child tasks in editor (4 hours total)
    • Display with name, estimate, and range (2 hours)
    • Add new children (1 hour)
    • Remove children (1 hour)

Feature #3

I should be able to specify alternatives/options for a given task.
Total Time ~ 11 hours
  • Update Task class (2 hours total)
    • Add Alternative Tasks (1 hour)
    • Add methods to add/remove alternates (1 hour)
  • Update Task editor (9 hours total)
    • Display Alternatives (3 hours total)
      • Display name, estimate and range (1 hour)
      • Add new alternative (1 hour)
      • Remove alternative (1 hour)
    • Select/Activate Alternate (4 hours)
    • Modify Display to indicate alternatives (2 hours)

Feature #4

I should be able to enter multiple estimates/ranges for a given task.
Total Time ~ 13 hours
  • Update Task Class (9 hours total)
    • Allow for multiple estimates and ranges (2 hours)
    • Adjust methods to specify specific estimate being edited (2 hours)
    • Update to indicate “active” estimate. (1 hour)
    • Update estimate calculation (4 hours total)
      • Account for only active estimates (1 hour)
      • Take mean/median of estimates (1 hour)
      • Take high/low estimate (1 hour)
      • Specify which algorithm to use (1 hour)
  • Adjust Task Editor (4 hours total)
    • Add indication of multiple estimates (1 hour)
    • Add ability to select estimate calculation algorithm (3 hours total)
      • Select algorithm (1 hour)
      • Add ability to select specific – active – estimate (2 hours)

Feature #5

The estimate should be saved in a human-readable format
Total Time ~ 8 hours
  • Define an XML schema (4 hours)
    • Hierarchically based on tasks
  • Serialize Task class to/from schema ( 4 hours)

That is the basic outline.? Right now I am looking at an implementation time of roughly 45 hours.? Everything is very rough at the moment because I am still in the design stage, but that is a pretty good start for the moment.

I should also point out that I have a minimum task time of 1 hour.? Since these estimates are composed of fairly small and granular tasks, these estimates may have been skewed upwards.? I think that skew will be balanced by the current uncertainty in the design, but we shall see.