• 0 Posts
  • 158 Comments
Joined 3 years ago
cake
Cake day: June 22nd, 2023

help-circle













  • You’re both right. You’re both wrong.

    • You write tests for functionality before you write the functionality.
    • You code the functionality so the tests pass.
    • Then, and only then, the test becomes a regression test and is enabled in your CI automation.
    • If the test ever breaks again the merge is blocked.

    If you only write tests after you’ve written the code then the test will test that the code does what the code does. Your brain is already polluted and you’re not capable of writing a good test.

    Having tests that fail is fine, as long as they’re not part of your regression tests.







  • wewbull@feddit.uktoProgramming@programming.devLiterate Programming
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    7 months ago

    I’ve tried this a few times. I don’t think it works.

    Basically the way you want to explain a piece of reasoning , and the order in which things need to be defined for a program, are different. You end up either making the document match the code structures, or the code structure match the document. Both are bad.