..Another lunch break, and Quora suggests that I might be the right person to answer this question.
Why, yes, I’m taking on it.
“Why should I test my program?” – Answer:
As a tester, I avoid jumping into conclusions. We know little from this question.
Let’s analyze possible points of concerns.
/Why/ should I test my program?
So the question is about reason?
Generally speaking, reviewing work is a way to understand what you’ve got. While creating something, people are focused on the model in their head and operations they’re performing. It requires to take a step back and review (that is, test) the actual creation. It doesn’t have to be upon completion of work, either.
In software development business, the purpose of testing is to provide an actionable feedback. If feedback is absolutely not needed then there’s no reason to test. And if it’s needed then testing approach and execution better be shaped by that need.
Speaking of non-business reasons, we may suppose education, entertainment, or exotic reasons. If that’s the case the author of this question should know “why”. Maybe you should test because your program will have only one chance and your life depends on it.
Why /should/ I test my program?
Should? Must? Have to?
It all depends on the reason and consequences.
Do you need information obtained through testing? For what? When? What kind?
Sometimes there are also “ceremonial” reasons (unfortunately). There might be a policy requiring to test the code before checking in. Or a team agreement.
Testing not shaped by real purpose is often misdirected and poorly performed.
Why should /I/ test my program?
It very well doesn’t have to be “you”.
Good testing requires a “critical distance”. See James Bach beautifully explaining critical distance:(begins at 26:52).
Paired programming, peer reviews, check-in triage exist to ensure more thorough testing than with a single pair of eyes.
Plus, you might need to do another more important or more urgent tasks, so someone else might give you a hand.
Now, there are also systemic problems that require testing of the product as a whole in specific conditions in order to be discovered. Programmers often don’t have system testing skills, and it’s not their specialty after all.
Why should I /test/ my program?
The most important part here is understanding what is “testing”.
I think of testing as a performance, critical thinking combined with empirical evaluation on the product.
Questions to consider – what is the purpose of testing? How should you test? For how long?
Programmers also often resort to checking instead of testing (Useful reference:). Checking is indeed important, and in specific circumstances is what you need to do instead of testing.
However, it’s important to understand risks and limitations of checking, and make a responsible decision.
Why should I test /my/ program?
Depending on the reasons, you might be specifically interested in testing your own creation, or – say, if it’s a learning exercise, it might be better if you test your colleague’s program while she tests yours.
Why should I test my /program/?
Testing code unit and testing the whole product have different purposes.
If all parts of the system were tested, it doesn’t mean that the whole system was tested. Testing at the system level does not necessarily provide needed coverage for the unit tests.
With all that said.. Should one test her/his own program and why really depends on the context.
What is universally “a must have” – an inquisitive and critical thinking mindset for software engineers.