【從學員練習影片觀察到一個關於 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 也不該是目標,目標永遠都是在實務上產生價值、解決問題、滿足需求。
同時也有66部Youtube影片,追蹤數超過7,950的網紅陰森IneS,也在其Youtube影片中提到,*CC字幕* 嗨又見面了 :D 很高興可以跟大家分享上網課的小撇步讓你在家也歐趴 可以在下面留言你的想法 我都會看! :3 ------ Timestamps: 0:00 Intro 0:31 Organizing digital space 1:25 File naming strategy 2:...
class notes 在 貓的成長美股異想世界 Facebook 的最佳貼文
🌻Docusign(DOCU), Crowdstrike(CRWD)財報結果
上週這兩家公司發表財報了.
這兩天看了一下他們的財報結果. Again, 兩家的表現都很好, 但發現分析師給DOCU的調價(往上)幅度比較多, 就好奇研究了一下SaaS公司是怎麼被估值的. 有興趣的話可以看看(從中學習到很多. 非常推薦一讀):
https://makingsenseofusastocks.blogspot.com/2021/09/blog-post.html
(By the way, 分析師對CRWD的價格調幅沒那麼大, 主因是成長趨緩了. 而DOCU的free cash flow佔營收比, 以及顧客黏著力在這季創了新高, 是讓分析師按讚的幾個原因).
關於CRWD: "The Street is already modeling revenue growth deceleration in 2022 to 36%, down from 60% expected in 2021, which on its own might prove a hurdle for a stock already trading at a high multiple," said Bank of America analyst Tal Liani in a report.
分析師對於DOCU的評價:
• 11位buy; 給的價格分別是: $310, $320 (x2), $330 (x2), $340 (x2), $345, $350, $350, $389
• 給Buy的分析師的評語:
o Baird: The analyst continues to view them as a best in class way to play digital transformation trends with strong growth, cash flow and profitability, and a strong competitive position. Power said DocuSign remains one of his top long-term compounding growth ideas.
o Citi: While slightly shy of the double-digit billings beat in recent quarters, DocuSign still delivered a solid 8% beat to Q2 billings, which grew 47% year-over-year, Radke tells investors in a research note.
o Evercore ISI: he calls "another strong quarter." While some may have wanted to see more aggressive Q3 billings guidance, he believes estimates "continue to leave room for upside," Materne said.
o JMP Securities: While revenue growth decelerated to 50% from 58% in Q1, the company is the clear leader in electronic signature and the broader system of agreement having crossed over 1M customers with a $2B run rate this quarter, the analyst tells investors in a research note, adding that he sees lots of room for growth as DocuSign targets a $50B total addressable market.
o Needham: The analyst commented, "Docusign reported another strong quarter in 2QF22 with typical DOCU upside to revenue and profitability. Sales metrics and growth decelerated Q/Q, as we expected against a massive pandemic quarter, but at a much slower rate than we believe much of the Street was anticipating. 65k net new customers was lower than the 70k - 90 range of CY20 but was still more than 2x greater than any pre-pandemic quarter, highlighting a strong end-market driving 47% billings growth against a strong comp. Commentary on incremental Agreement Cloud demand was positive, suggesting an additional growth tailwind combined with solid international can further aid 2HF22. Although DOCU shares could be lower near-term due to weak 2H OpMg guidance, we think this guidance is conservative, as the recent OM was greater than the pre-pandemic level even with tough comps."
o RBC Capital: The quarter highlighted the sustainability of the company's tailwinds post-pandemic as most of its underlying metrics such as billings and net revenue retention were solid, the analyst tells investors in a research note, adding that the traction with CLM and Notary was also "impressive".
分析師對於CRWD的評價:
• 12位buy; 給的價格分別是: $300, $310 (x2), $313, $315 (x2) , $305, $320, $325, $330 (x2), $340
• 1位給hold: $280 (from $220 by J.P. Morgan(same))
• 給Buy的分析師的評語:
o Baird: The analyst believes the company has significant room for growth with core modules, opportunities with Humio and in cloud workload security, among others, should help drive a continuation of strong growth over a long time horizon.
o BTIG: The company's "strong" Q2 results "cleared every hurdle", even though the buy-side benchmarks may have been slightly higher, the analyst tells investors in a research note. Powell adds that Crowdstrike is clearly gaining share in its core endpoint security target market at a rapid pace and gaining traction with new products across multiple categories.
o Canaccord: The analyst said the stock is down from its recent highs, and he thinks the re-rating creates a more favorable entry point for longer-oriented investors for a foundational security name. He views Crowdstrike as a long-term secular winner in security due to its native cloud platform advantage versus closely held peers in endpoint security combined with platform expansion into tangential segments to capture greater share of security budgets.
o Goldman Sachs: CrowdStrike last night delivered "another beat and raise quarter as the company benefited from another quarter of elevated demand," Essex said. But it traded lower following net new annual recurring revenue growth guidance that was slightly less than investors had hoped for. Essex, nonetheless, said the quarter demonstrated CrowdStrike's "ability to continue to go down market efficiently."
o JMP Securities: The analyst notes the company's Q2 annualized recurring revenue of $1.34B topping his estimate of $1.30B, with "sustained" 70% ARR and revenue growth along with margin upside seen as key highlights for the quarter. Suppiger adds that the metrics reflect Crowdstrike's "strong execution and robust demand environment".
o Mizuho: "very good" fiscal Q2 results. The annual recurring revenue growth of 70% year-over-year "was strong and still nicely surpassed" the Street's 65%-66% estimate, Moskowitz tells investors in a research note. He believes "strong execution can propel" Crowdstrike's stock higher.
o Piper Sandler: The company's metrics "outperformed across the board" in Q2 with 70% annual recurring revenue and revenue growth and record net new customer adds in the quarter, Owens tells investors in a research note.
o RBC Capital: Hedberg adds that CrowdStrike's record pipeline entering Q3 should continue to fuel the company's "land-and-expand" momentum.
o Stifel: Q2 results that he said "exceeded consensus estimates across all major financial metrics." He continues to believe that Crowdstrike's growth opportunity "remains in the early days" despite the company's scale given continued share capture within its core endpoint security market and incremental module adoption on the Falcon Platform, Reback tells investors.
o UBS: the company reported "pretty good" Q2 results against high expectations.
🌻趨勢: 跨境電商 Cross-border commerce
Morgan Stanley:
From our perspective, we think many are underestimating what the cross-border eCommerce demand could ultimately be, once key friction points like FX rates, tax and duties, shipping, language, etc are smoothed—all issues that Global-E directly addresses.
Cross-border ecommerce brings new, high-yield volume: We think elevated levels of cross-border ecommerce (ex-travel) is a structural shift thathas yet to be fully contemplated in MA (and V)'s long-term forecasts. MA's cross-border CNP ex-travel volume was 69% above 2019's level in 2Q and 63% higher in 1Q. Strength reflects both broader ecommerce adoption plus globalization of commerce, as marketplaces and services that reduce cross-border friction (such as those from GLBE) make international online ordering more readily adopted. Early data at V suggests greater cross-border ecommerce spend is persisting even in areas with pre-pandemic levels of international travel. Cross-border transactions also come at a higher yield, making us more optimistic that the trend can bring incremental long-term growth to the networks.
產業的潮流是有連貫性的. 疫情讓電商更發達後, 接下來應該就是加速電商跨境了. 跨境的話, 有很多問題需要解決(稅率, 語言, etc.) 這就需要有公司來做整合的動作. 這種跨境, 也可以想像是omnichannel的一種呈現.
Harley Finkelstein (President of Shopify): "I mean I think commerce in 2021 is cross-border."
🌻SPAC熱潮退卻,初創市值蒸發750億美元
"SPAC熱潮已經退卻。分析顯示,在2月中旬以前完成合併的137家SPAC的總市值已經蒸發25%,市值回落幅度上個月一度超過1,000億美元。"
"像貝萊德(BlackRock Inc., BLK)和富達投資(Fidelity Investments Inc.)這類企業管理的基金,以及許多對沖基金、養老金管理公司和其他一些投資者,都在SPAC的回落中遭受了衝擊,他們在去年年底開始的熱潮中競相投資SPAC。其中許多基金由於在價格還很低的時候就早早入場,所以現在仍坐擁可觀收益。事實上,SPAC市值仍有約2,500億美元,高於一年前的約1,000億美元,反映出這期間股價上漲和新公司上市的影響。
但即便如此,今年年初令人炫目的回報還是讓許多後來者做了接盤俠,扎堆投資所謂穩賺不賠的領域,其永恆的風險可見一斑。在過去的幾個月裡,一些投資者眼睜睜看著帳面財富縮水。"
"股價下跌會在SPAC領域形成惡性循環,因為投資者有權在併購交易前從空白支票公司撤資。一旦SPAC跌破發行價,投資者就更有可能這樣做,而許多SPAC的股價現在正處於這樣的水平。目前,在尚未宣布併購交易的空白支票公司中,超過95%的公司股價低於發行價。
投資者的大規模撤資會讓已經上市的空白支票公司手上的現金大幅減少,讓其更難實現業務目標,並可能加劇股價跌勢。"
https://on.wsj.com/3n6JznC
🌻BNPL (buy now pay later)
But most BNPL providers including Affirm, Klarna and Afterpay have been losing money despite breakneck revenue growth as they invest heavily in marketing to win share. Sweden-based Klarna’s credit losses more than doubled in the second quarter. Affirm has projected adjusted operating losses of $50m-$55m for the fiscal year that ended June 30.
The path to profitability for many of these companies was to achieve massive scale, analysts said.
https://www.ft.com/content/ca201a37-a16d-4223-b123-04d38350a972
Pictures: 一葉知秋; from EarningsWhispers
class notes 在 最愛小金韓國商品代購 Facebook 的精選貼文
韓國 VANS CHECKERBOARD CLASS SLIP-ON 經典款黑白格紋穆勒鞋/懶人鞋型號VN0004KTEO1鞋店官網線上出清特價⏩⏩1️⃣6️⃣5️⃣0️⃣含運🉐🉐
原價2千多
尺吋~22-28公分,有半號可選
男女皆可穿
⭐️⭐️版型正常,喜歡合腳一點就選正常尺吋,喜歡舒適一點或會穿襪子的話就選大半號
有想買的親估可再私訊向小金登記😃😃
🌳🌳數量有限,售完為止
🌼🌼因粉絲專頁觸及率低,很多親估反映看不到新發的貼文😅😅
可加入LINE群組或是加入小金新開的社團
https://www.facebook.com/groups/754718342079964
即可FOLLOW最新商品或折扣資訊哦😎😎
➡️➡️付款完成後約2週至一個月左右到貨,若有提早到會再通知,想要早點到貨(2週內)需另外加錢單獨寄送哦‼️‼️
🌈🌈匯款/填單等相關問題請參考👇👇
https://www.facebook.com/notes/%E6%9C%80%E6%84%9B%E5%B0%8F%E9%87%91%E9%9F%93%E5%9C%8B%E5%95%86%E5%93%81%E4%BB%A3%E8%B3%BC/%E9%9F%93%E5%9C%8B%E4%BB%A3%E8%B3%BC%E9%9C%80%E7%9F%A5%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A0%85/2569731476626116/?av=1402986163300659&eav=AfYPfvN7CW0FwSqAhe9BEvklgrQVTbucY99cY7sE44NYOkikUwKsZM1vNS2zUma56cKcqbumRq66ZVC_EvWZW0k8
class notes 在 陰森IneS Youtube 的最佳解答
*CC字幕*
嗨又見面了 :D
很高興可以跟大家分享上網課的小撇步讓你在家也歐趴
可以在下面留言你的想法 我都會看! :3
------
Timestamps:
0:00 Intro
0:31 Organizing digital space
1:25 File naming strategy
2:02 Notebooks format
2:35 List of apps & textbooks
3:11 Class alarms
3:43 Build new routine
4:13 Make time for every class
4:49 Set reminders
5:18 Setup
5:48 Taking notes
6:06 Answer questions
6:32 Do asgnmts on time
6:55 Networking
8:19 Outro
------
其實是有15個啦但我在錄的時候沒有在數 :P
|統整|
1. 整理電腦桌面&資料夾
2. 統一檔案的命名方式
3. 寫筆記的標題格式(iPad/ 活頁紙)
4. 上課的軟體&課本的清單
|時間管理|
1. 設上課鐘
2. 規劃新的生活步調
3. 規定自己課後複習時間
4. 設考試日期&功課期限的提醒
|讀書|
1. 舒適的座位
2. 寫筆記
3. 回答問題
4. 按時交作業
|拓展人脈|
1. 跟新同學攀談
2. 上課發言時打開鏡頭
3. 寄感謝信給教授
------
我在紐約讀 Fashion Institute of Technology,現在大三,主修時尚商業管理。
我的經驗可能不適用於每所學校,希望你看完這個影片還是有收穫 :)
------
IG: @insen_asen
帽踢: Warriors shop (Dubs 💙💛)
隱形眼鏡: Olens
眼影: Colourpop
唇膏: MAC Chili Matte
------
Music by Gil Wanders - Waves - https://thmatc.co/?l=8302E819

class notes 在 BlueBerries詭計星的頻道 Youtube 的最佳解答
比較詳細的聯動內容介紹 More Detail about Event Shop/Collab Gacha:
https://www.youtube.com/watch?v=iC2kM7g7j64
台版活動資訊: https://rom.gnjoy.com.tw/Notice/Notice_View?id=3975#topv
SEA/Global Event Note: https://www.facebook.com/notes/ragnarok-m-eternal-love/ragnarokmxsamuraitrooper-crossover-event/2669978759908066/
All videos used copyrighted by Sunrise/Gravity.

class notes 在 Melody Tam Youtube 的最佳貼文
一直以嚟,都無點拍有關JUPAS嘅影片…
Quit U/ Trans科呢樣嘢,講親都會比haters攻擊
「肯定係讀唔掂啦」/「GPA得一」/「原來狀元咁廢」
呢啲謠言同更難聽嘅說話我全部聽過
無論我澄清幾多次畀埋數據,都仍然有人質疑我
加上我都算係揀錯過科嘅人,真係有資格分享?
但係我知道今年嘅同學走過呢段路係特別唔容易
人人都會做錯決定,況且又唔係咩傷天害理嘅事
我作為一個反面教材,唔係更加有說服力咩?
所以就算預咗haters會dislike段片或講難聽說話
我都仍然鼓起勇氣去拍呢段片
希望用趁放榜同改選JUPAS前夕
用自己嘅故事啟發更多同學
-
全港唯一雙料狀元(DSE 7科5** + IELTS 9分)線上補習平台 – 免費試讀!
www.mteducationhk.com / www.mteducationielts.com
1) 5**濃縮精華筆記:狀元Melody Tam親撰濃縮精華筆記,絕對不拖時間,真正去蕪存菁,適合想於短時間內升Grade的你
2) 30年操卷祕技傾囊相授:Melody Tam應考前曾多次操練各科30年的Past Paper,將心得精華、試題備註傾囊相授,伏位、失分位一應俱全
3) 無限次重溫教學:安坐家中便能無限次重溫高質素教學影片,隨時隨地學習狀元考試秘技—— 你還願意到大型補習社上video class嗎?
-
早註冊 = 早享受
一站式平台比過往自動化好多,唯一須人手審批嘅步驟就係註冊(因為我地採用實名登記,所以會喺72小時內處理),之後就可以即買即睇!註冊後更加可以觀看所有免費課程同下載筆記(比免費資源下載頁內容更多!),免費資源不斷更新中,大家早註冊早享受~
-
Instagram: melodytamhkdse
Email: admin@mteducationhk.com
WhatsApp (Admin): +852 6049 1152
