Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests needed #162

Open
redcloud80 opened this issue Jul 9, 2022 · 8 comments
Open

Unit tests needed #162

redcloud80 opened this issue Jul 9, 2022 · 8 comments

Comments

@redcloud80
Copy link
Contributor

We should add unit tests for existing codebase in order to have a coverage of 80% at least.

@vlad-nitu
Copy link

Unit tested Tile.java class and created PR for it (see #164)

@redcloud80
Copy link
Contributor Author

redcloud80 commented Jul 10, 2022

Thanks for contribution! Hope it will be accepted. In order to improve code quality, I'd remove test word from method name (it is redundant) and use a self explaining format like [Calling]<METHOD>_[With<PARAMETERS or CONDITION>_]<EXPECTED_RESULT>

void getIDTest() -> CallingGetId_returnsId

Look here for some examples https://medium.com/@stefanovskyi/unit-test-naming-conventions-dd9208eadbea

@vlad-nitu
Copy link

vlad-nitu commented Jul 10, 2022

@redcloud80 thanks for the additional reading material, I'll have your note in mind when naming other test methods in the future (as I find getters test names to be self-explanatory).

@redcloud80
Copy link
Contributor Author

redcloud80 commented Jul 12, 2022

Classes that need to be covered with a first unit test iteration:

PLEASE RESERVE A TASK IN ORDER TO AVOID CODING TASK OVERLAPPING BETWEEN DEVELOPERS.

  • Audio.java
  • Camera.java
  • Constants.java
  • Options.java
  • PClass.java
  • SideScroller.java
  • Tileset.java
  • Utility.java
  • components/AnimationComponent.java
  • components/Tile.java [PR waiting by @vlad-nitu]
  • entities/CleanerRobot.java
  • entities/Enemy.java
  • entities/Player.java
  • multiplayer/Multiplayer.java [DONE by @redcloud80]
  • objects/BackgroundObject.java
  • objects/CollidableObject.java
  • objects/EditableObject.java
  • objects/EditorItem.java
  • objects/GameObject.java
  • objects/MagicSourceObject.java
  • objects/MirrorBoxObject.java
  • particleSystem/Particle.java
  • particleSystem/ParticlePreloadSystem.java
  • particleSystem/ParticleSystem.java
  • particleSystem/Particles.java
  • particleSystem/emissions/ArchEmission.java
  • particleSystem/emissions/AreaEmission.java
  • particleSystem/emissions/DirectionalEmission.java
  • particleSystem/emissions/ParticleEmission.java
  • particleSystem/emissions/RectEmission.java
  • particleSystem/emissions/RotationEmission.java
  • particleSystem/events/ParticalVelocityController.java
  • particleSystem/events/ParticleAccelerationController.java
  • particleSystem/events/ParticleAnimationController.java
  • particleSystem/events/ParticleChildController.java
  • particleSystem/events/ParticleEventListener.java
  • particleSystem/events/ParticleNoLoopController.java
  • particleSystem/events/ParticleSizeController.java
  • projectiles/MagicProjectile.java
  • projectiles/ProjectileObject.java
  • projectiles/Swing.java
  • scene/AudioSettings.java
  • scene/GameplayScene.java
  • scene/MainMenu.java
  • scene/MultiplayerClientMenu.java
  • scene/MultiplayerHostMenu.java
  • scene/MultiplayerMenu.java
  • scene/PScene.java
  • scene/PauseMenu.java
  • scene/Settings.java
  • scene/gameplaymodes/GameplayMode.java
  • scene/gameplaymodes/ImportGameMode.java
  • scene/gameplaymodes/InventoryGameMode.java
  • scene/gameplaymodes/LoadExampleGameMode.java
  • scene/gameplaymodes/ModifyGameMode.java
  • scene/gameplaymodes/MoveGameMode.java
  • scene/gameplaymodes/PlayGameMode.java
  • scene/gameplaymodes/SaveGameMode.java
  • scene/gameplaymodes/TestGameMode.java
  • ui/Anchor.java
  • ui/Button.java
  • ui/List.java
  • ui/Notifications.java
  • ui/NumberInputField.java
  • ui/ScrollBarHorizontal.java
  • ui/ScrollBarVertical.java
  • ui/Slider.java
  • ui/Tab.java
  • ui/TextInputField.java
  • windows/ImportLevelWindow.java
  • windows/LoadLevelWindow.java
  • windows/SaveLevelWindow.java

@micycle1
Copy link
Collaborator

At this stage your time would better spent developing the game, rather than adding tests.

@redcloud80
Copy link
Contributor Author

I will for sure but testing is something that shouldn't be separated from feature implementation. I wouldn't release new features with no tests.

@calfaand
Copy link

calfaand commented Nov 3, 2022

Hello, can I contribute to this project with writing tests ?

@redcloud80
Copy link
Contributor Author

Hello, can I contribute to this project with writing tests ?

Hi, which class would you like to take care of? Open a specific issue for the task please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants