Another reason why testing is so important!




Bad Algorithm Burns $440 Million -  Worst Software Testing Day EVER

Knight Capital, a firm that specializes in executing trades for retail brokers, took $440 million in cash losses Wednesday due to a faulty test of new trading software.

In headlines it’s being called a trading “glitch,” which isn’t nearly as accurate as the term I’d use: “f**king disaster.” The broad outline of the story is here and more colorful, bloody details are here.


Briefly, here’s what happened: Knight Capital’s worst day in IT started Wednesday morning with a test run of their new trading software. An old pal of mine who’s following the story closely (and is also deep in both IT and trading) told me that the company set up the software to work with only a few stocks. They also set the buy/sell points well outside where the markets were currently trading to ensure that nothing would actually execute.

But somehow – and this will probably the be the subject of several lawsuits, books, and maybe even a Broadway musical – the software didn’t behave as expected. It went out and did what it was designed to do: execute lots and lots of trades very, very quickly.

Unfortunately, the trading algorithm the program was using was a bit eccentric as well. On every stock exchange, there is a ‘bid’ and an ‘ask’ price. The bid price is what you’d pay the holder of the stock if you want to buy their shares. The ask price is what they’ll pay to buy those same shares from you. There’s always a spread between the two prices, with the ‘bid’ being a few cents or more above the ‘ask.’ If the stock is thinly traded, then the spread between the bid and the ask is higher than what you’d see for, say, IBM.

Knight Capital’s software went out and bought at the ‘market,’ meaning it paid bid price and then sold at the ask price – instantly. Over and over and over again. One of the stocks the program was trading, electric utility Exelon, had a bid/ask spread of 15 cents. Knight Capital was trading blocks of Exelon common stock at a rate as high as 40 trades per second – and taking a 15 cent per share loss on each round-trip transaction. As one observer put it, “…Do that 40 times a second, 2,400 times a minute, and you now have a system that’s very efficient at burning money.”

As the program continued its ill-fated test run, Knight’s fast buys and sells moved prices up and attracted more action from other trading programs. This only increased the amount of losses resulting from their trades to the point where, at the end of the debacle 45 minutes later, Knight Capital had lost $440 million and was teetering on the brink of insolvency.

They may get at least a partial reprieve. The NYSE will reverse trades in six stocks during the time period when the prices were at least 30% outside the normal trading range for the stocks. This will significantly defray much of Knight Capital’s losses for the day, but we don’t know if it’s enough to allow the firm to survive the blow.

We also don’t yet know exactly what happened. I find it hard to believe that the software was so faulty that it could just go into berserker mode and start wildly trading. Seems to me that that’s the type of issue that ISV regression testing would find and correct right away. On the other hand, I don’t think that the Knight Capital IT guys would just fire the program up for testing and not put in solid parameters to ensure that it doesn’t play with real money.

I think we’ll find that the culprit was a combination of ISV software bugs, bad documentation, and human error from Knight Capital. In short, plenty of blame to go around. But apportioning blame will have to wait until the forensics are complete. Then will come the lawsuits, settlements, high-level blue-ribbon commission hearings, and, finally, the insider tell-all books. Put me down for a Kindle versions of the books, please.

Source: http://www.gabrielconsultinggroup.com/gcg-news-and-views/20-general-blog/434-bad-algorithm-burns-440-million-worst-software-testing-day-ever.html

Comments

Popular posts from this blog

Software Testing @ Microsoft

Trim / Remove spaces in Xpath?