• CanadaPlus@lemmy.sdf.org
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 个月前

    At a certain level of detail, tests just become a debugger, right?

    I’m thinking of something like an implementation of Strassen’s algorithm. It’s all arithmetic; you can’t really check for macro correctness at a micro point without doing a similar kind of arithmetic yourself, which is basically just writing the same code again. It resembles nothing other than itself.

    • leisesprecher@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      1 个月前

      And who actually writes tests like that?

      I mean, do you think tests do the calculations again? You simply have well defined input and known, static output. That’s it.

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 个月前

        Yeah, you definitely run fixed tests on the whole thing. But when it returns indecipherable garbage, you’ve got to dive in in more detail, and at that point you’re just doing breakpoints and watchpoints and looking at walls of floating point values.

        I suppose Strassen’s is recursive, so you could tackle it that way, but for other numerical-type things there is no such option.