How would you know what you’re going to need or what it can do before you code it ?

@Hexorg@beehaw.org
link
fedilink
7
edit-2
1Y

The Test part of TDD isn’t meant to encompass your whole need before developing the application. It’s function-by function based. It also forces you to not have giant functions. Let’s say you’re making a compiler. First you need to parse text. Idk what language structure we are doing yet but first we need to tokenize our steam. You write a test that inputs hello world into your tokenizer then expects two tokens back. You start implementing your tokenizer. Repeat for parser. Then you realize you need to tokenize numbers too. So you go back and make a token test for numbers.

So you don’t need to make all the tests ahead of time. You just expand at the smallest test possible.

It also forces you to not have giant functions.

No, being unable to read giant functions is what forces me not to have giant functions.

My friend, let me tell you a story during my studies when I had to help someone find a bug in their 1383-line long main() in C… on the other hand I think Ill spare you from the gruesome details, but it took me 30 hours.

Case in point, actually. Whenever I’m forced to write a giant function, I always get nervous because it could be crawling with bugs that I have little hope of spotting.

I don’t know if you’re joking or not. I suppose tdd will help know what you need before you start.

Spike
link
fedilink
151Y

There’s some things called software architecture, requirement engineering and software design. More dev teams should try this.

You don’t write a whole app in tests and then write the whole app in code, you make tests for the functionality as you go.

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 77 users / day
  • 211 users / week
  • 413 users / month
  • 2.92K users / 6 months
  • 1 subscriber
  • 1.53K Posts
  • 33.8K Comments
  • Modlog