Lightweight Microobject Library with Graphic Output (Java)

Is there a good Java library to get good micro-tests out of the game? I think that something that can provide (with a minimal amount of hassle) provides text (CSV or HTML, take your choice) to output the results and, possibly, graphs summarizing the results. Ideally, this should be something that goes well with JUnit or the equivalent and should be easy to set up tests with variable parameters.

I looked at japex, but found it too heavy (25 MB of libraries to turn on ?!), and, frankly, it was just painful to work. Virtually nonexistent documentation, spoofing with ant, XML and paths ... etc.

+3
source share
2 answers

A few of us from the Google Collections team are in the early days of creating something that suits your needs. Here is the code for measuring the length of foo ():

public class Benchmark1 extends SimpleBenchmark {
  public void timeFoo(int reps) {
    for (int i = 0; i < reps; i++) {
      foo();
    }
  }
}

Neither the API nor the tool itself are particularly stable. We are not even ready to receive error reports or feature requests! If I have not scared you, I invite you to take Caliper for rotation.

+4
source

Oracle now has JMH. This is not only written by members of the JIT team (who will take the bulk of writing good micro-tests), but also has other neat features, such as plug-in profilers (including those that print the assembly of your hot spots using -line cpu time )

. . . .

. JUnit, Maven .

+1

Source: https://habr.com/ru/post/1727316/


All Articles