Showing posts from June, 2014

Book review: The Silkworm

When I wrote about The Cuckoo's Calling, the first detective novel by J K Rowling, writing as Robert Galbraith, I mentioned how it felt in some ways similar to reading Agatha Christie.

The Silkworm re-enforces that, in no uncertain measure.

Cormoran Strike, the one-legged retired army-man is doing well - digging dirt about infidel men and women.  He has profited by his success in solving the Lula Landry murder case.  Robin continues to work for him, despite her fiancee's misgivings.

In comes Leonora Quine to Strike's office, asking him to investigate the mystery of her missing husband, a writer.  It appears to be a simple case of a runaway writer, but it is not.

Quine has written a book Bombyx Mori, which no one wants to publish.  Bombyx Mari is Latin for Silkworm which explains the book title.  In the novel, he has made veiled references to many of his peers, which have antagonized them.

As usual there are a number of suspects, who may have a hand in what is going wrong …

Setting up and running php unit tests from Eclipse - 3 / 3

In Part 1, we saw how to set up your Windows system to run phpunit.
In Part 2, we saw how we can set up Eclipse to run phpunit

Here, I want to show how we set this up to run on jenkins, our continuous integration server and use the data for sonarreport.

I decided to go with a simple antbuild script.  There were two requirements
since vendor folder was not checked in, ant should run composer install to create the vendor folder and install/update the dependenciesit should then run phpunit with the relevant parameters to generate a test report as well as a coverage report The previous version of sonar php plugin ran phpunit as part of its run.  The current version requires you to have run the tests and generated the report.  It takes the test report and coverage report as properties.

Here are the relevant snippets of the build script.
Run composer install     <target name="run-composer">
        <exec executable="composer">
            <arg value="i…

Setting up and running php unit tests from Eclipse - 2 / 3

In Part I, we saw how to set up phpunit on your Windows system and run php unit tests from command line.  Let us now look at how to configure Eclipse to run phpunit.  The existing documentations are either obsolete (referring to pear-based phpunit configuration) or incomplete.

We will use Eclipse Kepler SR2 (4.3.2) as reference.  (I am unable to get it working in Eclipse Luna that released yesterday (26 June 2014) and have logged a bug).  [Updated: 7 July 2014]. It works with Eclipse Luna (4.4) as well with MakeGood 3.1.0.

Install Eclipse Kepler SR 2 (I use Eclipse JEE for Windows 64-bit)Install PHP Development Tools (PDT)

Install MakeGood from Eclipse Marketplace: This is the plugin which will help us run phpunit from Eclipse.

Choose Windows : Preferences : PHP : PHP Executables

Add the php we had installed earlier.Make sure you have PHP debuger enabled.  If you have the wamp-installed php, it comes with XDebug.  Choose XDebug.

Verify PHP : Debug settings to ensure it has taken the value…

Setting up and running php unit tests from Eclipse - 1 / 3

We had been make attempts to write automated unit tests in php for some of the business modules.   yii provides a test framework which makes it easy to start writing unit tests.  This uses phpunit.  We had set up phpunit using pear on our systems and could run the tests on our systems from command line.

We had also got the unit tests to run as part of continuous integration and used the test reports and coverage report in sonar.

Recently, we started a new php project and our new developer attempted to set up his sytem to run phpunit.  That was when we discovered a few things.

pear was no longer the popular method to install required php libraries.  It was now composer. phpunit was stopping support for pear and there was no official documentation to install it using pear.

This is the background of this three-part write-up.

In Part I (this write-up), I attempt to detail out how we set up our project for phpunit using composer.
In Part II, I show we set up Eclipse to run the unit tests

Why desktop client for IT returns

Having written about filing IT returns for FY 2014-2015, I could not help wondering why IT department went for a java-based desktop utility, replacing the excel utility that existed earlier.

I can see the primary issue with the excel utility - that it needs Microsoft excel, which is a licensed software and does not run on linux.

I can also understand that a java utility is (hopefully) platform independent and can be run without additional license cost (Java being free to download and use).

But what I can't understand is, why not a web-based utility to do this?  The income tax return utility is not very complex.  I don't see why it cannot be implemented as a web-based application.

A web based application can also

pre-fetch data do any kind of validationcreate an xml output and upload to the IT server
In addition, a web application

can run without additional softwarerun on any operating system/browser (if coded properly)can even run on mobile browers (if coded properly - using re…

Filing income tax returns - FY2013-2014

It is that time of the year when the annual income returns have to be filed.   It is still early (the last date is 31st July 2014), but yesterday I got a call from a relative of mine, saying he needed help filing tax returns online.

I pride myself on filing tax returns on my own.  In fact, I have written about the first time I filed returns online,   how quickly I got a refund once,  some tools I issues that I got last year, as well as the rectification proposal that I got.  So, I gave detailed instructions over phone on logging into the e-filing website, downloading the excel sheet, enabling macros and so on...

Then, for good measure, I decided to check it out myself, though I didn't expect it to be different.  But what do you know?

For assessment year 2014-2015 (i.e. financial year 2013-2014), there is no longer the Excel utility for filling income tax returns.  It has now been replaced with a java utility.  (Updated 26 July 2014.  Both excel and java utilities are now available…