Skip to content

Latest commit

 

History

History

java_maven

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Java Maven Example

Generate test coverage report

mvn test

Running MutaHunter to Analyze Tests

Initial Test Coverage

Currently test coverage is 100%. But how good is the test suite? Let's find out.

LLM-based Mutation Testing

export OPENAI_API_KEY=your-key-goes-here
mutahunter run --test-command "mvn test" --code-coverage-report-path "target/site/jacoco/jacoco.xml" --coverage-type jacoco --model "gpt-4o-mini"

Generate unit tests to increase line and mutation coverage

# remove some tests
mutahunter gen --test-command "mvn test -Dtest=BankAccountTest" --code-coverage-report-path "target/site/jacoco/jacoco.xml" --coverage-type jacoco --test-file-path "src/test/java/BankAccountTest.java" --source-file-path "src/main/java/com/example/BankAccount.java" --model "gpt-4o" --target-line-coverage 0.9 --max-attempts 3

Check logs/_latest/html for mutation report.