
<PAGE>   1
                                                                       Exhibit 5


                      [LETTERHEAD OF CUMMINGS & LOCKWOOD]


                                 August 25, 1998



Analysis & Technology, Inc.
Route 2
PO Box 220
North Stonington, CT   06359

            Re:  Analysis & Technology, Inc.
                 Registration Statement on Form S-8

Dear Sirs:

            We have acted as special counsel for Analysis & Technology, Inc., a
Connecticut corporation (the "Corporation"), in connection with its registration
statement on Form S-8 being filed on August 25, 1998 (the "Registration
Statement") relating to 150,000 shares (the "Shares") of common stock, no par
value (the "Common Stock"), of the Corporation which may be issued upon the
exercise of options pursuant to the Corporation's 1998 Stock Option Plan (the
1998 "Plan") and to additional shares which may be issued pursuant to other 
stock option plans of the Company.

            In that connection, we have examined originals, or copies certified
or otherwise identified to our satisfaction, of such documents, corporate
records, and other instruments as we have deemed necessary or appropriate for
the purpose of rendering this opinion, including: (a) the Certificate of
Incorporation of the Corporation; (b) the By-Laws of the Corporation; (c) the
Registration Statement; (d) the minutes of the meetings of the Board of
Directors and shareholders of the Corporation relating to the approval of the
1998 Plan; and (e) the 1998 Plan.

            Based upon the foregoing, we are of the opinion that the Shares
will, upon issuance in accordance with the provisions of the 1998 Plan, be 
validly issued, fully paid, and nonassessable.
<PAGE>   2
Analysis & Technology, Inc.               -2-                   August 25, 1998

            The opinion contained herein is qualified as follows. While it is
our understanding that the Corporation does not now have any issued but not
outstanding shares, the Corporation may use currently issued shares of its
Common Stock which it may hereafter acquire to satisfy its obligation to deliver
shares under the 1998 Plan in lieu of issuing new shares. As an opinion with
respect to any such treasury shares which might be delivered to satisfy
obligations under the 1998 Plan would require a review of all issuances of stock
by the Corporation from the date of its incorporation, the opinion contained
herein is intentionally and specifically limited to those shares which may
hereafter be issued by the Corporation for delivery pursuant to the 1998 Plan.
In addition, the opinion contained herein does not relate to any shares of the
Company's Common Stock which may be issued upon exercise of options granted
under the Company's other stock option plans referred to in the Registration
Statement since opinions with respect to such shares were filed as exhibits to
the prior registration statements relating to such plans.

            We hereby consent to the filing of this opinion as Exhibit 5 to the
Registration Statement.



                                    Very truly yours,



                                    /s/Cummings & Lockwood


