rockerest’s avatarrockerest’s Twitter Archive—№ 18,492

        1. I have a JavaScript assertion. ☝🏻 You could delete 100% of your tests - including the entire testing framework - and your current and future defect rate would DECREASE. 🐛⬇️ All you would have to do is strictly enforce this ESLint rule: "complexity": [ "error", 3 ]
      1. …in reply to @rockerest
        My underlying theory is that the REASON people feel more secure with tests written 3x-5x the amount of feature code is that the feature code is so overly complex that you cannot assert that it is functioning correctly by simply looking at it.
    1. …in reply to @rockerest
      "complexity": [ "error", 3 ] may preclude certain patterns. Certainly the jaw-dropping trend of "just put everything in a big switch statement" is absolutely out. Your favorite over-engineering global variable is probably out (Redux/Vuex).
  1. …in reply to @rockerest
    In return, you get massively simplified software architecture, an 80% reduction in source code (tests are code you have to maintain!), and drastically reduced time to understand any individual chunk of code which cascades into decreased time to understand the entire system.
    1. …in reply to @rockerest
      Unfortunately, the dogma of unit tests is so deeply embedded in pop-dev and corporate development culture, there's essentially no way to scientifically test this assertion. Companies built testing into their development culture...
      1. …in reply to @rockerest
        Some people won't even look at an open source library if it doesn't have high-90s test coverage. Developers have been trained that "software is too complex to trust" so they write tests (which is more software).
        1. …in reply to @rockerest
          What we should be training is "if you need unit tests to ensure this is working properly, it's too complex."