• 0 Posts
  • 48 Comments
Joined 2 years ago
cake
Cake day: October 23rd, 2023

help-circle








  • Either way gets me to a passing test, but I prefer the latter because it enables me to write another failing test.

    But you could just write that failing test up front. TDD encourages you to pretend to know less than you do (you know that testing evenness requires more than one test, and you know the implementation requires more than some if-statements), but no-one has ever made a convincing argument to me that you get anything out of this pretence.

    Tests should make changing your system easier and safer, if they don’t it is typically a sign things are being tested at the wrong level

    TDD is about writing (a lot of) unit tests, which are at a low-level. Because they are a low-level design-tool, they test the low-level design. Any non-trivial change affects the low-level design of a component, because changes tend to affect code at a certain level and most of those below it to some degree.


  • When faced with a failing test, you make it pass as simply as possible, and then you summon all your computer science / programming experience to refactor the code into something more elegant and maintainable.

    Why bother making it pass “as simply as possible” instead of summoning all that experience to write something that don’t know is stupid?

    TDD doesn’t promise to drive the final implementation at the unit level

    What exactly does it drive, then? Apart from writing more test code than application code, with attendant burdens when refactoring or making other changes.



  • As the existing reply stated, there are only ever finitely many tests.

    My issue with TDD is that it pretends to drive the final implementation with tests, but what is really driving the implementation is the monkey at the keyboard thinking, “testing for evenness should be done with the modulo operation,” not exhaustive tests.





  • It’s a shame that you’re so quick to express skepticism but so reluctant to do any research of your own, because the facts are a bit embarrassing with the exact same trend in the USA as in the UK.

    Driver safety peaks in the 60s, and only moderately worsens after then. The large increase in fatal accidents, by the way, is clearly a result of older drivers being more vulnerable in a crash - because the chart at the bottom doesn’t show any such large increase for passengers and others.

    I’m interested to know if this changes your mind.


  • That doesn’t affect the ability of older drivers, only the number of them.

    In fact, since one reason very old drivers might get more accident prone is because they stop driving as much and lose some of the skills, you would expect that, if older Americans really persist in driving more as they get older (you haven’t provided any evidence that they do) they would retain those skills and be less accident prone, not more, so would be safer, and less at need of re-tests, than their UK counterparts.

    Focusing on the driving safety of the elderly is a classic example of Saliency Bias. A 20-year old kid wrecking his car is nothing unusual so you don’t remember it when thinking about safety. An 80 year old who can’t even remember which way to turn the wheel getting in a wreck is unusual and extreme, so it’s more salient. Getting stuck behind an elderly driver gives you the impression that they’re a bad and hence unsafe driver, which contributes to this.