Monday, September 24, 2012

Unit Tests: automatically generating

I've recently assisted to a course about different ways to automate testing. It includes generating, coverage and generating input for the tests.


This is a tool that analyses the code coverage of tests. When we write tests, the idea is that all the lines of our code will be executed. This tool allows us to check it. The result is going to be shown directly over the code with helpful color highlighting.
An Eclipse plugin is available and also a standalone version for use from Command Line and Ant.
Link to CodeCover:


This is my favorite one. It randomly generates unit tests! The best thing of this is that is really useful, you don't need to write any single line of test code.

How it works? For each method tries to generate code to call the method in different ways, and using different seeds of code generates random code to achieve unexpected exceptions or problems with the class invariant. To check the class invariant it requires a method usually called repOk(). This method ensures that the object under test is in a valid state. For example:

public boolean repOk() {
    if (size < 0 ) return false;
    if (size == 0 && last != null) return false;
    return true;

Other example a little bit more complex:

public boolean repOK() {
    int itemsLeft = size;
    Node current = last;
    while (
itemsLeft>0 && current!=null) {
        current =;
    return (
itemsLeft==0 && current==null);


Eclipse plugin


Given a class and a test case, this tools mutate(ie changes) aritmetic operands and logic. The it runs the tests, and if they won't fail, then you've bad test cases.
It's very easy to use and more than helpful.



Korat helps you to create input data for testing. Given a class invariant and domain restriction about its attributes, Korat generates valid structures and with no redundant results.
This is very usefull if you have a complex data type and you want to test it with lots of valid data sets.


A powerful tool that uses constraint solving engine to execute all your code and detect possible fails. It's only available for .NET.
There is a fun online app which is called Pex for fun that makes you guess code by modified constraint solving engine.

Tags: test, random, eclipse, junit, code, java, net.

Sunday, September 9, 2012

Kindle 4 get oxidized

Part 1:
The problem

I bought a Kindle 4 five months ago. Since then I've protecting my gadget using a cover that I've bought via focalprice. I'm so proud of my Kindle since is quite cheap, and reading books inhere is a pleasure. One day I get my Kindle out of the cover and realized that the back part of the kindle was dirty, with black spots. Doing a little of research I get to know that if you leave your Kindle inside some kind of covers I could get all oxidized.
Also my girlfriend and a friend of mine run in the same problem.

Part 2:
What Amazon said

I've send an email to amazon to complain about my defective Kindle 4. I didn't get an answer at all because I got an automatically email response. I'll be calling amazon in a couple of days and then I'm gonna update my post.

Part 3:

Unknown yet.

Tags: kindle, problem, amazon.

Saturday, September 8, 2012

Best Android apps

Hello all! I left here my top android apps that help me every day.


    This is a complete backup and restore app very useful if you frequently change your ROM. It also give's you the possibility to backup you app's data.


    An easy and very effective firewall. Allows you to block the apps you won't want them to access internet(3G and WiFi separately)


    Send free sms all over the world with this app. It works with most mobile companies of the globe. You're given an USA number, where you'll receive the answer if your friends reply to that number.


    An already well known online file sharing service. The mobile app helps you to sync your photos with the could automatically. If you dont have a data plan, you can choose to upload them only when WiFi is conected.


    Find out what's the song name that's currently being played in a disco. It doesn't introduce any new concept, but it works fine.


    A simple but beautiful and with lots of configuration calendar widget. It's very lightweight and doesn't consume any battery at all.

Note: I highly recommend you to root your phone. It's safe! And you'd get much more functionality that way.

Tags: android, apps, best, top, security, daily use.

Saturday, September 1, 2012

Files on the Cloud: the best of the best

Hi there! I've been doing a little bit of research about which online file sharing is the best, and I got to the following conclusions:

Google Drive

Pros: 5GB free. Very cheap pricing: $2.5/month for 25GB and $5/month for 100GB. The integration with google docs its an advantage.
Cons: no linux support yet.


    Pros: 2GB free, up to 23GB free doing referral and camera upload(easy to achieve). Supports all platforms and smartphones. Very easy to use and to share files.
    Cons: Pricing starts at $10/month for 100GB.


      Pros: 30GB free! It's a complete OS online. You can customize it and runs directly from a browser. Allows you to edit files online: doc, xls, jpg and more.
      Cons: no mobile app.

      For a complete review about Google Drive, Dropbox, SkyDrive, SugarSync, iCloud and others check this link. But be aware, it's a little bit outdated.