The golden rule:
When you write a function, write a set of tests to go with it.
It is hard to overstate the importance of automated testing. It gives you peace of mind.
When you change some code, you can simply rerun your test suite and ensure that nothing has been broken.
The key is to fully automate the testing. Your project should have a single function that runs all tests in order.
All programming languages have unit testing frameworks that make it easy to automate this process. Julia's is described here.
The testing framework (and really all of Julia) is designed to work with packages.
But we can explore the basics even without creating a package (yet).
The key elements are:
@test 1 == 1runs silently
@test 1 == 2produces an error, but tests keep running
@testsetmacro groups tests for clearer reporting.