Menu
Tomek's blog
  • Contact & About
Tomek's blog
Photo by Aaron Burden on Unsplash

Soft Assertions? Rarely Useful

Posted on September 7, 2015November 10, 2022 by Tomek Kaczanowski

I remember some time ago I was really excited about the idea of soft assertions. The latest blog post by Rafał Borowiec reminded me about them. …but wait, if I was so crazy about them some time ago, then how it happened that now I need to be reminded about their existence?

Integration and E2E Tests

So first of all, I believe they make sense only for integration or e2e tests. Only, where execution of test is so costly (in terms of time) that you really, really want to learn as much about the tested scenario as possible. So, if you have a long (Webdriver) test, which ends with bunch of asserts, then I think it might make sense to write them using soft assertions.

Unit Tests

But for unit tests? Oh no, you do not need soft asserts! Execution of such test takes milliseconds so rerunning them is simply a matter of few keystrokes using your IDE. Not much gained by soft asserts here.
And I also see a potential downside. I think that using soft asserts might lead you into the wrong direction: it might encourage you to verify much more then required, or to verify different thing “because you can”. No, thank you, I strongly believe you should go with one (logical!) assertion per test.

No Need

So, all in all, my initial excitement about the soft assertions has vanished over the years. I would never use them for unit tests, and I do not use them for other kind of tests. Why not? I think that when I first learned about them they were not supported by the tools so I gave up the idea. And later… well, I think I got used to not using them, and as I think now about my E2E/GUI/Integration tests I do not see compelling reasons to change my mind.

Just my 3 cents.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print

Like this:

Like Loading...

Related Posts

  • soft assertions
  • testing
  • tips & tricks
  • unit testing
  • Leave a ReplyCancel reply

    Follow me on Twitter

    My Tweets

    Subscribe to Blog

    My Books

    Practical Unit Testing - JUnit Practical Unit Testing - TestNG Bad Tests, Good Tests kanban for your team 1,2,3 kanban Złe testy, dobre testy

    Tags

    4dx agile book review capacity planning conference constraints continuous improvement daily scrum decision taking discussion effectiveness review estimation experiment facilitation feedback funny getting things done goals interview kanban leadership management management 3.0 meetings notes organisational culture procrastination productivity psychological safety rant remote work retrospective scrum scrum sprint sociocracy sociocracy 3.0 team testing tips & tricks tools transparency visualization wip work in process work in progress

    There is no Planet B. Act Now!

    There is no Planet B. Act Now!
    There is no Planet B. Act Now!

    Follow me on LinkedIn

    Tomasz Kaczanowski

    Top Posts & Pages

    • ACE! Conference 2015
      ACE! Conference 2015
    • Sociocracy 3.0 Effectiveness Review
      Sociocracy 3.0 Effectiveness Review
    • Interview Tool: Moving Motivators
      Interview Tool: Moving Motivators
    • 4DX: LAG vs. LEAD
      4DX: LAG vs. LEAD

    Categories

    • agile (32)
    • book (7)
    • event (2)
    • facilitation (2)
    • organization (11)
    • productivity (32)
    • sociocracy (10)
    • team (5)
    • testing (2)
    • tools (16)
    • Uncategorized (9)
    • varia (30)
      • remote work (2)
      • ux (2)

    No Business On A Dead Planet

    No Business On Dead Planet
    No Business On Dead Planet
    ©2025 Tomek's blog | WordPress Theme by Superb Themes
    %d