Total Pageviews

Donate

Nov 18, 2015

Install JDK on Ubuntu

Maybe since Oracle is responsible for Java, and every time I install an Ubuntu machine I struggle for few minutes to install the JDK. Thus, I decided to write this extremely short post about how to do it.

All what we need is to add the correct repository and then install it like any other app with apt-get install.

Here are the commands:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
That's all folks :)

Feb 21, 2015

Automated UI Testing in Python

During the last year 2014, I was exposed to behavior testing. As I mentioned in my last blog post about agile team building, me and my team applied different automated testing techniques including the behavior testing using Gherkin. In fact, this was - and still - a very hard task to maintain these tests, especially with the unstoppable flow of business changes. Behavior testing is all about complete features and their different scenarios. In other words, it is all about testing the UI being interacted by the system users to apply their business needs. Below I'm going to list why it is not very easy to maintain these tests and after that I will show a new technique that can make it maintainable. But first let's talk a little bit about Selenium and Python Webdriver.

Automating UI Interaction (Selenium) 

Selenium is a web apps software testing framework, and its name came from a joke by the original creator Jason Huggins in an email. He was making a joke of a competitor - Mercury by HP - saying that: "you can cure mercury poisoning by taking selenium supplements" :)
Huggins developed Selenium during 2004 while he was at ThoughtWorks. He joined Google in 2007 completing his work on Selenium. At the same time, ThoughtWorks was working on the development of a browser automation tool called WebDriver. In 2009 these two project has been combined together to produce a new product called Selenium 2.0 or in other words Selenium WebDriver. Now Selenium 2.x is almost the most powerful UI test automation tool and has become a kind of a 'de facto standard' for test automation. Selenium IDE is a Mozella Firefox extension that works as an integrated development environment for Selenium scripts called Selenese. Selenese is a special test scripting language for Selenium.  Selenium Remote Control (RC) is a server written in Java that accepts Selenium command for browser through HTTP. It allows to write automated tests using any programming language that facilitated integrating Selenium in already existing testing frameworks. Selenium client API  is an alternative to writing tests in Selenese that can be written in many languages like Python, Java, C#, and Ruby. Now in Selenium 2, Client API include WebDriver as a central component.
In the following section I'll give an example of how tests can be written using Python Client API.

Jan 6, 2015

Agile Team Building

Introduction

During  2014, in my start-up we had an agile training with Mr. Amr Elssamadesy the famous Agile trainer and the author of Agile Patterns: The Technical Cluster and Agile Adoption Patterns: A Roadmap to Organizational Success.

Mr. Elssamadesy joined the company during critical circumstances. Back then, we had new team of developers, business, and quality control and this team was considered as a "Junior"  team where as most of them were fresh grads or with 2-3 years experience in some cases. This was not the only problem, the major problem was that we had a mega huge product which was built during the previous 2 years that has a lot of very complicated features.

The major problem here is that, the very successful business team has sold this product to many clients and each client now are ready to operate and have their own very long list of requirements and customization needed. The product is really huge to the level that it is not very easily customizable. There wasn't any possible solution for the company to succeed by gaining the customer satisfaction. By very optimistic calculations, the new "Junior" team will take no less than 3 months to warm up and getting into the mode. Plus, the code base was really huge.

Jan 10, 2012

Successful Team Leading


NOTE: This article is written by Dave Chaplin, an IT Consultant with 10 years experience. He leads and mentors teams of developers on agile .NET projects and has extensive experience in agile development techniques, particularly Test-Driven Development. Dave can be emailed atdavechaplin@byte-vision.com.

Date: Sunday, October 06, 2002

And it was taken from the following URL: http://www.byte-vision.com/TeamLeadingTipsArticle.aspx
==================================================================================================

Successful Team Leading

Abstract
This article describes some practical tips for successfully leading a team of software developers. It defines what success means and then describes some very common sense tips for achieving that success.
What deems a project to be successful?
The primary goal of any software project is to meet the user requirements and make sure the users are delighted. If something has been built that nobody wants, it makes no difference what happens to staff turnovers, budgets or training. If requirements are not met, the project is a failure. The next goal after requirements is probably to complete the project within the required budget. After that, there might be others requiring staff to be trained, and so on.
Here are a number of tips for team leaders to help them achieve success in their own projects.

Dec 29, 2010

Python String Literals

Some times while dealing with strings using python we find that a string starts with a character before the string quotes. for example:
r'here is my string' 
or:
u'here is another string'
what are the 'r' and 'u'??

In python strings, we may use the backslash (\) character to escape characters that has different meanings such as:

  • New Line (\n)
  • Tab (\t)
  • backslash it self (\\) :)
  • ...etc

Also strings may optionally be prefixed with a letter - like the examples above - and here are there different meanings:

  • A prefix letter 'r' or 'R', these strings are called "Raw Strings" and they use different rules for the backslash skipping rule ...
    • All characters following the backslash are included in the string as they are. For example "\n" is not a new line ... it is a backslash followed by a small character 'n'. Also, "\"" will give a string error because the backslash followed by a double quotes is interpreted as they are and hence, this string contains three double quotes and this is invalid. 
    • Also if a single backslash followed by a newline is interpreted as two characters as a part of the string, not as a line continuation !!
  • A prefix letter 'u' or 'U' makes it a "Unicode String" which used the Unicode character set defined by the Unicode Consortium ISO 10646.
    • Here the backslash only escape the codes for characters. Let's see examples:
      • u"\u0062" is a small letter 'b'.
      • u"\u0025" is the percentage sign '%'
      • u"\n" here the backslash will not escape the new line character and the string will remain as it is "\n"  
Hope this was useful :)

Dec 15, 2010

Changing default python version in Ubuntu

It happens a lot that you have installed more than one version of python on Ubuntu. let's say python2.5 and python2.6 and you want to change the default python version.

It is very simple and with a single line of shell script


For example if I have python2.6 is the default and I wanna to change it to python2.5
Here is the default python when you just type python in the command

~$ python
Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>


Now let's change it

~$ sudo rm /usr/bin/python && sudo ln -s python2.5 /usr/bin/python
Now check the verstion

~$ python
Python 2.5.4 (r254:67916, Jan 20 2010, 21:45:54)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
and also to change it back use the same command again

~$ sudo rm /usr/bin/python && sudo ln -s python2.6 /usr/bin/python
How this works??
1) we remove the executable from /usr/bin/python
2)we link (ln) the python version we want to be copied again to the location of python executable

Very simple :)
Hope it is useful :)

Donate