[{"data":1,"prerenderedAt":809},["ShallowReactive",2],{"content-/waterfall-chart-testing":3,"all-pages-for-dir":786,"related-/waterfall-chart-testing":787,"og-image-/waterfall-chart-testing":808},{"id":4,"title":5,"body":6,"category":770,"concepts":770,"description":771,"extension":772,"meta":773,"navigation":774,"ogImage":770,"path":775,"project_name":770,"published":776,"publishedAt":777,"seo":778,"source":770,"stem":779,"tags":780,"todo":770,"unpublished":776,"updatedAt":777,"__hash__":785},"pages/2025-12/2025-12-22/waterfall-chart-testing.md","ウォーターフォールチャートのテスト設計",{"type":7,"value":8,"toc":748},"minimark",[9,12,16,21,29,36,42,55,60,82,88,91,96,111,116,127,131,138,141,145,156,161,182,185,188,192,201,206,235,243,245,249,258,263,269,288,293,324,329,337,346,348,352,358,368,372,394,396,400,404,456,460,506,510,560,564,569,571,574,578,629,632,634,637,744],[10,11,5],"h1",{"id":5},[13,14,15],"h2",{"id":15},"現状のテスト構成",[17,18,20],"h3",{"id":19},"_1-pl-ウォーターフォールチャートのテスト","1. P/L ウォーターフォールチャートのテスト",[22,23,25],"h4",{"id":24},"appswebapputilswaterfall-charttestts",[26,27,28],"code",{},"apps/web/app/utils/waterfall-chart.test.ts",[30,31,32,35],"p",{},[26,33,34],{},"calculateWaterfallPositions","関数のユニットテスト。",[30,37,38],{},[39,40,41],"strong",{},"テストパターン:",[43,44,45,49,52],"ul",{},[46,47,48],"li",{},"Pattern 1: 営業損失 → 営業外収益で税引前利益プラス",[46,50,51],{},"Pattern 5: 全ステップでプラス（正常パターン）",[46,53,54],{},"Pattern 6: 売上総損失（原価 > 売上）",[30,56,57],{},[39,58,59],{},"検証内容:",[43,61,62,73,79],{},[46,63,64,65,68,69,72],{},"各バーの ",[26,66,67],{},"startValue"," と ",[26,70,71],{},"endValue"," が正しいか",[46,74,75,78],{},[26,76,77],{},"isLoss"," フラグが正しく設定されているか",[46,80,81],{},"フローの遷移（Revenue → Cost → Gross Profit → ... → Net Income）",[22,83,85],{"id":84},"appswebtestswaterfall-integritytestts",[26,86,87],{},"apps/web/tests/waterfall-integrity.test.ts",[30,89,90],{},"PLDetailedDataの差額計算ロジックと整合性検証。",[30,92,93],{},[39,94,95],{},"検証項目:",[97,98,99,102,105,108],"ol",{},[46,100,101],{},"Revenue - Cost = Gross Profit",[46,103,104],{},"Gross Profit - SG&A - R&D - D&A - Other = Operating Income",[46,106,107],{},"Operating Income + Non-op = Pre-Tax Income",[46,109,110],{},"Pre-Tax Income - Taxes = Net Income",[30,112,113],{},[39,114,115],{},"特徴:",[43,117,118,124],{},[46,119,120,123],{},[26,121,122],{},"financial-data.ts","の全企業・全期間のデータを自動検証",[46,125,126],{},"UIコンポーネント表示ロジックのシミュレーション検証",[17,128,130],{"id":129},"_2-cf-ウォーターフォールチャートのテスト","2. CF ウォーターフォールチャートのテスト",[22,132,134,137],{"id":133},"appswebtestscf-waterfall-integritytestts-2025-12-22-作成",[26,135,136],{},"apps/web/tests/cf-waterfall-integrity.test.ts"," (2025-12-22 作成)",[30,139,140],{},"CashFlowDataの内訳計算ロジックと整合性検証。",[30,142,143],{},[39,144,95],{},[97,146,147,150,153],{},[46,148,149],{},"FCF = Operating CF + CapEx",[46,151,152],{},"Investing CF = CapEx + Acquisitions + Investment in Securities + Other",[46,154,155],{},"Financing CF = Net Debt + Dividends + Stock Repurchase + Stock Issuance + Other",[30,157,158],{},[39,159,160],{},"テスト結果 (2025-12-22実行):",[43,162,163,166,172,177],{},[46,164,165],{},"対象: 149社、1597期間",[46,167,168,169],{},"FCF整合性: 1597期間 ",[39,170,171],{},"全て成功",[46,173,174,175],{},"投資CF内訳整合性: 1597期間 ",[39,176,171],{},[46,178,179,180],{},"財務CF内訳整合性: 1597期間 ",[39,181,171],{},[183,184],"hr",{},[13,186,187],{"id":187},"議論ログ",[17,189,191],{"id":190},"_2025-12-22-cf整合性テストの作成","2025-12-22: CF整合性テストの作成",[30,193,194,197,198,200],{},[39,195,196],{},"背景:","\nTypeScriptデータ（",[26,199,122],{},"）から直接取得している営業CF、投資CF、財務CFについて、ウォーターフォールチャートでは投資CFと財務CFの内訳を表示しているため、合計値 - 内訳 = 0 となることをテストで検証したい。",[30,202,203],{},[39,204,205],{},"議論:",[43,207,208,215,222,229],{},[46,209,210,211,214],{},"営業CF: データから直接取得（",[26,212,213],{},"cf.operatingCF","）",[46,216,217,218,221],{},"投資CF: データから直接取得（",[26,219,220],{},"cf.investingCF","）、内訳はCapEx + Acquisitions + Securities + Other",[46,223,224,225,228],{},"財務CF: データから直接取得（",[26,226,227],{},"cf.financingCF","）、内訳はNetDebt + Dividends + Repurchase + Issuance + Other",[46,230,231,232,214],{},"増減: 計算（",[26,233,234],{},"operatingCF + investingCF + financingCF",[30,236,237,240,242],{},[39,238,239],{},"実装:",[26,241,136],{},"を作成し、全149社・1597期間のデータに対して整合性を検証。\n全テストパス。",[183,244],{},[17,246,248],{"id":247},"_2025-12-22-ディレクトリ構造のリファクタリング","2025-12-22: ディレクトリ構造のリファクタリング",[30,250,251,253,254,257],{},[39,252,196],{},"\n機能別の分類がされておらず",[26,255,256],{},"financial-quiz/","ディレクトリ直下に35ファイルがフラットに配置されていた。全企業にCFウォーターフォールを適用する前にディレクトリ構造を整理する。",[30,259,260],{},[39,261,262],{},"実施内容:",[30,264,265,268],{},[39,266,267],{},"Phase 1: waterfall/ 作成"," ✅",[43,270,271,277,282],{},[46,272,273,276],{},[26,274,275],{},"PLWaterfallChart.vue"," を移動",[46,278,279,276],{},[26,280,281],{},"CFWaterfallChart.vue",[46,283,284,287],{},[26,285,286],{},"index.ts"," を作成してre-export",[30,289,290,268],{},[39,291,292],{},"Phase 2: proportional-statements/ 作成",[43,294,295,300,305,310,315,320],{},[46,296,297,276],{},[26,298,299],{},"ProportionalFinancialStatements.vue",[46,301,302,276],{},[26,303,304],{},"ProportionalFinancialStatementsAnimated.vue",[46,306,307,276],{},[26,308,309],{},"ProportionalFinancialStatementsComparison.vue",[46,311,312,276],{},[26,313,314],{},"BalanceSheetBox.vue",[46,316,317,276],{},[26,318,319],{},"BalanceSheetComparison.vue",[46,321,322,287],{},[26,323,286],{},[30,325,326],{},[39,327,328],{},"独立性チェック:",[43,330,331,334],{},[46,332,333],{},"全コンポーネントがVue以外の外部依存なし ✅",[46,335,336],{},"内部依存は同ディレクトリ内で解決 ✅",[30,338,339,340,345],{},"詳細は ",[341,342,344],"a",{"href":343},"./financial-quiz-directory-structure","financial-quiz-directory-structure.md"," を参照。",[183,347],{},[17,349,351],{"id":350},"_2025-12-22-cfウォーターフォールのインジケーター改善","2025-12-22: CFウォーターフォールのインジケーター改善",[30,353,354,357],{},[39,355,356],{},"変更内容:","\nCash Flow Waterfallのセクションタイトル横に、CFサマリーインジケーターを追加。",[359,360,365],"pre",{"className":361,"code":363,"language":364},[362],"language-text","営業  ↑    投資  ↓    財務  ↓    増減  ↑\n10,000     ▲5,000     ▲3,000     2,000\n","text",[26,366,363],{"__ignoreMap":367},"",[30,369,370],{},[39,371,239],{},[43,373,374,388,391],{},[46,375,376,379,380,383,384,387],{},[26,377,378],{},"waterfall-test.vue","に",[26,381,382],{},"cfSummary","を拡張（",[26,385,386],{},"netChange","を追加）",[46,389,390],{},"4項目（営業・投資・財務・増減）を縦2行×横並びで表示",[46,392,393],{},"矢印の色: プラスは黒、マイナスは赤",[183,395],{},[13,397,399],{"id":398},"実装済みcfウォーターフォールテスト","実装済みCFウォーターフォールテスト",[17,401,403],{"id":402},"_1-fcf計算テスト","1. FCF計算テスト ✅",[359,405,409],{"className":406,"code":407,"language":408,"meta":367,"style":367},"language-typescript shiki shiki-themes vitesse-light vitesse-light","// FCF = Operating CF + CapEx\nexpect(operatingCF + capex).toBe(fcf)\n","typescript",[26,410,411,420],{"__ignoreMap":367},[412,413,416],"span",{"class":414,"line":415},"line",1,[412,417,419],{"class":418},"sxvE3","// FCF = Operating CF + CapEx\n",[412,421,423,427,431,435,439,442,445,448,450,453],{"class":414,"line":422},2,[412,424,426],{"class":425},"senZ8","expect",[412,428,430],{"class":429},"shFtX","(",[412,432,434],{"class":433},"s4oTP","operatingCF",[412,436,438],{"class":437},"stQ0i"," +",[412,440,441],{"class":433}," capex",[412,443,444],{"class":429},").",[412,446,447],{"class":425},"toBe",[412,449,430],{"class":429},[412,451,452],{"class":433},"fcf",[412,454,455],{"class":429},")\n",[17,457,459],{"id":458},"_2-投資cf内訳整合性","2. 投資CF内訳整合性 ✅",[359,461,463],{"className":406,"code":462,"language":408,"meta":367,"style":367},"// Investing CF = CapEx + Acquisitions + Investment in Securities + Other\nexpect(capex + acquisitions + investmentInSecurities + otherInvesting).toBeCloseTo(investingCF)\n",[26,464,465,470],{"__ignoreMap":367},[412,466,467],{"class":414,"line":415},[412,468,469],{"class":418},"// Investing CF = CapEx + Acquisitions + Investment in Securities + Other\n",[412,471,472,474,476,479,481,484,486,489,491,494,496,499,501,504],{"class":414,"line":422},[412,473,426],{"class":425},[412,475,430],{"class":429},[412,477,478],{"class":433},"capex",[412,480,438],{"class":437},[412,482,483],{"class":433}," acquisitions",[412,485,438],{"class":437},[412,487,488],{"class":433}," investmentInSecurities",[412,490,438],{"class":437},[412,492,493],{"class":433}," otherInvesting",[412,495,444],{"class":429},[412,497,498],{"class":425},"toBeCloseTo",[412,500,430],{"class":429},[412,502,503],{"class":433},"investingCF",[412,505,455],{"class":429},[17,507,509],{"id":508},"_3-財務cf内訳整合性","3. 財務CF内訳整合性 ✅",[359,511,513],{"className":406,"code":512,"language":408,"meta":367,"style":367},"// Financing CF = Net Debt + Dividends + Stock Repurchase + Stock Issuance + Other\nexpect(netDebt + dividends + stockRepurchase + stockIssuance + otherFinancing).toBeCloseTo(financingCF)\n",[26,514,515,520],{"__ignoreMap":367},[412,516,517],{"class":414,"line":415},[412,518,519],{"class":418},"// Financing CF = Net Debt + Dividends + Stock Repurchase + Stock Issuance + Other\n",[412,521,522,524,526,529,531,534,536,539,541,544,546,549,551,553,555,558],{"class":414,"line":422},[412,523,426],{"class":425},[412,525,430],{"class":429},[412,527,528],{"class":433},"netDebt",[412,530,438],{"class":437},[412,532,533],{"class":433}," dividends",[412,535,438],{"class":437},[412,537,538],{"class":433}," stockRepurchase",[412,540,438],{"class":437},[412,542,543],{"class":433}," stockIssuance",[412,545,438],{"class":437},[412,547,548],{"class":433}," otherFinancing",[412,550,444],{"class":429},[412,552,498],{"class":425},[412,554,430],{"class":429},[412,556,557],{"class":433},"financingCF",[412,559,455],{"class":429},[17,561,563],{"id":562},"_4-全企業全期間検証","4. 全企業・全期間検証 ✅",[30,565,566,568],{},[26,567,122],{},"の全企業データ（149社、1597期間）に対してCF整合性を自動検証済み。",[183,570],{},[13,572,573],{"id":573},"今後追加検討のテスト",[17,575,577],{"id":576},"beginning-cash-cf-ending-cash-整合性","Beginning Cash + CF = Ending Cash 整合性",[359,579,581],{"className":406,"code":580,"language":408,"meta":367,"style":367},"// Beginning Cash + Operating CF + Investing CF + Financing CF = Ending Cash\nexpect(beginningCash + operatingCF + investingCF + financingCF).toBeCloseTo(endingCash, tolerance)\n",[26,582,583,588],{"__ignoreMap":367},[412,584,585],{"class":414,"line":415},[412,586,587],{"class":418},"// Beginning Cash + Operating CF + Investing CF + Financing CF = Ending Cash\n",[412,589,590,592,594,597,599,602,604,607,609,612,614,616,618,621,624,627],{"class":414,"line":422},[412,591,426],{"class":425},[412,593,430],{"class":429},[412,595,596],{"class":433},"beginningCash",[412,598,438],{"class":437},[412,600,601],{"class":433}," operatingCF",[412,603,438],{"class":437},[412,605,606],{"class":433}," investingCF",[412,608,438],{"class":437},[412,610,611],{"class":433}," financingCF",[412,613,444],{"class":429},[412,615,498],{"class":425},[412,617,430],{"class":429},[412,619,620],{"class":433},"endingCash",[412,622,623],{"class":429},",",[412,625,626],{"class":433}," tolerance",[412,628,455],{"class":429},[30,630,631],{},"※ Beginning CashとEnding CashはBSから取得する必要があるため、現在のCFデータ単体では検証不可。\nCFとBSの連携テストとして将来的に検討。",[183,633],{},[13,635,636],{"id":636},"関連ファイル",[638,639,640,653],"table",{},[641,642,643],"thead",{},[644,645,646,650],"tr",{},[647,648,649],"th",{},"ファイル",[647,651,652],{},"説明",[654,655,656,667,677,687,697,707,717,726,735],"tbody",{},[644,657,658,664],{},[659,660,661],"td",{},[26,662,663],{},"apps/web/app/components/financial-quiz/waterfall/CFWaterfallChart.vue",[659,665,666],{},"CFウォーターフォールチャートコンポーネント",[644,668,669,674],{},[659,670,671],{},[26,672,673],{},"apps/web/app/components/financial-quiz/waterfall/PLWaterfallChart.vue",[659,675,676],{},"P/Lウォーターフォールチャートコンポーネント",[644,678,679,684],{},[659,680,681],{},[26,682,683],{},"apps/web/app/components/financial-quiz/waterfall/index.ts",[659,685,686],{},"waterfall re-export",[644,688,689,694],{},[659,690,691],{},[26,692,693],{},"apps/web/app/components/financial-quiz/proportional-statements/",[659,695,696],{},"比例縮尺財務諸表コンポーネント群",[644,698,699,704],{},[659,700,701],{},[26,702,703],{},"apps/web/app/pages/financial-quiz/waterfall-test.vue",[659,705,706],{},"テストページ（両チャートを表示）",[644,708,709,714],{},[659,710,711],{},[26,712,713],{},"apps/web/app/utils/waterfall-chart.ts",[659,715,716],{},"P/Lウォーターフォール計算ロジック",[644,718,719,723],{},[659,720,721],{},[26,722,28],{},[659,724,725],{},"P/Lウォーターフォールのテスト",[644,727,728,732],{},[659,729,730],{},[26,731,87],{},[659,733,734],{},"P/L整合性テスト",[644,736,737,741],{},[659,738,739],{},[26,740,136],{},[659,742,743],{},"CF整合性テスト (2025-12-22作成)",[745,746,747],"style",{},"html pre.shiki code .sxvE3, html code.shiki .sxvE3{--shiki-default:#A0ADA0;--shiki-dark:#A0ADA0}html pre.shiki code .senZ8, html code.shiki .senZ8{--shiki-default:#59873A;--shiki-dark:#59873A}html pre.shiki code .shFtX, html code.shiki .shFtX{--shiki-default:#999999;--shiki-dark:#999999}html pre.shiki code .s4oTP, html code.shiki .s4oTP{--shiki-default:#B07D48;--shiki-dark:#B07D48}html pre.shiki code .stQ0i, html code.shiki .stQ0i{--shiki-default:#AB5959;--shiki-dark:#AB5959}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":367,"searchDepth":422,"depth":422,"links":749},[750,755,760,766,769],{"id":15,"depth":422,"text":15,"children":751},[752,754],{"id":19,"depth":753,"text":20},3,{"id":129,"depth":753,"text":130},{"id":187,"depth":422,"text":187,"children":756},[757,758,759],{"id":190,"depth":753,"text":191},{"id":247,"depth":753,"text":248},{"id":350,"depth":753,"text":351},{"id":398,"depth":422,"text":399,"children":761},[762,763,764,765],{"id":402,"depth":753,"text":403},{"id":458,"depth":753,"text":459},{"id":508,"depth":753,"text":509},{"id":562,"depth":753,"text":563},{"id":573,"depth":422,"text":573,"children":767},[768],{"id":576,"depth":753,"text":577},{"id":636,"depth":422,"text":636},null,"P/LおよびCFウォーターフォールチャートのテスト現状と今後の方針についての議論","md",{},true,"/waterfall-chart-testing",false,"2025-12-22T00:00:00.000Z",{"title":5,"description":771},"2025-12/2025-12-22/waterfall-chart-testing",[781,782,783,784],"testing","vitest","waterfall-chart","financial-quiz","I2JHkWH7J72kOwq-ehpXYD43_oWwizgtzxKTanGb47k",[],[788,792,796,800,804],{"title":789,"path":790,"publishedAt":791},"テスト失敗修正・Cloudflareデプロイの日本語コミットメッセージ問題・公開記事3本","/tests-deploy-and-misc-articles","2026-05-15T00:00:00.000Z",{"title":793,"path":794,"publishedAt":795},"ローンシミュレーターのリファクタリング：カンマ入力・比較表示・テスト追加","/loan-simulator-refactoring","2026-02-01T00:00:00.000Z",{"title":797,"path":798,"publishedAt":799},"決算コメントの「3年未満で回収」を原文で検算し、クラウド設備投資チャートと純粋関数に落とすまで","/cloud-capex-chart-and-pure-functions","2026-07-31T00:00:00.000Z",{"title":801,"path":802,"publishedAt":803},"トップページにGitHub草風ヒートマップを実装、テスト18,440件全パス化とKRW単位ラベルの根本修正","/contribution-heatmap-and-krw-label-fix","2026-07-13T00:00:00.000Z",{"title":805,"path":806,"publishedAt":807},"tripleBeat の GAAP評価データを9銘柄に拡充し、散布図にGAAP/Non-GAAP切替を実装した","/triplebeat-gaap-valuation-scatter","2026-05-31T00:00:00.000Z","https://log.eurekapu.com/og/blog/waterfall-chart-testing.png?v=2025-12-22T00%3A00%3A00.000Z&title=%E3%82%A6%E3%82%A9%E3%83%BC%E3%82%BF%E3%83%BC%E3%83%95%E3%82%A9%E3%83%BC%E3%83%AB%E3%83%81%E3%83%A3%E3%83%BC%E3%83%88%E3%81%AE%E3%83%86%E3%82%B9%E3%83%88%E8%A8%AD%E8%A8%88&author=Kei%20Komatsu&sig=90930fd041a7da7e",1785654979304]