News for hackers. Stuff that matters.
Re:Why was "goto fail;" added without any other change to th... by homakov on Friday February 28, 2014 @09:55AM (#7318960)
More importantly, why Apple doesn't run test suites, basic checks? Test driven development must be everywhere
Re:Why was "goto fail;" added without any other change to th... by danpalmer on Friday February 28, 2014 @10:10AM (#7319071)
Test driven development is actually quite uncommon in many parts of the industry.

Sure the startup culture and new breed (new bubble?) tech companies mostly emphasise it, but among older companies it's much less common for a few reasons:

1. It just wasn't considered normal practice until fairly recently. 2. They often use 'lower level' languages, and as @raverbashing mentions, they're more difficult to test. 3. The companies are much slower moving, so arguably have less of a risk with not having automated testing. Automated testing has more benefits in agile than it does in the waterfall methodology.

Re:Why was "goto fail;" added without any other change to th... by laureny on Friday February 28, 2014 @10:14AM (#7319097)
TDD might be useful for unit tests (even that I'm not convinced of) but not for integration tests.

The bug happens very deep inside the handshake protocol and it's extremely hard to test it automatically.

Re:Why was "goto fail;" added without any other change to th... by stcredzero on Friday February 28, 2014 @10:18AM (#7319134)
How about verifying a bad cert?
Re:Why was "goto fail;" added without any other change to th... by landypro on Friday February 28, 2014 @10:54AM (#7319420)
That's hardly an excuse given the significance of this code.
Re:Why was "goto fail;" added without any other change to th... by dllthomas on Friday February 28, 2014 @11:23AM (#7319664)
Right, this is a much stronger case for static analysis and warning-free builds. This change caused dead code. If that code was supposed to be dead, comment it out.
Re:Why was "goto fail;" added without any other change to th... by ryandrake on Friday February 28, 2014 @12:14PM (#7320042)
If the code is supposed to be dead, DELETE it. Do not comment it out.

If the code doesn't belong there, get rid of it. If, for whatever reason, you want to show the reader that code used to be there, delete it and leave an explanatory comment. If you're commenting it out because you're not confident in taking it out or you plan to re-enable it in the future, well, that's what you have source control for.

Re:Why was "goto fail;" added without any other change to th... by dllthomas on Friday February 28, 2014 @12:24PM (#7320113)
I don't agree. Or I do to a point, but it's a relatively weak point. I agree code should be yanked if there's no reason to be keeping it around. I don't think there's never reason to be keeping it around. Sending people to figure out which version of the repository had the relevant piece of code (which is now correspondingly less likely to have been updated at all when surrounding code changed) doesn't make sense if you genuinely expect it will be relevant again soon.
Re:Why was "goto fail;" added without any other change to th... by raverbashing on Friday February 28, 2014 @09:59AM (#7318980)
Because TDD in low level languages is a pain in the behind.

And sometimes impossible

In Python/Ruby sure, it's easy. In Java, or even C++, it's doable, but not great, and it requires some heavy tricks.

But they surely need tests, but not necessarily TDD.

Re:Why was "goto fail;" added without any other change to th... by homakov on Friday February 28, 2014 @10:12AM (#7319082)
Not testing everywhere, but "smoking test" that your SSL implementation protects from MITM, at all, and none of your programmers screwed it (with gotofail or anything else).

This is what I expect from an OS developers

Re:Why was "goto fail;" added without any other change to th... by raverbashing on Friday February 28, 2014 @10:17AM (#7319124)
Yes, something that would test all the steps of the SSL authentication and possible failures

Maybe the people from OpenSSL have some test like that already

Re:Why was "goto fail;" added without any other change to th... by nailer on Friday February 28, 2014 @10:10AM (#7319073)
Ack re: TDD, but integration tests with a bad certificate would have picked this up.
Re:Why was "goto fail;" added without any other change to th... by stcredzero on Friday February 28, 2014 @10:12AM (#7319084)
And sometimes impossible

I've been in that position. Sometimes with embedded, you can't have software fixtures, only hardware ones. (Bit banging)

Re:Why was "goto fail;" added without any other change to th... by raverbashing on Friday February 28, 2014 @10:22AM (#7319158)
Tell me about it

And you think you know what the device answers and understands, but there's usually some gotchas.