[GRASS5] Automated test-system for basic functionalities.

Hi Developers,

we discussed a automated test-system for modules which
will report simple OK/error statements for basic functionalities.

Currently there is no clear idea, but thoughts about a shell-script
with configuration file have been made.

The dataset is also a problem, since it must be small enough to
distribute it to testers. Spearfish is probably too big...

A manual example (with spearfish6-data) can be found here[1].

Perhaps someone on this list can give some ideas, thoughts about
best-practice of creating such a test-environment?

Thank you for input!

Stephan

[1] http://mpa.itc.it/markus/mum3/testing_grass6_software.txt

--
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office - Mengendamm 16d - D-30177 Hannover
Internet: www.gdf-hannover.de - Email: holl@gdf-hannover.de
Phone : ++49-(0)511.39088507 - Fax: ++49-(0)511.39088508

Hi Stephan,

Soeren Gebbert and me have recently started to work on a test
suite. I suggest to get you involved, probably offlist for
now and to send to you the current scripts for testing.

Anyone else interested may write to us.

The current test suite isin fact Spearfish based since this
is a well know data set.
Once the test suite is tested a bit more, we can move
it to CVS.

Sounds good?

Markus

On Mon, Jan 09, 2006 at 12:36:30PM +0100, Stephan Holl wrote:

Hi Developers,

we discussed a automated test-system for modules which
will report simple OK/error statements for basic functionalities.

Currently there is no clear idea, but thoughts about a shell-script
with configuration file have been made.

The dataset is also a problem, since it must be small enough to
distribute it to testers. Spearfish is probably too big...

A manual example (with spearfish6-data) can be found here[1].

Perhaps someone on this list can give some ideas, thoughts about
best-practice of creating such a test-environment?

Thank you for input!

Stephan

[1] http://mpa.itc.it/markus/mum3/testing_grass6_software.txt

--
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office - Mengendamm 16d - D-30177 Hannover
Internet: www.gdf-hannover.de - Email: holl@gdf-hannover.de
Phone : ++49-(0)511.39088507 - Fax: ++49-(0)511.39088508

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

On Monday 09 January 2006 12:36, Stephan Holl wrote:

Hi Developers,

Hi,

we discussed a automated test-system for modules which
will report simple OK/error statements for basic functionalities.

Interesting, Markus and i just had the same thoughts and developed a small prototype of a testframework
which tests some GRASS modules of success/failure and try to guess the failure.

www-pool.math.tu-berlin.de/~soeren/grass/modules/GRASS_Testsuite.tar.gz

If you want to test it, do it at your own risk, this is a proof of concept, but it works. Its not well documented.
You have to edit the script RunGRASSTestSuite.sh and add the installation path.
Please run it in spearfish right now, or edit the testregion settings in RunGRASSTestSuite.sh.
I focued to test the r3.* modules, so there are scripts which tests all r3.* modules in grass-6.1-cvs.
But some raster and general tests also available.

Currently there is no clear idea, but thoughts about a shell-script
with configuration file have been made.

I think bash shell scripts may be the best choice for this kind of tests, the prototype i developed
is completely written in bash. It is a *nix standart and we are only able to test the success or failure of the modules.

The dataset is also a problem, since it must be small enough to
distribute it to testers. Spearfish is probably too big...

I think, the test should be work with every dataset, not only with a provided one. Some tests
i created are producing the input by there own with r.mapcalc or r3.mapcalc.
(ok if r.mapcalc and r3.mapcalc are not working, nothing will be tetested)
And yes, thats not possible for every module.

A manual example (with spearfish6-data) can be found here[1].

Perhaps someone on this list can give some ideas, thoughts about
best-practice of creating such a test-environment?

Tests should be simple to add, even with basic bash knowledge. Every module developer should be able to add tests.
The Testsuite should be easy to extend and it should provide a framework to add simple and extremly, dependenly
sophisticated tests.

There should be a test-directory for every noninteractive command in the sources, which contains the testscripts for this module.

example:
grass6/raster3/ <----------------- contains all r3.* modules
grass6/raster3/r3.out.vtk <--------------- contains r3.out.vtk sources, description, Makefile and testdierectory
grass6/raster3/r3.out.vtk/testing <--------------- contains r3.out.vtk tests
grass6/raster3/r3.out.vtk/testing/r3.out.vtk-test-simple.sh <------------- simple test file, will run within the testframework, not standalone?!
grass6/raster3/r3.out.vtk/testing/r3.out.vtk-test-complex.sh
...

While installation the tests should be copied into a testsuite directory in the GRASS installation path.

I think the GRASS tests should be run without interaction -> standalone for automatic tests and should produce a parsable complete logfile
with stdout and stderr messages from the tested modules. Also a parsable summary of success and failures should be provided.

Maybe it should produce readable html output, to host a success/failure page at grass.itc.it. So everybody
will know which module works and which should be fixed. (except the problem is in the lib).

Just my 2c
Best regards
Soeren

Thank you for input!

Stephan

[1] http://mpa.itc.it/markus/mum3/testing_grass6_software.txt

Hello Markus, Sören,

thanks for answering so quickly.

On Mon, 9 Jan 2006 13:29:44 +0100 Markus Neteler <neteler@itc.it> wrote:

Hi Stephan,

Soeren Gebbert and me have recently started to work on a test
suite. I suggest to get you involved, probably offlist for
now and to send to you the current scripts for testing.

Received them already through the Sörens link.

Anyone else interested may write to us.

The current test suite isin fact Spearfish based since this
is a well know data set.
Once the test suite is tested a bit more, we can move
it to CVS.

Sounds good?

yes, definetly. I will have a look at the current testsuite later that
day and come back to you.

Best
  Stephan

--
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office - Mengendamm 16d - D-30177 Hannover
Internet: www.gdf-hannover.de - Email: holl@gdf-hannover.de
Phone : ++49-(0)511.39088507 - Fax: ++49-(0)511.39088508

On 1/9/06, Sören Gebbert <soerengebbert@gmx.de> wrote:

Interesting, Markus and i just had the same thoughts and developed a small prototype of a testframework
which tests some GRASS modules of success/failure and try to guess the failure.
www-pool.math.tu-berlin.de/~soeren/grass/modules/GRASS_Testsuite.tar.gz

It only tests if a module runs not the results, right?

> Currently there is no clear idea, but thoughts about a shell-script
> with configuration file have been made.
I think bash shell scripts may be the best choice for this kind of tests, the prototype i developed
is completely written in bash. It is a *nix standart and we are only able to test the success or failure of the modules.

We must get it running on Windows (native).

> The dataset is also a problem, since it must be small enough to
> distribute it to testers. Spearfish is probably too big...
I think, the test should be work with every dataset, not only with a provided one.

But how can you check if module's output is correct?

Radim

Hi Radim,

On Monday 09 January 2006 18:26, Radim Blazek wrote:

On 1/9/06, Sören Gebbert <soerengebbert@gmx.de> wrote:
> Interesting, Markus and i just had the same thoughts and developed a small prototype of a testframework
> which tests some GRASS modules of success/failure and try to guess the failure.
> www-pool.math.tu-berlin.de/~soeren/grass/modules/GRASS_Testsuite.tar.gz

It only tests if a module runs not the results, right?

Yes. Thats one main task of the framework. It should start the user specified grass programms and/or testscripts,
and catch/process the exitstatus (Signals) of the programms/scripts . Other tasks of the framework are, to parse the output (stdout and stderr)
for known errors (Usage, Fatal Error, Segfault and so on) and create a readable summary and a logfile.
It should also be able to create reports (html ...?).

> > Currently there is no clear idea, but thoughts about a shell-script
> > with configuration file have been made.
> I think bash shell scripts may be the best choice for this kind of tests, the prototype i developed
> is completely written in bash. It is a *nix standart and we are only able to test the success or failure of the modules.

We must get it running on Windows (native).

Then Windows should bring a bash within ;). Seriously, the framework prototype runs only within grass and uses the GRASS shell
variables and the shell output of some programms. And if grass-shellsript's (r.mremove) are running in grass/windows
then the framework should run too.
But if we decide to create a testfamework that works outside grass, creating locations and stuff, we may use another language (Perl?).
Any suggestions are welcome.

> > The dataset is also a problem, since it must be small enough to
> > distribute it to testers. Spearfish is probably too big...
> I think, the test should be work with every dataset, not only with a provided one.

But how can you check if module's output is correct?

The framework should not be that smart (i think thats impossible to implement, every test may produce different output ) to check if every output is
correct. But it should provide the functionality so the dev/user can build testfunctions to check the output (r.info -r). The framework
should handle this funktions and should integrate them into the reports.

The framework do not test anything, it just provide a functionality to easy create and manage test's.
To have a testsuite we have to implement the framework and the testscripts! (i made some small examples)

Radim

Regards
Soeren

On 1/9/06, Sören Gebbert <soerengebbert@gmx.de> wrote:

> It only tests if a module runs not the results, right?
Yes. Thats one main task of the framework. It should start the user specified grass programms and/or testscripts,
and catch/process the exitstatus (Signals) of the programms/scripts . Other tasks of the framework are, to parse the output (stdout and stderr)
for known errors (Usage, Fatal Error, Segfault and so on) and create a readable summary and a logfile.

> We must get it running on Windows (native).
Then Windows should bring a bash within ;). Seriously, the framework prototype runs only within grass and uses the GRASS shell
variables and the shell output of some programms. And if grass-shellsript's (r.mremove) are running in grass/windows
then the framework should run too.
But if we decide to create a testfamework that works outside grass, creating locations and stuff, we may use another language (Perl?).

Say that MSYS can be installed for testing. Anyway, I would
like to separate test description and the script running it.

> But how can you check if module's output is correct?
The framework should not be that smart (i think thats impossible to implement, every test may produce different output ) to check if every output is
correct. But it should provide the functionality so the dev/user can build testfunctions to check the output (r.info -r). The framework
should handle this funktions and should integrate them into the reports.

Without output data verification it is almos useless in my opinion.
I have 2 examples in my mind I recently saw:
- new bug introduced in v.to.rast (last line segment not rasterized)
- bug in v.in.ascii on Windows (missing header file -> wrong output)

That is why I suggested a small mapset with etalon output data
which can be used for verification of test output.

Radim

On Tue, 10 Jan 2006, Radim Blazek wrote:

On 1/9/06, Sören Gebbert <soerengebbert@gmx.de> wrote:
> > It only tests if a module runs not the results, right?
> Yes. Thats one main task of the framework. It should start the user specified grass programms and/or testscripts,
> and catch/process the exitstatus (Signals) of the programms/scripts . Other tasks of the framework are, to parse the output (stdout and stderr)
> for known errors (Usage, Fatal Error, Segfault and so on) and create a readable summary and a logfile.

> > We must get it running on Windows (native).
> Then Windows should bring a bash within ;). Seriously, the framework prototype runs only within grass and uses the GRASS shell
> variables and the shell output of some programms. And if grass-shellsript's (r.mremove) are running in grass/windows
> then the framework should run too.
> But if we decide to create a testfamework that works outside grass, creating locations and stuff, we may use another language (Perl?).

Say that MSYS can be installed for testing. Anyway, I would
like to separate test description and the script running it.

> > But how can you check if module's output is correct?
> The framework should not be that smart (i think thats impossible to implement, every test may produce different output ) to check if every output is
> correct. But it should provide the functionality so the dev/user can build testfunctions to check the output (r.info -r). The framework
> should handle this funktions and should integrate them into the reports.

Without output data verification it is almos useless in my opinion.
I have 2 examples in my mind I recently saw:
- new bug introduced in v.to.rast (last line segment not rasterized)
- bug in v.in.ascii on Windows (missing header file -> wrong output)

That is why I suggested a small mapset with etalon output data
which can be used for verification of test output.

I agree, we need to compare the target output data with the generated.
Given that they are most often binary, we can't use diff (R test uses diff
on plain text files), but could we use checksums or something like a file
digest to show same/different?

Roger

Radim

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand@nhh.no

On Tuesday 10 January 2006 10:28, Roger Bivand wrote:

On Tue, 10 Jan 2006, Radim Blazek wrote:

> On 1/9/06, Sören Gebbert <soerengebbert@gmx.de> wrote:
> > > It only tests if a module runs not the results, right?
> > Yes. Thats one main task of the framework. It should start the user specified grass programms and/or testscripts,
> > and catch/process the exitstatus (Signals) of the programms/scripts . Other tasks of the framework are, to parse the output (stdout and stderr)
> > for known errors (Usage, Fatal Error, Segfault and so on) and create a readable summary and a logfile.
>
> > > We must get it running on Windows (native).
> > Then Windows should bring a bash within ;). Seriously, the framework prototype runs only within grass and uses the GRASS shell
> > variables and the shell output of some programms. And if grass-shellsript's (r.mremove) are running in grass/windows
> > then the framework should run too.
> > But if we decide to create a testfamework that works outside grass, creating locations and stuff, we may use another language (Perl?).
>
> Say that MSYS can be installed for testing. Anyway, I would

I'll take a look on it.

> like to separate test description and the script running it.

But if the test description is a shell script the user/dev will have more options to write tests.

We can define the test description in xml and write the framework in C/C++,
but in this case im not able write the framework (i dont have the time and the knowledge). :frowning:

I just wanted a small module test framework, if you and other devs want a huge sophisticated test suite,
maybe we should take a look on the mass of frameworks and testsuites which are free availible?

>
> > > But how can you check if module's output is correct?
> > The framework should not be that smart (i think thats impossible to implement, every test may produce different output ) to check if every output is
> > correct. But it should provide the functionality so the dev/user can build testfunctions to check the output (r.info -r). The framework
> > should handle this funktions and should integrate them into the reports.
>
> Without output data verification it is almos useless in my opinion.
> I have 2 examples in my mind I recently saw:
> - new bug introduced in v.to.rast (last line segment not rasterized)
> - bug in v.in.ascii on Windows (missing header file -> wrong output)

Please dont misunderstand me, i didnt say'd we should not validate the output data, but the testscript
writer should provide these informations.
And your a right in the point, that the framework should know how to compare/remove the data. :wink:

>
> That is why I suggested a small mapset with etalon output data
> which can be used for verification of test output.

I completly agree.
Indeed, thats an important point, to have one/some validation mapsets.
+ added to the must have list

I agree, we need to compare the target output data with the generated.
Given that they are most often binary, we can't use diff (R test uses diff
on plain text files), but could we use checksums or something like a file
digest to show same/different?

Interesting point, i dont know which one is better/faster, maybe a combination one for ascii and the other one for binary files?
+ added to the must have list

Many thanks for your suggestions!

Example: maybe a test description should look like this?

#########################################
#Testcript for r.mapcalc written by me

#Some important variables, needed by the framework
NeedValidationMapset="True" #only run this test in a validation mapset
ValidateOutputData="True" #validate the output data
OutputDataType="raster" #need to compare and remove the data

Programm="r.mapcalc" #the programm that should be tested
NumberOfTests=3 #Number of Tests

#define the output map names
OutputData[0]="grassTestOutputRmapcalc0"
OutputData[1]="grassTestOutputRmapcalc1"
OutputData[2]="grassTestOutputRmapcalcNoValidation"

#define the Validation map names
ValidationData[0]="r_mapcalc_validation_int_10"
ValidationData[1]="r_mapcalc_validation_float_10"
ValidationData[2]="none" #no validatio is needed, just an example

#define the command line options
GrassProgrammOptions[0]="${OutputData[0]} = 10"
GrassProgrammOptions[1]="${OutputData[1]} = 10.0"
GrassProgrammOptions[2]="${OutputData[2]} = 10.0"

#Now run the test
TestProgramm #thats a framework function, runs the programm and compares the output

#Take care the produced output is removed
RemoveTestedData #thats a framework function, the framework knows the datatype

########################################

What are you thinking?

Best regards
Soeren

Roger

>
> Radim
>
> _______________________________________________
> grass5 mailing list
> grass5@grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5
>

On Tuesday 10 January 2006 10:28, Roger Bivand wrote:

On Tue, 10 Jan 2006, Radim Blazek wrote:

> On 1/9/06, Sören Gebbert <soerengebbert@gmx.de> wrote:
> > > It only tests if a module runs not the results, right?
> > Yes. Thats one main task of the framework. It should start the user specified grass programms and/or testscripts,
> > and catch/process the exitstatus (Signals) of the programms/scripts . Other tasks of the framework are, to parse the output (stdout and stderr)
> > for known errors (Usage, Fatal Error, Segfault and so on) and create a readable summary and a logfile.
>
> > > We must get it running on Windows (native).
> > Then Windows should bring a bash within ;). Seriously, the framework prototype runs only within grass and uses the GRASS shell
> > variables and the shell output of some programms. And if grass-shellsript's (r.mremove) are running in grass/windows
> > then the framework should run too.
> > But if we decide to create a testfamework that works outside grass, creating locations and stuff, we may use another language (Perl?).
>
> Say that MSYS can be installed for testing. Anyway, I would

I'll take a look on it.

> like to separate test description and the script running it.

But if the test description is a shell script the user/dev will have more options to write tests.

We can define the test description in xml and write the framework in C/C++,
but in this case im not able write the framework (i dont have the time and the knowledge). :frowning:

I just wanted a small module test framework, if you and other devs want a huge sophisticated test suite,
maybe we should take a look on the mass of frameworks and testsuites which are free availible?

>
> > > But how can you check if module's output is correct?
> > The framework should not be that smart (i think thats impossible to implement, every test may produce different output ) to check if every output is
> > correct. But it should provide the functionality so the dev/user can build testfunctions to check the output (r.info -r). The framework
> > should handle this funktions and should integrate them into the reports.
>
> Without output data verification it is almos useless in my opinion.
> I have 2 examples in my mind I recently saw:
> - new bug introduced in v.to.rast (last line segment not rasterized)
> - bug in v.in.ascii on Windows (missing header file -> wrong output)

Please dont misunderstand me, i didnt say'd we should not validate the output data, but the testscript
writer should provide these informations.
And your a right in the point, that the framework should know how to compare/remove the data. :wink:

>
> That is why I suggested a small mapset with etalon output data
> which can be used for verification of test output.

I completly agree.
Indeed, thats an important point, to have one/some validation mapsets.
+ added to the must have list

I agree, we need to compare the target output data with the generated.
Given that they are most often binary, we can't use diff (R test uses diff
on plain text files), but could we use checksums or something like a file
digest to show same/different?

Interesting point, i dont know which one is better/faster, maybe a combination one for ascii and the other one for binary files?
+ added to the must have list

Many thanks for your suggestions!

Example: maybe a test description should look like this?

#########################################
#Testcript for r.mapcalc written by me

#Some important variables, needed by the framework
NeedValidationMapset="True" #only run this test in a validation mapset
ValidateOutputData="True" #validate the output data
OutputDataType="raster" #need to compare and remove the data

Programm="r.mapcalc" #the programm that should be tested
NumberOfTests=3 #Number of Tests

#define the output map names
OutputData[0]="grassTestOutputRmapcalc0"
OutputData[1]="grassTestOutputRmapcalc1"
OutputData[2]="grassTestOutputRmapcalcNoValidation"

#define the Validation map names
ValidationData[0]="r_mapcalc_validation_int_10"
ValidationData[1]="r_mapcalc_validation_float_10"
ValidationData[2]="none" #no validatio is needed, just an example

#define the command line options
GrassProgrammOptions[0]="${OutputData[0]} = 10"
GrassProgrammOptions[1]="${OutputData[1]} = 10.0"
GrassProgrammOptions[2]="${OutputData[2]} = 10.0"

#Now run the test
TestProgramm #thats a framework function, runs the programm and compares the output

#Take care the produced output is removed
RemoveTestedData #thats a framework function, the framework knows the datatype

########################################

What are you thinking?

Best regards
Soeren

Roger

>
> Radim
>
> _______________________________________________
> grass5 mailing list
> grass5@grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5
>

On Tue, 10 Jan 2006, Sören Gebbert wrote:

On Tuesday 10 January 2006 10:28, Roger Bivand wrote:
> On Tue, 10 Jan 2006, Radim Blazek wrote:
>
> > On 1/9/06, Sören Gebbert <soerengebbert@gmx.de> wrote:
> > > > It only tests if a module runs not the results, right?
> > > Yes. Thats one main task of the framework. It should start the user specified grass programms and/or testscripts,
> > > and catch/process the exitstatus (Signals) of the programms/scripts . Other tasks of the framework are, to parse the output (stdout and stderr)
> > > for known errors (Usage, Fatal Error, Segfault and so on) and create a readable summary and a logfile.
> >
> > > > We must get it running on Windows (native).
> > > Then Windows should bring a bash within ;). Seriously, the framework prototype runs only within grass and uses the GRASS shell
> > > variables and the shell output of some programms. And if grass-shellsript's (r.mremove) are running in grass/windows
> > > then the framework should run too.
> > > But if we decide to create a testfamework that works outside grass, creating locations and stuff, we may use another language (Perl?).
> >
> > Say that MSYS can be installed for testing. Anyway, I would

I'll take a look on it.

> > like to separate test description and the script running it.

But if the test description is a shell script the user/dev will have more options to write tests.

We can define the test description in xml and write the framework in C/C++,
but in this case im not able write the framework (i dont have the time and the knowledge). :frowning:

I just wanted a small module test framework, if you and other devs want a huge sophisticated test suite,
maybe we should take a look on the mass of frameworks and testsuites which are free availible?

> >
> > > > But how can you check if module's output is correct?
> > > The framework should not be that smart (i think thats impossible to implement, every test may produce different output ) to check if every output is
> > > correct. But it should provide the functionality so the dev/user can build testfunctions to check the output (r.info -r). The framework
> > > should handle this funktions and should integrate them into the reports.
> >
> > Without output data verification it is almos useless in my opinion.
> > I have 2 examples in my mind I recently saw:
> > - new bug introduced in v.to.rast (last line segment not rasterized)
> > - bug in v.in.ascii on Windows (missing header file -> wrong output)

Please dont misunderstand me, i didnt say'd we should not validate the output data, but the testscript
writer should provide these informations.
And your a right in the point, that the framework should know how to compare/remove the data. :wink:

> >
> > That is why I suggested a small mapset with etalon output data
> > which can be used for verification of test output.

I completly agree.
Indeed, thats an important point, to have one/some validation mapsets.
+ added to the must have list

>
> I agree, we need to compare the target output data with the generated.
> Given that they are most often binary, we can't use diff (R test uses diff
> on plain text files), but could we use checksums or something like a file
> digest to show same/different?

Interesting point, i dont know which one is better/faster, maybe a combination one for ascii and the other one for binary files?
+ added to the must have list

Many thanks for your suggestions!

Example: maybe a test description should look like this?

#########################################
#Testcript for r.mapcalc written by me

#Some important variables, needed by the framework
NeedValidationMapset="True" #only run this test in a validation mapset
ValidateOutputData="True" #validate the output data
OutputDataType="raster" #need to compare and remove the data

Programm="r.mapcalc" #the programm that should be tested
NumberOfTests=3 #Number of Tests

#define the output map names
OutputData[0]="grassTestOutputRmapcalc0"
OutputData[1]="grassTestOutputRmapcalc1"
OutputData[2]="grassTestOutputRmapcalcNoValidation"

#define the Validation map names
ValidationData[0]="r_mapcalc_validation_int_10"
ValidationData[1]="r_mapcalc_validation_float_10"
ValidationData[2]="none" #no validatio is needed, just an example

#define the command line options
GrassProgrammOptions[0]="${OutputData[0]} = 10"
GrassProgrammOptions[1]="${OutputData[1]} = 10.0"
GrassProgrammOptions[2]="${OutputData[2]} = 10.0"

#Now run the test
TestProgramm #thats a framework function, runs the programm and compares the output

#Take care the produced output is removed
RemoveTestedData #thats a framework function, the framework knows the datatype

########################################

What are you thinking?

Shell scripts will be fine. Maybe we need a template which specifies
things and checkpoints others: platform, some environment variables, GRASS
environment variables, in a text file reporting the output, then runs the
command with specified option values, finally prints some representation
of the output for the options/environment variables. Programs outputting
^H will be a problem. The output should include something like a checksum
of binary files created.

Each command test script must have a benchmark output file, then the fresh
output should be diff'ed against the benchmark, and some grepping done to
remove false hits (only report if important output differs). That way, we
don't need validation data in place, just a text representation of some
file digest like md5sum in the benchmark file. In:

http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Drafts/MurrellHornik.pdf

use is actually made of diff to detect differences in binary graphics
files - that might be enough. I feel that to start with a simple shell
script accepting arguments to pass through should be enough, trapping
errors, and reporting back in a way that is easy to understand.

Roger

Best regards
Soeren

>
> Roger
>
> >
> > Radim
> >
> > _______________________________________________
> > grass5 mailing list
> > grass5@grass.itc.it
> > http://grass.itc.it/mailman/listinfo/grass5
> >
>

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand@nhh.no

On 1/10/06, Sören Gebbert <soerengebbert@gmx.de> wrote:

But if the test description is a shell script the user/dev will have more options to write tests.

Do we need such options?

We can define the test description in xml and write the framework in C/C++,
but in this case im not able write the framework (i dont have the time and the knowledge). :frowning:

No! I prefer something very simple. To use checksum is good idea.
My idea was to have test location with some input maps in PERMANENT.
Then the test descriptions could be a text file with GRASS commands
and list of output data to be verified + checkums for that data.

Radim

On Tue, 10 Jan 2006, Radim Blazek wrote:

On 1/10/06, Sören Gebbert <soerengebbert@gmx.de> wrote:
> But if the test description is a shell script the user/dev will have more options to write tests.

Do we need such options?

> We can define the test description in xml and write the framework in C/C++,
> but in this case im not able write the framework (i dont have the time and the knowledge). :frowning:

No! I prefer something very simple. To use checksum is good idea.
My idea was to have test location with some input maps in PERMANENT.
Then the test descriptions could be a text file with GRASS commands
and list of output data to be verified + checkums for that data.

Yes, better described than by me, this will work, I'm pretty sure. Simple
and robust.

Roger

Radim

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand@nhh.no

On Tue, Jan 10, 2006 at 04:31:20PM +0100, Roger Bivand wrote:

On Tue, 10 Jan 2006, Radim Blazek wrote:

> On 1/10/06, Sören Gebbert <soerengebbert@gmx.de> wrote:
> > But if the test description is a shell script the user/dev will have more options to write tests.
>
> Do we need such options?
>
> > We can define the test description in xml and write the framework in C/C++,
> > but in this case im not able write the framework (i dont have the time and the knowledge). :frowning:
>
> No! I prefer something very simple. To use checksum is good idea.
> My idea was to have test location with some input maps in PERMANENT.
> Then the test descriptions could be a text file with GRASS commands
> and list of output data to be verified + checkums for that data.

Yes, better described than by me, this will work, I'm pretty sure. Simple
and robust.

I have submitted an initial testsuite to CVS:

testsuite
|-- README
`-- raster
    |-- README
    |-- raster_md5test.sh <- generates map, performs md5sum comparison
    `-- rmapcalc_test.sh <- generates map, performs comparison with results
                               of univariate statistics on map

CELL and FCELL cases are tested currently.

The bug
http://intevation.de/rt/webrt?serial_num=3974
can be easily shown now:

./raster_md5test.sh
Saving current & setting test region.
INT/CELL md5sum test.
100%
MD5 checksum on output of INT/CELL test.
ERROR. The md5sum differs.
Removing temporary map
Restoring user region

Markus

On Tue, Jan 10, 2006 at 05:31:01PM +0100, Markus Neteler wrote:
...

I have submitted an initial testsuite to CVS:

testsuite
|-- README
`-- raster
    |-- README
    |-- raster_md5test.sh <- generates map, performs md5sum comparison
    `-- rmapcalc_test.sh <- generates map, performs comparison with results
                               of univariate statistics on map

CELL and FCELL cases are tested currently.

The bug
http://intevation.de/rt/webrt?serial_num=3974
can be easily shown now:

./raster_md5test.sh
Saving current & setting test region.
INT/CELL md5sum test.
100%
MD5 checksum on output of INT/CELL test.
ERROR. The md5sum differs.
Removing temporary map
Restoring user region

Markus

I have a question concerning EPSILON (here acceptable error between
expected and found value) and the test (currently written in awk):

On a 64bit box I get:

g.region s=0 n=3 w=0 e=3 res=1tbres=1
r.mapcalc "30432_tmp_testmap=1.1"
r.out.ascii 30432_tmp_testmap
north: 3
south: 0
east: 3
west: 0
rows: 3
cols: 3
1.1000000000000001 1.1000000000000001 1.1000000000000001
1.1000000000000001 1.1000000000000001 1.1000000000000001
1.1000000000000001 1.1000000000000001 1.1000000000000001

r.univar 30432_tmp_testmap
...
n: 9
minimum: 1.1
maximum: 1.1
range: 0
mean: 1.1
standard deviation: 2.43335e-08
variance: 5.92119e-16
variation coefficient: 2.21214e-06 %
sum: 9.9

The test fails at standard deviation:
rmapcalc_test.sh
...
Univariate statistics of FLOAT/FCELL test.
ERROR. stddev: Expected=0 | FOUND=2.43335e-08
...

Bug (where)? Correct? The test is in testsuite/raster/rmapcalc_test.sh

Markus

On Tue, 10 Jan 2006, Markus Neteler wrote:

On Tue, Jan 10, 2006 at 05:31:01PM +0100, Markus Neteler wrote:
...
> I have submitted an initial testsuite to CVS:
>
> testsuite
> |-- README
> `-- raster
> |-- README
> |-- raster_md5test.sh <- generates map, performs md5sum comparison
> `-- rmapcalc_test.sh <- generates map, performs comparison with results
> of univariate statistics on map
>
> CELL and FCELL cases are tested currently.
>
> The bug
> http://intevation.de/rt/webrt?serial_num=3974
> can be easily shown now:
>
> ./raster_md5test.sh
> Saving current & setting test region.
> INT/CELL md5sum test.
> 100%
> MD5 checksum on output of INT/CELL test.
> ERROR. The md5sum differs.
> Removing temporary map
> Restoring user region
>
> Markus

I have a question concerning EPSILON (here acceptable error between
expected and found value) and the test (currently written in awk):

On a 64bit box I get:

g.region s=0 n=3 w=0 e=3 res=1tbres=1
r.mapcalc "30432_tmp_testmap=1.1"
r.out.ascii 30432_tmp_testmap
north: 3
south: 0
east: 3
west: 0
rows: 3
cols: 3
1.1000000000000001 1.1000000000000001 1.1000000000000001
1.1000000000000001 1.1000000000000001 1.1000000000000001
1.1000000000000001 1.1000000000000001 1.1000000000000001

r.univar 30432_tmp_testmap
...
n: 9
minimum: 1.1
maximum: 1.1
range: 0
mean: 1.1
standard deviation: 2.43335e-08
variance: 5.92119e-16
variation coefficient: 2.21214e-06 %
sum: 9.9

The test fails at standard deviation:
rmapcalc_test.sh
...
Univariate statistics of FLOAT/FCELL test.
ERROR. stddev: Expected=0 | FOUND=2.43335e-08
...

For float this is numerically the same as zero, epsilon for doubles in
IEEE is 2.220446e-16. Where is the "Expected=0" coming from - is it output
from the initial (audited) run seen as correct, or is it assumed? I think
all IEEE float and double should give about the same fuzz.

Roger

Bug (where)? Correct? The test is in testsuite/raster/rmapcalc_test.sh

Markus

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand@nhh.no

On Tuesday 10 January 2006 16:22, Radim Blazek wrote:

On 1/10/06, Sören Gebbert <soerengebbert@gmx.de> wrote:
> But if the test description is a shell script the user/dev will have more options to write tests.

Do we need such options?

For the unit-test i think no, but for integration tests it may be usefull.
(definition: if the unit is one grass module and the integration test the kombination of serveral modules)

> We can define the test description in xml and write the framework in C/C++,
> but in this case im not able write the framework (i dont have the time and the knowledge). :frowning:

No! I prefer something very simple. To use checksum is good idea.
My idea was to have test location with some input maps in PERMANENT.
Then the test descriptions could be a text file with GRASS commands
and list of output data to be verified + checkums for that data.

I will try to make the core functionality of the testframework as simple and robust as i can.

Best regards
Soeren

Radim