News for hackers. Stuff that matters.
Re:What I wish I knew when I became CTO by wolco on Tuesday February 13, 2018 @08:40PM (#16372702)
If there is never enough time to refactor and new features are always being pushed when does anyone have time to write new tests.

Tdd helps focus and structure some developers but rarely does it save time. In situations where everyone is being pushed too hard for too long saving time is more important. I would bet documentation is also a low priority.

Re:What I wish I knew when I became CTO by kaeawc on Tuesday February 13, 2018 @09:13PM (#16372876)
> If there is never enough time to refactor and new features are always being pushed

That is a sign of bad culture, both in engineering and product. Whether its starting a green-field project in a scrappy startup or building yet-another-feature for an established product if the estimates are constantly redlining everyone's available time and never giving thought to maintenance, QA, testing, code review, and testing then of course it will always feel like that. When estimates include that stuff and you show product you can ship features more reliably more often in the long run, they buy into that. If they don't buy into that they are either very delusional, have only worked with absolutely perfect people, or they utterly do not care how many extra hours / stress the lack of quality causes you / the team / the company.

Re:What I wish I knew when I became CTO by wolco on Tuesday February 13, 2018 @10:11PM (#16373119)
And in a bad culture other priorities can be more important. As an employee your job is to adapt and support the business. Writing tests in a culture that doesn't value the time spent is not helpful.
Re:What I wish I knew when I became CTO by nine_k on Tuesday February 13, 2018 @10:59PM (#16373351)
The problem is that the "bad culture" wastes more time and mental strain on addressing the consequences of the lack of tests than it would spend maintaining a proper test suite.

This waste exhausts morale.

Re:What I wish I knew when I became CTO by latch on Tuesday February 13, 2018 @08:53PM (#16372782)
Tests don't cost time.

Not true 100% of the time, but it's the right "default" mindset, because it's true the majority of the time.

Re:What I wish I knew when I became CTO by dionian on Tuesday February 13, 2018 @10:51PM (#16373314)
tests do cost time, but an investment in an automated test can save orders of magnitude greater time than it takes to write them... in the end, automated tests save a lot of time, as long as they (A) cost relatively little to maintain and (B) provide a reasonably useful guarantee of quality
Re:What I wish I knew when I became CTO by wolco on Tuesday February 13, 2018 @10:19PM (#16373155)
From a pure number of keystrokes tests can add time.

If you know exactly what to write because you have done this 100s of times before tdd will slow you down.

If you are unsure of what the outcome of what you write tdd will give you training wheels and help guide you. That may make some quicker for a little while.

Re:What I wish I knew when I became CTO by hinkley on Wednesday February 14, 2018 @01:36AM (#16373949)
Pay attention, because it’ll be a while before anyone tells you this again: You are the sort of person people in this thread are warning others about.

Nobody who ‘needs training wheels’ is going to get them from/do TDD.

I’m more concerned about people who think they can fly without learning to walk.

Most of us can type 60-80 wpm. Have you ever gotten close to that while coding? Typing is incidental. The very easiest part of your day. You’re right, they type less, because they’re so into the smell of their own farts that they refuse to believe their bugs are bugs, and they make other people clean up after them.

Humans are fallible. We all have bad days. We all get distracted. We all misunderstand. We all change our minds. Don’t be so sure you got it right the first time. Even if the evidence supports you. You’ll be looking at a broken piece of code soon enough that you can’t figure out how it ever worked. Sooner or later it’ll be yours.

Re:What I wish I knew when I became CTO by tejasmanohar on Wednesday February 14, 2018 @04:44AM (#16374687)
>If you know exactly what to write because you have done this 100s of times before tdd will slow you down.

I once had this attitude. Then, I worked with other people. It makes all the difference. My perspective shifted when I was bitten by something small when making a small patch to a foreign system because someone else didn't leave good test cases behind.

Re:What I wish I knew when I became CTO by krmboya on Tuesday February 13, 2018 @10:28PM (#16373205)
I find that when working in a team, tests help save time by preventing people from stepping on each others' toes, breaking existing functionality
Re:What I wish I knew when I became CTO by rowyourboat on Wednesday February 14, 2018 @03:56AM (#16374498)
> If you are unsure of what the outcome of what you write tdd will give you training wheels and help guide you. That may make some quicker for a little while.

In my experience, if you are unsure of how you are going to solve a problem, writing test only makes you slower. When you are coding exploratively, you will likely have to delete and completely rework what you did several times before you find what works. If you write tests for all but the highest level, those will just be scrapped along with the rest of the code.

Re:What I wish I knew when I became CTO by threeseed on Tuesday February 13, 2018 @11:53PM (#16373577)
Of course tests costs time. You are often writing twice the amount of code and there is the amount of time it takes for most CI systems to run all of the tests (often tens of minutes, but I've worked on hours).

But the reason we do it is because it increases quality.

Re:What I wish I knew when I became CTO by snowwrestler on Wednesday February 14, 2018 @12:13AM (#16373647)
I think the theory is that increasing quality will save time in the long run via fewer regressions and bug reports.

Making that math work, though, seems to depend on the idea of some sort of future crisis state, where normal development is slowed way down. (You'd need to avoid a big slow down in the future, in order to balance out the continuous extra time given to testing.)

Does such a crisis lurk in the future of every development effort? Hard to know. It's certainly not the only way technology projects fail. Plenty of products have passing tests but fail to find customers.

Re:What I wish I knew when I became CTO by dangero on Wednesday February 14, 2018 @12:50AM (#16373776)
Exactly. It’s likely for some projects every line of code you write will in the end be a complete waste. TDD is only worth the trouble assuming any of the project succeeds. If not it may just be more wasted effort. For this reason I think a case can be made to skip TDD on MVP traction tests in some cases.

A friend of mine just had his startup acquired, so his startup was an above average success and he told me 80% of what they built ended up getting scrapped.

Re:What I wish I knew when I became CTO by virtualized on Wednesday February 14, 2018 @09:40AM (#16375992)
The problem is you don't know which 80% will get scrapped.
Re:What I wish I knew when I became CTO by dangero on Thursday February 15, 2018 @06:45AM (#16383289)
I don’t see this as a problem as long as you make time to add tests later once you are convinced the code will be kept active through user traction.
Re:What I wish I knew when I became CTO by bkeroack on Wednesday February 14, 2018 @12:10AM (#16373633)
Tests absolutely cost time, inversely proportionate to the raw ability of the programmer. A 95th percentile engineer can write cowboy code with zero tests that largely works. Enforcing tests could cause up to a 50% slowdown. It’s probably worth it in the long run, but for a time and cash strapped startup its a legitimate cost/benefit analysis.
Re:What I wish I knew when I became CTO by pavel_lishin on Wednesday February 14, 2018 @11:37AM (#16377034)
God save me from code that "largely works".