In the movie "The Imitation Game", Alan Turing along with his team crack the German encryption machine Enigma but advises his superiors to not act on all decrypted intelligence, as that might lead to the Germans getting suspicious about Enigma being cracked, possibly resulting in a change of its design to thwart further decryption efforts.
His character specifically says that his team "would develop a system to help determine how much intelligence to act on; which attacks to stop, which to let through, using statistical analysis; find the minimal number of actions it would take to win the war, but the maximal number that can be taken before the Germans get suspicious".
Is this historically accurate? If so, how was it done? What branch of mathematics/statistics deals with this?