Index: openacs-4/packages/acs-core-docs/www/tutorial-debug.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-debug.html,v diff -u -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/tutorial-debug.html 22 Mar 2004 11:50:30 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/tutorial-debug.html 22 Mar 2004 12:46:37 -0000 1.25 @@ -1,7 +1,7 @@ Debugging and Automated Testing

Debugging and Automated Testing

by Joel Aufrecht

OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

Debugging

Developer Support.�The Developer Support package adds several goodies: debug +

Debugging

Developer Support.�The Developer Support package adds several goodies: debug information for every page; the ability to log comments to the page instead of the error log, and fast user switching so that you can test pages as anonymous and as dummy users without logging @@ -22,16 +22,16 @@ ?�searches�backward�
/�searches�forward.�
����������

-

Manual testing

Make a list of basic tests to make sure it works

Test NumActionExpected Result
001Browse to the index page while not logged in and +

Manual testing

Make a list of basic tests to make sure it works

Test NumActionExpected Result
001Browse to the index page while not logged in and while one or more notes exist.No edit or delete or add links should appear.
002Browse to the index page while logged in. An Edit link should appear. Click on it. Fill out the form and click Submit.The text added in the form should be visible on the index page.
API-001Invoke mfp::note::create with a specific word as the title.Proc should return an object id.
API-002Given an object id from API-001, invoke mfp::note::get.Proc should return the specific word in the title.
API-003Given the object id from API-001, invoke mfp::note::delete.Proc should return 0 for success.

Other things to test: try to delete someone else's note. Try to delete your own note. Edit your own note. - Search for a note.

Write automated tests

by Simon Carstensen and Joel Aufrecht

+ Search for a note.

Write automated tests

by Simon Carstensen and Joel Aufrecht

OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

+

It seems to me that a lot of people have been asking for some guidelines on how to write automated tests. I've done several tests by now and have found the process to be extremely easy and useful. It's a joy to work with automated testing once you get the hang of it.

Create the directory that will contain the test script and edit the script file. The directory location and file name are standards which are recognized by the automated testing package:

[service0 www]$ mkdir /var/lib/aolserver/service0/packages/myfirstpackage/tcl/test
 [service0 www]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/tcl/test