The samurai tradition is often cited as the source for the mindset of the warriors, soldiers, leaders, and officers of various twentieth-century confrontations such as Japan’s war against China, Southeast Asia, and the United States [1]. During these conflicts, the norms and values of the Japanese are said to have been “conditioned by and derived from an ancient code of warrior behavior called bushidō”, a word that literally translates to “The Way of the Warrior” [1]. However, bushidō is an ambiguous term that covers a wide range of thinking. The term actually appears in modern English publications such as martial arts magazines more often than it did in premodern Japanese texts [2]. Neither modern nor early modern ideas about it had much to do with authentic samurai behavior during the age when it was first used by bureaucrats to enunciate a code of conduct for the samurai. The concept of a code of conduct for the samurai was a product of the seventeenth and eighteenth centuries when Japan was at peace, not during the “Age of the Country at War (1467-1604)” [1]. The samurai of this later period were bureaucrats and administrators, not fighting men; the motivation held in common by those who wrote bushidō was a quest to identify the “proper” role of a warrior class in a world without war [1].
In traditional Japan, the rule of bureaucrats at the court were swept away by the militaristic government at Kamakura, which enforced strict discipline, maintained public peace, and won the confidence of all social classes of by administering fair and strict justice. The bushi warriors of the Kamakura period (1185-1333) were responsible for this stern behavior and produced an ethical code which later became known as bushidō [3]. Specifically, Yamaga Sokō, a major Confucian scholar of the Ancient Studies school and military strategist, is generally credited as the formulator of bushidō [4]. In the tenth and eleventh centuries, the bushi (warrior) was known as a musa (man-at-arms) or tsuwamono (strong man) and a strict adherence to warrior principles was upheld in words such as “tsuwamono wo tatsuru” (uphold the warrior’s honor) [3]. However, simple physical courage and defiance of death does not have moral significance alone and is generally understood to not be the true breeding ground of bushidō [3].
By nature of his profession, the bushi esteemed military valor, shared the same hardships in battle, trusted their master’s sincerity such that faith or fidelity was reciprocated among the warriors’ society, and valued integrity and disinterestedness [3]. However, as has been indicated, the term bushidō did not come to acquire its modern interpretation until after the Age of a Country at War – long after when the samurai had ceased to be warriors. With calmer social orders in the beginning of the seventeenth century, “the warrior was again recognized by himself and others as exemplar to the farmer, the artisan, and the tradesman” [3]. Ultimately, thanks for the most part to Confucian scholars, the warrior’s interest in morality was revived so that bushidō flourished in Japan again [3]. The practical necessities of warriors functioned as the “breeding ground” for bushidō which, in turn, “came to be popularized by Confucian moral ideas, not only as the morality of the warrior-class but as the cornerstone of national morals” [3].

References:
[1] Friday, Karl F. “Bushidō or Bull? A Medieval Historian’s Perspective on the Imperial Army and the Japanese Warrior Tradition.” Society for History Education, vol. 27, no. 3, 1994, pp. 339–49. Link
[2] Hurst, G. Cameron. “Death, Honor, and Loyalty: The Bushidō Ideal.” University of Hawai’i Press, vol. 40, no. 4, 1990, pp. 511–27. Link
[3] Kawakami, Tasuke. “Bushidō in its Formative Period.” Hitotsubashi University, vol. 3, no. 1, 1952, pp. 65–83. Link
[4] Varley, Paul. Japanese Culture. Univeristy of Hawai’i Press, 2000.