1 EXHIBIT 5.1 FOLEY, HOAG & ELIOT LLP One Post Office Square Boston, Massachusetts 02109 May 21, 1997 Cayenne Software, Inc. 8 New England Executive Park Burlington, MA 01803 Ladies and Gentlemen: We are familiar with the Registration Statement on Form S-8 transmitted for filing by the Company today (the "S-8 Registration Statement") relating to 2,000,000 shares (the "Shares") of the Company's Common Stock to be offered puruant to the Company's Amended 1996 Incentive and Nonqualified Stock Option Plan (the "Plan"). We are familiar with the Company's Articles of Organization and all amendments thereto, its By-Laws and all amendments thereto, the records of all meetings and consents of its Board of Directors and of its stockholders, and its stock records. We have examined such other records and documents as we deemed necessary or appropriate for purposes of rendering this opinion. Based upon the foregoing, we are of the opinion that (a) the Company has corporate power adequate for the issuance of the Shares in the manner set forth in the S-8 Registration Statement; and (b) upon issuance upon exercise of options granted under the Plan in against payment of the specified exercise prices therefor, the Shares will be legally issued, fully paid and non-assessable. We consent to the filing of this opinion as an exhibit to the S-8 Registration Statement. Very truly yours, FOLEY, HOAG & ELIOT LLP By: /s/ David W. Walker ---------------------------- a Partner -E-8-