Surely modular programming (or OO programming ) is a given these days. TDD and OO (or modular) aren't an either/or proposition - one doesn't preclude the other.
For anything other than trivial applications, you need documentation on use cases and outcomes (valid outcomes or error conditions). You either start with a system that can generate all the test cases and documentation for you, or you need to build and maintain that all separately. Or you just don't (this is where most sysadmins end up, IME) and you have buggy code (you just don't realise it) Cheers Ken From: [email protected] [mailto:[email protected]] On Behalf Of Micheal Espinola Jr Sent: Friday, 25 April 2014 6:54 AM To: ntsysadm Subject: Re: [NTSysADM] RE: PowerShell unit testing I'd say that I started scripting with more of a TDD mindset, and then drifted toward modular over time. I'm not discounting the usefulness of any methodology. I'm only speaking in ideals. Certainly many factors drive how you go about researching and/or creating something in any discipline. -- Espi On Thu, Apr 24, 2014 at 12:14 PM, Joseph L. Casale <[email protected]<mailto:[email protected]>> wrote: > +1 for modular [script] programming. > Build in terms of modules and standardize your variables. In the future you > can drop-in added functionality easy-peasy-lemon-squeezy. Like I said earlier, for one pager's or banging out simple scripts its not worth the time. But it doesn't scale. How do you know a change over there doesn't affect something over here? > I've read the Wikipedia article for TDD, and it sounds like throwing stuff at > a wall to see what sticks. Well, if you have not been around software development or written anything very large I can see how you might find that concept daunting. It is however a discipline but once learnt you'll never go back. For older more mature languages like Python, Java etc where good frameworks exist, it is pretty easy to setup a simple test. Some IDEs will even create an initial scaffold for testing and support easy integration of it. I use PyCharm for Python development and while I am writing I can run a test and maintain that changes I am making are actually correct. So it ends up being seamless and more often saves time... Give it a whirl next project. jlc

