There are multiple examples of unit tests for parsers.  In your case I
would include a small BAM file in /inst/extdata and make a test which
parses this file and asserts a number of things about the output.
Depending on philosophy, this may not be considered a pure unit test, but
it is very useful.  If the BAM file gets too big if its going to be
"interesting" we have in the past released experiment data packages with
testing data; this has usually been done for packages which read multiple
different files.  Examples are IlluminaDataTestFiles and
AffymetrixDataTestFiles (for parsing microarray data)

On Thu, Mar 23, 2017 at 10:37 PM, Dan Tenenbaum <dtene...@fredhutch.org>
wrote:

> Here's what BiocCheck says:
>
> Consider adding unit tests. We strongly encourage them. See
> http://bioconductor.org/developers/how-to/unitTesting-guidelines/
>
> So, unit tests are encouraged but not required.
> Dan
>
>
> ----- Original Message -----
> > From: "张腾" <2573552...@qq.com>
> > To: "bioc-devel" <bioc-devel@r-project.org>
> > Sent: Thursday, March 23, 2017 7:33:22 PM
> > Subject: [Bioc-devel] Unit tests
>
> > Hello all,
> >
> > I am not sure whether the Unit tests are necessary to release a package
> for
> > Bioconductor. In my package, only one main function to export and other
> > functions are hidden into the main function. In my package, the input
> data are
> > some files in BAM format and the output is a report in HTML format. So I
> want
> > to know if the unit tests are very important and necessary for releasing
> a
> > package. If it is necessary, how can I add these tests to my package in
> this
> > special input and output situation?
> >
> > Can anyone help me solve this problem? Thank you very much
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > Bioc-devel@r-project.org mailing list
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.
> ethz.ch_mailman_listinfo_bioc-2Ddevel&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=
> TF6f93hjWmgMzjqP9F3thRifibmFvfjc5Ae-bzNwDGo&m=-
> y21Sirq2bdhul9Ar8vnDiy_LjASe_ND5ozxWVwudWw&s=Wroy1VJao_
> ttDgKZZY7vOApZkTTauP_S8kAgYTs6jo4&e=
>
> _______________________________________________
> Bioc-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

        [[alternative HTML version deleted]]

_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel

Reply via email to