According to the author's note, the idea of the play came to him on 1874, in Moscow.
Next time Ostrovsky mentioned it in his 1878, in a letter to Burdin: "Now I am busy working on a large original play.