|
1 | 1 | --- |
2 | 2 | theme: ./theme |
3 | | -title: 2022-08-25-UnitTesting |
| 3 | +title: UnitTesting |
4 | 4 | transition: fade |
5 | 5 | session-time: 70min |
6 | 6 | track: Architecture |
7 | 7 | type: Theoretical |
| 8 | +first: 2022-08-25 |
8 | 9 | h1: |
9 | 10 | type: slashes |
10 | 11 | color: muted |
@@ -69,6 +70,69 @@ layout: section |
69 | 70 |
|
70 | 71 | Job of the Tech Lead / Architect |
71 | 72 |
|
| 73 | + |
| 74 | +--- |
| 75 | +layout: default |
| 76 | +--- |
| 77 | + |
| 78 | +# The Testing Pyramid |
| 79 | + |
| 80 | +<div class="flex justify-center items-center h-full gap-8 -mt-8"> |
| 81 | + <!-- Left: Speed arrow --> |
| 82 | + <div class="flex h-96 gap-3 items-center"> |
| 83 | + <div class="flex flex-col h-full py-2 justify-between"> |
| 84 | + <div class="text-7xl -mt-8">🐢</div> |
| 85 | + <div class="text-7xl">🐇</div> |
| 86 | + </div> |
| 87 | + <svg width="24" height="100%" viewBox="0 0 24 380" class="h-96"> |
| 88 | + <line x1="12" y1="18" x2="12" y2="362" stroke="#9ca3af" stroke-width="3"/> |
| 89 | + <polygon points="12,0 4,18 20,18" fill="#9ca3af"/> |
| 90 | + <polygon points="12,380 4,362 20,362" fill="#9ca3af"/> |
| 91 | + </svg> |
| 92 | + </div> |
| 93 | + |
| 94 | + <!-- Pyramid (SVG) --> |
| 95 | + <svg width="480" height="380" viewBox="0 0 480 380"> |
| 96 | + <defs> |
| 97 | + <filter id="glow" x="-50%" y="-50%" width="200%" height="200%"> |
| 98 | + <feGaussianBlur stdDeviation="8" result="coloredBlur"/> |
| 99 | + <feMerge> |
| 100 | + <feMergeNode in="coloredBlur"/> |
| 101 | + <feMergeNode in="SourceGraphic"/> |
| 102 | + </feMerge> |
| 103 | + </filter> |
| 104 | + </defs> |
| 105 | + <!-- E2E - top --> |
| 106 | + <path d="M240,15 L330,115 L150,115 Z" fill="#10b981"/> |
| 107 | + <text x="240" y="78" text-anchor="middle" fill="white" font-weight="bold" font-size="14">E2E</text> |
| 108 | + <!-- Integration - middle --> |
| 109 | + <path d="M150,115 L330,115 L400,235 L80,235 Z" fill="#06b6d4"/> |
| 110 | + <text x="240" y="185" text-anchor="middle" fill="white" font-weight="bold" font-size="16">Integration</text> |
| 111 | + <!-- Unit - bottom (with glow) --> |
| 112 | + <path d="M80,235 L400,235 L450,355 Q458,375 435,375 L45,375 Q22,375 30,355 Z" fill="#ec4899" filter="url(#glow)"/> |
| 113 | + <text x="240" y="318" text-anchor="middle" fill="white" font-weight="bold" font-size="18">Unit</text> |
| 114 | + </svg> |
| 115 | + |
| 116 | + <!-- Right: Cost arrow --> |
| 117 | + <div class="flex h-96 gap-3 items-center"> |
| 118 | + <svg width="24" height="100%" viewBox="0 0 24 380" class="h-96"> |
| 119 | + <line x1="12" y1="18" x2="12" y2="362" stroke="#9ca3af" stroke-width="3"/> |
| 120 | + <polygon points="12,0 4,18 20,18" fill="#9ca3af"/> |
| 121 | + <polygon points="12,380 4,362 20,362" fill="#9ca3af"/> |
| 122 | + </svg> |
| 123 | + <div class="flex flex-col h-full py-2 justify-between"> |
| 124 | + <div class="text-4xl font-bold text-emerald-600 -mt-3">€€€</div> |
| 125 | + <div class="text-4xl font-bold text-emerald-600">$</div> |
| 126 | + </div> |
| 127 | + </div> |
| 128 | +</div> |
| 129 | + |
| 130 | +<!-- |
| 131 | +The Testing Pyramid (Mike Cohn): Most tests should be unit tests (fast, cheap, isolated). Fewer integration tests (test how components work together). Fewest E2E/UI tests (slow, brittle, expensive to maintain). |
| 132 | +Anti-pattern: The Ice Cream Cone - too many manual/E2E tests, not enough unit tests. |
| 133 | +--> |
| 134 | + |
| 135 | + |
72 | 136 | --- |
73 | 137 | layout: default-aside |
74 | 138 | h1: |
|
0 commit comments