News for hackers. Stuff that matters.
Re:Ask HN: What change in your programming technique has bee... by twh270 on Thursday January 23, 2020 @03:55PM (#22131911)
I'm not even thinking about "how it's going to get built" when I write test-first. I'm just writing (test) code as a client that's calling an API. It just so happens that the API (method, or method + object) in question doesn't actually exist yet, so the first thing I do is let the IDE generate them so it compiles.

Once the code compiles I go into the implementation and make it work.

Now and then I realize during implementation that I need some additional parameter, but it's easy to add that.

Re:Ask HN: What change in your programming technique has bee... by fjp on Thursday January 23, 2020 @04:29PM (#22132335)
I guess to me:

1) Writing a test that calls an API and asserts that everything resulted correctly from it is more of an integration test in my opinion - in this case I can agree this can be written beforehand.

2. If I'm changing my tests as I write my code then it doesn't matter if I go test-code-test-code vs code-test-code-test. I have still changed my definition of "correct" on the fly based on something I found out as I implemented.