The nickname, which was never used by the composer himself but was introduced only early in the 19th century, originates from a story about how Scarlatti came up with the strikingly unusual motif on which the fugue is built.
On one occasion, according to the story, Scarlatti wrote down a phrase from one of these "improvisation sessions", and used it as a lead motif in a fugue: .