"I want to thank Ducati for the great memories and especially the support and enthusiasm of the Ducati fans for our shared passion for racing and motorcycling, I'll always remember this," said Stoner.
Stoner's most recent Ducati test was at Sepang in January, just before undergoing major shoulder surgery on an old injury.
After retiring at the end of 2012 with 38 MotoGP wins, Stoner initially helped Honda with some testing duties before a headline-grabbing return to Ducati.
"Over the past three years I have really enjoyed doing my job with the test team, the engineers and technicians, as we worked towards improving the Desmosedici GP package and I sincerely want to wish the team all the very best for their future endeavours," Stoner added.
Ducati praised the 33-year-old, for helping improve its MotoGP machine to become arguably the most competitive bike on the grid, while also providing input for the 'final development' of the new Panigale V4 Superbike.
"Casey is and will always remain in the hearts of Ducatisti and it is also on their behalf that we wish to thank him for the important collaboration he has offered us over the last three years," said Ducati Motor Holding CEO Claudio Domenicali.
Stoner had proved he had lost none of his legendary speed by leading the full-time MotoGP field on the opening day of Sepang testing in 2017.
"His technical indications and suggestions, together with the work and the feedback of the factory riders and Michele Pirro, have helped to make the Desmosedici GP one of the most competitive bikes on the grid, and his advice for the development of our production bikes has been just as precious and useful. Ducati and its many fans wish to offer their sincere thanks and their best wishes to Casey and his family for a serene and happy future," Domenicali added.