This comic can be very true when you are new to automation or just don’t understand what you really need automated.
When you are new to automation you tend to not think about lastability of the code you are writing. You tend to whip up your automated workflow as if you are trying to fill in an array the first time in your intro computer science class. It would usually contain a lot of hard coded values and quick hacks in order to get what you want. Sure, this might work the first few times you need it but as soon as variables, names, or functionality of your work flow changes, or even if you change the work flow itself, you will be putting your “copious” amounts of spare time into maintaining and debugging your code. You will cry in the corner with your bottle of Macallen 12 go back to writing “hello world” scripts to feel confident about programming again.
The other side of the coin are those that have experience but don’t really know what needs to be put into the work flow before automating it. This is usually due to assumptions about the environment and lack of proper planning. There is never any shame in mapping it out on a whiteboard and researching questions as you go.
In order to reap the benefits of automation it will take you a bit of time (if you ultimately don’t want to update and maintain it every waking hour). It’s worth spending the extra few hours at the end of your coding process to create proper functions, document, and touch up your code. Planing out automation should be given as much care as developing a product, especially if others are going to consume it.
Things to consider before beginning your automation:
1. Is the process you are automating subject to a lot of change? Unless you are in QA and need to have regression testing for changes in code, you should rethink what you are automating or just stick to one version of the different products you are working with.
2. Does the products you are automating have APIs? If so use them. Don’t re-invent the wheel. You will also get notices when APIs change so you can adjust code accordingly.
3. Will it take more than a week to automate? If the answer is yes, then make sure what you are automating is really worth your time.
4. Is the automation important enough that you would run the steps manually again? If repetitiveness of what you are trying to automate is high then this is likely to save you time in the future. If not, it might be worth it to take the manual steps as a hit… In other words, there are probably more important things you want to automate and you will be more motivated to do something right that you expect will save you a lot of time.
5. Are you making a lot of assumptions before automating? Are you just saying to yourself “of course that can be done.” While this is true, the complexity of the direction you are going might be exponentially harder than you originally planned. Take time to investigate what you are automating, why you are automating, and the depth of complexity you are undertaking. (unless you are specifically making a product where you automate a ridiculously large workflow).
6. Remember that there is always more than one way to do it.