Playground FAQs

What will compile and run?

The example templates provide a good way to get a feel for how Playground works. Any top-level class or other type that can have functional methods will compile and run. Here is an example of a simple top-level class:

public class Hello {
  public String sayHello() {
    return "World";

You also need to ensure that your class contains at least one method or a constructor.

Why does Playground require methods?

Typically a unit test covers the expected output of a method from the given input to the parameters of that method. Diffblue Cover writes tests as a human would and operates on each method inside of the provided class. Without methods there is no ‘unit’ that can be tested.

Why can’t tests be found for my method?

Playground showcases the advantages of using Diffblue Cover to generate unit tests for your code. For complex methods Diffblue Cover requires more time and resources to analyse the code, and these resources are limited in Playground.

Which libraries can I import into my code?

We support a stripped down list of the main Java and Javax libraries as follows: java.rmi java.lang.instrument
java.lang java.rmi.activation
java.lang.annotation java.rmi.dgc
java.lang.invoke java.rmi.registry java.util.prefs
java.lang.ref java.rmi.server javax.annotation.processing
java.lang.reflect java.sql javax.lang.model
java.math javax.rmi.ssl javax.lang.model.element javax.sql javax.lang.model.type
java.nio javax.transaction javax.lang.model.util
java.nio.channels javax.transaction.xa
java.nio.channels.spi javax.xml
java.nio.charset javax.xml.datatype
java.nio.charset.spi javax.xml.namespace
java.nio.file javax.xml.parsers
java.nio.file.spi javax.xml.transform javax.xml.transform.dom javax.naming javax.xml.transform.sax
java.text javax.xml.transform.stax javax.naming.event
java.text.spi javax.naming.ldap
java.time javax.xml.validation javax.naming.spi
java.time.chrono javax.xml.xpath
java.time.format org.w3c.dom
java.time.temporal org.w3c.dom.bootstrap javax.sql.rowset javax.sql.rowset.serial
java.util javax.sql.rowset.spi
java.util.concurrent org.xml.sax
java.util.concurrent.atomic org.xml.sax.ext javax.xml.crypto
java.util.concurrent.locks org.xml.sax.helpers javax.xml.crypto.dom
java.util.function   javax.xml.crypto.dsig
java.util.jar   javax.xml.crypto.dsig.dom
java.util.logging   javax.xml.crypto.dsig.keyinfo
java.util.regex   javax.xml.crypto.dsig.spec
java.util.spi   org.ietf.jgss    

Why didn’t my code generate any tests?

Playground offers a small glimpse at what Diffblue Cover has to offer. In order to provide a free demo Playground is limited to a few minutes of analysis time and a handful of method bodies. This can mean for more complex examples we are unable to generate tests. Please contact us if you wish to see what Diffblue Cover can do.

Contact us with any other questions

Name *