lundi 11 juillet 2016

Should I test for nullness or alike if I have static analysis enabled?

Our project have static analysis enabled, and, when it comes to testing, we starting to worry if we should test for nullness or anything that may already tested by the static analysis. Should I still test for those stuff?

e.g. for method

@RegEx("bla.*bla") 
public static String bar(@Nonnull Foo par1)

Should we have test

assertTrue(Pattern.matches(XXX.bar(someFoo)));

then test for the NPE thrown if null is passed in?

Aucun commentaire:

Enregistrer un commentaire