Datanauts 132: Unit Testing For Fun And Profit




The Fat Pipe - All of the Packet Pushers Podcasts show

Summary: While performing a routine sensor sweep of the Gargleblaster nebula, the crew of the Datanauts starship noticed that many of the tasks are manual in nature and could, with a little effort, be automated with some scripting.<br> However, every time we moved on from one part of the nebula to another, a different error would crop up with the script’s code. Isn’t there some way that we can automatically test our code to make sure that more time is spent drinking a frothy ale instead of all this debugging?<br> On today’s episode with talk with <a target="_blank" href="https://twitter.com/adbertram" rel="noopener">Adam Bertram</a>, a Microsoft MVP and author of <a target="_blank" href="https://leanpub.com/pesterbook" rel="noopener">The Pester Book</a>.<br> He is currently a Senior Systems Automation Engineer working with PowerShell, Desired State Configuration, and various other DevOps tools to coordinate reliable software deployments for a biotech company. You can find his work at <a target="_blank" href="https://www.adamtheautomator.com/" rel="noopener">adamtheautomator.com</a>.<br> We start by defining a unit test for scripts, and how unit testing differs from integration, functional, regression tests, and others.<br> Then we dive into why you’d want to test your scripts (testing isn’t just for developers!), and how to create these tests.<br> We also talk about the notion of test-driven development, and dive into Pester, which is a testing framework for PowerShell.<br> Show Links:<br> <a target="_blank" href="https://twitter.com/adbertram" rel="noopener">Adam Bertram on Twitter</a><br> <a target="_blank" href="https://www.adamtheautomator.com/" rel="noopener">Adam The Automator.com</a><br> <a target="_blank" href="https://leanpub.com/pesterbook" rel="noopener">The Pester Book</a> – Adam Bertram<br>