Comment by yakshaving_jgt

5 years ago

That is demonstrably false.

You can absolutely write DSLs, mocks, and spies in a statically-typed language.

Maybe that's possible in theory but I've never encountered a statically language where I consider the testing frameworks "good enough".

  • I'm not sure what to make of that. Maybe you just haven't bothered to look? You personally not knowing about something is a reflection of your own knowledge, and not of the state of the world.

    • No, I've look enough I think. Maybe those better frameworks do exist though indeed, but I have no proof of that. Usually they just have the bare minimum of assert checks and call it a day.

      A testing framework should be able to mock and patch any class (or applicable) of the running instance of the program without modifying your code for example, tell me if a method was executed or not, intercepting all HTTP requests without changes, have complex assertion partially matching objects, factories, change the current time... I could add a lot more here.

      All of that is necessary harder I think in a static typing environment.

      2 replies →