4 ms·
I wish he talked about specification's real problem. There are many ways out there to write specifications. Some are good, some are bad. Let's assume we got a
by hibikir 13y ago
I wish he talked about specification's real problem.
There are many ways out there to write specifications. Some are good, some are bad. Let's assume we got a very good one. Then let's say I actually implement the specification correctly. So now I have a program and a spec it matches.
But then comes the problem: My application needs to change. Along with it, we need to change the specifications. If said specifications are too high level, then we start changing code without changing spec, and it doesn't take long before the spec is a dead document. If the spec is too low level, then change is hard, because the specification's friction becomes unbearable quickly.
So the problem quickly becomes the fact that writing specifications isn't really any easier than writing the code. It's the same problem that plagues many testing suites in practice: They either test too little, or test so much they increase the cost of development way past their value.
I am not saying we should not write tests, or specs. But what I really want to know is how to write a good spec, or a good test suite, because if those are bad quality, they actually become detrimental. At work, I just spent a solid two weeks trying to fix extremely overspecified tests: Hundreds of them that should have never been affected by the code changes. The people that write such tests will probably write terrible specifications that are just as brittle.
So don't show me a new specification language: Show me how said language makes it easy to write good specifications, and hard to write bad ones.
- auggierose 13y agoIf you cannot write good specifications, then probably you shouldn't, except for exercise purposes. There are then two possibilities: 1) you work in a team where there is a job for someone just implementing specs instead of coming up with good ones (usually such a team is mediocre at best) 2) you should be fired and replaced by someone who can write good specs.
- grogers 13y agoWriting a formal specification using something like TLA+ is actually very much like writing unit tests. Therefore, many of the same problems apply. The main difference is that you are testing your design, not the implementation. You are trying to work at a much higher level than the actual code. That's why it is most useful for checking concurrency. It is hard for humans to mentally think about all possible interleavings of events, hard for fuzz testing to catch rare interleavings, but very easy for a computer to check all possibilities with breadth-first search. By no means are specifications a complete answer, even making sure your implementation implements the spec is hard. But it is another useful tool in the arsenal.
- deleted 13y ago[deleted]