commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kinow <...@git.apache.org>
Subject [GitHub] commons-lang issue #171: Removing test redundant for org.apache.commons.lang...
Date Fri, 15 Jul 2016 21:02:08 GMT
Github user kinow commented on the issue:

    https://github.com/apache/commons-lang/pull/171
  
    Both tests use ClassUtils#wrapperToPrimitive. One passes a String.class, and the other
a null value. Then the method looks at a map, created and filled in a static constructor.

    
    Since String.class is not in the map, it returns a null value.
    
    Then trying to get a value for the key null, also returns a null value.
    
    I agree that, considering code coverage, both tests are redundant. But they are assessing
two different things, as defined in the method names. One assessing that asking for null will
return a null. And the other that requesting an element that is not in the map also returns
null.
    
    Even though they may be redundant now, something may change in the future, and having
tests covering scenarios, regardless of coverage, is a good thing too.
    
    >If you do not believe any of these tests should be ignored, we would greatly appreciate
it if you could follow up on this pull request and let us know your reasons.
    
    So for this, I'm -1 for removing the test based only on coverage. They may be redundant,
looking from a test coverage perspective, but as a developer using that method, I expect to
be able to quickly understand what's going to happen in each scenario I use it. Tests and
Javadoc with some examples, covering these scenarios, can be extremely useful.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message