Re:Kent Beck: “I get paid for code that works, not for tests...
by marcosdumay on Thursday December 08, 2016 @10:08AM
(#13130716)
You have to:
1. Have an overall idea of what your software will do before writing the first line of code.
2. Challenge and change any touched assumption from #1 during development when you refine that idea.
3. Test that the program satisfies your refined idea after it's written.
4. Create some assurance you'll keep #3 correct while you write any further code later.
However you fulfill those needs, if you got them all, you are good.
1. Write tests to prove your code works, which is sometimes referred to as "test-driven development"
2. Write tests to catch any side effects or regressions when altering code
Funny thing is that if you write good tests, then the results are pretty much the same regardless of your motivation.