3

Background. In a legacy product, we saw some tests start failing intermittently....

 1 year ago
source link: https://twitter.com/joshuamck/status/1572528796125003777
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Don’t miss what’s happening
People on Twitter are the first to know.

Tweet

See new Tweets

Conversation

Replying to

You mention two issues. With regards to short-circuiting, does it matter when the test passes?

And does it matter if you first wrote the first assertion, saw it fail, made it pass, checked in, and then added the second assertion?

Related:

Regarding the second issue, could it be resolved in other ways than duplicating the test?

In this particular example, duplicating the test seems innocuous, but in more realistic cases would it really make the code more maintainable to duplicate the arrange and act phases?

Image

I realise that my response could be construed as moving the goalpost.

To elaborate, I'm not against having only a single assertion. `Assert.Equal(expected, actual)` is my ideal.

Replying to
Background. In a legacy product, we saw some tests start failing intermittently. They weren’t just flakey, but also failed without providing enough info to fix. One of things which caused time to fix to increase was multiple ways of a single test to fail. 1/

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK