News for hackers. Stuff that matters.
Re:Ask HN: As a CTO, what is your most frustrating problem w... by pmarreck on Tuesday July 24, 2018 @10:29AM (#17601319)
> Big rewrites cause big issues.

Those issues are very much constrained by a very good test suite.

Re:Ask HN: As a CTO, what is your most frustrating problem w... by carlmr on Wednesday July 25, 2018 @02:40AM (#17607289)
I'm just going to ask which company you've been at that a) needed a big rewrite and b) had a "very good test suite". In my experience there's not much overlap here, especially because one of the reasons why a) is necessary is often that there's so little modularization that b) is not possible to exist.
Re:Ask HN: As a CTO, what is your most frustrating problem w... by pmarreck on Thursday July 26, 2018 @09:40AM (#17617381)
> a) needed a big rewrite and b) had a "very good test suite"

Desk.com has a gigantic Rails codebase and a test suite that runs for... well when I left them it was 40 minutes long but it's probably longer now. But it did save us many many times.

I'm working at another company right now (can't disclose) and they also have a rather large Rails codebase and a fairly good test suite.

I think the Rails community historically has been pretty great at communicating good test/design decisions, so the modularization issue you mentioned is largely moot.

Re:Ask HN: As a CTO, what is your most frustrating problem w... by carlmr on Monday July 30, 2018 @10:12AM (#17644501)
Like I said, you wouldn't want a huge refactor of the code there, because it's already tested and probably very testable the way it is. Otherwise it wouldn't have this good test suite.

Modularization is the issue, not size. If you have a big project and it's nicely modularized you probably already have good tests for it, but don't need to refactor. If it's big and needs a huge refactor it's probably hard to test and doesn't have appropriate tests.

Re:Ask HN: As a CTO, what is your most frustrating problem w... by waterlink on Tuesday July 24, 2018 @10:35AM (#17601371)
Unless your test suite needs a rewrite, as well…

(Better refactor, of course)

Re:Ask HN: As a CTO, what is your most frustrating problem w... by camgunz on Tuesday July 24, 2018 @12:01PM (#17602249)
Your test suite should essentially be your requirements. If it's out of date, it's the first thing you should update. Adding features or changing your requirements without updating your tests is the essence of tech debt: you're delivering features quickly at the expense of future work and brittleness.

I agree it's pretty common though. I've also seen huge test suites of only unit tests, no integration tests. As a result, you have no assurance that your refactors work because changing the inner workings fundamentally requires you to change the unit tests too, and nothing checks the top-level interface.

Re:Ask HN: As a CTO, what is your most frustrating problem w... by Shorel on Tuesday July 24, 2018 @01:43PM (#17603328)
You either rewrite the tests, or the code.

Not both at the same time, in my opinion.

Re:Ask HN: As a CTO, what is your most frustrating problem w... by collyw on Tuesday July 24, 2018 @10:42AM (#17601428)
You mean a test suite that will take longer to write than the rewrite?
Re:Ask HN: As a CTO, what is your most frustrating problem w... by maxxxxx on Tuesday July 24, 2018 @10:46AM (#17601473)
He means one that slowly goes out of date because nobody has the time to change it when the requirements change.