Diffblue Playground FAQs

What will compile and run?

The example templates provide a good way to get a feel for how Diffblue 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 Diffblue 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?

Diffblue 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 analyze the code, and these resources are limited in Diffblue Playground.

Why didn’t my code generate any tests?

Diffblue Playground offers a small glimpse at what Diffblue Cover has to offer. In order to provide a free demo Diffblue 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.

Which libraries can I import into my code?

We support a stripped down list of the main Java and Javax libraries as follows:

  • java.io
  • java.lang
  • java.lang.annotation
  • java.lang.instrument
  • java.lang.invoke
  • java.lang.management
  • java.lang.ref
  • java.lang.reflect
  • java.math
  • java.net
  • java.nio
  • java.nio.channels
  • java.nio.channels.spi
  • java.nio.charset
  • java.nio.charset.spi
  • java.nio.file
  • java.nio.file.attribute
  • java.nio.file.spi
  • java.rmi
  • java.rmi.activation
  • java.rmi.dgc
  • java.rmi.registry
  • java.rmi.server
  • java.security
  • java.security.acl
  • java.security.cert
  • java.security.interfaces
  • java.security.spec
  • java.sql
  • java.text
  • java.text.spi
  • java.time
  • java.time.chrono
  • java.time.format
  • java.time.temporal
  • java.time.zone
  • java.util
  • java.util.concurrent
  • java.util.concurrent.atomic
  • java.util.concurrent.locks
  • java.util.function
  • java.util.jar
  • java.util.logging
  • java.util.prefs
  • java.util.regex
  • java.util.spi
  • java.util.stream
  • java.util.zip
  • javax.annotation.processing
  • javax.crypto
  • javax.crypto.interfaces
  • javax.crypto.spec
  • javax.lang.model
  • javax.lang.model.element
  • javax.lang.model.type
  • javax.lang.model.util
  • javax.management
  • javax.management.loading
  • javax.management.modelmbean
  • javax.management.monitor
  • javax.management.openmbean
  • javax.management.relation
  • javax.management.remote
  • javax.management.remote.rmi
  • javax.management.timer
  • javax.naming
  • javax.naming.directory
  • javax.naming.event
  • javax.naming.ldap
  • javax.naming.spi
  • javax.net
  • javax.net.ssl
  • javax.rmi.ssl
  • javax.script
  • javax.security.auth
  • javax.security.auth.callback
  • javax.security.auth.kerberos
  • javax.security.auth.login
  • javax.security.auth.spi
  • javax.security.auth.x500
  • javax.security.cert
  • javax.security.sasl
  • javax.sql
  • javax.sql.rowset
  • javax.sql.rowset.serial
  • javax.sql.rowset.spi
  • javax.tools
  • javax.transaction
  • javax.transaction.xa
  • javax.xml
  • javax.xml.crypto
  • javax.xml.crypto.dom
  • javax.xml.crypto.dsig
  • javax.xml.crypto.dsig.dom
  • javax.xml.crypto.dsig.keyinfo
  • javax.xml.crypto.dsig.spec
  • javax.xml.datatype
  • javax.xml.namespace
  • javax.xml.parsers
  • javax.xml.stream
  • javax.xml.stream.events
  • javax.xml.stream.util
  • javax.xml.transform
  • javax.xml.transform.dom
  • javax.xml.transform.sax
  • javax.xml.transform.stax
  • javax.xml.transform.stream
  • javax.xml.validation
  • javax.xml.xpath
  • org.ietf.jgss
  • org.w3c.dom
  • org.w3c.dom.bootstrap
  • org.w3c.dom.events
  • org.w3c.dom.ls
  • org.xml.sax
  • org.xml.sax.ext
  • org.xml.sax.helpers