[ 
https://issues.apache.org/jira/browse/PDFBOX-1977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13932107#comment-13932107
 ] 

John Hewson edited comment on PDFBOX-1977 at 3/12/14 7:20 PM:
--------------------------------------------------------------

{quote}
I wrote this brief blog post about Lucene's randomized tests a while back
{quote}

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. Perhaps we 
need both kinds of test? Deterministic unit tests for catching regressions and 
known corner-cases, and randomized fuzz tests for increased coverage. What do 
you think?

{quote}
Had the seed in this test been constant, this issue would not have been found. 
It's because the seed is randomly selected that the test finally produced a 
sequence of data that provokes the bug.
{quote}

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.

---

\* Meaning that when I say "unit test" I specifically mean "regression test", 
perhaps this makes me unusual.


was (Author: jahewson):
{quote}
I wrote this brief blog post about Lucene's randomized tests a while back
{quote}

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. Perhaps we 
need both kinds of test? Deterministic unit tests for catching regressions and 
known corner-cases, and randomized fuzz tests for increased coverage. What do 
you think?

{quote}
Had the seed in this test been constant, this issue would not have been found. 
It's because the seed is randomly selected that the test finally produced a 
sequence of data that provokes the bug.
{quote}

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.

* Meaning that when I say "unit test" I specifically mean "regression test", 
perhaps this makes me unusual.

> 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)

Reply via email to