Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Category Archives: Testing

HOWTO: Block Google to simulate the Google-less environment

Some Chinese Zanata users report they cannot use Zanata in China.

In order to simulate the environment, I run following script:

iptables -I INPUT -s -j DROP
iptables -I INPUT -s -j DROP
iptables -I INPUT -s -j DROP
iptables -I INPUT -s -j DROP
iptables -I INPUT -s -j DROP
iptables -I INPUT -s -j DROP
iptables -I INPUT -s -j DROP

Since I just want a quick environment to simulate the Google-less users, nor do I obtained the exact blocked IP ranges,  I did not spend much time on fixing false positive and false negative of these IP ranges.  So do check whether your web services are fallen with in the range before you test it.


recordmydesktop: screen recording for linux

A picture is worth a thousand words, and a video is worth a thousand pictures (literately!), especially for bug reporting.

Anyway, I have tried gtk-recordMyDesktop, which is gtk frontend of recordMyDesktop, a desktop session recording tool.

It is not hard to use, and capable of recording my voice. See this  for result.

The packages are in official Fedora repositories, so to install::

sudo yum -y install gtk-recordmydesktop

Replace gtk-recordmydesktop with qt-recordmydesktop if you perfer qt frontend.


TDD 其實也是測試的一部分

看到一篇很有趣的文章:不要把 TDD 和做測試混為一談


  1. 不該否定TDD 的價值
  2. 測試和TDD不能混為一談

在繼續討論之前,先看看 W Model

大部分人以為測試只有 W Model 的右半邊,也就是說只有 Unit test、Integration test、System test 以及  Acceptance test。

但是實際上測試在 W Model  的左半邊也算,而且在左半邊就開始測更加事半功倍。而TDD 其實就是 Push 開發者作左邊的測試的方法之一。

對於系統應該長甚麼樣,有什麼行為,大多數的使用者、項目經理和  Business Analysts都只有一個模糊的概念。經由 TDD,開發者更有機會在需求面發現實際需求,而不是蓋完房子之後才發現使用者還要窗戶和廁所,到那時才改那就吃力不討好。


A software may pass the UAT, yet nobody want to use it

I recently encountered an interested case: we are asked to evaluate a system through user acceptance testing (UAT). I looked at the testing, it is essentially a set of functional tests.

I wonder what’s the difference between functional tests and UAT, and dig out the following link.

According most posts on that thread, the differences between UAT and functional testing are just focus and scope, that is, if functional testing is performed by users for the sake of user, then it’s UAT.

While there is nothing wrong for functional testing including in UAT, however, if UAT only contains functional testing, it is possible that users tick all the box, but still avoid to use the system. For example, if the system requires a complex authentication mechanism to login, while with alternative you don’t have to. Even the system does everything else correctly it was designed, you would most likely to use the alternatives instead of the system.

So stop wondering why your system pass UAT but people deflect to alternatives. Please at lease asks following:

  1. Do you need to use this system?
  2. Do you enjoy using this system? If not, why?

If you feel like it, you may even ask

3. Will you use this system.

You may get interesting results combining the answers of all there question.

How to temporarily block a web site for testing lost connection

At my work, I need to test whether a web application return proper errors when the connection is lost.

I searched and tried several site blocker add-on for Chrome and Firefox, however, most of them are design for blocking the site that aren’t work related, but I need to find the one for work related web sites. 😛 In other words, I am looking for the add-on that provide an easy way to toggle the block/unblock function, so I can work.

I have tried the following:

  1. StayFocused (Chrome): This one let you set time limit on the web sites that you try not to spend lots of your time on. However, it does not provides the easy toggle.
  2. Temporary Site Blocker (Chrome): This one is pretty close what I need, it has a button and a clean menu to let you enable and disable the blocking. However, it does not block the action on current page, i.e. you can pretty much to anything before you leave the page. Not I want.
  3. BlockSite (Firefox): This one does not provide a cute icon in the UI that do the toggle, however, I can check/uncheck the “Enable BlockSite” in other tab to achieve the same.

So far I am using BlockSite for this purpose. But I guess there should be some better add-on for this.

Generate JUnit XML format for Jenkins from CMake CTest

In JUnit XML Skeleton fits for Hudson., I showed the minimal JUnit XML for showing  meaningful results in Hudson/Jenkins.

But how to generate the JUnit XML from cmake and ctest?

I got the inspiration from How to get CTest results in Hudson / Jenkins in StackOverflow and create following  CTest2JUnit.xsl.

To use the xsl, you may either use the I provide in the same directory, or following command in Linux:

xsltproc CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml