RE: Calc unit tests

2017-03-23 Thread Winfried Donkers
Hi Markus,

>> I'm working on fixes for Calc functions (LEGACY.)CHITEST and CHISQ.TEST 
>> that came forward when Raal compared results between Calc and Excel.
>> When compiling my changes I came across unit test functions in 
>> sc/qa/unit/ucalc_formula.cxx, as these failed because of my changes.
>> They tested the current behaviour, not the ODFF1.2 specs.

> So for now I suppose the best way forward is to just adapt the existing tests 
> to conform to your improved implementation.

No problem, will do.

That brings me to the next issue: ODFF1.2 interpretation and Excel 
interoperability.
ODFF1.2 states for LEGACY.CHITEST that "For an empty element or an element of 
type Text or Boolean in A the element at the corresponding position of E is 
ignored, and vice versa.". This was not the case and I am fixing that.
Excel ignores empty elements AND retains the value for the number of rows and 
columns of the ranges, i.e. a range of 3x3 and a range of 3x4 (same value plus 
an empty row somewhere) produce different results. I can't see any mathematical 
reason in retaining the number of rows and columns of the ranges in case of 
empty elements, but it very much simplifies the calculation and with my fix 
Calc reproduces Excel's behaviour.

But what if ALL elements are empty? All ignored produces a Xi^2 of 1, i.e. a 
function result of 1. But Excel returns an error (#DIV/0!, even) and that I 
cannot explain or defend.
IMHO Calc should return 1 or return IllegalArgumentError plus corresponding 
explanation in help/ODFF1.2 that the ranges must have at least 1 data pair 
(i.e. a change request to add a constraint to ODF1.2 for LEGACY.CHITEST). That 
way we block a useless use case and retain interoperability with Excel (even 
though the error type differs).
I would like to hear your opinion in this, as it seems we have to choose 
between a mathematic approach/ODF1.2 and Excel's behaviour.

(And Boolean is a type I cannot distinguish from numeric, so that part of 
ODFF1.2 I have to ignore.)

Winfried
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc unit tests

2017-03-22 Thread Markus Mohrhard
Hey Winfried,

On Wed, Mar 22, 2017 at 2:02 PM, Winfried Donkers <
w.donk...@dci-electronics.nl> wrote:

> Hi Markus,
>
>
>
> I'm working on fixes for Calc functions (LEGACY.)CHITEST and CHISQ.TEST
> that came forward when Raal compared results between Calc and Excel.
>
> When compiling my changes I came across unit test functions in
> sc/qa/unit/ucalc_formula.cxx, as these failed because of my changes. They
> tested the current behaviour, not the ODFF1.2 specs.
>
> I wonder if you have ideas about these tests now Raal has made test
> documents for almost all Calc functions? Can they be deleted, at least the
> CHITEST-test function, or do you intend to keep both unit tests (in which
> case I shall fix that test too)?
>

We still plan to have some tests in ucalc_formula.cxx. They have the
advantage of being more precise (they point directly to a failing
statement) and are much faster to execute. However such a test should only
be added in case of a fixed bug or a problem that is not easily covered in
the formula tests.

It is not unexpected that some of them are written against the
implementation instead of the specification. The best solution is to adapt
them while fixing the implementation. Actually I would consider them doing
there job if they start to fail when you update the implementation. While a
failing unit test normally means something broke you always need to
evaluate the failure and assess whether it might not be an expected failure
based on the new implementation.

So for now I suppose the best way forward is to just adapt the existing
tests to conform to your improved implementation.

Regards,
Markus


>
>
> Winfried
>
>
>
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Calc unit tests

2017-03-22 Thread Winfried Donkers
Hi Markus,

I'm working on fixes for Calc functions (LEGACY.)CHITEST and CHISQ.TEST that 
came forward when Raal compared results between Calc and Excel.
When compiling my changes I came across unit test functions in 
sc/qa/unit/ucalc_formula.cxx, as these failed because of my changes. They 
tested the current behaviour, not the ODFF1.2 specs.
I wonder if you have ideas about these tests now Raal has made test documents 
for almost all Calc functions? Can they be deleted, at least the CHITEST-test 
function, or do you intend to keep both unit tests (in which case I shall fix 
that test too)?

Winfried

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice-qa] New way for non coders to help with calc unit tests

2011-10-01 Thread Alexander Thurgood
Le 30/09/11 22:37, Markus Mohrhard a écrit :


Hi Markus,

Thanks for the heads up and the work on preparing the ground and basics
for what I hope will be a very useful addition to the unit testing of
LibreOffice. Although I'm not much of a Calc user myself, I will have a
look at what has been prepared and see if I can add anything useful.

Thanks once again to everyone who worked on this.

Alex

___
List Name: Libreoffice-qa mailing list
Mail address: Libreoffice-qa@lists.freedesktop.org
Change settings: http://lists.freedesktop.org/mailman/listinfo/libreoffice-qa
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://lists.freedesktop.org/archives/libreoffice-qa/


[Libreoffice-qa] New way for non coders to help with calc unit tests

2011-09-30 Thread Markus Mohrhard
Hello guys,

I want to present you the new way you can write build-time unit tests for
calc.
*
How are the tests organized?*

The tests are located in sc/qa/unit and consists of filters-test.cxx and the
files in sc/qa/unit/data. In the data directory there is one directory per
supported file extensions (ods, xls, xlsx) and one directory contentCSV that
only contains csv files. Please don't touch the other directories, they are
for special tests) At the moment we have a for-named-ranges test, a database
ranges test , a formatting test and a standard content test file.
Additionally there is one file per directory for bugfix tests so that import
bugs that are fixed once will not reoccur.  If possible a new test case
should be added to each of the three directories so that we test as much as
possible for every filter.
*
What can we test?*

We can test the content of a calc document directly after loading it. It is
quite easy to test the content of cells, that means the formula in a cell,
the result as a value and the formatted result as a string. It is even
possible to test the result of cells that are part of conditional
formatting. It gets more complicated for other stuff since I don't have any
csv handler for that or it might need some code to test it.

We can't test any dynamic changes in calc documents with this test ( there
is ucalc for these cases). So for unit tests that try to emulate user input
and/or changes that go beyond what is done during loading, can't be tested
with this easy unit test.

*
How to write a new test?*

It's quite easy to write a new unit test.
 The first step is to create a document that should be tested or
add/extend an existing sheet in a document.
 The second step is to create for every sheet a csv file that contains
the expected result, formula or string that the test document should
contain.

*How can I get the existing files?*

Either you have the source code already than it is in sc/qa/unit or you can
get the files from:
http://cgit.freedesktop.org/libreoffice/core/plain/sc/qa/unit/data


I will create a wiki page for these information soon but feel free to ask me
anything or make suggestions. I try to announce changes around this on the
QA list.


It would be amazing if some of the calc users would write or extend the
existing tests. Even if you could provide just one or two test cases you
would help very much ensure that our next release will contain less bugs and
that calc becomes even more stable.
Here are somethings, for instance, that could be tested or
the test extended:
 - normal content
 - data pilot/pivot table
 - the functions document should be extended to all build-in functions (
testing special cases, normal behaviour, etc. )
 - advanced functions like sorted content, autofilter, subtotals,
scenarios, etc.
 - some of the import bugs fixed during the 3-4 release cycle

I'm sure I missed a lot of important things and that is your big chance! Did
you ever wanted to commit something to Libreoffice source code but you don't
know how to code ? You don't have the time to get familiar with the code ?
This is the perfect opportunity to get your first commit ;) You have a nasty
bug that you don't want to see again ? Write a test file, add a csv file
with the expected content and send it to the
libreoffice-qa@lists.freedesktop.org list.

I'm looking forward to all your great contributions that will help us to
release a nice next version.

Regards,
Markus


 P.S. Links to all ods documents that we have at the moment:

http://cgit.freedesktop.org/libreoffice/core/plain/sc/qa/unit/data/ods/bug-fixes.ods

http://cgit.freedesktop.org/libreoffice/core/plain/sc/qa/unit/data/ods/database.ods

http://cgit.freedesktop.org/libreoffice/core/plain/sc/qa/unit/data/ods/formats.ods

http://cgit.freedesktop.org/libreoffice/core/plain/sc/qa/unit/data/ods/functions.ods

http://cgit.freedesktop.org/libreoffice/core/plain/sc/qa/unit/data/ods/named-ranges-global.ods

http://cgit.freedesktop.org/libreoffice/core/plain/sc/qa/unit/data/ods/universal-content.ods
___
List Name: Libreoffice-qa mailing list
Mail address: Libreoffice-qa@lists.freedesktop.org
Change settings: http://lists.freedesktop.org/mailman/listinfo/libreoffice-qa
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://lists.freedesktop.org/archives/libreoffice-qa/