Il mio team non scrive test per il codice generato (ad esempio alcuni POJO). Un ingegnere che rispetto molto di recente ha scritto sul tema:
Research over the past 10 years has revealed that generated code is as prone to bugs as other code, and in many cases the bugs in generated code are far more costly to triage. Hence, the common recommendation regarding generated code is that it should be unit tested either by:
Generated unit tests (provided along-side the generated code)
Unit tests provided by the integration code
Most of the time #1 isn't available, but #2 above is usually intrinsic to the unit tests written for classes utilizing the generated code, and well written unit tests for the consuming/extended classes results in high coverage of the generated code.
This recommendation has been universally (more-or-less) picked up by the code coverage community, as evidenced by the fact that Cobertura's replacement, JaCoCo, does not even provide exclusions as an option.
Non sono stato in grado di trovare una ricerca su questo argomento, ma di nuovo non sono nel profondo delle prove. Ci sono dati su questa domanda? Se sì, quali sono le implicazioni?