• Kache@lemmy.zip
    link
    fedilink
    arrow-up
    15
    arrow-down
    1
    ·
    14 hours ago

    This is merely one instance/example of a deeper principle: avoid mixing layers of abstraction

  • jokro@feddit.org
    link
    fedilink
    arrow-up
    15
    ·
    18 hours ago

    There is also this gem in the post:

    You shouldn’t be mocking your methods, you should mock your IO. And, similarly, you shouldn’t test methods, but rather software functionality

    I totally agree! With containers you might not even have to mock your IO but can check if the application behaves correctly.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      11
      ·
      15 hours ago

      Unit and method tests are still useful to quickly find where the issue occured. If you just test the input and output of the program, no its individual units, then in an error case you still need to figure out where it exactly went wrong. So in short, its not just to check if program behaves correctly, unit tests also helps debugging.

  • jtrek@startrek.website
    link
    fedilink
    arrow-up
    8
    ·
    16 hours ago

    This is saying if you have a module with public functions A and B, they shouldn’t call each other, right? But it’s not saying that module A shouldn’t call module B’s public functions. That’s what I thought it meant at first, but that seems crazy.

  • MagicShel@lemmy.zip
    link
    fedilink
    English
    arrow-up
    7
    ·
    19 hours ago

    I think the headline doesn’t convey the substance of the article, but this is spot on. I just ran into a small, fixable problem my developers had created by doing that just this week.

    It was easily fixed, but it shouldn’t have been done that way in the first place.

      • MagicShel@lemmy.zip
        link
        fedilink
        English
        arrow-up
        9
        ·
        18 hours ago

        Ironically in this case the bug was in the MVC controller and fixed as part of a ports-and-adapters AOP audit implementation. MVC isn’t immune to it. It was a controller endpoint calling another controller endpoint, because someone was doing a bit of business logic there rather than in the service.

        Yes, had they implemented MVC properly they wouldn’t have done that. Anyway your point is well taken but as it happens in this case, the deities of irony conspired against you today.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      15 hours ago

      I think the headline doesn’t convey the substance of the article

      I see two reasons this could be: a) either it is by design, so people click and read it, or b) he couldn’t figure out a good and short title that conveys the article. So in other words either clickbait or skill issue. :D (I’m just joking here!)