TESTA HURWITZ & THIBEAULT, LLP 125 High Street Boston, MA 02110 Exhibit 5.1 July 20, 1999 NetScout Systems, Inc. 4 Technology Park Drive Westford, MA 01886 RE: Registration Statement on Form S-1 (File No. 333-76843) Ladies and Gentlemen: This opinion relates to an aggregate of 4,600,000 shares of common stock, par value $.001 per share ("common stock"), of NetScout Systems, Inc. (the "Company"), which are the subject matter of a Registration Statement on Form S-1 as filed with the Securities and Exchange Commission (the "Commission") on April 22, 1999, as amended by Amendment No. 1 to the Registration Statement on Form S-1 as filed with the Commission on May 4, 1999, Amendment No. 2 to the Registration Statement on Form S-1 as filed with the Commission on June 3, 1999 and Amendment No. 3 to the Registration Statement on Form S-1 as filed with the Commission on July 20, 1999 (the "Registration Statement"). The 4,600,000 shares of common stock covered by the Registration Statement consist of 4,000,000 shares being sold by the Company, and 600,000 shares subject to an over-allotment option granted by certain stockholders of the Company to the underwriters (the "Underwriters") named in the prospectus (the "Prospectus") incorporated by reference in the Registration Statement. Based upon such investigation as we have deemed necessary, we are of the opinion that when the 4,000,000 shares of common stock to be sold by the Company pursuant to the Prospectus have been issued and paid for in accordance with the terms described in the Prospectus, such shares of common stock will have been validly issued and will be fully paid and nonassessable. Further, we are of the opinion that the 600,000 shares of common stock to be sold by the stockholders of the Company pursuant to the Prospectus have been validly issued and are fully paid and nonassessable. We hereby consent to the filing of this opinion as Exhibit 5.1 to the Registration Statement and to the reference to our firm in the Prospectus under the caption "Legal Matters." Very truly yours, /s/ Testa, Hurwitz & Thibeault, LLP --------------------------------------------- TESTA, HURWITZ & THIBEAULT, LLP