you are viewing a single comment's thread
view the rest of the comments
[–] 13 points 3 days ago (7 children)

Designing your unit tests before you've written your algorithm is - in my experience - a bit ass backwards.

  • source
  • parent
  • hideshow 10 child comments
  • [–] 2 points 3 days ago (6 children)

    Agreed, you find the right shape for the code as you build and try stuff, adding the tests right after makes most sense, unless maybe you're just testing an API or something

  • source
  • parent
  • hideshow 8 child comments
  • [–] 3 points 2 days ago (5 children)

    I mean I'm theory for any planned method you would know the input and expected output before the coffee is written.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 1 point 2 days ago

    As I said, an interface can easily be tested, but if it's internal implementation I normally make a design, implement it, and I usually come up with other ideas and I like having the fluidity of making changes as I prototype and such, that way I'm not constrained by a test yet. After I'm done, and documented my choices if necessary, then I add the tests.

  • source
  • parent
  • load more comments (4 replies)
  • load more comments (4 replies)
  • load more comments (4 replies)