1 Exhibit 5 SHAW, PITTMAN, POTTS & TROWBRIDGE 2300 N Street, N.W. Washington, D.C. 20037 August 11, 1998 Landmark Systems Corporation 8000 Towers Crescent Drive Vienna, Virginia 22180 Re: Landmark Systems Corporation Registration Statement on Form S-8 Ladies and Gentlemen: We have acted as counsel to Landmark Systems Corporation, a Virginia corporation (the "Company"), in connection with the registration of 1,000,000 shares (the "Shares") of the Common Stock, $0.01 par value, of the Company pursuant to a Registration Statement on Form S-8 under the Securities Act of 1933 (the "Registration Statement"), relating to the Landmark Systems Corporation 1998 Employee Stock Purchase Plan (the "Plan"). Based upon our examination of the originals or copies of such documents, corporate records, certificates of officers of the Company and other instruments as we have deemed necessary and upon the laws as presently in effect, we are of the opinion that the Shares have been duly authorized for issuance by the Company, and that upon issuance and delivery in accordance with the Plans referred to in the Registration Statement, the Shares will be validly issued, fully paid and nonassessable. We hereby consent to the filing of this opinion as Exhibit 5 to the Registration Statement. Very truly yours, /s/ SHAW, PITTMAN, POTTS & TROWBRIDGE SHAW, PITTMAN, POTTS & TROWBRIDGE