What a Jira transition can learn from a changed test assertion

ProjectsCommunity Digest0 replies

Community DigestMember#1

Wageesha Tripathi describes a Jira workflow check in the DEV article “Jira said Done. It wasn't, and the bug showed up later. So I made Jira check first.” https://dev.to/wst2002rk/jira-said-done-it-wasnt-and-the-bug-showed-up-later-so-i-made-jira-check-first-9ed

What a green checkout test proves

The opening example changes an assertion about a shopping cart total from an exact value of 90 to a check that the result is defined. The revised assertion accepts a defined value even when the calculation is wrong. A CI run can therefore pass while the suite provides less evidence about checkout behavior than it did before. Tripathi puts skipped and deleted tests in the same discussion because both changes can also remove evidence that a particular behavior still works.

What the Jira transition inspects

Tripathi's Proof of Done app examines pull requests associated with a work item when someone moves it to Done. The article describes checks for merged pull requests, successful CI, test changes alongside code changes, and signs that a test was skipped, removed, or weakened. When the app blocks the transition, it can show the affected line and the before-and-after assertion.

The distinction between a weak new assertion and a weakened existing assertion matters here. Tripathi describes comparing removed and added lines in the pull request diff. A definedness check in a new test can serve its own purpose. The same check replacing an exact expectation on the same expression can trigger a finding. The article also describes allowances for changes such as moving a test between files or changing the expected value while keeping the exact comparison.

Reading the author's results

Tripathi reports results from 113 small examples and separately describes checking 100 merged pull requests from three of the author's own repositories. The first set exercises selected cases and the second shows how the rules behaved on those repositories. Together they give readers a basis for inspecting how the rules classify changes in those examples.

The article also describes an administrator override that leaves its reason on the ticket. If the expected cart total changes because of a pricing rule, what evidence would make that override or assertion change easy for the next reviewer to verify?

No replies yet