Tuesday, July 17, 2012

Decision Trees Tool - Origin

Once upon a time, I was checking the blog of a well known programmer reporting troubles with an IF statement. Wow, if even an expert programmer can get into difficulties, what about "normal people"? By the same time, I was reading the good Software Requirements book by Karl Wiegers. In its modelling chapter it describes how useful decision trees can be when trying to express some requirements. I can't help but agree with him. I mean, take a look at the picture below, based on the book. Anyone can understand when the request should be accepted or rejected, right?


In contrast, consider this: When the user is authorized, and the chemical is available, and or the chemical is not hazardous or the chemical is hazardous and the user is trained, the request is accepted. It can be quite confusing, huh? Not to mention the ambiguity...

So, there must be a tool that enables us to model a decision tree and to do fancy stuff, like generating decision tables, IF statements, etc., right? Right? No, or at least no that I could find.


By the same time, I was seeing all that HTML5-related hype going on, with good browser support for stuff like SVG, local database, javascript workers, CSS3... then I realized that such a tool would not only be useful, but also fun to create, and a great learning opportunity! Thus, after some weeks thinking "oh, should I do it, or should I not?", I finally took a saturday to develop such a tool.

By the end of that (long) day, I was quite pleased with the result, all the functionality for modeling the tree and saving/load XML was done. But then - life happens - I let it stood by... eventually I'd play around with it. One day I started using Twitter bootstrap to have a standard good-looking UI (buttons, modals, and so on). Other day I embedded a very simple plugin-like system. Another day I used canvg to save the tree as PNG. At this point, I realized "well, it's not nearly as fully-featured as I'd like it to be, but it is already useful", then I prepared starting things up to launch. You know, register domain, create a basic surrounding website, setting up analytics, creating a feedback form, etc. In the mean-time, I had it alpha-tested with some friends. Everything was ready at... 3+ months ago. Because, well, as you may know, promoting a website can be waaaaaaay more time-consuming than developing one.

But that's it, no more delays, the time is now: here you have the Decision Tree Tool. Go around and play with it! I know it's not nearly perfect, but now it's up to you to tell me what needs to be improved! I'm sticking with Karl Wieger's view of binary decision trees (yes/no), but if you really need it to be flexible, it shall be so!

Go on, play with it and spread the word!