Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Testing is very important. Ok.

The problem I have with TDD is the concept of writing tests first. Tests are not specifications (in TDD world the line is blurred.) Tests are confirmation.

I develop my code (I write back end plumbing code for iOS currently) from a test frame work.

My flow:

* Specify. A weak and short specification. putting too much work into the specification is a waste. "The Gizmo record must be imported and decoded from the WHIZZBAZ encoding into a Gizmo object" is plenty of specification.

* Write code for the basic function.

* Write a test for validity of the code (the validity of the record once loaded in the Gizmo/WHIZBAZ case)

But the most important tests are small micro tests (usually asserts) before and after every major section (a tight loop, a network operation, system calls etcetera). More than half my code is that sort of test.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: