It’s been a tough ride for BlackBerry Ltd. (TSX:BB)(NASDAQ:BBRY) shareholders, especially ones that have been holding on for a long time.

Just a decade ago, the company dominated the smartphone market–a position that allowed it to basically print money. It briefly became Canada’s most valuable company in 2007, reaching a market cap of $67.4 billion.

Things are a lot different today. BlackBerry has a market cap of just $5.2 billion, and its largest shareholder is famed value investor Prem Watsa. The company has even announced a partial withdrawal from the smartphone market. It’ll still market BlackBerry phones. It just won’t design or manufacture them.

Instead, it plans to focus on its growing software division. Revenue from the division grew 89% in its most recent quarter, much of which can be attributed to a couple big acquisitions in late 2015. Still, that’s impressive growth, and software margins are much higher than hardware.

A big reason to be excited about software

The province of Ontario recently announced it would approve a self-driving-car pilot program, provided licensed drivers are behind the wheel at all times to ensure the car is following the rules of the road.

Three different organizations will participate in the pilot project. The first is the University of Waterloo. The second is car manufacturer Erwin Hymer Group. The final participant is QNX, one of BlackBerry’s software subsidiaries.

Being a part of one pilot project might not seem like much, but there are a number of reasons to be optimistic about BlackBerry’s presence in the program.

One reason is the sheer size of the self-driving-car market. There are more than 1.2 billion cars on the road today with estimates putting that number as high as two billion by 2035. That number may go down as more people choose to rent cars in a driverless world, but it’s still pretty obvious there’s enough of a market available for several software companies to do quite well.

Why BlackBerry specifically?

We all know self-driving cars will be a big opportunity for the world’s leading tech companies. Why should investors choose BlackBerry specifically as their exposure to such a trend?

One major factor to consider is how much of this is priced in. Investors fully expect both Apple and Google to enter the market. Both are throwing billions at the problem in a very quiet way. We know both companies are working on it. We just don’t know how far along both are.

BlackBerry’s entrance is a little different. The stock is already cheap on multiple levels. It has US$2.1 billion in cash. And although it continues to post negative quarterly earnings numbers, it did have positive free cash flow in its fiscal 2013, 2015, and 2016.

BlackBerry represents a very inexpensive way to get access to a potentially large market. And with a market cap just over $5 billion, a larger tech company could even acquire BlackBerry for its promising technology.

The bottom line

The journey between participating in a pilot program and successfully making software that will allow cars to drive themselves is a long one. BlackBerry, like many of its competitors, is still years away from really making a breakthrough.

But at the same time, investors have to be excited the company is working on a such a huge project. It could really impact the bottom line. Just don’t expect results immediately.

Stock Buy Alert Hits Astounding 96% Success Rate!

The hand-picked investing team inside Stock Advisor Canada, recently issued a buy alert for one special type of "bread-and-butter" stock where The Motley Fool U.S. has banked profits on 23 out of 24 recommendations. Frankly, with an astounding 96% success rate that has delivered average returns of 260%, chances are this new pick could deliver life-changing returns as well. Because the team at Stock Advisor Canada fully embraces the same time-tested investing philosophies that have led to countless Motley Fool winners globally. So simply click here to unlock the full details behind this new recommendation and join Stock Advisor Canada.

*96% accuracy includes restaurant stock recommendations from Motley Fool U.S. services Stock Advisor, Rule Breakers, Hidden Gems, Income Investor and Inside Value since each services inception. Returns as of 5/27/16.

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Nelson Smith owns shares of BlackBerry. David Gardner owns shares of Alphabet (A shares), Alphabet (C shares), and Apple. Tom Gardner owns shares of Alphabet (A shares) and Alphabet (C shares). The Motley Fool owns shares of Alphabet (A shares), Alphabet (C shares), and Apple and has the following options: long January 2018 $90 calls on Apple and short January 2018 $95 calls on Apple.