Test Failures Should Be Actionable
testing.googleblog.com
Test Failures Should Be Actionable
1–10 of 17 posts
Re: Test Failures Should Be Actionable
#2My favorite test framework of all time, rspec-given[1] (by the late, great Jim Weirich) solved this a different way by using AST introspection to extract both sides of a boolean expression and give a helpful message even with an assertion like: `Then { result == 7 }`
Re: Test Failures Should Be Actionable
#3Re: Test Failures Should Be Actionable
#4Regressions should be rare; if you get a test failure when you break something's public API then that is already a success - we had the right test case!
That you then maybe need to spend a few minutes finding out exactly what is failing, I can live with that.
Re: Test Failures Should Be Actionable
#5Re: Test Failures Should Be Actionable
#6TotT is one of those kinds of things that I really miss from Google. None of the TotTs were exactly groundbreaking, but they almost all made for excellent rules of thumb that would rarely ever be bad advice, and often times even if they seemed simple and obvious, you could still find places to apply them in your actual codebase. (TotT definitely nudged me into making some test improvements when I worked at Google.)
Re: Test Failures Should Be Actionable
#7With the rapidly increasing number of websites and applications that feel "an error occurred" is an acceptable error message, I'm glad someone is pointing out that failures should contain actionable information, but I'm also greatly saddened this is needed. I truly do not understand how anyone, much less developers, needs to be told that the content of an error message is important. It really boggles my mind. How is…
For websites, security is a big one. Detailed error messages can lead to information exfiltration, exploits, fingerprinting and generally bad things. Long error messages in some network protocols enable amplification attacks.
For general applications, there are commercial reasons. You don't want to enable your users too much, they should be incentivized to buy your pricey platinum premium package after all. Therefore an opaque error message, maybe with some error code but no text and no information, is necessary: The user will need to call support and get the error code decoded and be told in hour-long, tedious and expensive support calls how to fix the error. Actually actionable errors are what makes your company go bankcrupt, especially if you do freemium or OSS+support business models.
Re: Test Failures Should Be Actionable
#8(JS with Vitest, etc. is good, Rust - not so much)
Re: Test Failures Should Be Actionable
#9Re: Test Failures Should Be Actionable
#10With the rapidly increasing number of websites and applications that feel "an error occurred" is an acceptable error message, I'm glad someone is pointing out that failures should contain actionable information, but I'm also greatly saddened this is needed. I truly do not understand how anyone, much less developers, needs to be told that the content of an error message is important. It really boggles my mind. How is…