Tsujigiri

Tsujigiri ( or , literally "crossroads killing") is a Japanese term for a practice when a samurai, after receiving a new "katana" or developing a new fighting style or weapon, tests its effectiveness by attacking a human opponent, usually a random defenseless passer-by, in many cases during nighttime. The practitioners themselves are also referred to as "tsujigiri".
Variations.
Sword attacks were not the only possible application of this act. In a variation named "tsuji-nage" (, "crossroads throwing"), the samurai would attack the passerby with jujutsu in order to test his own techniques or indulge in alive practice. This must not be mistaken with "tsuji-zumo", unsanctioned sumo bouts hosted in the street between willing participants.
History.
In the medieval era, the term referred to traditional duels between samurai, but in the Sengoku period (1467–1600), widespread lawlessness caused it to degrade into indiscriminate murder, permitted by the unchecked power of the samurai. Shortly after order was restored, the Edo government prohibited the practice in 1602. Offenders would receive capital punishment. 
1696 spree killing.
The only known incident where a very large number of people were indiscriminately killed in the Edo period was the 1696 Yoshiwara spree killing (, "Yoshiwara hyakunin giri"; "One hundred Yoshiwara slash"), where a wealthy lord, Sano Jirōzaemon, had a psychotic fit and murdered dozens of prostitutes with a katana in Yoshiwara, the red-light district of Edo (modern-day Tokyo). Despite his class and heritage, he was treated by authorities as a spree killer and was later sentenced to death and executed. Later, a kabuki play was made about the incident; the incident later inspired the 1960 movie adaptation "Hero of the Red-Light District". 50-year-old Tokugawa Tsunayoshi, the 5th "Shōgun" of the Tokugawa shogunate, was serving his 16th year in power at the time of the attack.
Mary Midgley's "Trying Out One's New Sword".
British philosopher Mary Midgley discusses "tsujigiri" in her well known essay, "Trying Out One's New Sword". Midgley refers to the practice as a "custom" of "ancient Japan". Contrary to her description, however, the historical record provides no indication that it was ever condoned. Nor is it clear that samurai actually slashed people in the street for the purpose of testing their swords. The idea that "tsujigiri" was done as a means of testing a sword may derive from confusion with the term "tameshigiri", meaning "test-cutting". 