Hacker News new | ask | show | jobs
by robotnoises 3480 days ago
To me there are two automated testing philosophies:

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.

1 comments

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.