<PAGE>

                                                                    Exhibit 10.4
                                                                    ------------
                            STERLING SOFTWARE, INC.

                             AMENDED AND RESTATED
                            1996 STOCK OPTION PLAN
                            ----------------------

     Sterling Software, Inc., a Delaware corporation (the "Company"),
established the Sterling Software, Inc. 1996 Stock Option Plan (the "Plan"),
effective as of April 22, 1996.  The Plan was approved by the Company's
stockholders on May 29, 1996, was amended and restated effective as of September
4, 1996, and was subsequently amended and restated as of February 12, 1999.

     1.  Purpose.  The purpose of the Plan is to attract and retain the best
         -------
available talent and encourage the highest level of performance by executive
officers, key employees, directors, advisors and consultants, and to provide
them with incentives to put forth maximum efforts for the success of the
Company's business, in order to serve the best interests of the Company and its
stockholders.  All options granted under the Plan are intended to be
nonstatutory stock options.

     2.  Definitions.  The following terms, when used in the Plan with initial
         -----------
capital letters, will have the following meanings:

         (a) "Act" means the Securities Exchange Act of 1934 as in effect from
     time to time.

         (b) "Board" means the Board of Directors of the Company.

         (c) "Code" means the Internal Revenue Code of 1986, as in effect from
     time to time.

         (d) "Common Stock" means the common stock, par value $.10 per share,
     of the Company or any security into which such common stock may be changed
     by reason of any transaction or event of the type described in Paragraph 6.

         (e) "Date of Grant" means the date specified by the Stock Option
     Committee, the Special Stock Option Committee or the Board, as applicable,
     on which a grant of Stock Options will become effective (which date will
     not be earlier than the date on which such committee or the Board takes
     action with respect thereto).

         (f) "Market Value per Share" means (i) the fair market value per share
     of the Common Stock on the Date of Grant as determined by the Stock Option
     Committee, the Special Stock Option Committee or the Board, as applicable,
     with respect to Stock Options granted to Participants, and (ii) with
     respect to Stock Options granted to Nonemployee Directors pursuant to
     Paragraph 5A, the average of the high and low closing sale prices as
     reported on any national securities exchange on which the Common Stock is
     listed on the Date of Grant if such date is a trading day and, if such date
     is not a trading day, on the immediately preceding date which is a trading
     day.

                                      -1-
<PAGE>

         (g) "Nonemployee Director" means a member of the Board who is not an
     employee of the Company or any Subsidiary, who qualifies as a "Non-Employee
     Director" within the meaning of Rule 16b-3 and who is a member of the
     Special Stock Option Committee.

         (h) "Option Price" means the purchase price per share payable on
     exercise of a Stock Option.

         (i) "Participant" means a person who is selected by the Stock Option
     Committee, the Special Stock Option Committee or the Board, as applicable,
     to receive Stock Options under Paragraph 5 of the Plan and who is at that
     time (i) an executive officer or other key employee of the Company or any
     Subsidiary, (ii) a Prospective Key Employee of the Company or any
     Subsidiary, (iii) an advisor or consultant to the Company or any
     Subsidiary, or (iv) a member of the Board other than a Non-Employee
     Director.

         (j) "Prospective Key Employee" means a person to whom the Company or
     any Subsidiary has extended or intends to extend an offer of employment.

         (k) "Rule 16b-3" means Rule 16b-3 under Section 16 of the Act as such
     Rule is in effect from time to time.

         (l) "Special Stock Option Committee" means the 1996 Special Stock
     Option Committee, which is a committee of the Board whose members are
     appointed by the Board from time to time.  All of the members of the
     Special Stock Option Committee, which may not be less than two, are
     intended at all times to qualify as "outside directors" within the meaning
     of Section 162(m) of the Code, and as "Non-Employee Directors" within the
     meaning of Rule 16b-3; provided, however, that the failure of a member of
                            --------  -------
     such committee to so qualify shall not be deemed to invalidate any Stock
     Option granted by such committee.  Although the Special Stock Option
     Committee has the authority under the Plan to make grants of Stock Options
     to any Participant, it is anticipated that the Special Stock Option
     Committee will make grants of Stock Options to those Participants who are
     executive officers of the Company and/or members of the Board, and as a
     result thereof are subject to Section 16 of the Act and the rules
     promulgated thereunder.

         (m) "Stock Option" means the right to purchase a share of Common Stock
     upon exercise of an option granted pursuant to Paragraph 5 or Paragraph 5A.

         (n) "Stock Option Committee" means the 1996 Stock Option Committee,
     which is a committee of the Board whose members are appointed by the Board
     from time to time.  Although the Stock Option Committee has the authority
     under the Plan to make grants of Stock Options to any Participant, it is
     anticipated that the Stock Option Committee will make grants of Stock
     Options to those Participants who are neither executive officers of the
     Company nor members of the Board, and as a result thereof are not subject
     to Section 16 of the Act and the rules promulgated thereunder.

                                      -2-
<PAGE>

         (o) "Subsidiary" means any corporation, partnership, joint venture or
     other entity in which the Company owns or controls, directly or indirectly,
     not less than 50% of the total combined voting power or equity interests
     represented by all classes of stock issued by such corporation,
     partnership, joint venture or other entity.

     3.  Shares Available Under Plan.  The shares of Common Stock which may be
         ---------------------------
issued under the Plan will not exceed in the aggregate 15,500,000 shares,
subject to adjustment as provided in this Paragraph 3.  Such shares may be
shares of original issuance or treasury shares or a combination of the
foregoing.

         (a) Any shares of Common Stock which are subject to Stock Options that
     are terminated unexercised, forfeited or surrendered or that expire for any
     reason will again be available for issuance under the Plan.

         (b) If, as of the close of business on the last day of each fiscal
     quarter of the Company following the effective date of the Plan, the sum of
     (i) the total number of shares of Common Stock previously issued upon the
     exercise of Stock Options, (ii) the total number of shares of Common Stock
     then subject to outstanding Stock Options, and (iii) the total number of
     shares of Common Stock then remaining available for future Stock Option
     grants under the Plan (such sum being the "Plan Shares") is less than 20%
     of the total number of shares of Common Stock then outstanding computed on
     a fully diluted basis (such total number being the "Outstanding Shares"),
     the number of shares of Common Stock available for issuance under the Plan
     will be increased (but not decreased) so that the number of Plan Shares
     will be equal to 20% of the number of Outstanding Shares.  For purposes of
     the foregoing adjustment, all outstanding Stock Options will be treated as
     fully exercised in computing the number of outstanding shares of Common
     Stock on a fully diluted basis, without regard to whether the Stock Options
     are then fully exercisable.

         (c) The shares available for issuance under the Plan also will be
     subject to adjustment as provided in Paragraph 6.

     4.  Individual Limitation on Stock Options.  The maximum aggregate number
         --------------------------------------
of shares of Common Stock with respect to which Stock Options may be granted to
any Participant during the term of the Plan will not exceed 5,425,000 shares.

     5.  Grants of Stock Options.  The Stock Option Committee, the Special Stock
         -----------------------
Option Committee or the Board may from time to time authorize grants to any
Participant of Stock Options upon such terms and conditions as such committee or
the Board, as applicable, may determine in accordance with the provisions set
forth below.

         (a) Each grant will specify the number of shares of Common Stock to
     which it pertains.

                                      -3-
<PAGE>

         (b) Each grant will specify the Option Price, which will not be less
     than 100% of the Market Value per Share on the Date of Grant.

         (c) Each grant will specify whether the Option Price will be payable
     (i) in cash or by check acceptable to the Company, (ii) by the transfer to
     the Company of shares of Common Stock owned by the Participant for at least
     six months (or, with the consent of the Stock Option Committee, the Special
     Stock Option Committee or the Board, as applicable, for less than six
     months) having an aggregate fair market value per share at the date of
     exercise equal to the aggregate Option Price, (iii) with the consent of the
     Stock Option Committee, the Special Stock Option Committee or the Board, as
     applicable, by authorizing the Company to withhold a number of shares of
     Common Stock otherwise issuable to the Participant having an aggregate fair
     market value per share on the date of exercise equal to the aggregate
     Option Price or (iv) by a combination of such methods of payment; provided,
                                                                       --------
     however, that the payment methods described in clauses (ii) and (iii) will
     -------
     not be available at any time that the Company is prohibited from purchasing
     or acquiring such shares of Common Stock.  Any grant may provide for
     deferred payment of the Option Price from the proceeds of sale through a
     bank or broker of some or all of the shares to which such exercise relates.

         (d) Successive grants may be made to the same Participant whether or
     not any Stock Options previously granted to such Participant remain
     unexercised.

         (e) Each grant will specify the required period or periods (if any) of
     continuous service by the Participant with the Company or any Subsidiary
     and/or any other conditions to be satisfied before the Stock Options or
     installments thereof will become exercisable, and any grant may provide, or
     may be amended to provide, for the earlier exercise of the Stock Options in
     the event of a change in control of the Company (as defined in the stock
     option agreement evidencing such grant or in any agreement referred to in
     such stock option agreement) or in the event of any other similar
     transaction or event.

         (f) Each Stock Option granted pursuant to this Paragraph 5 may be made
     subject to such transfer restrictions as the Stock Option Committee, the
     Special Stock Option Committee or the Board, as applicable, may determine.

         (g) Each grant will be evidenced by a stock option agreement executed
     on behalf of the Company by the Chief Executive Officer (or another officer
     designated by the Stock Option Committee, the Special Stock Option
     Committee or the Board, as applicable) and delivered to the Participant and
     containing such further terms and provisions, consistent with the Plan, as
     such committee or the Board, as applicable, may approve.

     5A.  Stock Options for Nonemployee Directors.  Each Nonemployee Director
          ---------------------------------------
(other than a Nonemployee Director who holds options that were granted under
Paragraph 5 prior to February 12, 1999) will be granted on the date of his or
her initial appointment to the Special Stock Option Committee an option to
purchase 100,000 shares of Common Stock (less the number of shares of Common
Stock subject to options granted to such Nonemployee Director within the

                                      -4-
<PAGE>

previous five years).  Each Nonemployee Director will also be granted an
additional option to purchase 100,000 shares of Common Stock (less the number of
shares of Common Stock subject to options granted to such Nonemployee Director
within the five years prior to such additional grant) every five years on the
anniversary date of the initial grant (or, in the case of a Nonemployee
Directors who holds options that were granted under Paragraph 5 prior to
February 12, 1999, on the fifth anniversary of the date of such prior grant),
beginning on the fifth anniversary of the initial grant (or such prior grant),
provided that such individual continues to serve as a member of the Special
Stock Option Committee through the close of business on such anniversary date.
All Stock Options granted pursuant to this Paragraph 5A will contain the terms
and conditions set forth below.

          (a) Each grant will specify the number of Common Stock to which it
     pertains.

          (b) Each grant will specify the Option Price, which will be 100% of
     the Market Value per Share on the Date of Grant.

          (c) Each grant will specify that the Option Price will be payable (i)
     in cash or by check acceptable to the Company, (ii) by the transfer to the
     Company of shares of Common Stock owned by the Nonemployee Director for at
     least six months (or, with the consent of the Special Stock Option
     Committee, for less than six months) having an aggregate fair market value
     per share at the date of exercise equal to the aggregate Option Price,
     (iii) with the consent of the Special Stock Option Committee, by
     authorizing the Company to withhold a number of shares of Common Stock
     otherwise issuable to the Nonemployee Director having an aggregate fair
     market value per share on the date of exercise equal to the aggregate
     Option Price or (iv) by a combination of such methods of payment; provided,
     however, that the payment methods described in clauses (ii) and (iii) will
     not be available at any time that the Company is prohibited from purchasing
     or acquiring such shares of Common Stock.  Each grant will also provide for
     deferred payment of the Option Price from the proceeds of sale through a
     bank or broker of some or all of the shares to which such exercise relates.

          (d) Stock Options for Nonemployee Directors will become exercisable in
     cumulative annual installments of one-fourth of the shares subject to the
     Stock Options, beginning one year after the Date of Grant, and will expire
     on the fifth anniversary of the Date of Grant.  Such Stock Options will
     also provide for immediate exercise in the event of a Change in Control, as
     hereinafter defined.

          (e) Each Stock Option granted pursuant to this Paragraph 5A may be
     subject to such transfer restrictions as the Stock Option Committee or the
     Board may determine.

          (f) Each grant will be evidenced by a stock option agreement executed
     on behalf of the Company by the Chief Executive Officer (or another officer
     designated by the Stock Option Committee or the Board) and delivered to the
     Nonemployee Director and containing such other terms and provisions,
     consistent with the Plan, as the Stock Option Committee or the Board may
     approve.

                                      -5-
<PAGE>

     For purposes of this Paragraph 5A, a "Change in Control" means the
occurrence, prior to the expiration of a Stock Option granted to a Nonemployee
Director, of any of the following events:

          (i)   the Company is merged, consolidated or reorganized into or with
     another corporation or other legal person, and as a result of such merger,
     consolidation or reorganization less than two-thirds of the combined voting
     power of the then-outstanding securities entitled to vote generally in the
     election of  directors ("Voting Stock") of such corporation or person
     immediately after such transaction are held in the aggregate by the holders
     of Voting Stock of the Company immediately prior to such transaction;

          (ii)  the Company sells or otherwise transfers all or substantially
     all of its assets to another corporation or other legal person, and as a
     result of such sale or transfer less than two-thirds of the combined voting
     power of the then-outstanding Voting Stock of such corporation or person
     immediately after such sale or transfer is held in the aggregate by the
     holders of Voting Stock of the Company immediately prior to such sale or
     transfer;

          (iii) there is a report filed on Schedule 13D or Schedule 14D-1 (or
     any successor schedule, form or report), each as promulgated pursuant to
     the Act, disclosing that any person (as the term "person" is used in
     Section 13(d)(3) or Section 14(d)(2) of the Act) has become the beneficial
     owner (as the term "beneficial owner" is defined under Rule 13d-3 or any
     successor rule or regulation promulgated under the Act) of securities
     representing 50% or more of the combined voting power of the then-
     outstanding Voting Stock of the Company;

          (iv)  the Company files a report or proxy statement with the
     Securities and Exchange Commission pursuant to the Act disclosing in
     response to Form 8-K or Schedule 14A (or any successor schedule, form or
     report or item therein) that a change in control of the Company has
     occurred or will occur in the future pursuant to any then-existing contract
     or transaction; or

          (v)   if, during any period of two consecutive years, individuals who
     at the beginning of any such period constitute the directors of the Company
     cease for any reason to constitute at least a majority thereof; provided,
     however, that for purposes of this clause (v) each director who is first
     elected, or first nominated for election by the Company's stockholders, by
     a vote of at least two-thirds of the directors of the Company (or a
     committee thereof) then still in office who were directors of the Company
     at the beginning of any such period will be deemed to have been a director
     of the Company at the beginning of such period.

Notwithstanding the foregoing provisions of clauses (iii) or (iv) above, unless
otherwise determined in a specific case by majority vote of the Board, a "Change
in Control" will not be deemed to have occurred for purposes of clause (iii) or
clause (iv) above solely because (A) the Company, (B) a Subsidiary or (C) any
Company-sponsored employee stock ownership plan or any

                                      -6-
<PAGE>

other employee benefit plan of the Company or any Subsidiary either files or
becomes obligated to file a report or a proxy statement under or in response to
Schedule 13D, Schedule 14D-1, Form 8-K or Schedule 14A (or any successor
schedule, form or report or item therein) under the Act disclosing beneficial
ownership by it of shares of Voting Stock of the Company, whether in excess of
50% or otherwise, or because the Company reports that a change in control of the
Company has occurred or will occur in the future by reason of such beneficial
ownership or any increase or decrease thereof.

     6.  Adjustments.  The Stock Option Committee, the Special Stock Option
         -----------
Committee or the Board may make or provide for such adjustments in the maximum
number of shares specified in Paragraph 3, in the number of shares of Common
Stock covered by outstanding Stock Options granted hereunder, in the Option
Price applicable to any such Stock Options, and/or in the kind of shares covered
thereby (including shares of another issuer), as such committee or the Board, as
applicable, in its sole discretion, exercised in good faith, may determine is
equitably required to prevent dilution or enlargement of the rights of
Participants and Nonemployee Directors that otherwise would result from any
stock dividend, stock split, combination of shares, recapitalization or other
change in the capital structure of the Company, merger, consolidation, spin-off,
reorganization, partial or complete liquidation, issuance of rights or warrants
to purchase securities or any other corporate transaction or event having an
effect similar to any of the foregoing.  In the event the Stock Option Committee
and the Special Stock Option Committee shall disagree (or either or both shall
disagree with the Board) with respect to the foregoing adjustments, the Board's
determination will be final and conclusive.  Any fractional shares resulting
from the foregoing adjustments will be eliminated.

     7.  Withholding of Taxes.  To the extent that the Company is required to
         --------------------
withhold federal, state, local or foreign taxes in connection with any benefit
realized by an optionee under the Plan, or is requested by an optionee to
withhold additional amounts with respect to such taxes, and the amounts
available to the Company for such withholding are insufficient, it will be a
condition to the realization of such benefit that the optionee make arrangements
satisfactory to the Company for payment of the balance of such taxes required or
requested to be withheld.  In addition, if permitted by the Stock Option
Committee, the Special Stock Option Committee or the Board, an optionee may
elect to have any withholding obligation of the Company satisfied with shares of
Common Stock that would otherwise be transferred to the optionee on exercise of
the Stock Option.

     8.  Administration of the Plan.
         --------------------------

         (a) The Plan will be administered by the Stock Option Committee, the
     Special Stock Option Committee and the Board.  For purposes of any action
     taken by the Stock Option Committee, the Special Stock Option Committee or
     the Board, whichever is applicable, a majority of the members will
     constitute a quorum, and the action of the members present at any meeting
     at which a quorum is present, or acts unanimously approved in writing, will
     be the acts of the Stock Option Committee, the Special Stock Option
     Committee or the Board.

                                      -7-
<PAGE>

         (b) The Stock Option Committee, the Special Stock Option Committee and
     the Board have the full authority and discretion to administer the Plan and
     to take any action that is necessary or advisable in connection with the
     administration of the Plan, including without limitation the authority and
     discretion to interpret and construe any provision of the Plan or of any
     agreement, notification or document evidencing the grant of a Stock Option.
     The interpretation and construction by the Stock Option Committee, the
     Special Stock Option Committee or the Board, as applicable, of any such
     provision and any determination by the Stock Option Committee, the Special
     Stock Option Committee or the Board pursuant to any provision of the Plan
     or of any such agreement, notification or document will be final and
     conclusive; provided, that in the event the Stock Option Committee and the
                 --------
     Special Stock Option Committee shall disagree (or either or both shall
     disagree with the Board) with respect to such interpretation, construction
     or determination, the Board's determination will be final and conclusive.
     No member of the Stock Option Committee, the Special Stock Option Committee
     or the Board will be liable for any such action or determination made in
     good faith.

         (c) Notwithstanding any provision of the Plan to the contrary, the
     Special Stock Option Committee will have the exclusive authority and
     discretion to take any action required or permitted to be taken under the
     provisions of Paragraph 6, Paragraph 8(a), Paragraph 8(b), Paragraph 9(a)
     and Paragraph 9(b) with respect to Stock Options granted under the Plan
     that are intended to comply with the requirements of Section 162(m) of the
     Code.

     9.  Amendments, Etc.
         ----------------

         (a) The Stock Option Committee, the Special Stock Option Committee or
     the Board, as applicable, may, without the consent of the optionee, amend
     any agreement evidencing a Stock Option granted under the Plan, or
     otherwise take action, to accelerate the time or times at which the Stock
     Option may be exercised, to extend the expiration date of the Stock Option,
     to waive any other condition or restriction applicable to such Stock Option
     or to the exercise of such Stock Option, to reduce the exercise price of
     such Stock Option, to amend the definition of a change in control of the
     Company (if such a definition is contained in such agreement) to expand the
     events that would result in a change in control of the Company and to add a
     change in control provision to such agreement (if such provision is not
     contained in such agreement) and may amend any such agreement in any other
     respect with the consent of the optionee.

         (b) The Plan may be amended from time to time by the Board or any duly
     authorized committee thereof.  In the event any law, or any rule or
     regulation issued or promulgated by the Internal Revenue Service, the
     Securities and Exchange Commission, the National Association of Securities
     Dealers, Inc., any stock exchange upon which the Common Stock is listed for
     trading, or any other governmental or quasi-governmental agency having
     jurisdiction over the Company, the Common Stock or the Plan, requires the
     Plan to be amended, or in the event Rule 16b-3 is amended or supplemented
     (e.g., by addition of alternative rules) or any of the rules under Section
     ----
     16 of the Act are amended or

                                      -8-
<PAGE>

     supplemented, in either event to permit the Company to remove or lessen any
     restrictions on or with respect to Stock Options, the Stock Option
     Committee, the Special Stock Option Committee and the Board each reserves
     the right to amend the Plan to the extent of any such requirement,
     amendment or supplement, and all Stock Options then outstanding will be
     subject to such amendment.

          (c) The Plan may be terminated at any time by action of the Board.
     The termination of the Plan will not adversely affect the terms of any
     outstanding Stock Option.

          (d) The Plan will not confer upon any Participant or Nonemployee
     Director any right with respect to continuance of employment or other
     service with the Company or any Subsidiary, nor will it interfere in any
     way with any right the Company or any Subsidiary would otherwise have to
     terminate a Participant's employment or other service at any time.


                                    STERLING SOFTWARE, INC.



                                    By /s/ Sterling L. Williams
                                      -------------------------------
                                       Sterling L. Williams
                                       President and Chief Executive Officer

                                      -9-