Klaros Test Management

What do you use for your Test Case management? Excel? Word? Paper?! While most software companies have bug tracking systems, most have poor or no test case management systems. They have no easy way to record the tests run and report the results.

After some digging, I found a free software (commercial use as well) that seems to do a good job managing tests and test cases. http://www.klaros-testmanagement.com/

Tests can be broken down into projects, environments, systems and test suites. Each test case can be broken down into steps.When executing manual tests it guides the tester through the steps of the test case and allows the tester to pass/fail each step.

Klaros allows integration with popular bug tracking systems like JIRA, Mantis, Trac, Bugzilla, etc

The default installation uses Apache Derby as the database backend. It's easy to switch Klaros to use MySQL (or another DB of your choice) instead.

The enterprise (paid) version has nicer reports but the free version is a little poor on useful reports. However, you can always tap into the database backend and write some scripts to roll your own reports. The database is complex but if you use MySQL Workbench to generate a nice ER diagram you can work your way through the rabbit hole and figure out the relationships


Installation Notes:

For my evaluation of the software I used the full Ubuntu-10.04x64 Server on a Virtual Machine. I ran most of the setup through an SSH terminal but the Klaros setup was run from within the VM's GUI console to the Ubuntu GUI. In case anyone is out there struggling like I was here are the steps I took to install Klaros:

1. Download setup
wget http://www.klaros-testmanagement.com/files/Klaros-Setup.jar

2. Install Java
sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk 

Check Version
java  -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode)

3. Install Klaros
I ran this from within the Ubuntu GUI terminal.
java -jar Klaros-Setup.jar

Follow instructions here: http://www.klaros-testmanagement.com/files/doc/html/User-Manual.Installation.InstallationProcess.html
  
4. Stop Klaros, if you selected to start it.
/path_to_klaros/bin/catalina.sh stop

5. (Reccomended-Optional) Switch Klaros Database
*pick a real password please!

Install MySql:
sudo apt-get install mysql-server mysql-client
mysqladmin create klaros or mysqladmin create -uroot -proot klaros

Switch Klaros Database:
vi ~.klaros/hibernate.properties

Replace file contents with (replace mysql credentials with yours)
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/klaros
hibernate.connection.username=root
hibernate.connection.password=root

7. Start Klaros
/path_to_klaros/bin/catalina.sh start
You can use --help for more options
 
8. Test in browser Navigate to: http://localhost:18080/klaros-web/  

9. Check if Klaros has populated mysql If you switched the database in step 5
mysql klaros -uroot -p
... 
mysql> show tables 

10. Setup email
To allow Klaros to send out emails I installed postfix as my mailserver. You can find installation guides online. One snag I hit is the fully qualified hostname is in your hosts file before localhost

user@ubuntu:~$ cat /etc/hosts
127.0.0.1       klaros.myserver.com localhost
127.0.1.1       ubuntu



Thats It!

What is the install locations for apps on the Android?

Location of pre-installed applications:
/system/app

** you need root access to get to the directories below **
Location of user installed application .apks (installer file):
/data/app

Location of user installed apps:
/data/data


Signal Strength of Wireless Clients

Scanning RSSI for access points is easy and there are a million apps for that!. Scanning the signal strength of the clients stumped me for a while till someone pointed me to a linux tool called iw.

On your router try: iw dev wlan0 station dump (wlan0 is your interface name)

Sample output:

Station 00:c0:02:3d:bd:9f (on wlan0)
        inactive time:  50 ms
        rx bytes:       117633826
        rx packets:     94924
        tx bytes:       4450552
        tx packets:     61371
        tx retries:     2050
        tx failed:      7
        signal:         -34 [-36, -40] dBm
        signal avg:     -33 [-35, -39] dBm
        tx bitrate:     54.0 MBit/s
        rx bitrate:     36.0 MBit/s

Android SDK Java Source Jars

The easiest way to download the source jars for the Android SDK.
GrepCode > com.google.android/android > 2.3.3_r1
Click the down arrow on the page to find SKD Versions:
  • 2.3.4_r1
  • 2.3.3_r1
  • 2.3.1_r1
  • 2.3_r1
  • 2.2.1_r1
  • 2.2_r1.1
  • 2.1_r2
  • 2.0_r1
  • 1.6_r2
  • 1.5_r4

A Visual Explanation of SQL Joins

SQL join always drive me crazy. INNER, OUTER, LEFT, RIGHT, CROSS, FULL!!
Here's a nice visual representation of the joins.

http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html

SVN Keywords: Automating the Modification History Header

Remember the days of manually editing the modification log in the header comment of your source? If you have SVN you can leverage SVN Keywords to automate inserting the log information. This way you never forget and each checkin has a revision number in the file!
Here's How:
  • In the source file header comments type:
    /*
    This is inside a Comment Block.
    
     $Author$
     $Date$
     $Rev$
    */
    
  • Select source files
  • Right Click > Tortise SVN > Properties
  • Select New
  • For Property Name select svn:keywords from drop down list
  • For Property Value paste: Author Date Rev Id
  • Commit
The source will be modified to read:
/*

This is inside a Comment Block.

 $Author: authorname $
 $Date: 2011-05-04 14:51:48 -0400 (Wed, 04 May 2011) $
 $Rev: 55648 $
*/
A little crusty but automated!

Mounting a SD Card in the Android Emulator

Unlike the backberry emulator the android emulator doesnt simply pretend that a directory on your drive is the SD card. You need a formatted .img file that it will use as the SD Card.
Why do you need the SD Card? Well besides using the SD Card in your app, the more important use is for profiling and debugging. Without the SD Card you will hit errors like
Unable to open trace file permission denied
Here are the steps to setup the card.:
  1. Open up the console (cmd) and navigate to the android SDK tools folder cd Android\android-sdk-windows\tools\
  2. Create your SD Card image. NOTE: 8MB is the minimum size the emulator will accept mksdcard -l mySdCard 1024M mySdCardFile.img
  3. Open up Eclipse and modify your run configuration. In the 'Target' tab enter th following for 'Additional Emulator Command Line Options': -sdcard C:\Android\android-sdk-windows\SDCard\SDCard64MB.img
  4. Click run and you should have an emulator with an SD Card.
If you are faced with: ERROR: the user data image is used by another emulator. aborting, or if the SD Card doesn't show, try restarting adb.

To restart adb enter the following in the command prompt: cd C:\android-sdk-windows\platform-tools adb kill-server adb start-server

Blackberry OTA with LightTPD or Apache

This works for files compiled with eclipse. I'm sure it can be easily adapted, if necessary.
  1. Ensure you files are signed if needed.
  2. If your cod file is unzippable, unzip it (Winzip works). If not use the single cod.
  3. Create an 'OTA' folder in you web server.
  4. Copy the multiple or single cod file to the folder.
  5. Copy the jad file to the folder.
  6. Create a .htaccess file in the folder with the following contents
  7. AddType text/vnd.sun.j2me.app-descriptor jad AddType application/java-archive jar AddType application/vnd.rim.cod cod
  8. Restart your apache or lighttpd web server
  9. Use your BlackBerry to navigate to the url: http://[server]/OTA/[filename].jad

That's it!


Reference:
http://assets.handango.com/marketing/developerTeam/BlackBerryOTADeployment.pdf

Manually create VMWare Desktop Shortcut

  1. Install the VMware Remote Console plugin by running https://localhost:8333/ui/plugin/vmware-vmrc-win32-x86.exe\
  2. Find out what what your Guest ID by looking at the objID tag in vmInventory.xml in either /etc/vmware/hostd/ or %ALLUSERSPROFILE%\Application Data\VMware\VMware Server\hostd
  3. Find the location of vmware-vmrc.exe. This depends on your version of Windows/Internet Explorer. Look in the following Locations: 32-bit Widnows XP: C:\Program Files\Common Files\VMware\VMware Remote Console Plug-in\ 64-Bit Windows 7: C:\Program Files (x86)\Common Files\VMware\VMware Remote Console Plug-in\
  4. Right click on your desktop and create new shortcut to: vmware-vmrc.exe [path-to-vmware-vmrc.exe] -h localhost:8333 -M [objID]

    Example: "C:\Program Files (x86)\Common Files\VMware\VMware Remote Console Plug-in\vmware-vmrc.exe" -h localhost:8333 -M 16


References: http://www.google.com/support/forum/p/Chrome/thread?tid=1e2eceea54682f11&hl=en

Updated: Key Value Pair Spinner (Android)

I did a little tweaking and optimizing for my key value spinner. I looked at the android source and realized that the BaseAdapter already implements the SpinnerAdapter. Infact I could simply extend the ArrayAdapter and let it do all the liftin for me.

I also wanted the drop down to look like the simple drop down but I wanted the list to look like the radio button list. A little digging through the Android source code and I found what I needed. Here is a stripped down version of my code.

public class KeyValueAdapter
    extends ArrayAdapter<String>
{
    private final Hashtable<String, CameraSource> _data;
    private final String[] _keys;

    public KeyValueAdapter(Context context, Hashtable<String, CameraSource> objects)
    {
        //To make the drop down a simple text box
        super(context, android.R.layout.simple_spinner_item);
        _data = objects;

        //To make the drop down view a radio button list
        setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        
        // TODO; Do your own data massaging here to present the data in a ordered list.
        
        //Assign hash keys with a position so that we can present and retrieve them
        int i = 0;
        _keys = new String[_data.size()];

        for (final Enumeration<String> e = _data.keys(); e.hasMoreElements();)
        {
            _keys[i++] = e.nextElement().toString();
        }
    }


    public int getCount()
    {
        return _data.size();
    }


    /**
     * Returns the camera name for the camera in the specified position 
     */
    @Override
    public String getItem(int position)
    {
        //TODO: return the value based on the position. This is displayed in the list.
    }

    /**
     * Returns the cameraKey for the camera in the specified position 
     */
    public long getItemId(int position)
    {
    //TODO: Return an id to represent the item. 
    
    return position;    // if this function is of no use to you simply return the position. 
                        // if your identifier is a different return type then you can make 
                        // your own method  eg: public String getPromaryKey(int position) and 
                        // call it where you need your identifier.
    }
}