Thursday, August 2, 2012

Basic instructions for git / GitHub

So, git is a version control system, and GitHub is a popular host for git. I don't know why it's so popular, but it may be because it makes it promotes forking and merging. If I want to extend or fix a bug in a publicly hosted project (e.g., jquery, Play framework, node), I can easily fork it and modify it at will. I can then submit (or not) my modifications to the owner of the original repository.

On a recent project, I finally decided to give it a try. I signed in at GitHub and installed its Windows client, which provides the basics: create local repository, create branches, commit, and publish/sync. After creating a local repository, I moved my files to the repository folder created at the git's deafult folder, went back to the client, commited it and published. That's it.

I found the dynamics quite interesting. I change my files, as usual. Then, anytime I want, I go to the client, which lists the modified files with the diff. Then I commit these files, describing what has changed. This is all local, and I can sync with the server anytime.

However, there were two other things I wanted to get done: to create a release and to publish it live (as it is an web project). This is not supported by the Windows client as of now, and it's not quite obvious to find out, so this is how I've done it:

How to create a release with GitHub Windows client

This can be done with the tagging mechanism. Once you create a tag, all its files are available as a single .zipped file. So, after commiting everything you want, you will need to open a command shell and add a tag refering to that commit.

In the client system, go to the repository, select the branch (if you haven't created a branch yet it will be in the default 'master' branch), then click on 'tools' / 'open a shell here'.

To find out the ID of the commit, use the git log command:

$ git log
or, for a brief version (preferred way):

$ git log --pretty=oneline

this will list all commits of this branch. In my case, it was this:


50b2ab641937cfcd9792923fa7bc47a40d6e51d0 balancing the difficulty
4edcda321423bece568e055b902e5d68d51251fe first commit

where the first collumn is the ID and the second collumn is the description of the commit. Then, you just need to use the git tag command, like this:

$ git tag -a 'tagName' 'commitId'

No, you don't need to tipe the entire Id, the first chars will suffice. For me, it was this:

$ git tag -a v1.0 50b2ab

It opens a text file - write the tag description, save it and close it. Now your release 1.0 is created. However, only in the local repository, you still need to send it to the server:


$ git push --tags

Ok, now you're done! Go to your GitHub page ( https://github.com/username ) and see that your release is right there in the tags' tab, with the option to download it as .zip and as .tar.gz

This was done based on the GitHub Learn site. I know, it is not as easy as it should be, but you probably won't be doing this often, anyhow.

The git tag command, without arguments, will list all tags you created so far:

$ git tag

The same can be achieved with

$ git describe --tags

No, I don't know what's the difference. Anyway, you may also delete your tags.

So, summing up:

$ git log --pretty=oneline
$ git tag -a 'tagName' 'commitId'
$ git push --tags


How to host your web project at GitHub

GitHub provides the feature of creating static pages for your project, on the likes of Google Sites, as well as a wiki. A third alternative is to create your own website, either for your user as a whole or for a particular project/repository.

To create a site for your GitHub project, open it in the GitHub client, create a new branch named 'gh-pages' and publish it. It will be available at http://username.github.com/repositoryName

Since my project was an web project, which was the actual site I wanted to get deployed, instead of creating a new branch I just used my 'master' branch. To do this, go to your repository in the Windows client, click on the branch name (at the top of the windows), then click 'MANAGE'. Then, click on the plus icon of the branch that you will use and type in 'gh-pages'. The plus icon reads "Create a new branch using this branch as the starting point".

After that, you can point to http://username.github.com/repositoryName and see your web system up and running. Actually, it may take a for it to be created, in the meantime GitHub will show a 404 error page.

So, summing up (2)


  1. Create a 'gh-pages' branch in your repository
  2. Access it at http://username.github.com/repositoryName


Points to explore later



And what about requirements?

The GitHub client is far, FAR from complete. However, it does provide the basic and most used functionalities with a good usability and a great response time. It does help its users. This is a lesson on requirements prioritization and release planning ;)

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!

Tuesday, June 5, 2012

Why, oh why?


I saw a post at LifeHacker that strucked me: "Hey, that's exactly why we use goal models", rather than use cases or anything else.

The post in question was about ToDo lists: "If You Want to Actually Finish the Tasks on Your To-Do List, Include Why You Should Do Them". When we know the goal, we can prioritize the tasks, think through alternatives, select what is more valuable to us, etc. Quite reasonable, right? That's pretty much why goal modeling is a good option for requirements modeling.

There are two more known goal modeling notations¹: i* (reads iStar) and KAOS. Both have been the target of invaluable research, even though they are not widely used in industry (yet?). More on then later.

¹ they are more than just notations, actually.

Thursday, April 5, 2012

How to install Eclipse with QVT [Tutorial]

Yes, we can execute QVTo (QVT Operational) transformations with Eclipse!! If you already installed the Eclipse Modeling Tools, you just need to install the Operational QVT plugin (Jump to step 3). If not, here it goes:

Quick and Dirty version:

  1. Download Eclipse Modeling Tools
  2. Extract and run it
  3. In the Eclipse's 'Help' menu, click at 'Instal Modeling Components'
  4. Select 'Operational QVT' and follow the wizard
If you wanna know how to configure and run a QVT Operational transformation, check our other tutorial.

Thorough version:

  1. Go to the Eclipse Modeling Tools site and download it. Wait, you don't know the Eclipse website url? Let's find out


  2. Ok, now we know it: http://www.eclipse.org/

    Click at 'downloads', select the operating system and download it.

    Eclipse home
    Download area - Select OS and then download the Eclipse Modeling Tools
    Download it

  3. Waaaait for it. Once it is downloaded, move it to the folder you want it to be installed in (Let's say, 'C:\EclipseModeling') and extract it there. Waaaait for it. A 'eclipse' folder will be created. Open it and run Eclipse
  4. Extract it

    And run eclipse.exe (if Windows)

    The Eclipse will ask you to select a workspace folder, i.e., a project folders. Browse for a folder (or use the default one) and click 'Ok'.
    In doubt, just press 'Ok'

  5. Once Eclipse is open, go in the 'Help' menu and click at 'Instal Modeling Components'
  6. In the wizard that follows, select 'Operational QVT' (in the Model to Model section) and click 'Finish'

  7. Waaaait for it. Press 'Next' and then 'Next' again.
    'Next' ...
    ...and 'Next' again

    Here you are expected to read the license agreement, select 'I accept the terms of the license agreement' and click 'Finish'.
    'I accept' and 'Finish'
  8. Waaaait for it. When the installation is finished, you'll be requested to restart your Eclipse. Go on.
  9. Waaaait for it (I promise you this is the last one). Now you're done! If you wanna check it, go to 'File/New/Other...' menu (Ctrl+N) and see that you can create a new 'Model to Model Transformation/Operational QVT Project'.
File/New/Other...

New 'Operational QVT Project'
That's it! If you wanna know how to configure and run a QVT Operational transformation, check our other tutorial.

What the hell?


I love programming. It is a hobby for me, as I find it very entertaining to solve these little puzzles people insists calling 'problems'. However, programming for programing is just fun - if we wanna make something really useful we need to pay attention to the world outside, right? That's pretty much why I started researching on requirements when I was a undergrad at UFPE/Brazil.

The research road is a long one, with plenty of time to learn and unlearn things. Specially those little obscure configurations required to use the diverse set of software engineering tools out there (i.e., Eclipse). Thus, I will use this space for sharing my thoughts and learnings on software engineering, hopefully helping fellow researchers on the way.

However, I cannot settle for that. In fact, the real reason I started this blog was to:

  • Estimulate requirements researchers/engineers to program! Yeah, get your hands dirty! Use the power of the machine to make your research even better!
  • Estimulate programmers to pay more attention to requirements! I know, the computer screen is so shiny, so attractive, so... but if we un-delve our head above the code ocean, we may find a fascinating world as well, full of interesting needs and desires waiting to be fulfilled!

So, what's your view on requirements and programming?