Skip to content

Testing & Code Coverage

Aviad Cohen edited this page Apr 4, 2017 · 10 revisions

Testing in Smart Market Project

How to run our tests?

Run 'mvn test' from the parent directory of the project - as simple as that. This will run all our unit testing. The excepted result should be success on each one of the modules and should look like:

How do we test the project?

  1. Compiling on every commit - we use Travis to compile and run our unit tests on every commit. If the build fails, we get notification for that and we can see 'x' near the commit message.

  2. Unit tests - Currently, apart from Cart module, we have full JUnit testing for each command (from the client-server API of the project) running on every commit using Travis. We use Mockito to test all the possible results for each command. (e.g. if the Employee sends Login command, we simulate all the possible results from the server). The JUnit Testing includes also testing for Common classes (such as Client-Server communication). For each commit we allow only 100% pass, otherwise the commit gets failure ('x' near the commit message).

  3. We test our project manually to check GUI usuability and full integration of all the modules.

How do we check Code Coverage?

It is very important for us to check as many code flows as can. We use Codecov for testing our code coverage. You can see on the main project page the code coverage percentage.

Clone this wiki locally