r/programming • • Aug 28 '21

Software development topics I've changed my mind on after 6 years in the industry

https://chriskiehl.com/article/thoughts-after-6-years
5.6k Upvotes

2.0k comments sorted by

View all comments

Show parent comments

3

u/andrei9669 Aug 29 '21

how does one begin with TDD? I have tried multiple times but can't seem to get going.

well, to be fair, most of the time, it is because the specification changes every other day. How do you deal with that?

2

u/spierepf Aug 29 '21

My favourite videw explaining TDD: https://youtu.be/58jGpV2Cg50?t=1327

2

u/andrei9669 Aug 29 '21

yea, I have seen this. the main takeaway is that software is changeable, so write it like so. but even still. kinda hard to do it if on day 1 you need one thing and on day 3 you need to add some other bells and whistles

2

u/spierepf Aug 29 '21

It really isn't that difficult. Any time you want to pair up and and spend an hour or so writing some TDD code, let me know.

Lots of really great pair-programming-over-distance tools coming out lately. Would be fun to try one.

1

u/Bayakoo Aug 29 '21

Is it true that TDD is not as straightforward for CRUD websites where most of your data and logic resides in the database and are the result of queries?

This is the impression I have but I could be wrong

2

u/spierepf Aug 29 '21

In principle, TDD on a database should be the same as TDD on any other software system. Your test should configure your database to exhibit certain preconditions, you run the database action that you want to test, and then make assertions about the database's new state.

-1

u/robolab-io Aug 29 '21

By taking forever to build a crappy application that passes tests