Beyond Pester 101: Applying testing principles to PowerShell
summary
Shows concrete practices not promises: uses Pester and a custom Invoke-ParallelTests to cut a DC networking module’s 985 unit tests from ~80 seconds down to about 42 seconds (but loses code coverage and reveals race conditions); reports a roughly 10:1 unit-to-integration test ratio and a test that ran 208 times without failing; recommends characterization tests for legacy code, mocking private wrappers to enable black‑box tests, removing slow or always‑green tests, and tagging to fail fast.
AI-written summary · about
chapters (16)
- 0:00Beyond Pester 101: Applying testing principles to PowerShell
- 0:11Beyond Pester 101 Applying testing principles to PowerShell
- 3:56Beginning the ascent.
- 4:42To reduce the risk that a user will experience an unexpected behaviour
- 6:39Kinds of tests?
- 12:062. Integration 3. Unit (Again?)
- 13:30Behavioural "What it does"
- 17:442. Integration 3. Unit (Black box)
- 18:00A characterization test is a test that characterizes the actual behavior of a piece of code ... The tests document the actual current behavior of the system
- 21:17The second half of the slope.
- 23:59Downsides?
- 24:22Code Coverage
- 25:41Not suitable for everything
- 26:43Use data! (Pester Output Files)
- 32:50Reduce duration Remove tests Reorder tests General maintenance
- 34:18Unit (White box) Integration Unit (Black box) Characterisation
related talks
03h 02mPowerShell Unit and Infrastructure Testing
39mWriting Pester Tests at Scale
43mBeyond Pester 103: Applying a Testing Mindset
43mBeyond Pester 102: Acceptance testing with PowerShell
37mTesting, Testing, 1...2...3: Using Pester for Infrastructure ...
49mUsing Pester with Test Kitchen to thoroughly test your Chocolatey Packages
37mClean Test Code
39mDebug Now! Zap bugs out of PowerShell
