Coder Social home page Coder Social logo

go_tdd's Introduction

練習設計模式並使用 TDD 進行開發

練習題目

  • 貪吃蛇遊戲

設計模式

封裝:簡單理解-資料隱藏
物件內部資料成員的存取限制
但封裝不只是資料隱藏,可泛指各種隱藏 p.17

1. 策略模式

strategy

2. 觀察者模式

observer

3. 裝飾者模式

decorator

4. 工廠模式

factory

How to TDD

TDD Cycle

  1. Add a test
  2. Run all tests and see if the new one fails
  3. Write some code
  4. Run tests
  5. Refactor code
  6. Repeat

PKG Testing

  • t testing.T
    • t.Run()
    • t.Error()
    • t.Errorf()

go_tdd's People

Contributors

hunick1234 avatar

Watchers

 avatar

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.