Cli Testing
CLI testing verifies software functionality through a command-line interface instead of a graphical user interface.
“Testing performed by submitting commands to the software under test using a dedicated command-line interface.”
(Definition reproduced from the ISTQB Glossary. Copyright belongs to ISTQB.)
View the complete ISTQB GlossaryWhat is Cli Testing?
CLI testing checks commands, parameters, outputs, error handling, and scripting behavior to ensure command-line applications function correctly.
Command validation: Verify valid and invalid commands.
Automation friendly: CLI applications are easy to automate using scripts.
Error handling: Test invalid syntax and unexpected input.
Real World Example
A DevOps team builds a custom "deploy" command that developers use in CI/CD pipelines, alongside a GUI dashboard that performs the same action.
The team thoroughly tests the GUI flow, but the command-line tool — which pipelines actually depend on — gets left out, so a bad exit code on the CLI could silently break every automated deployment without a human ever seeing it happen.
The tester designs Cli testing specifically for this tool: verifying each command's flags and arguments including invalid and missing ones, checking that exit codes are correct for both success and failure since CI scripts branch on exit code rather than visual feedback, and confirming error messages printed to stderr are clear enough to act on.
The tester finds the deploy command returns exit code 0 — success — even when the underlying deployment actually failed, a defect invisible in a human-run GUI check but one that would have silently broken every pipeline relying on that exit code, caught specifically because Cli testing treats exit codes as a first-class concern.
Practice Questions
Question 1
Which assertion is MOST important for CLI reliability?
Question 2
Which test BEST validates portability?
Test your knowledge with real ISTQB-style questions
You’ve learned Cli Testing. Test your understanding with topic-specific questions in our Mock Exams.