Trivial getters and constructors, and codes T001 and T005

I’m trying to generate tests for Apache Accumulo and I don’t get tests for two methods:

17:37:16.383 INFO [1/3] Created 0 tests for method org.apache.accumulo.core.conf.AccumuloConfiguration.getUpdateCount
17:37:16.383 INFO [1/3]   Method considered not valuable to test due to T001: Trivial getters are not considered valuable to test.
17:37:16.386 INFO [2/3] Created 0 tests for method org.apache.accumulo.core.conf.AccumuloConfiguration$ScanExecutorConfig.<init>
17:37:16.386 INFO [2/3]   Method considered not valuable to test due to T005: Trivial constructors are not considered valuable to test.

Two questions:

  • What exactly is the definition of ‘trivial getter’ and ‘trivial constructor’ for Cover?
  • Can I override this decision and try to get a tests for these methods? How?

I’m aware of, but it doesn’t really answer the questions above.

This is what I did:

git clone
cd accumulo
git checkout cfd8d44
mvn package -DskipTests # needs Java 11
cd core
dcover create org.apache.accumulo.core.conf.AccumuloConfiguration

A trivial getter is a method that just returns the value of a field or a constant. A trivial constructor is a constructor that does trivial initialisation such as assigning the constructor’s arguments to the corresponding fields.
We don’t create tests for such methods because

  • such tests have very low value in general,
  • such methods are usually tested as part of other tests, and
  • such tests just clutter your test classes with code that will be onerous to maintain later.

There is no flag to override this decision at the moment.
The methods that you mentioned are correctly classified as trivial. However, If you see a method mistakingly classified as trivial then please let us know.