Skip to content
This repository has been archived by the owner on Jan 2, 2022. It is now read-only.
/ Grades-Manager Public archive

📊 Testing skills grinding - grades manager (MongoDB + jongo, Mockito - mock, spy, TDD, bash, tests - acceptance, integration, unit)

License

Notifications You must be signed in to change notification settings

Ukasz09/Grades-Manager

Repository files navigation

📊 Grades-Manager License

Simplified grades manager made for university classes. Main idea of project has been implementing unit, integrational and acceptance tests.

About

Implemented code was intend to comply imposed on specification and give interface which allowed to run this commands:

  • <main_app_path> student <name> <nazwisko> - adding new student to database
  • <main_app_path> add subject <subject_name> - adding new subject to database
  • <main_app_path> del student <name> <nazwisko> - removing student from database
  • <main_app_path> del subject <subject_name> - removing subject from database
  • <main_app_path> count students - count students stored in a database
  • <main_app_path> count subjects - count subjects stored in a database
  • <main_app_path> set grade <name> <nazwisko> <subject_name> <grade> - adding new grade to student from given subject
  • <main_app_path> average <name> <nazwisko> <subject_name> - calculating average grade from given subject

Used tools / libraries

  • Language: Java
  • Build system: Gradle
  • Database: MongoDB
  • DB Mapper: Jongo
  • Tests library: JUnit 5
  • Mocking library: Mockito
  • Acceptance tests script language: Bash

MongoDB as a database was used mainly for educational purpose. In this case overengineering is kinda intend

Used metodology

  • ✅ TDD (Test Driven Development)

Tests

Total tests qty: 193

  • Unit tests: 91
  • Integration tests: 47
  • Acceptance tests: 55

In order to mock DB dependencies in unit tests, have been applied mocks and spies with Mockito library

Total code coverage:

  • Classes: 100%
  • Methods: 96,6%
  • Lines of code: 97,2%

coverage

Total of about 1700 lines of tests code. Full code coverage report in the form of .html files, can be found in coverage.zip

How to use it?

You can run all tests from IDE or using gradle tool:

Units tests:

./gradle test

Integration:

./gradle testInteg

Acceptance

./acceptance_tests.sh <main_app_path>

In order to test application API you can:

  • a) Run java jar application: java -jar app.jar <arguments> for example:
java -jar app.jar add student Łukasz Gajerski

  • b) Run wrapping scripts ./app.sh <arguments> or ./app.bat <arguments> for example:

Linux

./app.sh add subject Biology

Windows

./app.bat add subject Biology

You can run acceptance tests by using acceptance_tests.sh.

Acceptance tests syntax:

./acceptance_tests.sh <path to main app file>

Script takes as an argument path to any app implementation, which is comply with API mentioned in (About) section. Test will generate results for every tests and summary report. For example:

acceptance_tests


📫 Contact

Created by

gajerski.lukasz@gmail.com - feel free to contact me! ✊

About

📊 Testing skills grinding - grades manager (MongoDB + jongo, Mockito - mock, spy, TDD, bash, tests - acceptance, integration, unit)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published