Re:Augmenting Agile with Formal Methods
by gbacon on Tuesday July 31, 2018 @01:08PM
(#17654924)
At the bottom of JavaUnitTestChallengeSolved[0], William Underwood posted the test below and claims that it always catches the `notify()` problem. He did not mention using TLA+.
[0]: http://wiki.c2.com/?JavaUnitTestChallengeSolved
[ Parent
| on HN ]
That's just testing that all of the test threads are awake after they run once. It only does one buffer operation (the `put` in `synchronized buffer`), and we trivially know it's "broken" if there are only puts and no gets. It's also using two threads for a buffer length of 4. This isn't actually surfacing the bug, just something that looks somewhat like the bug if you already know what the bug is.