Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > .NET > VB.NET > Requirements Analysis with 'pseud-Formal' Method
【标  题】:Requirements Analysis with 'pseud-Formal' Method
【关键字】:Requirements,Analysis,with,pseud-Formal,Method
【来  源】:http://Threading.cnblogs.com/archive/2006/01/23/321867.html

Requirements Analysis with 'pseud-Formal' Method

Your Ad Here 鍗氬鍥?- Thinking and Coding - Requirements Analysis with 'pseud-Formal' Method

Thinking and Coding

Lester Yu 鐨勬濊冪┖闂?/p>

Requirements Analysis with 'pseud-Formal' Method

闇姹傚紑鍙戝湪杞欢寮鍙戞祦绋嬩腑鐨勫湴浣嶄笌鏃ヤ勘澧烇紝鏈枃鐨勭紪鍐欑洰鐨勫湪浜庝粙缁嶄竴绉嶇敤浜庨渶姹傚紑鍙戠殑瀛愯繃绋嬧斺旈渶姹傚垎鏋愮殑“浼舰寮忓寲”鏂规硶銆?BR>鏈枃鍐呭鍦ㄩ渶姹傚紑鍙戜腑鎵澶勭殑浣嶇疆锛?BR>闇姹傚紑鍙?BR>鈥斺旈渶姹傝幏鍙?BR>鈥斺?/FONT>闇姹傚垎鏋?/EM>
鈥斺旈渶姹傞獙璇?BR>
闇姹傚垎鏋愰樁娈典腑锛屽線寰闇瑕佺‘瀹氱郴缁熻竟鐣屻佹帴鍙fā鍨嬨佷俊鎭祦绛夊唴瀹癸紝闇瑕佸紑鍙戠郴缁熷師鍨?( Prototype ) 锛岄渶瑕佸缓绔嬩竴涓讳綋妯″瀷銆傚湪鐩墠骞挎硾搴旂敤鐨勬柟娉曚腑锛岃繖浜涘唴瀹瑰線寰閲囩敤浜嗚嚜鐒惰瑷鎻忚堪鍜屼竴浜涘浘鏉ヨ〃绀猴紝濡?Data Flow Diagram, Context Diagram 绛夈傝繖鏍风殑鏂规硶鏈変竴瀹氱殑妯$硦鎬э紝骞朵笖鍏跺悗鐨?Design 鍙兘涓?Requirements 鍙戠敓涓嶄竴鑷淬備笅闈袱寮犲浘缁欏嚭浜嗕娇鐢?#8220;浼舰寮忓寲”鏂规硶鐨勫伐浣滄祦绋嬩互鍙婃ā鍨嬬粍鎴愩?BR>




鍦?#8220;浼舰寮忓寲”鐨勬柟娉曚腑锛屼竴涓畬鏁寸殑闇姹傚垎涓轰袱澶у潡锛屽叾涓鏄?Initial Requirements 锛屽叾浜屾槸 Functional Spec銆傚湪 Initial Requirements 涓殑鍩烘湰浠诲姟鏄細灏嗗鎴烽渶瑕佸強绾︽潫鏂囨。鍖栵紝浣跨敤 Informal Goal Hierarchy 琛ㄨ揪瀹㈡埛鐨勯渶瑕侊紝浣跨敤闈炲舰寮忓寲鐨勮鍙ユ弿杩扮害鏉燂紙鍖呭惈璧勬簮锛屾ц兘锛岀幆澧冪瓑绛夛級锛屽鐩稿叧绯荤粺灞炴ц繘琛屽缓妯★紝閫氳繃 Formal Environment Model 鏍囧噯鍖栭渶姹傜瓑绛夈傝?Functional Spec 鍒欐彁渚涗竴涓簿纭殑鐩爣绯荤粺琛屼负鐨勯粦绠辨ā鍨嬨侷nitial Requirements 涓?Functional Spec 鐨勫尯鍒涓嬶細
Initial Requirements 鏄拡瀵归」鐩彂璧风粍缁囩殑浜х墿锛屽畠浣跨敤瀹㈡埛鍩熺殑璇嶆眹鎻忚堪瀹㈡埛闇瑕侊紝瀹冭褰撲綔 RFP (Request for Proposal) 浣跨敤銆?BR>Functional Spec 鏄拡瀵归」鐩紑鍙戠粍缁囩殑浜х墿锛屽畠浣跨敤闂鍩?(Problem Domain) 涓庤蒋浠跺煙 (Software Domain) 鐨勮瘝姹囨弿杩板鎴风殑闂锛堝寘鍚竴浜涚洰鏍囧強绾︽潫锛夛紝瀹冭褰撲綔 RFP 鐨勫洖搴斻?BR>
杩欓噷鏈夊繀瑕侀槓鏄庡嚑涓蹇点?BR>绗竴涓蹇垫槸 Logic 鍙婂叾琛ㄨ揪銆傝繖閲岀殑 Logic 琛ㄨ揪鐗垫秹鍒颁簡涓绉嶉昏緫绗﹀彿銆備箣鎵浠ヤ娇鐢ㄩ昏緫绗﹀彿鑰岄潪鑷劧璇█锛屽氨鍦ㄤ簬閫昏緫绗﹀彿鍙互鏇村姞绮剧‘鐨勮〃杈鹃渶姹傦紝甯︽潵鏇村姞灏戠殑閫昏緫閿欒锛屽苟涓旀彁渚涗簡涓绉嶆瘮缂栫▼璇█鏇村姞鍘熷鐨勮〃杈炬柟寮忋備妇涓涓緥瀛愶細鍦ㄤ竴涓數姊帶鍒剁郴缁熶腑锛屽鎴疯姹傦細

"The doors must not be open on a given floor unless the elevator is stopped at that floor." 

杩欏彞璇濆線寰灏辨槸浣滀负瑙勮寖鍐欏叆鎴戜滑鐨勬枃妗d腑鐨勩傝屽鏋滈噰鐢?Logic 鐨勫舰寮忥紝閭d箞灏卞彲鑳芥槸绫讳技浜庝互涓嬬殑鏍峰瓙锛?/P>

e: an elevator, f: a floor.
Position(e
, f) means e is at the f floor
Stopped(e) means e is stopped
Door_Open(e
, f) means e’s door is open on 
the floor f   
ALL(e: elevator
, f: floor:: (Door_Open(e, f) =>
(Position(e
, f) & Stopped(e)) ))

杩欑鎻忚堪寰堢被浼间簬绂绘暎鏁板涓殑閫昏緫琛ㄨ揪锛屾瘮璧峰墠涓绉嶅悇浜烘湁鍚勪汉鐞嗚В鐨勮嚜鐒惰瑷鎻忚堪鏉ワ紝杩欐槸鏋佷负绮剧‘鐨勶紝娌℃湁浜屼箟鎬у彲瑷鐨勩備互涓嬫槸涓夌琛ㄨ揪鐨勪緥瀛愶紝鍒嗗埆鏄嚜鐒惰瑷锛岄昏緫琛ㄨ揪浠ュ強鎴戜滑杩欓噷鎵鐢ㄥ埌鐨勮〃杈炬柟寮忋?BR>

绗簩涓蹇垫槸 Environment Model銆傞【鍚嶆濅箟锛岃繖涓?Model 瀹氫箟鐨勬槸鐩爣绯荤粺涓庡弬涓庤呭拰绯荤粺鐜涔嬮棿鐨勫叧绯伙紝鍏舵渶缁堜篃鍙氳繃 Context Diagram 鍙嶆槧鍑烘潵銆備互涓嬫槸涓涓緥瀛愶細
涓涓埅绌哄敭绁ㄧ郴缁熺殑 Initial Environment Model

  DEFINITION airline_environment

  INHERIT system  --  defines software_system, proposed.

--  controls

INHERIT user  --  defines User_class, uses

INHERIT business  --  defines vendor, customer, sells

IMPORT Subtype FROM type

 

CONCEPT airline_reservation_system: software_system

  WHERE proposed (airline_reservation_system),

        --We are going to build an airline reservation

-- system

     Controls (airline_reservation_system, reservation)

       --The system will help travel agents sell tickets by

       --managing reservations.

CONCEPT travel_agent: User_class

  WHERE ALL(ta: travel_agent

::uses(ta, airline_reservation_system)),

        --Travel agents use the airline reservation system.

        --We are only concerned with the travel agents using

        --our system.

Subtype(travel_agent, vendor),

--A travel agent is a sales person.

ALL(t : ticket :: SOME (ta: travel_agent

:: sells(ta, t) )),

    ALL(r: reservation :: SOME (ta: travel_agent

      :: supplies(ta, t) ))

--Travel agents are the only sources for tickets

--and reservations.

 

CONCEPT ticket: type

   WHERE Subtype(ticket, product),

      ALL (t: trip :: Needed_for(ticket, t))

--A ticket is needed for every trip.

 

CONCEPT trip : type

   WHERE Subtype (trip, activity),

      ALL(t: trip :: Needed_for (flight, t))

--A flight is needed for every trip.

 

CONCEPT passenger : type

WHERE Subtype (passenger ,custom),

      ALL (p: passenger :: SOME(t: trip :: wants(p, t))),

ALL (p: passenger :: SOME(t: ticket :: buys(p, t)))

 

CONCEPT airline : type

WHERE Subtype(airline, supplier),

      ALL(f: flight :: SOME(a: airline :: supplies(a, f)))

        --Every flight is associated with an airline.

        --We are only concerned with commercial flights.

 

CONCEPT flight :type

WHERE Subtype(flight, activity)

     

CONCEPT reservation : type

WHERE ALL (t: trip :: SOME(r: reservation

 :: Neded_for (r, t)))

END

缁忚繃绮惧寲 (Refine) 涔嬪悗鐨勪竴涓?Environment Model

DEFINITION flight_view
INHERIT time
INHERIT location
IMPORT Subtype FROM type
IMPORT One_to_one FROM function (flight
, flight_id)

CONCEPT flight: type
    - -The passenger will choose a flight based on origin
,
    - -destination
, departure, arrival, and price.
WHERE Subtype (flight
, activity)

  CONCEPT origin (f: flight) VALUE (a: airport)
CONCEPT destination (f: flight) VALUE (a: airport)
CONCEPT departure (f: flight) VALUE (t: time_of_day)
CONCEPT arrival (f: flight) VALUE (t: time_of_day)
CONCEPT price (f: flight) VALUE (m: money)
CONCEPT id (f: flight) VALUE (i: flight_id)
   - - The flight id is used by the passenger to find
   - - the flight.
   WHERE One_to_one (id)   - - The id uniquely identifies
                           - - a flight.

CONCEPT airport: type
   WHERE Subtype (airport
, location)

CONCEPT flight_id: type

CONCEPT airline: type 
   WHERE Subtype (airline
, supplier),
      ALL (f: flight :: SOME (a: airline :: supplies (a
, f) ) )
        - - Every flight is associated with an airline.
        - -We are only concerned with commercial flights.
END

绗笁涓蹇垫槸 Functional Spec 涓殑 FUNCTION銆丮ACHINE銆乀YPE銆傝繖浜涗笢瑗跨敤浜庡畾涔夌郴缁熶腑鐨勫悇涓ā鍧椼侳UNCTION 琛ㄧず鍙橀噺鍩熶笌鍊煎煙瀛樺湪鐨勬槧灏勫叧绯伙紱MACHINE 琛ㄧず涓涓姸鎬佹満锛汿YPE 琛ㄧず涓绉嶅彲鏈夊涓疄渚嬬殑绫诲瀷銆傚畠浠殑瀹氫箟璇硶濡備笅锛?/P>

FUNCTION function_name
--inherit 
, import , export section
--message definitions
--concept definitions
END

MACHINE machine_name
--inherit 
, import , export section
--state model definition
--message definitions
--concept definitions
END

TYPE type_name
--inherit 
, import , export section
--instance model definition
--message definitions
--concept definitions
END
浠ヤ笅鏄竴涓?FUNCTION 鐨勪緥瀛愶細
FUNCTION square_root {precision:real SUCH THAT precision > 0.0}
    MESSAGE(x:real) - - anonymous message
        WHEN x >
= 0.0 - -  precondition
            REPLY(y:real) - - return value
            WHERE Y >
= 0.0 AND                         approximate(y*y,x)
            OTHERWISE REPLY EXCEPTION
                imaginary_square_root
CONCEPT approximate(r1
,r2:real)
    - - true if r1 is a sufficiently accurate approximation of r2
, based on the value of the precision specified by the user
    VALUE(b: boolean )
        WHERE
            b飪砤bs(r1-r2)<
=abs(r2*precision)
END
鍙互鐪嬪埌锛岄氳繃杩欑鏂瑰紡绮剧‘瀹氫箟浜嗕竴涓姛鑳芥ā鍧楃殑“榛戠”琛屼负銆?BR>
绗洓涓蹇?Stimulus-Response Diagram銆傝繖涓?Diagram 鐢ㄤ簬鏄剧ず浠ヤ笂涓夌 Spec Language 鐨勮緭鍏ャ佽緭鍑烘祦銆傚浜庝笂闈㈢殑瀹炰緥 FUNCTION 锛屾湁涓嬮潰鐨勫浘锛?BR>
闄愪簬绡囧箙浠ュ強涓汉鐨勭悊瑙o紝鐩墠灏卞啓杩欎簺銆傜粰鍑轰竴涓?Case Study 锛屼緵鏈夊叴瓒g殑鏈嬪弸瀛︿範銆?

posted on 2006-01-23 01:48 Lester Yu 闃呰(1) 璇勮(0)  缂栬緫 鏀惰棌 鏀惰棌鑷?65Key 鎵灞炲垎绫? 瀛︿範绗旇

【相关评论】
没有相关评论
【发表评论】
姓名:
邮件:
随机码*
评论*
      
|  首 页  |  版权声明  |  联系我们   |  网站地图  |
CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.