Monday, June 30, 2008

The Career Programmer: Guerilla Tactics for an Imperfect World By Christopher Duncan

Likewise many software engineer graduates, i took several project management and software development related courses. Most of these courses and topics were boring, based on theory, out of touch with reality and practically. I don't have good memories on these courses.

Recently I come cross a brilliant, funny, practical e-book "The Career Programmer: Guerilla Tactics for an Imperfect World" by Christopher Duncan. The title of the book actually explains lots. The author narritives his real world work experiences with a witty, funny, daily life language. I think this book should be a must reading for software engineering students.

Sunday, June 22, 2008

Churchill A study on Greatness by Geoffrey Best

Garry Kasparov, in his book "How life imitates chess", talks with great admiration and enthusiasm about Winston Churchill. Even further Kasporov claims that Churchill one of the biggest personality of 20th century. He is not alone. Many people share similar enthusiasm about him. Enormous studies have been conducted on him. Given that much coverage by media and scholars, i decided to read an auto/biography on him.

My research on Internet led me to a relatively recent published book: "Churchill A study on Greatness" by Geoffrey Best whom teaches history at Sussex University. The book is compiled out of enormous literature research. In this book, Geoffrey Best aims to cover overall respects of Winston without much penetrating into details.

Although Geoffrey Best puts an incredible work to justify how great was Winston Churchill in its historical context, unfortunately, given the stories and evidence in the book, my impression and thought about Winston is completely different and, to surprise myself, it is, even worse,a disappointment. To credit to the author, he points out in the book, given the evidences and stories, readers should make their mind on Winston Churchill themselves. Unlike the author and many people, given my working class, non-white, social-democrat background, i am failed to see why Churchill is a great man in terms of international and national politics, war leader, personality, literature, family. Let me elaborate my thoughts on these subjects.

Let's start with a summary of his peculiar personality. In his all life, even though Churchill did all his best to evade any type of classification, people knew him and some historian describe Churchill as egoist, gambler, loves luxury lifestyle, rude to people working under him, difficult to work and get along together, Victorian Liberal Imperialist, opportunist, man of war (warmonger) and peace, enemy of working class people, believer of white-superiority of Anglo-Saxoinism and Tory radical, sympathetic to Zionism, imperialist, good political speaker and writer. Sure, i think some of these are over-exaggerated.

Winston Churchill is known well as politician and military background. After high school,he attended Royal Military Academy for two years and he commissioned as Second Lieutenant. As service man, he deployed to various part of British Empire, Cuba, India, South Africa, Sudan and Malakand. Even though he disliked traditional education system in his school times, he self educated himself during the service. In addition, he also wrote articles as war correspondence to several London based newspapers. He was a brave soldier and participated in several risky campaign.

Winston Churchill, first of all, was a politician. After spending five years in the army, in 1900, he started his political career in the conservative party where his father was also a hard-core MP. But he did not stayed there for a long time. In his second election, against his families and father's will and tradition, he transferred to the Liberal Party where he assumed doors and posts will be opened more quicker. He was right. Soon, he undertook important positions in the party and the governments between in 1905 and 1916 till disastrous defeat in the battle of Gallipoli against Turks in which he was Admiral. He never recovered from that bad publicity caused deu to his role in this battle.

As politician, he was big supporter of free trade and in many circumstances he comes cross as an opportunist. Especially in the beginning of his career in the Liberal Party, in election campaigns, even though he comes from aristocracy, he gave speeches that House of Lords should not be superior than House of Common upon he sensed the unhappiness among the working class electorates against aristocracy. In 1924, he rejoined the conservatives and until 1929's he undertook the position of Chancellor of the Exchequer in the conservative government. Some economics believe that, his decision to return to the gold standard at the pre-war parity in 1925, would lead to a world depression. In industrial conflicts and strikes, in many occasion, he put his preference on business elite and he made a reputation as enemy of working class people.

Upon 1929 general election lose, Churchill stayed away from politics for couple of years. This isolation is due to his personal relations with party management, his stand against India policy and his connections with dubious peoples. When he backed to Parliament in first half of 30s, he vigorously established an anti-Indian, Nazi and Communism campaign. But none of his opinions is taken into consideration by majority of people cos of his warmonger, imperialist attitude. With WW II, in 1940 he backed to main political arena again as Prime minister due to his military background.

Overall, both in Liberal and Conservative parties until 1940, he was not an extraordinary politician and not put his name under long term significant works. He made reputation as egoist, opportunist, rude to people working under him, difficult to get along together, Victorian Liberal Imperialist, warmonger, enemy of working class people, anti Nazi and Communist, opposite to Indian independence, supporter of white-superiority of Anglo-Saxinism and sympathetic to Zionism. Even more, in all his political life, it seems, because of his love to luxury lifestyle, he never hesitated to get financial help from his rich friends.

During WW II, as prime minister and leader of national coalition government, he led his country against Nazi Germany. And he owes all his popularity to this role. For his countrymen, he is the saviour of not only UK but also civilization against Nazi. I think his role in WW II is overrated. I think he was only the defender of his country. UK could not won the war by herself, and it took long time, in spite of mass colonies and resources. Fate of the war only has changed after Soviets and America joined to the war in Allies side. Besides all of these, there are doubts on his leadership skills.

Without doubt, Winston Churchill was a good speaker and boosting morale of public in war times. But I wonder if someone else would be able lead better the army and country in WW II? Because people working under him often say that he was full of ideas. For an issue, he was coming up more than 10 different ideas. Unfortunately, so often, only one of these ideas was plausible and his staff wasted quite lots of time to argue about impractical side of his other ideas. You can guess how it would be difficult to work with someone who especially thinks: "All i wanted was compliance with my wishes after reasonable discussion". Who knows maybe with a better leader, the war would have been won more faster against Nazis. I think, the public should have shared the similar frustration with his management, so after WW II, in the first election in 1945, Labour party defeated Churchill with an unprecedented seat majority in the Parliament. Besides these, short after Nazi Germany was defeated, in international meetings, Britain could not defend her interest well against Soviet Union and America. Some diplomats complaint that Winston Churchill attended meetings without much preparation, even worse, sometimes without reading the briefings.

Someone would argue that, given the historical context and resources, Winston Churchill achieved incredible results. But i can not help to think that, people can create miracles in real tough circumstances. 20th century has being witnessed many great national leaders in many wars in which superior countries attacked small, tiny countries but dramatically been defeated. I think, if opportunities were given to other people, Britain would had achieved better with a more skillful person. But without any doubt, unlike the battle of Gallipoli in WW I, Winston Churchill did not let his country down in WW II with help of Soviet and America.

Towards to end of WW II and afterwards, in government and opposition seats, he introduced the main seeds of European Union movement. After WW I, not many people in Europe was thinking there would be another war in Europe soon. But WW II proved that that assumption was so optimistic. In order to prevent such a third war in Europe and against Soviet occupation, Winston Churchill developed and introduced European Union movement. He worked and campaigned on this idea especially when he was on the opposition between 1946-1951. But when he came to power again in 1951, he put his preference on America once again and focuses on the "special relationship" with America. But on the other hand, he always iterated that UK will be always with Europe to against Soviet. To credit to him, whatever his motive was, Winston Churchill was one of the prior in European Union movement.

After WW II, having defeated Nazism, Winston Churchill turned his all attention to the old enemy, Communism. Expansion of Soviets to East Europe after WW2 caused concern among western European countries and Churchill used this atmosphere to promote his anti-Communism in UK and USA. His tone of language against Soviet got more stronger with time and he established his new political career on anti-Communism. He was even accused of being a provocateur, warmonger by some Labours. He was the principal architect of Iron Curtain betwen Soviet and West. It seems to me, in order to come power again, Churchill and some conservatives promoted a political tension in between Soviet block and Western countries which lasted until the end of the century. Once more, this tactic of seizing power and keeping people under control by creating a common enemy is used against Muslim by neocons after communism collapsed.

His stands on non-white European colonies and countries were imperialist and he was big believer and supporter of white-superiority of Anglo-Saxionism. Without much change, in his all political life, he opposed of independence of India. His following remark on Gandhi in 1930 explains his conservative, aristocratic, imperialist, politic background:

"A seditious Middle Temple lawyer now posing as a fakir of a type well-known in the East,striding half naked-up the steps of the Vice-regal place... to parley with the representative of the King-Emperor."

Winston Churchill had tendency that non-white people can not run their countries themselves. For example, with irony, he claimed that Indian people would be better under the British rule because he thinks that non-white people are lack of self management. Irony is that, in his white aristocratic, imperialist world, in spite of limited academic, military and political achievement and inter personal skills, a white aristocrat can become an MP and even more a Prime Minister, but a non-white person such as Gandhi, who is a lawyer and graduated from London, loved and respected by millions in India is not capable of self management!

Luckily India has not suffered much from his opposition. But Middle East suffered dramatically cos of his and his peers's policies, prejudice, ignorance and sympathy to Zionism. After first WW I,he was in charge of determining new borders in Middle East. New borders are drawn without taking into consideration of local people's opinion and many current problems in Middle East (Palestine, Jewish, Kurdish, Arabs) are attributed to role of his role. In these talks, he did not even want to meet with Arab delegates.

Another interesting characteristic of Winston Churchill was that he earned his livelihood from his pen when he was not in the Parliament. He published several books on military, WW I and II and English speaking world. He also wrote many articles for newspapers. At the moment i am reading, his "My Early Life" book, later i would be able to comment about his writing style. He won the Nobel Prize in Literature 1953. He hired several, Oxford graduated writer to help him in his latest books after WW II. There is also not much known artistic side of Winston Churchill. In his free times, he painted and vivid colours were dominant in his paintings.

In family side, although he was close to his children and biggest admirer of his wife, his children did not catch up any of his success or popularity. His son, Randolph, followed his fathers step in terms of career, personality and lifestyle and with failure. Some of his daughters made unhappy marriages. Most interesting part of his life, surprisingly, his never lasting love to his wife. He and his wife, were biggest supporter of each other all the time.

In conclusion, I do understand admiration of Kasparov to Churchill because Winston was the first person in Western warned and even more provoked people against Communism. He was the main ideologist in the West created so-called Communist Monster. But, i think, Kasparov misses a crucial thing. Due to his character, Churchill never lack of enemies or suspicion of stranger/foreigner. In order to keep his status, he and neo-cons always created an enemy. His stand, vision on Communism is more prejudice similar to his attitude against India, Middle East, Palestine and desire and hunger to the power.

Based on this book, i think, Winston Churchill is really overrated in its historical context. I do understand this pheromone from the British, conservative point of view. Every nation or political movement has tendency to satisfy their ego anyhow with national heroes. But from an objective point of view, I think British Empire should/would have done better without Winston and there are certainly far far better statesman in 20th century in all around the world.

Friday, June 20, 2008

Losing My Virginity: The Autobiography by Richard Branson

Richard Branson is one of the British about whom i have been getting positive remarks whenever his names comes up in a conversation. He is known well with his entrepreneurial business skills (creator of Virgin brand), generous support to various charities, connections with various political and non-political figures, and of course, his sport challenges, some of which has, understandably, patriotic aspect. But, like many other people, my personal experience with Richard Branson is limited, through his companies, Virgin, as a customer and it is mixed with satisfaction (virgin trains) and frustration (virgin media).

Even though, Branson is one of the well known celebrety entrepreneur in Bratain, it is so rare to see him on public events (even on enrepreurial related TV prograns such as Dragons Den). It seems he enjoys his privacy and prefer to stay away from public attention which make people more interested in his life. His autobiography "Losing My Virginity: The Autobiography" is a good reference for those who interested in him and history of Virgin.

In his autobiography, his extra ordinary, colorful life is fluently told in a relatively long way (now it is about 600 pages, and he updates it regularly every year). Although, last two chapters (2006 and 2007) kinda come across as snapshots from his busy calendar, this book suprisingly is worthwhile to read.

Richard Branson is born into a post war England in 1950. He is the oldest children of Ted and Eve Branson both of them actively involved in WW II. Richard with his two sisters had a peaceful childhood in Surrey. He describes his family as that would have killed for each other. That special bond between him and his family, especially with parents can be sensed through the pages whole book.

He remembers his childhood full of challenges which were set up by his parents and relatives to make him self-sufficent and creative. These challenges were generally sportive and business oriented rather than academic. This was not a coincidence. Since Richard has dyslexia, his academic record was not good, however how much he tries hard in schools. In these times, when dyslexia was not known, and pupils who fail at Math are branded as stupid, sportive activies were the only way to survive in school. So, Richard focused on sport and made a good reputation as football player in school team. But after an accident in field, doctor banned him participating any sportive activities which led to a miserable school life. Upon the accident, he spent his most of the time in library, far away from eyes, but girls.

One of most apprepciated characterisitct of Richard, i think, his modesty and personality. From the first pages of the book, it came cross to my mind that maybe he owes his personality to a degree to his dyslexia which made him more sensetive, conscious, caring to other people. My this superficial thought is got stronger when i read Sally Gardner's interview on a magazine. Likewise Richards Branson, Sally Gardner is a dyslexia and she makes livelihood writing children books. She does not also recall great memories from her schooltimes due to her dyslexia. She explains affect of dyslexia on personality by : "After such a long period of time seen as a misfit you always feel an outsider. It is something that never leaves you. I will always be a round ball in a square hole. "

Since neither in academic nor sport(after the accident) he was successful, he directed his all effort to small scaled business plan in his childhood. In high school, about in the second half 60's, when students rebelling against established system in all around the world, he came up with the idea of a student magazine called Student. With a childhood friend, he set up the magazine. While his friend was editor of the magizine, he took all financial and organizational responsibilities. He and his friends made Student one of the biggest magazine for student in 60's. While content contributors of Student were generally leftist, he tried to keep himself in neutral, as a business man.

He learnt quite lots of deal about marketing and business and made extensive business network out of Student. As far as i see from the book that Richard Branson tries to apply all these lessons to all his business deals till now. Some of these lessons are that a succesful business is a team work and must enjoyable, the satisfaction of staff comes first and taking risk is essential to grown the business.

Rather than discussing about his success in business, i would like point out something else which i could not help myself noticing through the pages. As i mentioned above, Branson is very keen to his family, parents, sisters, children and wife. I dont want to speculate on his personal life, but with respect, i am a bit suprised that he did not mentioned so much about his second wife, Joan, mother of his two children and love of his life. Through lines, she comes cross as just a good, modest mother and full time house wife. But i am sure she is more than just these, as you guess, partners have big impact on someone's success. For example, Clementine, wife Winston Churchill, was the biggest supporter of his husband in many matters in peace and war time.

I think it would be very revealing to read biography of Joan&Richard Branson from one of their children (for example Holly Branson who recently graduated from University College in London with MD) for a objective and insider aspect to the life of Richard Branson.

Monday, June 09, 2008

Software Tests in GWT

Since software development in GWT is based on Java, many conventional and well-practiced test techniques related to Java can be utilised for applications developed using GWT. Following test techniques are supported by GWT:

· Unit testing (JUnit by extending GWTTestCase)
· Performance testing (Benchmarking, by extending Benchmark)
· Robot testing ( Selenium, UI test)
· Continuous Testing (Cruise Control)

Unit Test (JUnit)


Out-of-box JUnit unit test support is shipped with GWT for client and server side synchronous and asynchronous testing. Test cases that wish to make use of unit tests extend GWTTestCase. By default, tests are run in hosted mode with an invisible GWT browser. GWT JUnit tests are generally designed for non-UI testing. More precisely they are used to test the logic and functionality of GWT applications (especially server side functionality). For UI triggered robot tests Selenium should be preferred.

Since GWT unit tests extends standard JUnit (version 3, not JUnit4), conventional JUnit test approaches (such as use of Assert assertion methods) can be used for GWT unit test cases. Each GWT JUnit test extends GWTTestCase and implements getModuleName() method which defines the interest of GWT module.

GWT JUnit supports asynchronous tests by introducing two methods, finishTest and delayTestFinish. delayTestFinish makes sure that test does not terminates immediately but wait for a period of time to handle asynchronous callbacks. As soon as a result obtained from asynchronous callback, finishTest should be invoked to finish test successfully, otherwise delayTestFinish will cause a timeout exception to fail test. In addition those, chain pattern can be implemented for invoking several asynchronous serially to simulate UI cases.

JUnit tests can be run either in hosted (default) or web mode (-Dgwt.args="-web" ,with various browsers). During hosted mode, cross browser compatibility is not checked. For this purpose, tests must be run against different browser in web mode. Corresponding to application size, compilation time can be longer (1-5 min) in hosted compared to web mode.

Please note that, in GWT 1.5 MS2 and RC1, the base test class which implements getModuleName() method must have the same package name as the package name of the module entry class. For example, for module com.booo.Boo.gwt.xml, the package name of the base test class should be com.booo.client

Performance (benchmarking)

With GWT 1.4, a benchmarking scheme is introduced to test performance of client side code. For profiling and reporting, in GWT, a benchmarking test class must extend Benchmark which is subclass of GWTTestCase. In addition to standard JUnit facilities, Benchmark provides automatic iterative test case invoking for given range or Iterator. Please refer to [1] and [2] for further information.

The biggest disadvantage of Benchmarking in GWT, unfortunately, it does not yet support asynchronous calls and access to server side code. This severely limits its use for testing performance of a whole application. Instead, it is better used to benchmark stand alone client side code.

Robot (Selenium)

Selenium is a de facto standard for robot UI testing. Selenium performs automatic UI trigger based tests against a given valid URL. Selenium utilises generally HTML elements' ids to carry out operations such as clicking buttons, editing input text or selecting an item from a list box.
These operations can be performed manually by a user on Firefox with the Selenium IDE which records all of these operations sequentially and then converts them to a Selenium JUnit class (extending SeleneseTestCase). These test cases can be aggregated in continuous tests similar to standard JUnit tests. Selenium supports continuous tests out-of-box with selenese Ant tasks [3].

Since any changes on the UI directly affect these tests, UI developers have to be careful in terms of naming or identifying HTML elements. If Selenium testing is chosen for robot UI testing a systematic schema has to be agreed and developed between QA and the UI developer. In addition to that, UI developer must use appropriate UI widgets and libraries which support identifying HTML elements for Selenium test.


GWT and continuous testing (CC)

Since GWT takes full advAntage of Java, it is possible to use a continuous testing schema for above tests. For example, Google uses GWT with CruiseControl for continuous testing. Eric Ayers from Google has described how they use CC and GWT in this link:

http://groups.google.com/group/Google-Web-Toolkit/msg/006793285e736d23

But for future reference, I am quoting it here again:

“…
The best advice I can give you for setting up a project build is to look at one of the projects on code.google.com:

  • - gwt-google-apis
  • - gwt-api-interop
  • - google-web-toolkit-incubator

All of these are projects that use GWT as a library and we build from cruisecontrol at the top level and 'ant' build files to actual compile everything. The ant build files are included in the subversion repository, but the Cruise \control files are not. For Cruisecontrol, setup your project as follows:


Create a directory with the download of GWT you want to build against. This directory you need to set as the ant property 'gwt.home' You may also need a directory with the 'tools' directory from the GWT subversion respository (but I'm not certain you need this). This directory you need to set as the ant property 'gwt.tools'

Now, look at the common.ant.xml file in one of the projects I mentioned. It has rules for building and testing GWT projects. You will probably need a copy of the direcory 'build-tools' in order to use all of the rules. You can copy this from the GWT repository or use an Subversion 'external' refernece to pull it in if your project uses subversion.

Our cruise control configuration file does the following:

  • - Refreshes the project code from SVN,
  • - Pulls the latest version of the GWT ''tools' directory
  • - builds the ant targets 'build' and 'test'
  • - runs an artifactspublisher to pull down the 'dist' directory as well as the unit test reports.

...“

I have followed his instruction and managed create an ant script for CC. As he mentioned above, even though, these sample build files based on GWT_tools, you can create simpler build files by ignoring tools.


Conclusion

Since development in GWT is based on Java, many testing techniques common to the Java domain can be applied to GWT. GWT supports many standard testing techniques such as unit testing (JUnit), performance (Benchmark) and UI triggered robot tests (Selenium).


Generally, it is recommended to use GWT JUnit for non-UI based test such as logic and functionality test which may or may not require client and server asynchronous communication.

At the time of writing this report, GWT Benchmark does not support asynchronous call and access to server side code, therefore benchmarking in GWT is not useful for performance tests of complete application but only for isolated client side logic and functionality.

For UI trigged testing, Selenium can be used but since Selenium tests are tightly-coupled to HTML elements a systematic agreement has to be developed between UI and test developers against UI code changes and type of widget will be used.

All of these tests can be aggregated in Cruise Control for continuous testing.

For detailed information regarding benchmarking and JUnit tests in GWT, please refer [2].

References

  1. “Google Web Toolkit Applications” by Ryan Dewsbury. Page (170-180) for JUnit and benchmarking.