vendredi 26 décembre 2014

JUnit3 and JUnit4 in the same project (but different module)?


I have an Android project with a Gradle build. We've decided to commit to writing a vanilla Java implementation of our business logic (since we took care to keep that divorced form the Android framework initially) and so I've pulled the core code out into a core module. This has the added benefit of allowing us to easily use JUnit 4 and a plain JVM (no Robolectric necessary) to have lightning fast, modern, unit tests.


Unfortunately Android is stuck on JUnit 3. Some members of my team are resisting because they don't like the idea of two different testing frameworks. They claim the cognitive dissonance of switching between them would be a nuisance and don't see the value in the features JUnit 4 affords. Frankly, I think the fact that Android forces JUnit 3 down your throat is a nuisance, as do some others on my team, and highly value the additional features provided by JUnit 4.


I don't care for a feature comparison between Junit 3 and 4 or opinions on which framework is better (I thought JUnit 4 was all people used these days anyway). The question is, "Is it acceptable to use an end-of-life circa 2005 framework simply to reduce cognitive load?". And, are there more substantial points to consider when you put, specifically, JUnit 3 and JUnit 4 side-by-side in the same codebase?





Aucun commentaire:

Enregistrer un commentaire