1 Exhibit 5.1 May 28, 1998 Atlantic Data Services, Inc. One Batterymarch Park Quincy, Massachusetts 02169 Re: Atlantic Data Services, Inc. Registration Statement on Form S-8 Ladies and Gentlemen: We are acting as counsel for Atlantic Data Services, Inc., a Massachusetts corporation (the "Company"), in connection with the registration on a Registration Statement on Form S-8 (the "Registration Statement") under the Securities Act of 1933, as amended, of the offer and sale of up to 2,263,010 shares of Common Stock, par value $.01 per share, of the Company (the "Shares") to be issued upon the exercise of options under the Amended and Restated 1992 Incentive Stock Option Plan (the "1992 Plan") and the Amended and Restated 1997 Stock Plan (the "1997 Plan") and the purchase of Shares under the 1998 Employee Stock Purchase Plan (the "Purchase Plan" and, collectively, with the 1992 Plan and the 1997 Plan, the "Plans") (as described in the Registration Statement) (collectively the "Options"). In rendering our opinion, we have examined, and are familiar with, and have relied as to factual matters solely upon, originals or copies certified, or otherwise identified to our satisfaction, of such documents, corporate records or other instruments as we have deemed necessary or appropriate for the purposes of the opinion set forth herein, including, without limitation, (a) the Plans, (b) the Company's Amended and Restated Articles of Organization, (c) the Company's Second Amended and Restated Articles of Organization, (d) the Company's Amended and Restated By-laws, (e) the Company's Second Amended and Restated By-laws, (f) a specimen of the form of Certificate evidencing the Shares, (g) the minute books and stock records of the Company, and (h) a Certificate of the Clerk of the Company dated May 27, 1998 (without making any independent investigation or inquiry with respect to the completeness or accuracy of such statements contained in such Certificate). We are members only of the bar of the Commonwealth of Massachusetts and are not experts in, and express no opinion regarding, the laws of any jurisdiction other than the Commonwealth of Massachusetts and the United States of America. Based upon and subject to the foregoing, we are of the opinion that the Shares are duly authorized and, when issued and delivered pursuant to the terms of the Options against receipt by the Company of the consideration therefor as provided therein, will be validly issued, fully paid and nonassessable. We hereby consent to the filing of this opinion as Exhibit 5.1 to the Registration Statement. Very truly yours, /s/ Testa, Hurwitz & Thibeault, LLP TESTA, HURWITZ & THIBEAULT, LLP