Sunday, December 14, 2008

Software Testing MindMap

Software Testing is not an easy topic, because of mass considerations.

So I just created a mindmap
to cover most perspectives around testing.

Saturday, September 27, 2008

big-endian UTF16 or little-endian UTF16?

I was working on generating configuration file for mobile device on PC today.
From the example, I can tell that it is using two bytes Unicode.
Thus I am using 'UTF-16' encoding for InputStreamReader and OutputStreamWriter.

However, it seems that the server running on mobile device doesn't like my configuration file.
By looking into the example and generated files, I notice that it was using little-endian UTF-16.
So I changed to use the following statement to write content in little-endian UTF16 encoding.

OutputStreamWriter out = new OutputStreamWriter(
new FileOutputStream(iniFile), "UTF-16LE");


Here are Unicode table for reference:























EncodingFile initial signatureJava encoding name
UTF 8FF BB BFUTF8
UTF 16 Big-EndianFE FFUTF16-BE
UTF 16 Little-EndianFF FE UTF16-LE

Tuesday, August 26, 2008

AntSys -- lightweight and powerful system test framwork

AntSys



Why write AntSys


I was looking for a well-know and easy to use open source tool for our system testing.
My requirements are:

  • Test Model, provides the concept of test suite, test case and test result

  • Test Method: launch command line application, check the outputs. which means should be easy to
    * configure parameters
    * setup environment variables
    * able to redirect stand input, output, and error
    * get back the process exit code

  • Test Assertions: should built-in with the following assertions:
    * check if output file is created as expect
    * check the content of output file against expected file.
    * check process exit code
    * check the content of system.ouput.
    * check the content of system.error.

  • Test Result:It should generate XML and HTML report

  • Test Language/API: the test language should provide rich API to help users write test case:
    such as create/delete directory, copy files, and even xml processing.

  • Extensibility: the test lanauge can be extended by end users.


  • Although the requirements are quite generic, I can't find a well-known OSS project. Most companies are
    using their own home-grow system test framework.
    Let's create a OSS tool to solve this problem then!

    What is AntSys


    AntSys is a lightweight and powerful system test framwork built on top of Ant.
    It is designed to be easy to work and user can create system/function test cases in xml file without writing single line of code.

    AntSys Tasks


    AntSys provides the following Ant tasks to write a system test:
  • tastsuite: is used to aggregate tests into groups of test cases that should be run together.

  • testcase: is a set of conditions under which a tester will determine if a requirement or use case upon an application is partially or fully satisfied.

  • assertfileexist: check if the output file is exist as expected.
  • assertfileequal: check the content of output file is the same as expected test result.
  • assertfilegrep: check the content of output file contains expected string defined in regular expression
  • assertpropertyequals: check the ant property against expected value. This is offened used after 'exec' task to check the process exit code.

  • Example test script


    Here is one example of test script to test echo command.

    <project name="antsys-systemtest" basedir="." default="systemtest">
    <target name="systemtest">
    <!-- this test suite is using AntSys to test echo shell commands -->
    <testsuite name="CommandTestSuite" failonerror="false" todir="./report" htmlreport="true">
    <!-- test echo command output -->
    <testcase name="echo_test">
    <!-- create working dir for testing -->
    <mkdir dir="work"/>
    <!-- use echo to create a test file -->
    <exec vmlauncher="false" executable="echo" output="work/test.dat">
    <arg value="testmessage"/>
    </exec>
    <!-- check the file exists or not -->
    <assertfileexist file="./work/test.dat" errormsg="should generate test.dat" />
    <assertfilegrep file="./work/test.dat" regexp="^test" errormsg="should start with test" />
    <assertfileequal expectedfile="./work/test.dat" actualfile="./work/test.dat"/>
    <delete dir="work"/>
    </testcase>
    </target>
    </project>

    Sunday, June 29, 2008

    Something big is right around the corner!






    The Symbian Foundation announcement this week will change the business strategy
    for mobile space in the following years.

    Android from Google is one big part of the reason for Nokia to pay 400M to buy Symbian and donate it to open source.
    Thinking about the Symbian/Nokia relation, this is the milestone in the use of open source by large tech companies like Nokia,

    Nine years ago, when i worked for Nokia, I found it is a company always ready to big change. I really respect to that.

    However, things are not clear to some related parties yet:

    • Employee
    In such big move to open source, Some teams in Symbian and Nokia will be cut (like what happened for UIQ).
    some time will shrink to fit the community driven mobel (How those managers find there position in community
    model?). As a symbianer, Do i want to wait for the special bonus?


    • Microsoft
    M$ will be the only company, who charge $ for mobile phone vendor. Let's see what will happen for them.

    • Apple
    Will iPhone be the most popular mobile device like iPod did for mp3? Can the company fight with foundation
    supported by major vendors and operators?

    Monday, June 23, 2008

    Symbian Fundation

    Big news again today.

    Nokia to acquire Symbian Limited to enable evolution of the leading open mobile platform
    June 24, 2008


    Visionary move embraces openness and accelerates innovation

    Sunday, February 17, 2008

    Config Idle Timeout for openSSH Fedora

    With some ssh servers, you can config the time out in /etc/ssh/sshd_config like

    IdleTimeOut=10m

    However, the openssh shipped with Fedora doesn't support this option.
    Two workarounds are:
    • Apply openssh watchdog patch
    http://www.sc.isc.tohoku.ac.jp/~hgot/sources/openssh-watchdog.html
    • use TMOUT for shell
    In /etc/profile
    #set the idle timeout for ssh to 10minutes
    TMOUT=600

    readonly TMOUT

    export TMOUT


    Notice here, need to set the TMOUT to readonly, otherwise users can override it.

    Thursday, January 31, 2008

    On The Road -- Google Map Mashup

    Just Created a google map mashup page to show those places i have visited.
    The page is hosted on google http://multiroute.googlepages.com/ajaxGoogleMapsMashup.html

    The draft version only show the list of places in the right side, and show marker and zoom in once you click the location.

    Plan to add more stuff when have time:
  • polish the site
  • show to pictures for each trip (Already in Picasa Web Albums)
  •