I'll start with one of the most basic testing fundamentals. It is also one that you will likely find applies in your day-to-day software development.
When you make a software change like adding new behavior or changing existing behavior, you need your testing to prove 3 things:
-
Your changes result in the desired new or changed behavior. With your changes, the test passes.
-
It IS your changes that result in the new or changed behavior. Without your changes, it does not behave in this new/changed manner. Without your changes, your test(s) fails.
-
Finally, your changes do not change the other existing behaviors that should not change, thus causing these other existing behaviors to regress. Your previous tests for these other existing behaviors still pass.
This is the basis of Verification Testing.
The first point is the obvious one, the second point is more subtle and is the one that many developers miss or forget. I myself have often made this mistake. Note that Test-Driven Development inherently addresses these two points.
The third point of not breaking what is already working is why you want to automate your testing. Manually testing everything that has been built and tested before is costly in time and effort and not testing it is risky to your business if something breaks.
Finally notice that the new tests you develop today to satisfy points one and two become tomorrow's tests for point 3.
⏭️ Fundamentals of Testing 2: What Values to Test - Boundary-Value Analysis