Coder Social home page Coder Social logo

rex.skill.tdd's People

Contributors

hatelove avatar rexlucien avatar

Watchers

 avatar  avatar

Forkers

hatelove

rex.skill.tdd's Issues

homework2 調整事項

  1. 需求的 scenario 之間可能是獨立的。這一點會影響到所謂的 discount 不會出現奇怪的 1.05 - discount * 0.5。
  2. TDD的紅燈、綠燈、重構,那個紅燈指的不是預設的 Assert.Fail(), 而是指:我要新增一個新的 scenario 囉。當調整完 production code 變成綠燈時,代表的是:我已經完成這個 scenario 囉。接著在所有測試案例都是綠燈的情況下,重構 production code。

這個作業不需要重做,但可以想一下,如果所謂的折扣是獨立的,而不是多一本書固定折 5%, 你的程式碼該怎麼設計比較好讀跟好維護。

homework1 completed

修改完的 test case 比之前好很多了,但就 API 跟 production code 的設計面來說,還有更進一步的改善空間。

請記得一定要看一下我之後公布的 solution 參考答案,相信可以讓你體會到在設計面上更多彈性的設計方式。

就 homework 來說,這樣的 test case 已經足以表達需求了,其他的是設計面的問題。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.