love fish大鵬一曰同風起,扶搖直上九萬里

          常用鏈接

          統計

          積分與排名

          friends

          link

          最新評論

          XP中的TDD是什么?測試驅動開發?測試驅動設計?

          XP中的TDD是什么?測試驅動開發?測試驅動設計?

          http://c2.com/cgi/wiki?TestDrivenDevelopment
          ?
          ?

          Test-Driven Development

          http://www.xprogramming.com/xpmag/whatisxp.htm#test

          Extreme Programming is obsessed with feedback, and in software development, good feedback requires good testing. Top XP teams practice "test-driven development", working in very short cycles of adding a test, then making it work. Almost effortlessly, teams produce code with nearly 100 percent test coverage, which is a great step forward in most shops. (If your programmers are already doing even more sophisticated testing, more power to you. Keep it up, it can only help!)

          It isn't enough to write tests: you have to run them. Here, too, Extreme Programming is extreme. These "programmer tests", or "unit tests" are all collected together, and every time any programmer releases any code to the repository (and pairs typically release twice a day or more), every single one of the programmer tests must run correctly. One hundred percent, all the time! This means that programmers get immediate feedback on how they're doing. Additionally, these tests provide invaluable support as the software design is improved.

          在上面的圖中,列出的的是XP的12個團隊實踐。Test-Driven Development是其中之一。
          Kent Beck 的著作TDD(Test Driven Development) 中詳細講述了測試驅動開發。
          在XP中測試是一種設計,不是簡單的為了測試你的功能是否實現。測試先行一個目的
          是可以在代碼編寫之前,保證測試已經寫好;其實這些測試的另一個目的就是設計接口,
          保證接口在以后的修改過程中能夠滿足測試(設計)。當你有意或無意修改接口的時候,你必須同時
          修改測試 要改動接口的時候,也應該是先修改測試,再修改代碼。而不是修改代碼等著報錯再修改
          測試(設計) 。(測試必須100%通過才能進行下一個功能),這樣測試也是在提醒你,接口已經改變。
          實際上,設計已經改變。當你修改單元測試的時候,可能就會遭到抱怨。為什么?你修改了設計
          ,別人的代碼是依賴你修改前的測試(設計),那么新的測試(設計)中的變動可能要影響到
          別人已有的代碼。
          ?
          當你使用TDD的時候一定要說明是測試驅動開發還是測試驅動設計。這兩者是有區別的。測試驅動
          開發,是通過測試定義所要開發的功能的接口,然后實現功能的開發過程。對于測試驅動設計,在XP中似乎
          已經消失了,而是被測試驅動開發所取代。另外在XP中有用于描述設計的,SimpleDesign ,Design Improvement.
          在XP中測試是一種設計,設計之后才有開發,這也就是為什么要測試先行了。
          在XP中測試是一種文檔,用于描述設計。

          posted on 2007-01-17 13:40 liaojiyong 閱讀(922) 評論(0)  編輯  收藏 所屬分類: Mixture

          主站蜘蛛池模板: 木兰县| 桃园市| 吉隆县| 通榆县| 司法| 乃东县| 卢氏县| 清水县| 来安县| 兴仁县| 永康市| 商丘市| 澜沧| 武川县| 海伦市| 常熟市| 突泉县| 湖州市| 哈尔滨市| 廉江市| 莱阳市| 砀山县| 林甸县| 张掖市| 桂林市| 西华县| 绥中县| 新和县| 万年县| 辽阳市| 从化市| 鹰潭市| 喀什市| 南丰县| 垫江县| 石家庄市| 定陶县| 彭水| 特克斯县| 阳信县| 应城市|