Image source: IBM.

What: Shares of International Business Machines (IBM -1.05%) surged 15.6% in March, according to data provided by S&P Global Market Intelligence. There wasn't any specific news driving the stock higher, but after slumping for the past three years, investor sentiment may have finally turned around in March.

So what: IBM has suffered from declining revenue in each of the past 15 quarters. The company is attempting to transform itself, shifting resources to areas like cloud computing and analytics. Meanwhile, legacy businesses are shrinking, and along with negative currency effects, the end result is a string of nasty quarterly results. During the fourth quarter of 2015, which IBM reported on in January, revenue tumbled 9%, and non-GAAP EPS sank 17%.

Shares of IBM bottomed out in February, hitting a 52-week low of about $117 per share, down over 40% from early 2013. Since then, the stock has surged, powering its way back to about $150 per share, with a big chunk of that gain coming in March.

IBM Chart

IBM data by YCharts.

Nothing has really changed about IBM's story, but pessimism surrounding the stock may have simply become too extreme. Despite the challenges facing IBM, the company is still a cash machine, generating $13.1 billion of free cash flow in 2015. At the 52-week low, the total market capitalization was less than 9 times this number.

Now what: IBM's transformation is still a work in progress, and 2016 will almost certainly be another tough year, in part due to continued currency headwinds. But the gains in March may be a sign that the market no longer believes that IBM is doomed. Or it could just be a fluke, with IBM riding a rising stock market higher.

Either way, IBM investors will need to continue to be patient as the company slowly turns itself in a new, and hopefully highly profitable, direction.