開發人員應遵循的七項持續整合要領
- Commit code frequently
- 有 code change,CI build 出黎嘅野先有意義
- Don’t commit broken code
- 每次建構失敗就代表著專案的健康狀態出了嚴重的問題,必須要立即花費時間與人力去修復
- 開發人員要對自己送交的程式負起責任,不要因為自己不小心而造成建構失敗
- Fix broken builds immediately
- 零容忍 broken build
- 如果團隊都沒有人把建構失敗當作一回事,久而久之,持續整合就失去它的作用
- Write automated developers tests
- 有 CI 冇 tests
- 持續整合頂多做做編譯的工作,無法藉由執行測試案例找出功能錯誤
- 冇 CI 有 tests
- 測試案例寫了一堆,但是卻擺在一旁很少執行
- 不執行測試案例怎麼會知道系統有沒有問出題
- 有 CI 冇 tests
- All tests and inspections must pass
- 測試或是inspection(可以想成靜態程式碼檢查)沒有通過,但是程式可以編譯,都唔算成功
- Run private builds
- 在送交程式之前,先執行本地建構
- Avoid getting broken code
- 兩個方法
- Pull 之前 check CI
- CI 一炒左,叫大家唔好 pull,直至問題解決為止
- 用 integrate 左 CI 嘅 Github,build fail 根本 merge唔到,唔會出現E個情況
- 兩個方法
亂談軟體設計(6):Single Choice Principle
- Single Choice Principle
- Whenever a software system must support a set of alternatives, one and only one module in the system should know their exhaustive list
- 當一個軟體系統必須要支援一組替代方案的時候,系統中應該只有一個模組知道這些替代方案的所有清單
- 程式中都有一個地方需要去「詳盡列舉(know their exhaustive list)出所有子類別(a set of alternatives)」
- 減少 duplicated code
除舊佈新 (1)
- Architecture is not a phase of development
- 因為軟體開發隨時都在做 architecture design
- 通常 over design 唯一個好處只是營造一種『自我感覺良好』的假象
- 爽到 architect ,艱苦到 programmers
消除浪費 (1):Partially Done Work
- Spec 係「尚未被實做的需求文件」
- 都係 partially done work
- 好多 requirement 會係幾個 sprint 後變得冇效
持續整合樣式:中文補充說明
講 Cross platform software development 嘅 continuous integration pattern 點樣整。
Ever wonder why the most popular apps are starting to look the same? It might be a good thing
- 解釋點解D出名 app 嘅 UI 開始相似,同埋解釋咁做嘅好處
- 新嘅 UI 潮流
- big, bold headlines with rounded sans-serif fonts
- minimal black and white interfaces with lots of negative space
- little to no color.
- 點解新 UI 潮流偏向簡潔
- App fatigue
- get tired of bouncing between too many apps
- get tired of learning how to use a new interface after every new download
- More consistency means better usability
- Consistency means no re-learn
- Branding isn’t just how it looks, but how it works
- A differentiated experience is more important than differentiated UI
- In future, UX design on voice interface (like Siri) is more important than screen interface
- App fatigue
How Dictators Hack Our Feelings
- Fascism
- My nation is superme
- Deny other identities
- Nationalism
- My nation is unique
- Data is replacing land and machine as the most important assets
- Politics is struggle to control the flow of data
- Dictatorship now means too much data is being concentrated in the hands of government
- New technology makes dictatorships more efficient than democracies
- Dictator hack our feelings of feat and hate and vanity
- Use these feelings to polarize and destory democracy from within
What is the coldest thing in the world?
- The coldest thing is colder than outer space
- Use laser to slow down (cold down) atoms
- Cold atoms can be use as detector
Integration database
- An integration database is a database which acts as the data store for multiple applications
- Integration databases should be avoided
- It is a point of coupling between the applications that access it
從合約判斷類別行為是否相容
- Liskov Substitution Principle 同 Design By Contract 嘅 Subcontracting 係同一樣野
- LSP
- 系統中基本型別(base types)出現的地方,都可以用子型別( subtypes)來取代,而不會破壞程式原有的行為
- DBC
- 子類別的 precondition 需要與父類別的 precondition 進行OR運算
- 子類別的 postcondition 需要與父類別的 postcondition 進行AND運算
- 子類別的 invariant 需要與父類別的 invariant 進行AND運算