Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 78190 invoked from network); 21 Apr 2005 12:13:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Apr 2005 12:13:13 -0000 Received: (qmail 99254 invoked by uid 500); 21 Apr 2005 12:13:23 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 99210 invoked by uid 500); 21 Apr 2005 12:13:23 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 99197 invoked by uid 99); 21 Apr 2005 12:13:22 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from brmea-mail-3.Sun.COM (HELO brmea-mail-3.sun.com) (192.18.98.34) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 21 Apr 2005 05:13:22 -0700 Received: from phys-biff-2 ([129.158.227.37]) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id j3LCD6jO015931 for ; Thu, 21 Apr 2005 06:13:07 -0600 (MDT) Received: from conversion-daemon.biff-mail1.india.sun.com by biff-mail1.india.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IFA00M01PAZGP@biff-mail1.india.sun.com> (original mail from Shreyas.Kaushik@Sun.COM) for derby-dev@db.apache.org; Thu, 21 Apr 2005 17:43:05 +0530 (IST) Received: from [129.158.229.246] (lilly.India.Sun.COM [129.158.229.246]) by biff-mail1.india.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0IFA00M87PXTXE@biff-mail1.india.sun.com> for derby-dev@db.apache.org; Thu, 21 Apr 2005 17:43:05 +0530 (IST) Date: Thu, 21 Apr 2005 17:40:09 +0530 From: Shreyas Kaushik Subject: Re: Adding new documentation for debugging test failures in the test framework In-reply-to: <4263D5F9.5030003@bristowhill.com> To: Derby Development Message-id: <42679821.8060503@Sun.com> MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_qJbiNQs4pBDPFwdwsSt3Qg)" X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0 (X11/20041208) References: <42633131.6090704@sun.com> <4263D5F9.5030003@bristowhill.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --Boundary_(ID_qJbiNQs4pBDPFwdwsSt3Qg) Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT Hi all, Here is the initial draft as per Apache Forrest 0.6. Please review this doc and let me know of improvements. When I was testing this I was unable to see the Samples tab in the web site I built.The build went through successfully but, I had to type the link in the browser window to view the page, this despite adding the following entry in ${derby.site.root}src/documentation/content/xdocs/site.xml, Should I do anything more to see the tab? ~ Shreyas Jean T. Anderson wrote: > Hi, Shreyas, > > Writeups are so very much appreciated! Especially writeups that can > be integrated into the derby web site with a minimum of fuss. > > For adding new content to the derby web site, the writeup below is > intended to help people test new content and also help committers > understand how to commit changes: > > http://incubator.apache.org/derby/papers/derby_web.html > > Currently the site uses forrest 0.6. The forrest project will release > 0.7 soon, so I opened a task to upgrade it to 0.7 -- see > http://issues.apache.org/jira/browse/DERBY-188 -- but I haven't > started looking at 0.7 yet. > > For improvements to the DITA doc source, see > http://incubator.apache.org/derby/manuals/dita.html . > > > regards, > > -jean > > > Shreyas Kaushik wrote: > >> Hi all, >> >> As people on this alias might know there was a thread running where >> we discussed about debugging the test failures in the Derby harness. >> I plan to do a write up of my learnings in the process ( also has >> some valuable suggestions from Kathey ). >> >> I was wondering where to start? Things like, >> >> ~ How do I work with the new Apache Forrest ? Is it like adding stuff >> another HTML document ? >> ~ Where to find the actaul docs source to start playing with ? >> ~ What section to put this write up in ? >> ~ How do I test my write up ? ( Formatting, font size..etc ) >> >> Any pointers on these would help. I hope this document will a be a >> good one for beginners and people not so familiar with the Derby test >> framework ( I am also learning ). >> >> ~ Shreyas >> > --Boundary_(ID_qJbiNQs4pBDPFwdwsSt3Qg) Content-type: text/xml; name=debugtest.xml Content-transfer-encoding: 7BIT Content-disposition: inline; filename=debugtest.xml
Debugging test failures with the Derby test framework This document gives details of how to debug test failures. This is targeted at developers who contribute code to Derby and would want to investigate test failures caused by their fixes. lease post questions, comments, and corrections to derby-dev@db.apache.org.
Introduction The contents in this document are mostly inputs I received from Kathey Marsden

The Derby codebase has a slightly complicated test framework suite. Although using the framewrok to run tests is very simple and the framework itself give extensive results of the tests that passed and failed, it does get really tough to debug these test failures. The following sections give a step by step insight into debugging test failure.

Steps to be followed

1. Frist the test/s have to be run. The details fro running the tests can be found at ${derby.source}/java/testing/README.htm. The command for running the test/s would something like this,

java -Dij.exceptionTrace=true -Dkeepfiles=true org.apache.derbyTesting.functionTests.harness.RunTest lang/"mytest".sql

For the netwrok server you would need to add the following property -Dframework=DerbyNet

2. Do a visual diff of the ouptut with the canon. It will give you more context in approaching the problem. In the test output directory you will see "mytest".out (filitered test output) and "mytest".tmp (unfiltered test output - this one should have a trace). To get the most information, it is advised to diff the tmp file with the canon which is checked in under java/testing/org/apache/derbyTesting/functionTests/master/ or appropriate framework or jdk subdirectory.

3. Identify the sql statement or java code causing the diff. For sql scripts this is usually pretty obvious. For java programs you have to look at the test source to figure out what is going on.

4. Evaluate the diff. Here of course starts the tricky and interesting part. Look carefully at the sql command or java code that caused the diff. Think about what it should do and how it relates to your change. Decide what you think the right behaviour should be. a) The old behaviour b) The new behaviour c) something else If you have a trace, look at the the trace and see if it holds any clue. If you are lucky it passes right through that code you changed. Often it is helpful to put that one sql command or bit of java code in a separate script or stand alone program, so you can evaluate it independently outside of the harness and evaluate in the debugger. Common results of the evaluation phase are: a) An error in your code. b) Someone elses test failure all together. It is good to keep a clean client for testing this. c) A master update. Be careful with this one. make sure you have a valid reason to update a master. Be especially cognizant of backward compatibility. We don't want any real or perceived regressions to catch us by surprise.

Two good questions to ask your self and then answer when you post your patch. 1) What is my valid reason for updating this master. 2) Might someone be surprised by this difference and perceive it as a regression?

5. Resolve the issue. Here are some possible actions based on your evaluation in step 4 a) An error in your code. Go fix it !!! b) Someone else's test failure all together. Look at the recent checkins and try to guess the culprit and post. c) A master update. Update the master and make sure you include an explanation in your patch.

6. Reporting your findings. If you get stuck along the way, please post to the list, but make sure you include. a) The small bit of sql or java code in question. b) A description of the old and new behaviour and what you think the right behavior should be. c) The stack trace if there is one. d) What you have learned so far from your own evaluation of 1-3 above. e) A specific question that is not going to take a lot of research for someone to answer that you think might send you back along your way if answered.

--Boundary_(ID_qJbiNQs4pBDPFwdwsSt3Qg)--