Some TYPO3 extensions and a lot of the TYPO3 core have unit tests that can be run with PHPUnit. You can use the TYPO3 PHPUnit extension to run them in the TYPO3 backend, but clicking buttons with the mouse is not something I like to do repeatedly during development.
Running the tests on the shell is easy - but you still need the TYPO3 PHPUnit extension because it provides bootstrapping code and base test classes. Simply run the CLI dispatcher with phpunit and the full path to the test file:
$ typo3/cli_dispatch.phpsh phpunit\ typo3/sysext/backend/Tests/Unit/Form/FormEngineTest.php
You may also pass a directory instead of a file, which runs all files in and below that directory.