mashkie / FH-SEM4-TDD-Workshop-Bookmarking

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bookmarking tool

This project is part of the TDD workshop 2021 and is purpose is to get a feeling of test driven development.

This project used Java and Maven.

We have to declare the maven-surefire-plugin in the pom.xml file and configure the dependencies of this plugin.

We have to declare the following dependencies:

The junit-platform-surefire-provider dependency allows us to run tests that use either the “old” JUnit (3 or 4) or JUnit 5.

If we want to run tests that use either JUnit 3 or 4, we have to declare the junit-vintage-engine dependency.

If we want to run tests that use JUnit 5, we have to declare the junit-jupiter-engine dependency.

Jenkins and Sonarqube

Allocate more virtual memory

sudo sysctl -w vm.max_map_count=524288
sudo sysctl -w fs.file-max=131072
ulimit -n 131072
ulimit -u 8192

Start the docker-compose file

docker-compose up

SonarQube IP address for jenkins

http://sonarqube:9000/

Expose jenkins

ngrok http 8080

Add webhook to github

http://*****.ngrok.io/github-webhook

Maven goals

Run the unit tests

mvn clean test

Generate javadoc for the source code

mvn javadoc:javadoc

Generate javadoc for the test code

mvn javadoc:test-javadoc

Generate Jacoco source code coverage report

mvn test jacoco:report

Check if thresholds limits are achieved

mvn test jacoco:check

Generates a PIT Mutation coverage report to target/pit-reports/YYYYMMDDHHMI

mvn org.pitest:pitest-maven:mutationCoverage

Generates a quicker PIT Mutation coverage report to target/pit-reports/YYYYMMDDHHMI

mvn org.pitest:pitest-maven:mutationCoverage -DwithHistory

Complete example

mvn clean test jacoco:report org.pitest:pitest-maven:mutationCoverage -DhistoryInputFile=target/fasterPitMutationTesting-history.txt -DhistoryOutputFile=target/fasterPitMutationTesting-history.txt -Dsonar.pitest.mode=reuseReport -Dthreads=4 -DtimestampedReports=false

Jacoco dependencies

About


Languages

Language:Java 100.0%