FAQ
Hi,

I've just started looking at how to create unit tests for the core of
PEAR. This task is overwhelming, since there are years of things being
added without unit tests. To test the installer requires the creation
of a fake PEAR install with fake installation packages and in fact there
are so many control variables that I hardly know where to start. It's
quite conceivable that the complexity of the fake environment will
introduce new bugs, requiring test cases for the take environment itself
to make sure it actually works.

I wonder if it might make more sense to create a package specifically
designed for testing the core, rather than using the runtests.php. This
package would have to be able to set up a very complex test environment
easily, including custom installations of PEAR, and pass each test to
runtests.php. Unfortunately, this will take a long time to perfect, and
so before I were to even begin such a project, I would like the ideas
and the code support of others. I don't think this QA package can
really work if only one person writes the code.

A simpler system for testing the core is desperately needed, so any
ideas/people interested in helping?

Greg

Search Discussions

  • Arnaud Limbourg at Aug 31, 2003 at 8:22 pm

    Hi,

    I've just started looking at how to create unit tests for the core of
    PEAR. This task is overwhelming, since there are years of things being
    added without unit tests. To test the installer requires the creation
    of a fake PEAR install with fake installation packages and in fact there
    are so many control variables that I hardly know where to start. It's
    quite conceivable that the complexity of the fake environment will
    introduce new bugs, requiring test cases for the take environment itself
    to make sure it actually works.

    I wonder if it might make more sense to create a package specifically
    designed for testing the core, rather than using the runtests.php. This
    package would have to be able to set up a very complex test environment
    easily, including custom installations of PEAR, and pass each test to
    runtests.php. Unfortunately, this will take a long time to perfect, and
    so before I were to even begin such a project, I would like the ideas
    and the code support of others. I don't think this QA package can
    really work if only one person writes the code.

    A simpler system for testing the core is desperately needed, so any
    ideas/people interested in helping?
    Wow, that is a very complicated task. Making it would require a lot of time, maintaining even more so. It could fall into disregard very easily.

    What are thinking about when you mention PEAR core ? the pear command ? (just to understand what we are talking about ;)

    Arnaud.
  • Greg Beaver at Aug 31, 2003 at 8:43 pm

    Arnaud Limbourg wrote:
    Hi,

    I've just started looking at how to create unit tests for the core of
    PEAR. This task is overwhelming, since there are years of things being
    [snip]
    A simpler system for testing the core is desperately needed, so any
    ideas/people interested in helping?

    Wow, that is a very complicated task. Making it would require a lot of time, maintaining even more so. It could fall into disregard very easily.

    What are thinking about when you mention PEAR core ? the pear command ? (just to understand what we are talking about ;)

    Arnaud.
    the PEAR_* classes (except PEAR_Error, which already has unit tests).
    There are not even basic regression tests to make sure something like
    what happened from 1.2b3 to 1.2b4 doesn't happen (installation was
    completely borked by one of my patches that was accidentally untested).

    Perhaps a first step would be to do the .phpt for PEAR_Common, since
    that is the basis of almost every package. The registry already has
    unit tests. If someone wants to take on writing unit tests for
    PEAR_Common, I will look into writing them for the PEAR_Installer.

    Greg

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-qa @
categoriesphp
postedAug 31, '03 at 6:34p
activeAug 31, '03 at 8:43p
posts3
users2
websitepear.php.net

2 users in discussion

Greg Beaver: 2 posts Arnaud Limbourg: 1 post

People

Translate

site design / logo © 2021 Grokbase