EXHIBIT 5.01 March 29, 2002 Keynote Systems, Inc. 777 Mariners Island Boulevard San Mateo, CA 94404 Ladies and Gentlemen: At your request, we have examined the registration statement on Form S-8 (the "Registration Statement") filed by you with the Securities and Exchange Commission (the "Commission") on or about March 29, 2002, in connection with the registration under the Securities Act of 1933, as amended, of 1,395,169 shares of your common stock (the "Stock"), subject to issuance upon exercise of stock options granted or to be granted under your 1999 Equity Incentive Plan (the "Incentive Plan"), and of 279,034 shares of Stock subject to purchase rights granted or to be granted under your 1999 Employee Stock Purchase Plan (the "Purchase Plan" and together with the Incentive Plan, the "Plans"). In rendering this opinion, we have examined the following: (1) your Amended and Restated Certificate of Incorporation, certified by the Delaware Secretary of State on January 12, 2000; (2) your bylaws, certified by your Secretary on February 29, 2000; (3) the Registration Statement, together with the exhibits filed as a part thereof or incorporated therein by reference, (4) the registration statement on Form S-8 (File No. 333-73244) filed by you with the Commission on November 13, 2001, together with the exhibits filed as a part thereof or incorporated therein by reference; (5) the registration statement on Form S-8 (File No. 333-87791) filed by you with the Commission on September 24, 1999, together with the exhibits filed as a part thereof or incorporated therein by reference, including the Incentive Plan and related forms of stock option agreement and stock option exercise agreement, and the Purchase Plan and related forms of enrollment form, subscription agreement, notice of withdrawal and notice of suspension; (6) the prospectuses prepared in connection with the Registration Statement; (7) the minutes of meetings and actions by written consent of your stockholders and Board of Directors that are contained in your minute books and the minute books of your predecessor, Keynote Systems, Inc., a California corporation, that are in our possession; (8) a certificate from your transfer agent of even date herewith verifying the number of issued and outstanding shares of your capital stock as of March 28, 2002 and a list of options respecting your capital stock and of any rights to purchase capital stock that was prepared by you and dated March 28, 2002 verifying the number of such issued and outstanding securities; and (9) a Management Certificate addressed to us and dated of even date herewith executed by you containing certain factual and other representations. In our examination of documents for purposes of this opinion, we have assumed, and express no opinion as to, the genuineness of all signatures on original documents, the authenticity and completeness of all documents submitted to us as originals, the conformity to originals and completeness of all documents submitted to us as copies, the legal capacity of all persons or entities executing the same, the lack of any undisclosed termination, modification, waiver or amendment to any document reviewed by us and the due authorization, execution and delivery of all documents where due authorization, execution and delivery are prerequisites to the effectiveness thereof. We have also assumed that the certificates representing the Stock will be, when issued, properly signed by your authorized officers or their agents. As to matters of fact relevant to this opinion, we have relied solely upon our examination of the documents referred to above and have assumed the current accuracy and completeness of the information obtained from the documents referred to above and the representations and warranties made by you to us, including, but not limited to, those set forth in the Management Certificate. We have made no independent investigation or other attempt to verify the accuracy of any of such information or to determine the existence or non-existence of any other factual matters; however, we are not aware of any facts that would cause us to believe that the opinion expressed herein is not accurate. We are admitted to practice law in the State of California, and we render this opinion only with respect to, and express no opinion herein concerning the application or effect of the laws of any jurisdiction other than, the existing laws of the United States of America, of the State of California and, with respect to the validity of corporate action and the requirements for the issuance of stock, of the Delaware General Corporation Law, the Delaware constitution and reported judicial decisions relating thereto. Based upon the foregoing, it is our opinion that the up to 1,674,203 shares of Stock that may be issued and sold by you upon exercise of (a) stock options granted or to be granted under the Incentive Plan and (b) purchase rights granted or to be granted under the Purchase Plan, when issued, sold and delivered in accordance with the applicable plan and purchase agreements to be entered into thereunder, and in the manner and for the consideration stated in the Registration Statement and/or the relevant prospectus, will be validly issued, fully paid and nonassessable. We consent to the use of this opinion as an exhibit to the Registration Statement and further consent to all references to us, if any, in the Registration Statement, the prospectuses constituting a part thereof and any amendments thereto. This opinion is intended solely for use in connection with the issuance and sale of Stock subject to the Registration Statement and is not to be relied upon for any other purpose. We assume no obligation to advise you of any fact, circumstance, event or change in law or the facts that may hereafter be brought to our attention whether or not such occurrence would affect or modify the opinions expressed herein. Very truly yours, /s/ Fenwick & West LLP FENWICK & WEST LLP