【從學員練習影片觀察到一個關於 TDD 的有趣現象】
極速開發的課後練習作業,雖說重點是放在極速開發要學習的技巧與刻意練習的模型,但開發的方式、順序也是刻意安排成類似 TDD 的進行方式,來讓生產力最大化(TDD 本來就是幫助開發的,不是幫助測試的)
我從2位第一次上我課的學員(當然就是 #極速開發,代表他們沒上過#單元測試 跟 #TDD與持續重構),雖然他們是照著示範影片、上課教學用 TDD 在寫整個 tennis 的過程,但從他們執行測試的時間點就可以發現:
「他是用測試來驗證 production code 的正確性」,即使他先寫了測試,也不先執行,沒有看到紅燈,每次都等到 production code 寫完了,應該要綠燈時,才執行測試。
而其他上過 TDD 課的同學 ,或是上過單元測試的同學,知道測試是用來描述情境,如果現在「加入的這個情境是新的需求或需求異動,代表目前 production code 還不支援這個情境,執行測試跑出的紅燈,就是等等 production code 要完成的 #目標」
test-frist 從來都只是 TDD 其中一個小小的衍生產物,而不是全貌。TDD, 測試驅動開發 從來都是一種開發方法,而不是測試方法。
總有些人老愛把 TDD 拿來跟測試相提並論,就總是喜歡把 test-first 當作靶子打,覺得違反人性跟直覺,覺得先寫測試在很多情況下是浪費時間或是不 work,可能拿來跟一堆測試的方法論相提並論,或總是只拿回歸測試的效益來當作 TDD 的整體。抑或是陷入 isolation unit test 與 integration test (其實就是非 isolation 等級、有實際依賴的自動測試)之爭。
```
註:TDD 事實上是可以不是單元測試等級的。
```
要比較正確看待 TDD 的角度,首先要知道它是幫助開發的、它是一種開發方式(當然不是唯一一種,甚至也不會是最好的一種,因為根本沒有最好,只有剛好)
接著要了解 TDD 可能用 IPO 模型還比較貼切,input-process-output,在你開發任何功能之前,你總要先想過這件事。而先想這件事,才是 TDD 的最基本精神。
接著是怎麼把你想好的東西,變成可執行的 spec,我們只是用測試程式來「描述」你腦袋中的「IPO模型」,把 process 的過程當作一個黑箱子。
而這個 IPO 模型在結合成「使用情境」,就會帶來「高易用性 API 的好處」,只有在一開始就先想好怎麼給別人用,最後才會好用。所謂的一開始想好,指的不是預先設計一堆 class,而是 input/output 想清楚期待(一般會結合實例化需求,搭配 Given/When/Then 的 gherkin style 來把前置條件、資料、前提想好,當發生什麼事,應該是怎樣的結果),然後描述它。在紅燈定義清楚目標,綠燈完成 input/output 關係且沒弄壞前面的所有情境後,來針對 process 進行重構(事實上 Kent Beck 的 TDD by Example 更多是用 refactor 來 #完成 process。
```
註:所謂的 output 不一定只有回傳值,包含外部依賴狀態、資料的改變,甚至顆粒度小一點,針對物件導向設計的話,物件內部狀態的改變也算,只是物件內部狀態改變,驗證點要嘛是拿得到內部狀態,要嘛就是要驗證物件哪個行為會因這個內部狀態而有所不同。
```
## 戰 TDD 之前該先做好的功課
要戰 TDD,是不是至少要把 Kent Beck 的 TDD by Example 看完?
要戰 TDD,請不要拿它跟測試方法論來比,那只是一下就被人看破手腳。因為它是個開發方法論。
要戰 TDD,請不要把它的好處只限縮在跟回歸測試、自動測試的比較,因為那只是它的衍生好處,當你試過在白海報紙上 TDD 就懂,TDD 是在釐清你的思緒的同時,又可以以終為始,確保你在 production code 的每一個動作都是為了滿足某個期待的情境。
要戰 TDD,請不要去把 單元測試、整合測試捲進來,那是測試的顆粒度,那是測試的分類,TDD 從來都不是只能限於單元測試。
要戰 TDD,請不要在那邊戰他是 bottom-up ,是直接從程式/class 的角度出發,事實上 TDD 既不是 bottom-up, 也不是 top-down, (書裡面就有講這件事咩),實務上的 TDD 結合倫敦派(GOOS)跟芝加哥派(Classic TDD),會更像 Outside-In 的進行方式,先定義好驗收情境,接著從最外部(也就是使用者看得到的部份)一路把依賴往另一邊的系統邊界推,直到推到系統以外的依賴資源(persistence 或 external API/service)
```
註: ATDD by Example 中 ATDD by Example, Kent Beck 寫的序最後的一段話。
Kent Beck:
「就像我曾說過的,TDD的一個缺點是,它可能會退化為一種用來滿足開發人員需求的編程技能。某些開發人員從更廣泛的角度來看待TDD,輕易在他們測試的不同抽象級別間跳躍。然而在ATDD中不存在歧義,這是一種加強與非編程人員溝通的技術。我們之間良好的協作關係,以及作為這種關係基礎的溝通,能夠使軟件開發更有效率。採用ATDD是向著溝通更清晰這個目標邁進的重要一步,而此書是一本全面又平易近人的入門讀物。」
```
要戰 TDD,請不要只關注在 test-frist,因為他只是用 test 來幫助你 think-first,不要邊寫邊想。然後不要過份依賴或相信你腦袋的能力,把你想好的東西具體化出來,最好可以被直接執行,最好除了你以外每個人執行出來的結果都會一樣(不管是對的,還是錯的)
要戰 TDD, 請不要把論點放在見樹不見林,如果你有看 TDD by Example 的 Part 1, Part 2 那兩個加起來共 24 個章節,就知道一開始就得把當下想到的全貌紀錄在一個「紙本」的 backlog (所謂的紙本,只是要講這並不依賴於任何工具)
而這個需求輪廓的全貌,會隨著你逐漸完成一部分一部分的情境,設計逐漸浮現後,而隨時跟著增減調整。
但不代表 TDD 就是先想到一個測試案例,就直接先幹下去了,那根本是亂搞。
以上這些,都還不是在列 TDD 的好處,而是針對那些從來沒搞懂 TDD 但又愛戰 TDD 的人一點提醒,你戰的很可能是「你誤解的 TDD」。
TDD 還有許多實務上的用途,列上我在譯者序中的一小段:
>> 測試驅動開發(Test-Driven Development, TDD)!一種以測試為開發輔助、以測試來描述需求情境、以測試來當作目標、以測試來表達期望、以測試來驗證疑問、以測試來實驗學習、以測試來溝通協作、以測試來協助設計高易用性 API 的「開發方法」。
譯者序有開放給大家看,請見:https://tdd.best/book/tdd-by-example/
拜託,要戰之前去看一下祖師爺 Kent Beck 對 TDD 的原始見解:https://www.tenlong.com.tw/products/9789864345618?list_name=srh
如果你想正確的使用 TDD 來幫助你在實務上產生許多的價值,帶來許多的好處,尤其是需求釐清、持續重構、小步快跑的部份,最好理解的培訓課就在這:https://tdd.best/courses/classic-tdd-by-example-video-training/
最後我想講一段話:
TDD 從來都不該被導入到團隊中,但它是一種很好的自我鍛鍊與學習的方式,也是一種能用很低的成本來帶來很多好處的開發方法(見下方註腳),然而它也不是適用所有的情況,但它可以讓『完美』變成一個動詞,而非不變的形容詞。
```
註:
Kent Beck 在 DHH 靠腰:《TDD is Dead》 之後寫的一篇反串文:《RIP TDD》
https://www.facebook.com/notes/1063422864115918/
我幾年前的簡易翻譯,通常也是 TDD 可以幫助你解決的問題,如下:
- Over-engineering (過度設計)
- API feedback (改善API的設計與可用性)
- Logic errors (想的跟寫的不一樣,寫的跟需求不一樣)
- Documentation (寫跟維護文件是痛苦的)
- Feeling overwhelmed (找不到切入點)
- Separate interface from implementation thinking (抽象設計)
- Agreement (確保已修正問題的證據)
- Anxiety (改東壞西的擔心受怕)
```
很久沒對 TDD 發表這種長篇大論了,因為不理解、不想理解、不同角度理解的人居多,能真的到各自的塔上用不同角度來看原義,以及實務上用它來幫助解決的問題有哪些的人,真的太少。
大部分人只想針對這個詞彙來攻訐以博得流量跟吸引目光,而不是想著「我可以用它來幫助我什麼」
問題跟需求是中性的,解決問題跟滿足需求的手段與方式有千萬種,不會只有一種,也不會有所謂的對錯,多點角度去了解不同的方法、方式,然後融會貫通,發揮綜效,在實務上用最少的成本與風險來產生最大的價值,這才是真正的目標。
導入敏捷不該是目標,導入 TDD 也不該是目標,目標永遠都是在實務上產生價值、解決問題、滿足需求。
同時也有8部Youtube影片,追蹤數超過3萬的網紅Eric's English Lounge,也在其Youtube影片中提到,同學期待的政治英文影片第一集總算出爐了! 在此先聲明,我跟Howard老師純粹是分析英文,兩位總統都是神人級的第二語言使用者! 此影片的目的不在於比較兩者的英文能力,而是提供學習者英文口語的實際操作和可以注意的小細節。 以下是影片中提到的一些資訊,請看完再發表評論: 馬英九(1950年7月13日...
「feedback example」的推薦目錄:
feedback example 在 91 敏捷開發之路 Facebook 的最佳貼文
趁著疫情在家期間,我已經將【Classic TDD by Example: Refactoring to Design】的 C# 版本培訓內容準備完成,經過約一週的 A/B testing 與內容調整(感謝前100位下單的朋友,幫忙做測試、給建議、提意見),目前已經調整到進入穩定的產能,以及較好的品質與體驗。
目前優先開放給之前有填寫 google form 表單的朋友,開始進行報名。(若您當時有填寫 google form 且語言選擇是 C# 的,應該會收到我今天寄出的主動通知信,若有興趣,可儘快報名卡位出貨順序)
#Google表單預購 優惠價為 NT$ 34,000,原價為 NT$ 36,000,預計為期一週,7/24 正式對外販售,將以原價以及相關票種折扣售票(介於 NT$ 34,000~36,000 之間)
若您不是使用 C#,但看得懂 C#,或是寫 Java 的同學,想要優先入手 C# 的版本也是可以的,屆時推出 Java 或其他語言版本時,我將提供超值的加購優惠價格給你。這主題內容,越早學會,越早能用在實務上,越早能得到它帶來的好處。
接下來預計推出的語言順序為:Java > Python > JavaScript > PHP ....
給自己的目標是期望在年底之前可以推出 Java 版本,但會不會突然被其他計畫打亂,就不敢肯定了,畢竟如果疫情趨緩,我還有這兩個月的企業客戶 coaching 檔期要還。
另外,也開放其他語言的朋友提前報名,(我不會請你提前繳費,提前報名也不影響屆時的票價,純粹是在你知道相關資訊與票價之後,你仍感興趣想報名,到時封測、A/B testing 我會主動邀請你,是否要先以更優惠的價格來參與封測,提供建議與 feedback)
出貨清單與狀態更新,請見:https://hackmd.io/@SYvyb1O4SLq8W6nvAQW5mw/ByVVUt86O
之前填寫 google 表單時的培訓介紹,以及授權條款內容,請見:https://tdd.best/courses/classic-tdd-by-example-video-training/
feedback example 在 91 敏捷開發之路 Facebook 的最佳解答
針對 2021 年預計推出的影片培訓內容,我把表單、相關脈絡、大家表單上關於上課形式、影片授權、定價、主題差異等等 Q & A 都整理到這篇文章中了。
這裡去:https://tdd.best/courses/classic-tdd-by-example-video-training/
這門課的內容,少說會讓學員想要重複練習三次,不管你是不是已經看過影片,每一次整套開發方式 run 下來至少都是半天以上起跳,這也是為什麼這很適合做成影片,不適合實體課的時間限制與學員能力落差。
當然,我這麼重視引導、pair 跟從彼此 feedback 中學習到東西的人,一定會再弄點其他活動,來讓大家可以在線上或實體,獲得更多的 AHA。
註:對我還不夠熟悉的朋友,建議看一下文章中的「我對購買人的建議」,或許可以提早讓你打消念頭。 :)
feedback example 在 Eric's English Lounge Youtube 的精選貼文
同學期待的政治英文影片第一集總算出爐了! 在此先聲明,我跟Howard老師純粹是分析英文,兩位總統都是神人級的第二語言使用者! 此影片的目的不在於比較兩者的英文能力,而是提供學習者英文口語的實際操作和可以注意的小細節。 以下是影片中提到的一些資訊,請看完再發表評論:
馬英九(1950年7月13日-),中華民國政治人物,曾任中華民國第12、13任總統、國民黨主席等職。畢業於國立台灣大學法律學系,其後前往美國深造,獲紐約大學法學碩士學位,哈佛大學司法學博士學位。曾經擔任蔣經國總統的英文翻譯。
影片: https://youtu.be/lRACKQkgFqc?t=32
Former President of Taiwan Ma Ying-jeou, in conversation with Jerome A. Cohen, discusses student exchanges between Germany and France.
●沒有看稿子
●非常有經驗的講者
●發音大致上標準 (Prussia 普魯士, herald, tribune, presidency)
●good use of stress (enhancements)
●流暢度有練過特別停頓來思考
●提連貫性跟內容組織的部分
●會以故事的方式去切入重點
用的評分系統: https://www.ielts.org/-/media/pdfs/sp...
●wide range and skillful use of vocabulary: are aware of, feel uneasy, visionary leaders, engage in a massive student exchange, worked miracles, became cornerstones
●mistakes: skip school, quit school, tense--become cornerstone
●short, concise sentences suited for clear public speaking
●lexically dense sentences
★★★★★★★★★★★★
蔡英文(1956年8月31日-)是中華民國(臺灣)的政治人物、法律學者、律師,為現任中華民國總統,原擔任民主進步黨主席。她先後獲得國立臺灣大學法律學系法學士、康奈爾法學院法學碩士、及倫敦政治經濟學院法學博士,曾任教於國立政治大學法學院和東吳大學法學院。
影片: https://youtu.be/5ygpAnK02uk?t=55
President Tsai Ing-wen in Harvard giving advice to students on policy challenges, choices, and leadership in the next decade
●沒有看稿子
●英式發音* (taught, good), 非常清楚
*其實很多英國人不喜歡英式口音這個標籤,英國人覺得他們自己講的才是真正標準的英文,是美國人才有口音
而且現在的英國(聯合王國)也是四個國家組成的,每個區域的發音都有一些區別。
用的評分系統: https://www.ielts.org/-/media/pdfs/sp...
●用詞豐富: rebellious, challenge your teachers and contemporaries, make yourself suited for changes, sharing values, expediting
●流暢度, 有些停頓, 但是思考內容的停頓絕對是自然的!
●文法沒有任何的錯誤 (a rebellious one, meaning...分詞構句, everything that is taught 形容詞子句, what is true today...名詞子句)
★★★★★★★★★★★★
對我而言,英文是一種工具,不覺得每一個政治人物都需要英文,有專業和可靠的翻譯輔助,就足夠了。
媒體報導: https://wp.me/p44l9b-1G4
在此提供我的「心智圖詞彙攻略」課程: https://bit.ly/2teELDq
也獻上Howard老師會走路的翻譯機,《會走路的翻譯機,神級英文學習攻略本》 http://bit.ly/2DfGrhH
最後要感謝炙瞳夢 RED FILM幾位大導演的友情協助,幫我們拍出一級棒的影片!
★★★★★★★★★★★★
NOTE: Thank you for the comments, everyone, both the positive and negative ones. We'll continue to do our best to produce entertaining yet educational videos.
There is a lot of information that we could not fit in a 10 min video, and some parts could be more clearly presented. For example, pauses are entirely natural when one searches for content. This point was stated in the video but went unnoticed by many commenters. Some have also expressed concerns about the clips selected. We selected them based on the following criteria: be related to education, have "spontaneous" interaction, and be in the public domain. Not many clips on the net meet these criteria, and the two above were the only ones we had access to. Last, some comments (from both sides) have accused us of bias. We tried to be as impartial as possible, and if you require more information on our thoughts, please refer to our notes in the video description. As previously stated, both candidates are advanced second language users, and it is not our aim to compare or criticize them. Again, thank you all for your feedback. We will strive to do better in the future.
feedback example 在 Anthony Carrino Youtube 的最佳解答
We are starting to release our podcast here on YouTube, and have plans to start shooting video of our interviews when we are in the same place as our guests...would love your feedback, and any questions in the comments below.
Show Notes:
This is our Project Planning Series, which we initially launched as the first 7 episodes of this podcast. We are publishing them again to make sure all our new listeners get the benefit of the series, and as a refresher for those who have already heard them. There is a ton of information here, so please let us know if you have any questions. And if you know someone who has an upcoming renovation, or who would benefit from this series, PLEASE SHARE IT!
We will be back with all new episodes after this series!
Digital Notebook Resources
http://www.houzz.com
http://www.pinterest.com
Anthony's Example Notebooks from Houzz and Pinterest
http://www.houzz.com/ideabooks/53930018/thumbs/wilson-kitchen
http://www.pinterest.com/carrinoanthony/100-monitor
Document Templates & Example Docs
http://www.homewiththecousins.com/s/HomeWithTheCousins-Working-Files.zip
#HOMEwTheCousins
Follow Us
http://www.instagram.com/CarrinoAnthony
http://www.facebook.com/CarrinoAnthony
http://www.twitter.com/CarrinoAnthony
http://www.instagram.com/ColaneriJohn
http://www.facebook.com/johncolaneritv
http://www.twitter.com/ColaneriJohn
Our Podcasting Kit: https://kit.com/CarrinoAnthony/podcast-kit
feedback example 在 Rayner Teo Youtube 的最佳解答
I want to share with you a trade that I got WRONG big-time from the start. SUBSCRIBE: https://bit.ly/2MsGjRR
If you want more actionable Forex trading tips and strategies, go to https://www.tradingwithrayner.com
FOLLOW RAYNER:
Facebook: https://www.facebook.com/groups/forextradingwithrayner
Twitter: http://www.twitter.com/rayner_teo
My YouTube channel: http://bit.ly/2EFg5VN
This is a trade on Pound Aussie, the daily time frame, and I just want to share with you my thought process to why I took this trade. So you can see that the price pretty much came into this area of resistance over here. Over here price came into this level and it got rejected, right? Cause you saw you saw this bearish reversal pattern at a nice round number of one point eight. And this obvious market structure resistance. So when this occurred, I told myself that I wanna get short because I'm against this obvious market structure. So I'm going down to a lower time frame, the four hour time frame, to look for an entry trigger.
One ATR is somewhere about here and I went short. And as you can see at this point in time - boom. I just got stopped out. The market just rallied against me and I took the loss on this trade. Now at this point, I wanna say that I don't regret making this trade. Yes I am wrong on this trade. The market has proved me wrong big time. But I have my stops in place to kinda contain the losses. But what happens is that, what if you hesitate to take the loss? What if you are thinking, lets say for example at this point in time, the price is now back at resistance.
You can see that trading is all about balancing your risk to reward. You never know how much the market will move in your favor. You never know how much the market will move against you. All you can do is to have a set of rule to play good defense and to take what the market offers you. So the three trades I shared with you, although the first two are losing trades, it hit my stop loss, I'm just protecting myself.
So I kinda leave it to you, depending on your trading goals, how you want to manage this trade. Right this is platinum. Another trade that I want to share with you is the Pound against the Swiss Franc. This one over here you can see that this market is in a down trend. In fact, there is this minor structure over here that I didn't draw it, but you can see it over here. That's that once, here, okay, and then here second time, and then third time over here. But what's interesting is that if you look at the four hour timeframe, there is a chart pattern that is showing you signs of weakness in the market.
This is a chart pattern, is what we call the descending triangle. Notice that there is lower highs coming into this area of support. This tells you that the buyers try to push price higher, but keep getting smashed down lower by the sellers at lower and lower prices. So now the buyers are kinda constrained, they are pushed into a corner. And if you ask me, there's a good chance, there's a good chance that this market could break down lower. So what I'm looking for is for a break and close below this area of support. If it does, again I'll go short, have my stops one ATR above this high, somewhere here, and try to ride the downward swing. And see, and to take what the market offers. If it's not going to offer anything I just bail out and say "Sayonara. Thank you and I'm out. See ya."
So that's what I'm doing on this Pound Swiss Franc trade. That's the setup that I'm looking at, okay? So these are the couple of trading opportunities that I feel that is worth watching for this coming week. And hopefully the first three trades that I share with you are good lessons to kinda ground you into what you should expect from trading. So with that said I have come to the end of this week's market analysis. If you have enjoyed it please hit the subscribe button below. Just click on it, duh duh duh click. Hit the like button. If you have any feedback, comments, questions, leave it in the comment section below and I'll get back to you. Alright so that's it. I wish you good luck and good trading until next time.
feedback example 在 20 Constructive Feedback Examples for Performance Reviews 的相關結果
12. “You did a fantastic job collaborating with your team last week, but I worry that you may have derailed Howie by seeking his help with X. I've seen you work ... ... <看更多>
feedback example 在 Top 10 Positive Feedback Examples for Employee Performance 的相關結果
Positive feedback you can give: "I'm really happy with your determination to finish this project. I know it wasn't easy, but I knew you could do ... ... <看更多>
feedback example 在 20 Positive Feedback Examples For Work [It Really Matters] 的相關結果
A: Some examples of positive feedback include saying this when an employee has reached a goal: I know this goal wasn't easy. That you managed to ... ... <看更多>