Sunday, 16 March 2014

File Sharing between Windows and OSX

SHARING WINDOWS  FOLDERS TO MAC
Windows side
Start->Search box ->Type: netplwiz [enter]
Click on Continue (or supply an administrator's password) when prompted by UAC

Uncheck the option "Users must enter a user name and password to use this computer". Select a user account to automatically log on by clicking on the desired account to highlight it and then hit OK. Enter the correct password for that user account (if there is one) when prompted. Leave it blank if there is no password (null).

You will find the automatic logon options for OS X in System Preferences>Accounts.

On Win7, go to Control Panel>All Control Panel Items>Network and Sharing Center. Click on "Change advanced sharing settings".

Turn ON network discovery
Turn ON file and printer sharing
Turn ON sharing in the Public folder sharing section
Turn ON password protected sharing

See also:
http://windows.microsoft.com/en-us/windows7/share-files-with-someone

Mac side (to access Windows shared folder)

http://lifehacker.com/247148/how-to-mount-a-windows-shared-folder-on-your-mac


SHARING MAC FOLDERS TO WINDOWS
Mac Side
1. Change or set the workgroup to be the same as Windows workgroup name:
http://www.7tutorials.com/how-change-workgroup-mac-os-x-easy-networking

Find the name of the workgroup on Windows by right-clicking on Computer icon in Windows Explorer and selecting Properties. In the Properties dialog (which opens the System control panel, e.g. Control Panel\All Control Panel Items\System) look for the name of the workgroup under the section Computer name, domain and workgroup settings.

2. Set up file sharing on the Mac, as follows:
http://www.7tutorials.com/how-share-os-x-folders-windows-7

Sunday, 21 April 2013

Python code snippet - Prime Numbers


This is a code snippet for generating prime numbers in Python.

#Prime number Python Example
#---------------------------
# (c) Leonard Aye 2013
#
# Prints the prime numbers between 1- 100.
# A Prime Number is one which is wholly divisible by 1 and itself only.


#For each number i, divide this from no 2 up to i-1 and check that it leaves
#no remainder (since we know that 1 and itself are divisible).
#
for i in range(1,100):
   prime = 1
   for j in range(2, i-1, 1):
      if (i % j == 0):
         prime=0 #if any other no is wholly divisible then it's not a prime
         break   #so break out of the loop.

  if prime == 1:
         print i

If you know of a more efficient way, then please comment below.

Thursday, 23 February 2012

Today I was 'abused' by a number cruncher

As a tester I try to live by  these two maxims:
  • Any activity which doesn't ultimately lead to finding bugs or stopping bugs from appearing  in the code in the first place is a waste of time - Cem Kaner 
  • I will not fake a test project - James Bach

But, today, I had to fake a test project and I felt like I was abused professionally.

I work in a team which developed an piece of software that is to be embedded inside a commercial electronic device and as a Scrum team we have been developing and doing mainly exploratory testing during the sprints. Now that our software has reached the stage of maturity and being readied for commercial release, more and more people outside our team (but within the company) are demanding to know the quality of our software. 

We duly provided them a report stating the kind of testing we did, the area of functionality covered, a list of all outstanding issues (no Major or Critical ones) and our professional opinion on the quality of the product. Sadly, this report wasn't good enough, since for them, the measure of quality is based solely on game of numbers; how many tests ran, how many passed, how many failed, percentage not run, pass rate, fail rate, etc.

Today, we received an email from an external team who has the power to decide which  software gets to be included in the commercial device demanded that we provide them with these test result figures or else our software will be dropped.

Not wanting to waste many months' worth of our team effort over the test results, I decided to give them what they wanted. I had an old and out of date spreadsheet which has around 85 test cases which checked for the basic features of our software, but had none of the complex test scenarios (that we discovered and used in our exploratory testing) which led us to finding all the critical bugs which we have fixed and retested.

And I spent the rest of the afternoon and early evening dutifully going through all of those out of date, incomplete test cases and marked each one of them as Passed or Failed and at the end we arrived at these magic numbers:

  • Test run: 100%
  • Passed: 95%
  • Failed: 5%

and then I resubmitted our test report with these figures.

And on the way home, I thought about what I did today and I felt used. I felt abused. I felt humiliated. I felt violated. I felt dirty and unclean. No matter how much I washed myself with soap in the shower, I still felt dirty inside and this feeling will stay with me for some time.

Sunday, 5 February 2012

I don't want to find any old bug

Ever since I started out my career as a Software Tester, I have always thought that my job was to help improve the quality of the product, and for many years I believed that to be the case. Likewise, when people hired me during the last 14 or so years to be a tester, they also believed that that was what my job was.

I guess, in that way, everyone's happy; I know what my role was and so did my employers. 

However, lately in these last couple of years, I'm beginning to feel less and less sure of exactly what my job entails. For example, at the beginning I said that I helped improve the software quality. But, do I really? How?

I don't get involved in the capturing user requirements or write user stories, I don't get involved in the design of the product in any way shape or form, I don't write a single line of code. In fact, I don't do a single thing in the creating of a software product. The first time I get to see the product is when it is  either partially or fully formed as a working piece of software.

If I'm not involved in the creative process of a software then how could I have any type of influence on the nature and the quality of the product?

This led me to realise that as a tester, my job is this:- I discover software bugs.

That's it! That's all I do.

It is through the discovery of initial bugs followed by the subsequent elimination and the further lack of discovery of new or old bugs that we somehow arrives at an inference that the software must now be in a solid and stable state because as far as we know, we can't make it fail, and it's good enough to be released to the outside world. 

All I could do, and the only thing I could do, is to point out how bad the software really is, and it's up to the developers and product owners/managers to decide how to take the news that I give them.

In fact, in many cases, we would (have to) release the software (due to marketing, external partners or competitor pressures) knowing full well that there are numerous bugs in the product. And yet, we'd often pad ourselves on the back for a 'job well done' by delivering the product on time and being congratulated by the management for hitting this or that target.

When I'm part of this sad scenario then how I can possibly say to myself and to others that I helped improved the quality of the product when I have spectacularly failed to do so, evident by the fact that the released product has 10s, if not 100s of known bugs.

For me, this is no longer acceptable.

If I could use an analogy, Testers are like Cleaners you'd often see working on the streets at night. Their job is to clean up the mess that people left behind, so the pavements are clean again the next morning. As long as developers are putting in bugs in the software (some obvious and some not so obvious places in the code), we, the testers, will have to keep on finding them and reporting them.

For a long time, I was quite content with that situation. It keeps me in a job of finding bugs and I would even feel elated that I raised 20 bug reports in a single day; going home felling quite good about myself that I discovered so many bugs!

But I don't want to do that any more. I don't want to keep finding bugs in the code. You see, by the time the software arrives on my desk to be tested, it is already too late for me to have any influence on its quality; it will be what is it. The bugs would have been planted and hidden deep within the code and we would then have to find them. Even if we did find them and the developer fixes then, very often it leads to unplanned and unexpected bugs in other parts of the code to raise their heads.

If you're in the same situation as me then what would you rather do? Carry on happily as before or would you find a better way?

I'm not implying that I don't want to find bugs. I do. But I only want to find really interesting bugs. Bugs that require me to be creative and inventive in order to discover them. I don't want to find those obvious bugs, and bugs which keep on recurring in the same area of the code or software. These kinds of bugs should have been quashed during development and not get through to testing to be discovered, because they only add noise and takes away the precious time we have to discover the more serious bugs which may lay deep within the code.

So, the question then arises: should we, as testers, limit ourselves to only finding bugs or should be expand our scope and responsibilities and help developers adapt to new practices that minimises the bugs being created in the first place during development?


Tuesday, 15 November 2011

Do you know where to poke?

Whenever you tell people that you're a software tester, people always think it's an easy job. A job anyone can do with little or no training required. This cannot be further from the truth, but still this perception exists both inside and outside the IT industry.

I remember a story that I heard a long time ago and I like to associate with the kind of work I do as a tester. The story goes something like this...

A guy went to a video repair shop (remember, this story was told about 20 years ago, before the invention of DVD players, and people only had VHS video cassette recorders) to fix his broken VCR. As he went into the shop, the door bell chimed and he saw that the shop was full of old TVs, VCrs and radios all piled up haphazardly on the floor of the shop and on the shelves. In the far corner of the shop was a work counter and an old man was there fixing a VCR.

The guy went up to the old man and said, 'Um, can you take a look at my machine? It stopped working last night.'

Old man said, 'Sure, put it on the counter', and he started unscrewing the cover. Once the cover was off, he looked into the machine and then with a screw driver, he started poking here and he started poking there, and muttering to himself, 'Yup', 'Ah...', 'Hmm...', etc. After a couple of minutes of doing that, the old man looked up and said to the guy, 'I think I've fixed it', and then he plugged in the machine to the mains socket and sure enough the machine whirled into life.

The guy was really happy that the old man was able to fix it so quickly. So he said, 'Thank you so much. How much do I owe you for this?' and the old man replied, 'Fifty pounds'.

The guy was shocked. 'Fifty quid? No way I'm going to pay you that. I saw what you did to fix it. All you did was poke your screw driver here and there and you didn't even changed a thing.'

And the old man replied, 'Yes, that's true. I charge 5 pound for poking and 45 pounds for knowing where to poke.'

Like the old man, a good tester has the knack of knowing where the weakness might lie in a piece of software by simply using it for a short time and can tune the testing efforts that will uncover the most important bugs. But to an outsider, a tester's job appear to be trivial and could be done by any person, but the difference is a good tester always know where to poke. Do you?

Thursday, 21 July 2011

Short-Selling and why is it regarded as high-risk investment?

Short-selling is a type of trading where the intention is to make a profit on a financial instrument (e.g. equity, commodities or derivatives) when the value of the instrument decreases rather than increases.

The most common form of dealing is buying shares at a certain price and then holding onto it for a certain amount of time and then selling it once the price has increased sufficiently or when you wish to realise a profit at a time that's suitable to you.  This is called going 'Long'. This is the basis of the saying, 'Buy Low and Sell High'. Everyone understands this concept and is simple to follow.

Shorting or Short-selling is the total opposite of going Long, i.e. it involves selling (borrowed) shares initially and then buying them back at a set time in the future and the profit is the difference between the price sold and the price bought. To paraphrase the above saying, the principle of short-selling is, 'Sell High and Buy Low'. But, how does it work in practice?

I'll illustrate it with a fictitious example. Let's say I have a friend who owns an expensive Ferrari that he loves and cherishes which he bought brand new a couple of years ago, and it's still worth a lot of money, say £100,000. But what he doesn't know is that Ferrari is about to announce a new model to the one he owns in 2 weeks time. So, somehow, I managed to persuade him to lend me his car for 1 month (30 days), and for his troubles for letting me borrow the car I'm going to offer him £200/day.

As soon as the car is in my possession, I sell the car for the current market value of £100,000, meaning I've just made £100,000 for a borrowed car, which I continue to pay £100/day to my friend. As expected, after 2 weeks, the news of a new model was released and suddenly the price of the current model nose-dived and at the end of 30 days, the price has dropped to, let's say £80,000. So I then go to a Ferrari dealer and buy the exact model of the car my friend owned (same colour, same year of manufacture and same specifications) for £80,000 from the £100,000 I originally received from the sale of his car. I then drive the car back to my friend, hand the car back to him and and walk away and in the process I made nearly £20,000, i.e.

Received from selling the car: £100,000 

Total borrowing fee over 30 days: £6000
Price paid to buy back a similar car: £80,000.
So, the total expense was £86,000.

Profit made = £100,000 - £86,000 = £14,000.

That's £14,000 for trading a car I do not own!! This is how Short-selling works: sell high (initially) and buy (back) when it's low.

I know you're going to say, "Wait a minute! Your friend's going to know that what you've given him is not his car because it won't have the same registration number or the same mileage". True, and I did say that this is a fictitious example.

But consider this: instead of the Ferrari, what if I borrowed his 10,000 shares of Apple stocks and did the same? Would he notice that the 10,000 shares I returned to him were not the same 10,000 shares that he lent to me? Of course not. A share is a share: it has no shape, size, smell or colour.

So, in practice, to short-sell a trade, you'd borrow shares from a lender (usually a broker) and pay him daily interest on it, and with an agreement to return the shares at a set date in the future, usually in a few days (rather than months). You'd then sell the shares immediately and then buy the same number of shares back on the due date at the current prevailing price, and you hope that by then the price would have dropped.

This last bit about price dropping is the reason why short-selling is a high risk investment strategy. Going back to our silly example above, what if instead of Ferrari announcing a new model they could have decided that they will no longer make any new car of the same model, making the current model (the one you just sold) the last model of its range. If that happens, the price of that model would have shot up due to the sudden realisation in the car enthusiasts market that there will be no more car like this ever.

Unlike a Long trade, when the price drops you can hold on to the shares as long as you can (months or years) until the prices comes back up again, with a Short trade, you don't have that luxury of waiting until the market is more favourable to you. Short-selling is bound by the time limit you can borrow the shares, so you HAVE to buy back the shares when the borrowed duration is up at whatever the current price is. Hence, if the stock market doesn't go in your favour then you're bound to lose a lot of money.


Saturday, 2 July 2011

Derivatives - introduction

I have been working in finance industry in City of London as a software tester for the best of 10 years and through the job interviews I've had I came to notice the type of finance related questions that they tend to ask at these places. These Q&As are not meant to be used as interview practice exercises, but rather for the reader to understand the common business terminology used in the finance sector.

Q: What are Derivatives and can you list a few examples?
A: A Derivative is a security whose price is dependent upon or derived from another underlying asset. The derivative itself is merely a contract between two or more parties. The most common underlying assets include stocks, bonds, commodities, currencies, interest rates and market indexes. (Source: Investopedia)

Examples of derivatives are futures, options and swaps. As derivatives could not exist by themselves without the underlying asset, you'd hear them being referred to as commodity futures, stock options, interest rates swaps, etc.

A characteristic of a derivative is that the contract holder reduces risk and at the same time acquires new risk. To understand what I mean by this, read the example in next question: Futures.

Q: What is a Future?
A: Futures are contracts to buy or sell an asset on a future date (but not earlier) at a price agreed today. Since this is a contract both the buyer and seller are obliged to exercise the trade at the agreed date in the future.

To better understand how a futures contract works, consider a commodities futures contract between a Farmer and Miller. 

The Farmer has wheat he wishes to sell when he harvests his crop in 3 months time. The Miller wishes to purchase wheat for his mills to produce flour. So, before harvest time, the farmer and the miller agreed a price for the wheat to be bought/sold when the wheat is harvested in 3 months time. In other words, they've signed a contract to buy/sell a commodity today with a price set for a future date.

It is common practice for both the farmer and the miller to go into this sort of future contract so that they can plan their finances and cash flow, knowing that they will receive or spend known amount of money for the commodities.

But what they both don't know for certain is how the market is going to be in 3 months time. If there is a drought in the coming months then the general harvest will be less and so the price of wheat will go up, and conversely, if there is a decent amount of rain then there will be plenty of harvest and the price of wheat will go down. Having a Future contract means that
they protect themselves from possible fluctuations of market prices when the time comes to buy/sell the commodities.
 
Let's say then that the current price of wheat is £150/tonne and the futures contract price agreed was £165/tonne.

The table below shows 2 possible scenarios where the actual market price differs significantly on the day of the contract maturity date, compared to the futures price agreed in the contract and what it meas to both the Farmer and the Miller in each case.

The price at the time of contract mature date Risk to Farmer Risk to Miller
The price dropped to £155/tonne By having a futures contract, the farmer reduces the risk of losing out £10/tonne by agreeing to sell his wheat at £165/tonne The miller takes on the risk of having to pay more to buy the wheat at £165/tonne, when he could have got a cheaper price if he simply bought the wheat at the market price at the contract mature date

The price increased to £170/tonne By having a futures contract, the farmer takes on the risk of loosing out on the opportunity to make more money (extra £5/tonne) if he simply sold his wheat in the market The Miller reduces the risk of having to pay a higher price for the wheat by having a fix price contract with the Farmer


Q: What is an Option?
 A: An Option is similar to a Future trade, except that an option is a contract that gives the buyer the right, but not the obligation, to buy or sell an underlying asset at a specific price on or before a certain date. 

Since options are far more complex types of trade there is a price to set up an Option. Firstly, a person who grants the option charges a fee (called the Premium) from the buyer. The price agreed to either buy/sell the underlying asset is called the Strike Price.

Options trading introduces two new terminologies: a Call and a Put, instead of a Buy or a Sell. This is because:-
A Call gives the holder the right to buy an asset at a certain price within a specific period of time.
A Put gives the holder the right to sell an asset at a certain price within a specific period of time.

This means that you can have 4 possible scenarios:
  • To Buy a Call (i.e. to buy the right to buy an asset at a certain price)
  • To Sell a Call (i.e. to sell the right to buy an asset at a certain price)
  • To Buy a Put (i.e. to buy the right to sell an asset at a certain price)
  • To Sell a Put (i.e. to sell the right to sell an asset at a certain price)
To understand this better, consider an example where someone advertises to sell his house using an Option, i.e. he writes (or sells) a Call. A person who is interested in buying the house pays a non-refundable deposit of £1000 to the seller, i.e. he pays the Premium and buys the Call, with the strike price of £100,000 for the property, with the exchange of property to be completed in 90 days.

During the purchase process two things could happen:
  1. The buyer discovers that the house is built on a land with a history of subsidence and consequently decided not to exercise the right to buy the properly. When this happens, after 90 days the Option expires and becomes worthless and the buyer loses the Premium, i.e. the deposit. However, the underlying asset, the house itself retains its value of £100,000. It is only the option that becomes worthless, not the underlying asset.
  2. The buyer discovers that the house was previously owned by a famous movie star and news of this leaked to the media and consequently the price of the house shots up 10 folds. So, after 90 days the buyer exercises the Call option and the seller is obliged to complete the exchange with the agreed price of £100,000, even though the properly is worth a lot more. 
The converse is also true for the Put option. It is also important to note that the person who can exercise the Option (i.e. either to let the option expires or not) is the Buyer of a Call or a Put, and not the Seller.

    Q: What are Equities and Commodities?
    Equities are nothing more than your run-of-the-mill stocks and shares, which can be bought and sold at stock exchanges or through stock brokers.

    Commodities are physical goods which are being bought or sold. The most common commodities which are traded in stock exchanges around the world are:
    • cattle
    • cocoa
    • coffee
    • corn
    • cotton
    • gold
    • iron
    • natural gas
    • oil
    • platinum
    • sugar
    • tea
    • wheat