Re: Need for unit testing changing the code?

2013-05-30 Thread Milan Sreckovic
That's an option I should have added to the list, you're right. It does mean we are not exercising the code that we're shipping, but it's probably better than nothing. Milan On 2013-05-30, at 3:46 PM, Joe Drew wrote: > On 2013-05-30 3:14 PM, Milan Sreckovic wrote: >> I'm thinking C++, I ima

Re: Need for unit testing changing the code?

2013-05-30 Thread Joe Drew
On 2013-05-30 3:14 PM, Milan Sreckovic wrote: I'm thinking C++, I imagine JS may have different answers or suggestions. Do we have a precedent or a preferred approach when unit testing requires changes or additions to the code? I've needed to do this in the past and resorted to an entirely di

Re: Need for unit testing changing the code?

2013-05-30 Thread Justin Lebar
> For example, a public method (which we want to test in the unit test) has a > number of side effects, but we don't have the public accessors to examine all > of those private side effects/state. I had this problem with the B2G process priority tests. >From a mochitest, I wanted to create a va

Re: Need for unit testing changing the code?

2013-05-30 Thread Benjamin Smedberg
On 5/30/13 3:14 PM, Milan Sreckovic wrote: Add public accessors, even if they're (currently) only used by the unit tests. If it doesn't hurt, this seems like a pretty good solution. --BDS ___ dev-platform mailing list dev-platform@lists.mozilla.org h

Re: Need for unit testing changing the code?

2013-05-30 Thread Ehsan Akhgari
On 2013-05-30 3:14 PM, Milan Sreckovic wrote: I'm thinking C++, I imagine JS may have different answers or suggestions. Since you mentioned C++, here is an example of an entire class [1] which I had to invent so that I can test it [2] in C++. The Gecko consumer derives [3] from this class, a