Get the latest tech news
Automated Test-Case Reduction
In a previous post, I used a simple interpreter bug to demonstrate the research skill of manually reducing test cases.This time, I show off the excellent Shrinkray reducer to see how it can automate the same process.The tricky part when using automated test-case reducers is writing an interestingness test that actually does what you want.I list a few tricks that help me write good interestingness tests.
The inner loop of test-case reduction can get old quickly: delete stuff, run the special command, check the output to decide whether to backtrack or proceed. To decide when to stop (#3), reducers detect a fixed point: they give up when the heuristics fail to find any more code they can safely delete. In essence, an interestingness test is a script that automates the commands we ran repetitively (with the “up arrow” at the shell prompt) during manual reduction.
Or read this on Hacker News