Hi Claudio!
Thanks
for the patch. This would be another quite useful task, I'm glad you
asked about it! :-) I don't think we have any policies about testing and
test coverage but here are the guidelines I usually set for myself:
- The goal of the tests is to provide confidence so we can improve the code without breaking things that already work
- 100% test coverage is not a goal in itself
- Adding a regression test for every fixed bug is helpful
- Test behaviour, not implementation
For
further work I would say let's work on adding test coverage where it's
most needed. For this I would generate some code coverage metrics and
look at where the coverage is particularly low, then look at which of
those areas will have the most positive impact on our confidence if the
test coverage is improved.
Of
the attached patch, I'd say the System.clearDateCaches() test could be
improved to better test the behaviour, for example, by figuring out what
effect it is supposed to have (I don't even know!) and thinking up a
test that would prove that that effect is happening. The System.gc()
test on the other hand, is actually kind of impossible to test from
within JS because by definition JS code cannot observe the garbage
collector's behaviour!
For more comments, why not put it in Bugzilla and we'll use the patch review system there?
Best regards,
Philip C