[
https://issues.apache.org/jira/browse/PDFBOX-1977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13932238#comment-13932238
]
Michael McCandless commented on PDFBOX-1977:
--------------------------------------------
bq. Thanks for the link, it's interesting; more what I'd call a fuzz test
rather than a unit test, because it can't be used to identify regressions at
the point they are committed, as the test data is different each time.
I like the name "fuzz test"!
bq. Perhaps we need both kinds of test? Deterministic unit tests for catching
regressions and known corner-cases, and randomized fuzz tests for increased
coverage.
+1, we definitely need both. Whenever a bug is hit it's best to make a very
specific non-randomized test case showing the bug, fix the bug, and then see
that the test passes. This test is like a "rifle" and the randomized test is
like a "shotgun".
bq. This is true, but it's also possible that a representative set of input
data could have caught this regression at the time it was introduced.
Right! If we knew which data to make, back then :)
bq. I suspect that the test was run for a longer time, although a "lucky" hit
might also be the reason.
In that blog post I compare this to the search for extraterrestrial life!
Finding a seed that produces a failure is not easy, and we all use our machines
/ Jenkins jobs / etc. to hunt for them.
> LZWFilter fails / TestFilters is non-determinate
> ------------------------------------------------
>
> Key: PDFBOX-1977
> URL: https://issues.apache.org/jira/browse/PDFBOX-1977
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 1.8.5, 2.0.0
> Reporter: John Hewson
> Assignee: Tilman Hausherr
> Labels: LZW
> Fix For: 1.8.5, 2.0.0
>
>
> TestFilters uses Random().nextLong() to generate a seed for random data,
> which means that it is non-determinate. Depending on the seed value, the test
> may fail or succeed.
> Using the following seed results in the LZW filter failing:
> final long seed = -6257105096642706464L;
--
This message was sent by Atlassian JIRA
(v6.2#6252)