Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Setting Your Tests Up to Fail

Setting Your Tests Up to Fail

It’s a fact of life that we often have to write automated UI tests for features that have defects, or that interact with 3rd party APIs that aren’t returning the right responses, or for items that we know aren’t working right. When the team has decided that the behavior isn’t going to be fixed, what’s an automation engineer to do? Let the tests fail? Not write them? Champion harder for the defects?

Jenny Bramble suggests writing your tests to pass.

By creating tests that pass on the current expected behavior (the defect), we are in a perfect position to tell when the defect is resolved, or the api is returning the correct information, or any of the other error cases we may be encountering. This prevents failure fatigue (from seeing a test ‘always fail), while still providing meaningful, actionable information out of our test suite.

She will discuss several cases that she’s experienced that this method has worked for as well as how to keep the rest of the team informed through TODOs, Jira stories, and documentation. And—of course!—what to do when your test finally fails.

You’ll walk away from this talk with a clear idea of when to design your tests to fail, how to use TODOs and other indicators to let the rest of the test team know what’s going on, as well as a frank discussion of automation as information—not as a bug detection system!

Jenny Bramble

April 15, 2021
Tweet

More Decks by Jenny Bramble

Other Decks in Technology

Transcript

  1. HI, I’M JENNY HUMAN INTERFACING IS MY FAVORITE THING MY

    PRONOUNS ARE SHE/HER @jennydoesthings
  2. Defect 1414 @JENNYDOESTHINGS "THE TEST IS IN THE LOGIN GROUP

    AND CURRENTLY VERIFIES THAT THE NEW PASSWORD IS AT LEAST SIX CHARACTERS. WHEN THIS DEFECT IS RESOLVED, THE TEST WILL NEED TO BE UPDATED TO THE CORRECT VALUE OF EIGHT CHARACTERS."
  3. Your Code @JENNYDOESTHINGS //TODO: REVISIT WHEN DEFECT 1414 IS RESOLVED.

    TEST WILL NEED TO BE UPDATED FROM 6 CHARS TO 8 CHARS.
  4. Your Code @JENNYDOESTHINGS //TODO: REVISIT WHEN DEFECT 1414 IS RESOLVED.

    TEST WILL NEED TO BE UPDATED FROM 6 CHARS TO 8 CHARS.
  5. @JENNYDOESTHINGS WHY DO WE DESIGN TESTS TO FAIL ▸ Know

    the state of the system ▸ Limit failure fatigue ▸ Increase confidence in our suite ▸ Treat automation as information
  6. @JENNYDOESTHINGS HOW DO WE DESIGN TESTS TO FAIL ▸ Write

    the test to pass on expected behavior ▸ Document your tests ▸ Expect your tests to fail ▸ Resolve failures quickly