Showing posts with label beta. Show all posts
Showing posts with label beta. Show all posts

Saturday, March 01, 2008

Sloth v0.1.1 beta released

Hey "all".

So it is time for another beta, this time we're talking about Sloth v0.1.1 - an exciting new version which again has improved a lot of the internal design in Sloth. This means more unit tests for verifying that code changes does not break existing stuff, optimized code, and a cleaner, more maintainable design. This is of course a great benefit as it makes adding new exciting features a lot easier. But what visible changes does Sloth v0.1.1 give you, the user?

Works on Vista "out of the box"

Vista has gotten a lot of heat, but it won't disappear any time soon, so I thought it was important to support it properly. Sloth now puts log- and configuration files in proper places so that Vista does not go ballistic because it tries to write to Program Files etc. This also means Sloth works well in terminal server environments.

Alert changes

You can now tell Sloth to alert you when a particular show is on - no more tagging or creating a rule manually. Just point to a show, right click, and choose "Notify me of this show". When the time comes, Sloth will let you know. Also, there is now an option (on by default) to tell Sloth not to display alerts while a full-screen application (presentation, video, game) is running.

If your screen resolution or screen working area changes, Sloth will now rearrange any open alerts to reflect this; No more alerts all over the place. When an alert is closed (automatically or manually by the user), any remaining open alerts will be moved to fill the open slot.

Rule handling changes

Rules are now handled in their own unit-tested section of the configuration. Quite a lot has been done internally to work with "delta rules" - i.e. when there is a rule change (a rule has been added, deleted or modified), Sloth will only update with the changes, not all rules as before. For users with significant amounts of rules, this should be noticeable. There is also a new search subsystem, which is currently only used for rule matching. Not yet optimized, but almost as fast as the old system, and vastly more flexible.

Community functionality

There is quite a lot being done to support community functionality; Show ratings, discussions etc. Not a lot of this is visible in the current beta, but more will be seen soon. It is now possible to rate shows in the community, but that won't show up for anyone else yet. The community functionality also includes a simplistic news system and a better Sloth Updater feature.

Better tools for helping me debug problems

A new program - SlothBetaInfo - is now included in the start menu. This will make it easier to locate logs etc. Also, if Sloth should crash somehow, you will now get a window with exception info that I would highly appreciate on the forum along with an explanation of what went wrong.

Other changes

Loading the XMLTV data file is now a lot faster. The notification and installation of newer versions is a lot more robust. A lot of old code has been cleaned up and refactored. TV data grabbing is less error-prone. Sloth also handles new TV channels showing up in data files without problems.

More statistics

As a follow-up to last time, where we had 92 passing unit tests, we now have 355. Does this guarantee that there are no bugs in Sloth? Of course not. But it means that if I change some code that is covered by a unit test, and break something, I'll know right away. And as I mentioned after v0.1, if a new bug is found in this code, I can add a unit test to check for it - if it comes back, I'll know immediately. Another important metric here is code coverage - how much of the library code that is actually tested by unit tests. The current numbers are:

SlothCommunity 40%
SlothCore 65%
SlothUtil 73%
SlothConfig 76%

While 100% code coverage would be nice, it's not necessarily realistic. However, I will work to improve the testing, making sure it is harder and harder for bugs to slip by.

Summary

Well, perhaps no revolutionary new features, but all of the above contributes to make Sloth a much more mature, stable application. I will try to move into quicker-iteration mode now, adding some nice new features and releasing both alphas and betas at a quicker pace. Happy testing!

Wednesday, June 20, 2007

Sloth v0.1 beta released

This is the first beta that is announced on this blog - and it is also the first beta that uses the .Net Framework v2.0. All beta testers up to and including v0.0.25 got away with just using .Net 1.1, but now you will all need to upgrade. You can download the .Net 2.0 framework installation here if you don't have it (the Sloth installation will tell you if you need it).

Apart from the move to .Net 2.0, there are a number of changes, fixes and additions to Sloth this time around too. A massive job of refactoring has been undertaken as well - this will not really be visible to users (perhaps except in the form of new bugs), but it has really cleaned up the codebase and will make it a lot easier to add exciting features in the future. The job is not finished, however, so a lot of time will be spent on refactoring for the next betas as well. This really should be reflected in the overall quality of the application.

So apart from boring stuff, what's new this time?

New features in the search window

Instead of just searching for phrases, you can now also perform "all words" searches, as well as search for regular expressions and tags.

image

In this example we have searched for anything that contains both of the tags "babe" and "star" (these tags are defined by my personal rule set, and may or may not be anything like the ones you're using).

As you can see, there is also now a Search button in place. This means no more "I'll start searching if you haven't typed anything for 0.8s" behaviour.

Tags are now clickable in ShowInfo windows

A consequence of the above is that it is now also possible to click the tags displayed in ShowInfo windows such as this:

ShowInfo window for Star Wars III with clickable tags

Clicking a tag would open a search window like in the last paragraph, showing all shows containing the same tag.

Programmable hotkeys

In older versions of Sloth, there were just two hard-coded hotkeys; Win-S for opening the main window, and Win-K for killing all open alerts. It is now possible to define as many of these as you want. The config window GUI is pretty ugly still, but it mostly works.

image

I'm guessing there's room for improvement here. Just like in every single other piece of Sloth GUI. :)

Keep in mind that this means that the two hardcoded hotkeys are no longer there! If you want to keep them, you'll have to add them yourself!

New context menu

Sloth now features a global, semi-intelligent context menu. This menu formats itself according to what the user is clicking. In the future it will also be user extendible, meaning you can add your own options to it. Want to search a certain website for actor information? Or perhaps launch VLC with the IP address of the channel you're clicking? The possibilities are.. eh.. well, several.

Grid view enhancements

The grid view is coming along nicely, although it is still a performance slug and there are a number of bugs living large.

image

You can now right click on individual shows and get the same context menu as in the rest of Sloth (see above).

Find pictures of actors and directors

Don't you just hate it when you recognize a name but you just can't place them? Well, I do, so I made this silly little thing which locates pictures of people off the net and shows them to you. Like this here:

image

You get this function by right clicking on an actor or a director in the ShowInfo window, and then choosing "Find picture(s)..." - please note that this is a web search, not in any way under my control, so the pictures you get may not even be remotely related to the person you're looking for. It could be them, or it could be someone they worked with, a movie poster without them featured, or their stalker.

Alerts rewritten

Alerts have been completely rewritten from the ground up. They may still look almost the same, but they now use much less resources, the close button is bigger, they can be used for much more, and they don't steal focus from other applications when they appear. They also react better when scores change.

Download and install new Sloth from inside Sloth

I know a lot of you - and myself - have wanted this feature for a long time. And more software really should have it. Remember the old, annoying window that would pop up with New Sloth information and not close until you went to the forum? Well, here's the new version:

image

Check out the ugly blue progress bar at the bottom. This appears after the user presses the Install-button. Once it is done downloading, it will start the installer automatically. The installer will in turn shut down Sloth and optionally restart it after the upgrade. All you have to do is click "Next".

This feature will of course not be seen by anyone until it is time to download the next beta after this one.

Minor changes to GUI and other stuff

There is a new date picker control in windows where you can choose what day to watch (individual channel windows, Interesting Shows window, and Grid window). This is currently a simple dropdown list showing the list of dates we have TV data for.

Bug fixes

Unsurprisingly, a number of these bug thingies have also been fixed. The fixes include:

  • Even if Sloth was configured not to play an alert sound, it would try to, throwing an exception in the process.
  • Tags are now case insensitive.
  • In certain conditions, if you added a new rule, alerts would not show up for shows matched by this rule (even if their score was high enough) unless you restarted Sloth.
  • When rule changes led a show with an open alert to drop beneath the alert threshold, the alert was not removed.
  • If the config window was minimized, pressing the Config button (main window) or menu item (systray context menu) did not "unminimize" it.
  • If shows in the XMLTV file are overlapping, Sloth will now clip them so that the first show stops when the second begins.
  • If rule changes cause tags to be added/removed for a show with an open ShowInfo window, the tags display will now be updated properly.
  • If you delete a rule in the config window, the rule list/categories are no longer reset. This caused GUI annoyance.
  • A bug that caused Sloth to screw up config window GUI related to online file checking has been fixed.
  • The wizard could overwrite your rule file if you ran it after the initial install.
  • The wizard could in some cases put the main window outside the screen on low-resolution systems.

Supported operating systems

Currently, Sloth is only verified to work on these versions of Windows:

  • Windows 2000
  • Windows XP

It also installs and runs fine on Windows Vista, but if you end Sloth and then restart it, it won't run. It also won't run after a reboot - in fact the only time you can get it to run is right after the installation. This is being looked into.

Statistics

I am slowly implementing unit testing for the libraries (SlothConfig, SlothCore, SlothUtil) to make sure I can refactor code without breaking existing functionality. That is the idea, anyway. Basically, I am supposed to write a test that runs every piece of the library code with every possible piece of input, and report if it breaks. I am not there yet. But for each test I add, it is less likely something will break as a result of change. And every time I fix a bug, I can write a test to make sure it doesn't come back.

As of Sloth v0.1 beta, there are 92 unit tests passing, and none failing. If some failed, I couldn't really release it.

 Availability

If you're a beta tester, you know where to get it. If not, send me an email, and we'll see about making you one. :)

Wednesday, May 30, 2007

Retro-fitting design, unit tests and coverage

Blog is back in business, after a good run of dormancy. Or is it? We'll see.

A while back, I got caught up in the hype surrounding test driven development. I read a bit about it, and while the whole Agile religion got to be a little too much for my tastes, I've tried to adopt a few of the practices. Of course, I see the point of writing the test first since it would be easy to get a unit test for an existing piece of code to verify that it does what it does. However, when you're aware of this, I've found that it forces you to put more thought into how you implement the test for existing code, which in turn can open your eyes to some good refactoring opportunities.

However, some other parts of the mantra (like pair-programming and their seemingly obsessive attitude about snacks) are simply not for me; It's hard to work in pairs when you're alone, and snacks might be the best way to treat my newly discovered diabetes. Well, I guess I can eat some fruit.

However, I can easily see the benefits of Test Driven Developement and refactoring, even in a relatively simple desktop gadget like Sloth. Keep in mind that I've been learning .NET and C# along the way here; Object oriented programming is something that has been completely new to me until recently. I guess you could say I'm the worst kind of self-taught waterfall-cowboy. :)

So, what happens when you mix a little theory on OOD, refactoring and unit testing with the spaghetti code from hell that is your existing project?

Well, at first I was very happy that these new ways of thinking helped me do a lot of clever refactoring. Code was optimized (no, not performance optimized), moved around, things are only done once, in smaller units.. The libraries have become leaner and more maintainable. That's for sure.

Then came the time for getting rid of some serious code smells. Almost all of the configuration related code has been moved to the designated library - except for the ancient configuration window, where a LOT of nasty code duplication is happening, and the main Session object, a textbook example of a God object if I ever saw one.

One of the problems with the fact that I was trying to apply the proper Object Oriented Design after the fact, is that the configuration window had no concept of the SlothConfiguration object. This object (via it's subobjects) contains everything you need in a configuration, and both the Wizard and Sloth itself uses it for everything config-related. Except the config window. It just copies out the bits and pieces it likes, and then leaves the session object to figure out what to do with a zillion properties. Apart from the maintenance horror, there are just so many things wrong with this that the few hairs I have left turn gray just looking at the code.

So after two weeks of boring code-monkey grunt work, I am almost to the point where I can start testing again; The configuration window knows nothing of the underlying logic, it just clones itself a config object and uses it. Then, if the user is happy and closes with the OK button, this config is made active. Sounds simple, right? Well, NOW it is.

So what I have left now is a God-object (10% smaller than when I started) that still needs heavy refactoring, a relatively flexible config solution, and utility libraries that keep growing. What's next?

Well, for a desktop application like this, the cool thing is of course adding new features. And I will do that. However I will spend half the coding time refactoring and testing until I can show the Sloth source code to someone's grandmother and not be embarassed. That'll take a while.

I must add that the process of learning to utilize unit testing (a process which I am nowhere near mastering) has been quite painless thanks to three very nice projects: TestDriven .NET, MbUnit and NCover. I love using them, and can recommend them to anyone wanting to give unit testing/test driven developement in Visual Studio a try.

All right, that was my first attempt at a blog rant. I already see that this was pretty boring, so if anyone by chance stumbles on to this blog, thanks, I'm not expecting to see you again. :)