We extend a technique devised by Saroka and Rebonato to "optimally" deform a yield curve in order to deal with a common and practically relevant class of optimization problems subject to linear constraints. In particular, we show how the idea can be applied to the case of reverse stress testing, andwepresent a case study to illustrate how it works. Finally, we point out a maximum-entropy interpretation of (or justification for) the procedure and present some obvious generalizations.