DEV Community

Discussion on: Tell me a coding confession

Collapse
 
molly profile image
Molly Struve (she/her)

I never practice TDD, I always write tests after I write the code. It just seems faster and easier 🤷

I also am not great with linux, I have to google simple command line commands all the time. I'm working on it though!!!

Collapse
 
ben profile image
Ben Halpern

TDD is incredibly unintuitive and the majority of developers do not use it.

It is a great skill to eventually take to IMO. But there’s no rush. It’s someyhing worth casually nibbling on until you find places it really clicks.

Collapse
 
alexayala profile image
Alex Ayala

I usually write my code first, add unit tests for new features/bug fixes, and then rely on my code coverage tool to tell me where I need to have more tests.

Collapse
 
andrerpena profile image
André Pena

TDD only comes natural to me when it actually improves my productivity, which happens around 10% of the time.

TDD is helpful when you are writing pure functions which the result is predictable. For example, if you are writing a function that uses Regex to transform a string, it is much easier to TDD it until it works than running your entire system on every change until it works.

Collapse
 
rhymes profile image
rhymes

I do hybrid testing, mostly after, sometimes TDD

I used to preach it but like all methodologies, it doesn't work all the time and requires a lot of discipline.

It's probably counter intuitive but I did a lot more TDD when I was a total noob, now I trust myself more. I have a mental map of most of the tests I have to write for the feature I have. If they are too many I write them in the ticket or a text file or whatever.

I think TDD shines with refactoring, more than for new features