https://issues.apache.org/bugzilla/show_bug.cgi?id=46962

--- Comment #26 from Mehdi Houshmand <[email protected]> 2012-03-22 21:55:19 
UTC ---
<snip/>

> And despite that, they probably don't even bring adequate coverage. Many 
> fields
> are set to a mock of some property (see e.g. EnumLengthTestCase). So the 
> equals
> method will compare two physically identical instances, which is definitely a
> narrow use case. We should also test the cases of properties made of 
> physically
> different but logically identical fields.
> 
> Likewise, the tests for not equals should be broader and test different
> combinations of field values.
> 
> Implementing proper coverage would require even more mocking, and things will
> start to be really unwieldy.

Yup, I came to the same conclusion and did what I could in the limited time I
had... Not ideal, but better than nothing right?

> 
> I'm not sure what's the right approach to this. Maybe some helper library like
> EqualsVerifier?
> http://code.google.com/p/equalsverifier/

I did see this and it'd be great if we used this, and it'd be awesome if we
used used a repository management system. But a) it introduces a new version of
objenesis (which may or may not cause compatibility issues) b) 2 new compile
time dependencies c) who's going to create the documentation.

Using these new libraries for testing is great, if people know how to use them
(and that's a big caveat). Take mocking for example, it's used widely enough in
the industry to assume devs either know or can find out how to use the mocking
frameworks. I'm not convinced this particular library is widely used enough and
if something broke we have to be confident ANYONE can fix the issue.

I should say, I'm not against adding these libraries, I think it's important to
take testing seriously, but we have to be aware of the implications of adding
dependencies and not just in terms of the classpath.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to