Skip to main content

Automation in General

Automation means a machine does a task by following fixed instructions, so a person does not have to do each step by hand. The person still decides what the task is and what a good result looks like. The machine does it the same way every time, as often as needed.

This page is about automation in general, not testing. Get this mental model first. Test automation is the same idea pointed at one job.

Automation you already use​

ExampleWhat it does for you
Washing machineFills, washes, rinses and spins without you standing there
Auto bill paymentPays the electricity bill on the 1st of every month
Email filterMoves every newsletter to a folder as it arrives
Factory lineFills, caps and labels thousands of bottles an hour
Phone backupCopies your photos to the cloud every night while charging

The shape of every automation​

Every one of those examples has the same four parts. Once you see this shape, you will recognise it in every automation tool you meet, including test tools.

The shape of every automation: a trigger starts fixed instructions, a check decides if it worked, and the outcome is reported back to a person; a failed check raises an alert

PartQuestion it answers
TriggerWhat starts it? A button, a time, an event
InstructionsWhat steps does it follow? The same ones every time
CheckDid it work? Compare the result to what it should be
Report backWho finds out, and how? A message, a log, an alert

Here are the four parts filled in for the examples above:

ExampleTriggerInstructionsCheckReport back
Washing machineYou press StartFill, wash, rinse, spinWater level sensor, door locked, drum balancedBeep when done; error code if the drain is blocked
Auto bill payment1st of the monthTransfer the amount to the billerIs there enough balance?Receipt by email, or a "payment failed" alert
Factory lineBottle reaches the stationFill, cap, labelCamera checks fill level and label positionBad bottles pushed off the line and counted
Phone backupNight time, charging, on Wi-FiCopy new photos to the cloudDid every file upload?"Backup complete" or "Backup failed" message

Automation without the check and the report back is a machine running blind. Nobody knows when it goes wrong.

Why we automate​

BenefitWhat it means
SpeedA machine does in seconds what takes a person minutes or hours
ConsistencyThe same steps every time. No skipped step because someone was tired on a Friday
ScaleDoing it 10 times or 10,000 times costs about the same
Any timeIt runs at night, on weekends and the moment something changes
People freed upPeople move from repeating work to work that needs judgement

When it is worth it​

Not every task should be automated. A task is a good candidate when most of these are true:

  • It repeats often. Something done once a year rarely pays back the effort.
  • The steps are fixed. The same rules every time, with no "it depends" judgement in the middle.
  • The input is predictable. The machine knows what it will receive.
  • The result can be checked. There is a clear right and wrong answer.
  • Mistakes are costly. A human slip would hurt, so consistency is worth paying for.

Tasks that need taste, judgement or a conversation (designing a screen, deciding if something "feels right", talking to a client) stay with people. Automation handles the repeating part around them.

What automation costs​

  • Building it. Someone has to work out the exact steps and write them down for the machine. That takes longer than doing the task once by hand.
  • Keeping it working. When the task changes, the automation must change too. A new biller account number breaks the auto payment until someone updates it.
  • Watching it. Someone must read the reports. An alert nobody reads is the same as no check at all.

Automation in a software team​

A software team automates many of its own repeating tasks, and each one has the same four parts.

TaskTriggerInstructionsCheckReport back
BuildDeveloper pushes codeCompile and package the appDid it compile?Build passed or failed
DeployBuild passedCopy the new version to a serverIs the app up and answering?Deployment status
BackupEvery nightCopy the database to storageIs the copy complete and readable?Backup report
MonitoringEvery minuteCall the websiteFast enough? Any errors?Alert to the on-call person
TestingNew version deployedRun the test casesDoes the app behave as expected?Test report, pass or fail

The last row is test automation. It is not a separate world. It is the same idea pointed at one job: checking that the software still does what it should. Test Automation Fundamentals zooms in on that row.

Tips​

  • Automate a messy process and you get a fast messy process. Fix and simplify the manual steps first, then automate them.
  • Do it by hand a few times first. You cannot write down steps you have not done yourself. The manual runs show you the exceptions the machine must handle.
  • Decide who reads the report before you build. If nobody owns the alert, the check is wasted.
  • Count the payback. Time to build plus time to maintain, against time saved per run times the number of runs. A task done weekly for years almost always pays back; a one-off rarely does.