The Testament of Ba was transmitted in manuscript form over many centuries, and so there are many different recensions of the text, but not one single, canonical printed version. Two early versions of the text have been identified by scholars:
A manuscript in 31 folios discovered in Lhasa in 1997, titled Dba' bzhed, that is thought to be a revised copy of an 11th-century manuscript, and which was published in facsimile with an English translation in 2000;
Three manuscripts titled Sba bzhed, one of which dates to the 12th century, that were used as the basis of an edition published in Beijing in 1980.
The Testament of Ba is also widely quoted in later Tibetan historigraphical works, for example the Scholar's Feast. The author of the Scholar's Feast calls the Testament the Rba bzhed, and refers to 'genuine', 'impure', 'large' and 'medium' versions of the text. A later, expanded version of the Testament of Ba, titled Sba bzhed zhabs brtags pa, was produced during the mid 14th century. A manuscript copy of this text was published with a summary in French by Rolf Stein in 1961. Up until 2009 it was thought that the Testament of Ba dated back to no earlier than the 11th or 12th century, and therefore its composition may not have been contemporaneous with the late 8th century events that it recorded. However, in 2009 Sam van Schaik of the British Library realised that two Tibetan manuscript fragments catalogued amongst the Chinese manuscripts of the Stein collection preserved a section of the Testament of Ba relating to the arrival of the Indian monk Śāntarakṣita, abbot of Nalanda University, to Lhasa:
These two fragments came from the 'Library Cave' at Dunhuang, which was sealed in the early 11th century, and so pre-date all of the other known versions of the Testament of Ba. Van Schaik dates the fragments to the 9th or 10th centuries. The text of the British Library fragments is very close to that of the Dba' bzhed manuscript discovered in Lhasa in 1997, but has some differences that suggest that it represents an earlier recension of the Testament of Ba. Most notably, in the British Library fragments the king is concerned that the foreign monk may have brought evil spirits with him, and so Śāntarakṣita is confined in the Jokhang and interrogated for three months through an interpreter called Ananta. However, the Lhasa manuscript softens the language, politely asking Śāntarakṣita to stay at the Jokhang rather than having him forcibly confined there.