A script that counts the number of tests each developer makes over a project
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

⭐️ The Testing Game 1.0 ⭐️

Welcome to the Testing Game! A simple script that counts the number of Objective-C, Java, C++ or python unit tests in the current working directory within a git repository, and showcases a ranking based on the percentage each developer has written.

Example output:

Total Tests: 2694
-------------------------------------------
1. Ellie Goulding , 659 (24.46%)
2. Bruno Mars, 255 (9.47%)
3. Ed Sheeran, 250 (9.28%)
4. Sam Smith, 199 (7.39%)
5. Calvin Harris, 147 (5.46%)

Background

This script was made to “gameify” testing at Spotify and to continue encouraging Test-Driven Development.

How It Works

The script uses the current working directory to find files it could possibly read (such as .m, .mm and .java files) and performs a git blame on these files in order to match tests written to the developers that wrote them. The owner of the method name of the test is considered the developer that wrote it. Note that since this script makes use of git, the file will need to be committed before it is counted. This will always look on the currently checked out branch.

Dependencies

The script should run on any operating system containing these two dependencies. The script may operate on lower python or git versions, but there is a certain of amount of buyer beware here.

Usage

  1. Run the Python setup.py from this repository:

    > python setup.py install
  2. Run the testing game script from your repository (or subdirectory):

    > testinggame
  3. Mention that you write most unit units of your project on every meeting (no, don’t do that).

Contribution

Yes please! Contributions are always welcomed, have a look at the CONTRIBUTING.md document for more information.

Credits

See the project’s contributors page.

License

This repository is licensed under an Apache 2 license.