jroid8@lemmy.world to Programmer Humor@lemmy.ml · 1 year agoTests are code toolemmy.worldimagemessage-square51fedilinkarrow-up1496arrow-down110
arrow-up1486arrow-down1imageTests are code toolemmy.worldjroid8@lemmy.world to Programmer Humor@lemmy.ml · 1 year agomessage-square51fedilink
minus-squaretoastal@lemmy.mllinkfedilinkarrow-up0arrow-down1·1 year agoIf you use your type system to make invalid states impossible to represent & your functions are pure, there less—maybe nothing—to test, which will save you from this scenario.
minus-squarejjjalljs@ttrpg.networklinkfedilinkarrow-up5·1 year agoNothing to test? Lol what. def add(a: int, b: int) -> int: return a * b All types are correct. No side effects. Does the wrong thing.
minus-squareMyNameIsRichard@lemmy.mllinkfedilinkarrow-up1arrow-down1·1 year agoMaybe it’s doing the right thing but is badly named
minus-squaremagic_lobster_party@kbin.sociallinkfedilinkarrow-up2·1 year agoMaybe the it’s the English language that is wrong?
minus-squaredan@upvote.aulinkfedilinkarrow-up2·edit-21 year agoOld and busted: Fix the function New hotness: Redefine enough words in the English language such that the function is now correctly implemented
minus-squarejmcs@discuss.tchncs.delinkfedilinkarrow-up1·1 year agoIt must be nice to work only with toy cases where this is feasible.
If you use your type system to make invalid states impossible to represent & your functions are pure, there less—maybe nothing—to test, which will save you from this scenario.
Nothing to test? Lol what.
def add(a: int, b: int) -> int: return a * b
All types are correct. No side effects. Does the wrong thing.
Maybe it’s doing the right thing but is badly named
Maybe the it’s the English language that is wrong?
Old and busted: Fix the function
New hotness: Redefine enough words in the English language such that the function is now correctly implemented
It must be nice to work only with toy cases where this is feasible.