News for hackers. Stuff that matters.
Re:The Generational Divide in Software Developers by js8 on Sunday July 25, 2021 @06:57AM (#27948253)
Are you saying you want to replace the specification with tests? That's really dubious to me.

I don't think it really helps software development, if instead of "here's the description of what we need to do" the SW developer gets "here's a few examples of what we need to do" (albeit if the examples can be automatically verified).

If that's NOT your intent, what's the role of specification in the TDD, and how it's interacting with the implementation and the tests?

Re:The Generational Divide in Software Developers by vikingerik on Monday July 26, 2021 @01:01PM (#27961911)
> Are you saying you want to replace the specification with tests? That's really dubious to me.

That's pretty much it. The value is that tests can be automatically executed and verified. A specification document can't.

Writing a spec is still a step in the process - a bootstrapping step. The spec is a "write one to throw away" placeholder until you get far enough that the spec can be replaced with executable tests.

Re:The Generational Divide in Software Developers by js8 on Monday July 26, 2021 @04:39PM (#27965145)
I don't think tests can ever replace specification, it's like trying to replace a mathematical proof with a computer experiment. Unless it's something like property-based tests, but even there..

My take on specification is that you encode it to be executable as your program, during development. Ideally, the program should encode the specs in the most straightforward way possible. To "specialize" the spec into tests first and then "generalize" it again from tests into a working program seems like unnecessary hassle, and frankly prone to information loss.

It's interesting, because as I state in another comment, I have a big disagreement with a guy who loves TDD. I guess I am a theorist (I derive my feeling of correctness from simplicity of the code) and he is an empiricist (he derives his feeling of correctness from many small tests), and it somehow defines our approach.

Re:The Generational Divide in Software Developers by loopz on Sunday July 25, 2021 @08:33AM (#27948714)
It's just the idea behind Test Driven Development, that tests drive development. It won't be very effective as a handover, though could be used as acceptance criterias if that is needed.

The adherents really want tests to be the specification, as a way to be measurable / testable. Specs may be converted to tests.

But most of it is theory. It all depends, as usual, on the dev(s) and circumstances.

Re:The Generational Divide in Software Developers by fatnoah on Monday July 26, 2021 @12:58PM (#27961863)
My one and only truly TDD project went brilliantly, but there were specific circumstances. In this project, I created the back-end and API while an outsourced team built the UI. What made it work well was that I wrote the tests AND the spec at the same time, and kept both up to date. Completed tests equalled progress on the back-end, made it easy to identify any regressions in my own code, and clear differentiated between logic and general HTTP plumbing errors.