Skip to content

Increase test coverage #25

@JPDSousa

Description

@JPDSousa

Hacktoberfester? :octocat:

Hey Hacktoberfester, if you came across this issue and you like MongoDB (and java), you've just found an awesome project to contribute to!

If you're not so much into databases and ORMs but you would like to contribute to other projects of mine: search my other Hacktoberfest issues

Description 🔍

Test coverage is really useful in any kind of software project. Smof greatly appreciates test coverage contributions.

How to? 😧

⚠️ Do not panic! Test coverage is not rocket science! ⚠️
Smof uses Maven to run tests. So, in order to run existing tests and create your own:

  • Clone the repository;
  • Be sure to have maven installed in your machine (check the Maven homepage on how to download and install maven;
  • Start a MongoDB instance:
    • mongod --port 20720
    • You can, optionally, specify a path to the database or any other valid options, just make sure the port is set to 27020, which is the port used by Smof to run tests;
  • hit mvn clean verify in the projects root folder (i.e. mongo-obj-framework) by default, and wait for the green text stating that everything went fine;
  • Now you're good to go. Add tests to the test source folder src/test/java and increase the test coverage!
    • Remember to create test classes that end with Test, such as ExampleTest.java, as Maven Surefire plugin will only run classes with that pattern;
    • Focus on code that is not tested yet. You can resort to the codecov reports, or even to the reports generated by Maven Jacoco Plugin, stored in {project.root}/target/site/jacoco (open the index.html for a sort-of-pretty report).

Questions?

Smof is in active development, and has not been properly tested, which may lead to some occasional bugs or questions. Feel free to create an issue if you stumble upon any bug or comment bellow if you have any douts.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions