Re: Extending tests



On Mon, Jan 23, 2017 at 8:56 AM Claudio André <claudioandre br gmail com> wrote:
Hi

I was trying to extend some tests. If anyone can take a look at the attached patch and tell me what else I can do, what policies I missed, etc, I will be grateful.

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
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]