Home » Archived » BIRT » how to do unit test for report output file content?
|
Re: how to do unit test for report output file content? [message #18583 is a reply to message #18558] |
Tue, 15 March 2005 22:22   |
Eclipse User |
|
|
|
Bruce,
Good question! Can you explain a bit about context would you be doing the
testing? Automated testing of a suite of reports?
The development team tests the BIRT engine to ensure that it faithfully
follows the layout rules specified in a design XML file. Assuming that
testing is reasonably complete, you can assume that the output will follow
your design.
Still, if you want to have an automated test, you could use a "golden file"
approach. Run the report against sample data, and visually verify that the
formatting in that sample is correct. Save this file as a "golden" file.
Then, later, automatically rerun the report against the same sample data and
verify that the two files are the same.
Some applications may want to test the application-specific portions of the
report, such as the query, business logic, and so on. The "golden file"
approach can be used for this also. In a future version, BIRT could provide
the ability to extract data from the report. This extracted data could be
compared against the expected data to ensure that the query, computed
columns, filters and so on work.
In any event, perhaps you can explain a bit more what you want to do;
automated testing of reports sounds like an interesting "best practice."
- Paul
Paul Rogers
BIRT PMC
"bruce" <bruce.liu@achievo.com> wrote in message
news:d185pr$o8i$1@www.eclipse.org...
> for example, how to check the target pdf file content is correct, how to
> check if the target html file content positioning is correct?
>
> thanks.
>
> Bruce
>
>
|
|
|
Re: how to do unit test for report output file content? [message #19523 is a reply to message #18583] |
Wed, 16 March 2005 20:19   |
Eclipse User |
|
|
|
Originally posted by: ddacunha_fr.yahoo.fr
Hi,
When it's about migrating another version of a product, I usually
compare the old PF with the new one using Adobe compare function.
Regards,
Daniel
Paul Rogers wrote:
> Bruce,
>
> Good question! Can you explain a bit about context would you be doing the
> testing? Automated testing of a suite of reports?
>
> The development team tests the BIRT engine to ensure that it faithfully
> follows the layout rules specified in a design XML file. Assuming that
> testing is reasonably complete, you can assume that the output will follow
> your design.
>
> Still, if you want to have an automated test, you could use a "golden file"
> approach. Run the report against sample data, and visually verify that the
> formatting in that sample is correct. Save this file as a "golden" file.
> Then, later, automatically rerun the report against the same sample data and
> verify that the two files are the same.
>
> Some applications may want to test the application-specific portions of the
> report, such as the query, business logic, and so on. The "golden file"
> approach can be used for this also. In a future version, BIRT could provide
> the ability to extract data from the report. This extracted data could be
> compared against the expected data to ensure that the query, computed
> columns, filters and so on work.
>
> In any event, perhaps you can explain a bit more what you want to do;
> automated testing of reports sounds like an interesting "best practice."
>
> - Paul
>
> Paul Rogers
> BIRT PMC
>
>
> "bruce" <bruce.liu@achievo.com> wrote in message
> news:d185pr$o8i$1@www.eclipse.org...
>
>>for example, how to check the target pdf file content is correct, how to
>>check if the target html file content positioning is correct?
>>
>>thanks.
>>
>>Bruce
>>
>>
>
>
>
|
|
| |
Re: how to do unit test for report output file content? [message #20523 is a reply to message #18583] |
Thu, 17 March 2005 22:09   |
Eclipse User |
|
|
|
Originally posted by: bruce.liu.achievo.com
The ultimate goal is to implement the 'continous integration' by integrating
the test cases into daily build process, so that as the product evolved,
the new feature will not break the existing feature set, and if that, we can
check it out very early.
About 'golden file' approach, do you mean we have an expected file list, and
in the test case, we generate some reports into a target file list, and we
compare
their file content one by one? About the pdf output, it should be dangerous,
because the detailed contents will be affected by your runtime environment,
for
example, sometimes the pdf output in different OS will be a little
different.
Could you please share me a URL to learn more about 'golden file'? :)
Thanks.
"Paul Rogers" <progers@actuate.com> wrote in message
news:d188q0$4ro$1@www.eclipse.org...
> Bruce,
>
> Good question! Can you explain a bit about context would you be doing the
> testing? Automated testing of a suite of reports?
>
> The development team tests the BIRT engine to ensure that it faithfully
> follows the layout rules specified in a design XML file. Assuming that
> testing is reasonably complete, you can assume that the output will follow
> your design.
>
> Still, if you want to have an automated test, you could use a "golden
file"
> approach. Run the report against sample data, and visually verify that the
> formatting in that sample is correct. Save this file as a "golden" file.
> Then, later, automatically rerun the report against the same sample data
and
> verify that the two files are the same.
>
> Some applications may want to test the application-specific portions of
the
> report, such as the query, business logic, and so on. The "golden file"
> approach can be used for this also. In a future version, BIRT could
provide
> the ability to extract data from the report. This extracted data could be
> compared against the expected data to ensure that the query, computed
> columns, filters and so on work.
>
> In any event, perhaps you can explain a bit more what you want to do;
> automated testing of reports sounds like an interesting "best practice."
>
> - Paul
>
> Paul Rogers
> BIRT PMC
>
>
> "bruce" <bruce.liu@achievo.com> wrote in message
> news:d185pr$o8i$1@www.eclipse.org...
> > for example, how to check the target pdf file content is correct, how to
> > check if the target html file content positioning is correct?
> >
> > thanks.
> >
> > Bruce
> >
> >
>
>
|
|
|
Re: how to do unit test for report output file content? [message #20531 is a reply to message #20101] |
Thu, 17 March 2005 22:23  |
Eclipse User |
|
|
|
Originally posted by: bruce.liu.achievo.com
your solution is very cool, but if it is only for unit test, is it a little
complex so that we have to write code to test for those test tools?
and I only know Tidy is written by C, so we have to call it from Java by
JNI? need more efforts to maintain the unit test code. :)
I found a JTidy project in sourceforge, but it seems it was dead.
Thanks.
"Andreas Voss" <eclipse@a-voss.de> wrote in message
news:d1cjlt$vlf$1@www.eclipse.org...
> > In any event, perhaps you can explain a bit more what you want to do;
> > automated testing of reports sounds like an interesting "best practice."
>
> We convert html pages to XML using Tidy. Then we apply a XSLT
> transformation to that XML which filters out the "noise", e.g. things
> that always change (like ID's or current date) or things that should not
> be compared over and over again (like menu bar, banner etc). The
> resulting XML is compared to the "golden file".
>
> The advantage of this approach is that you can test very specific
> portions of a page, like a table or even a single table cell. So if one
> test fails (e.g. the page title is not rendered correctly), the others
> will not because they filter out the title. Btw, we use httpunit for
> testing which has nice built-in Tidy support.
>
> Andreas
|
|
|
Goto Forum:
Current Time: Tue Jul 22 17:52:47 EDT 2025
Powered by FUDForum. Page generated in 0.05224 seconds
|