java-math-library icon indicating copy to clipboard operation
java-math-library copied to clipboard

Mavenenize project

Open axkr opened this issue 4 years ago • 5 comments

Please create a Maven github action to automatically test and build a JAR for every commit:

  • https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven

Define Maven pom.xml

Define Maven folder structure:

  • /src/main/java
  • /src/main/ressources
  • /src/test/java
  • /src/main/ressources

Move JUnit dependencies to Maven test scope only

axkr avatar Jun 28 '21 13:06 axkr

Yes, that would be recommendable. But priority is low for me.

TilmanNeumann avatar Jun 29 '21 14:06 TilmanNeumann

A side note: For this kind of software, performance bugs are almost as much a bug as compiler errors. And they are harder to detect and need special testing. My performance tests are typically open end (on factor argument size) and terminated by the developer (me) when he has seen enough. This may take a long time, typically hours, sometimes days. So performance tests are not very well-suited to CI tests, I would say. Unless you convince me otherwise ;-)

TilmanNeumann avatar Jul 15 '21 15:07 TilmanNeumann

Don't know your requirements exactly, but there are tools for these cases.

For example:

  • https://github.com/quick-perf/doc/wiki/core-annotations

axkr avatar Jul 15 '21 16:07 axkr

Thanks for pointing out. Don't see though how that approach could handle large test runtimes appropriately.

TilmanNeumann avatar Jul 15 '21 18:07 TilmanNeumann

For testing smaller but performance sensitive parts of the code I recommend using the Java Microbenchmarking Harness - JMH:

  • http://openjdk.java.net/projects/code-tools/jmh/
  • https://github.com/openjdk/jmh

It is created by the developers of the openJDK them self, so I assume it is very sophisticated and reliable.

It is mainly distributed as Maven project and then quite straight forward to set it up. The following is one guide, but there are plenty others in the internet: https://www.baeldung.com/java-microbenchmark-harness

If you can relay on JMH it could speed up your performance tests significantly. You could even run them in the CI, but then it should be ensured that for each run the same hardware is used to get comparable results.

HannesWell avatar Jan 10 '22 17:01 HannesWell