SypherEngine / SypherEngine

A simple, fast and lightweight 2D Game Engine, written in Java with JavaFX
https://sypherengine.github.io
MIT License
43 stars 3 forks source link

Tests #13

Open AurumByte opened 3 years ago

AurumByte commented 3 years ago

SypherEngine doesn't have Unit tests yet... so adding them is gonna be a must

Tests:

Yeffian commented 2 years ago

Could I be assigned to this issue?

AurumByte commented 2 years ago

Hello there! You can totally go ahead and get started :) I know I haven't been that clear on this issue, so I have updated it to provide a better roadmap for this issue.

Yeffian commented 2 years ago

Hello there!

You can totally go ahead and get started :) I know I haven't been that clear on this issue, so I have updated it to provide a better roadmap for this issue.

Thanks for the updated roadmap, its much clearer what I need to do now 😄. One question though. When you say Benchmarks, what kind of benchmarks are you looking for exactly? Like, benchmarks for rendering and stuff?

AurumByte commented 2 years ago

When you say Benchmarks, what kind of benchmarks are you looking for exactly? Like, benchmarks for rendering and stuff?

Yes. While you can't really benchmark the entire program (the update and render loops run infinitely unless closed), you can still benchmark the time it takes to reach a certain point in the program under certain conditions, like for example:

I am rendering 100 squares, how long does it take to finish rendering one frame, and so on like that. You can also benchmark the responsiveness of the engine in doing certain tasks, like loading the window itself, for instance...

By benchmarking, we end up trying to put the engine under stress and see how it performs. If it is really slow in some aspects, it should be looked at as an issue and must be fixed, and if it is fast, well, it can always be faster xD

Yeffian commented 2 years ago

When you say Benchmarks, what kind of benchmarks are you looking for exactly? Like, benchmarks for rendering and stuff?

Yes. While you can't really benchmark the entire program (the update and render loops run infinitely unless closed), you can still benchmark the time it takes to reach a certain point in the program under certain conditions, like for example:

I am rendering 100 squares, how long does it take to finish rendering one frame, and so on like that. You can also benchmark the responsiveness of the engine in doing certain tasks, like loading the window itself, for instance...

By benchmarking, we end up trying to put the engine under stress and see how it performs. If it is really slow in some aspects, it should be looked at as an issue and must be fixed, and if it is fast, well, it can always be faster xD

But shouldn't that type of benchmarking be handled separately from unit tests? Unit tests test if code works, and benchmarks measure the efficiency for the code. Shouldn't those be separated?

AurumByte commented 2 years ago

yes, but then again, they will end up in separate classes at most, as the respective benchmarks and unit tests will be put in their respective modules. You won't be finding physics based tests in the core engine module and vice versa.

Preferably, the Unit tests will be run first, and if they pass, the benchmarks will be run right after, so we have a nice and rather fail safe system, with the benchmarks only being run when the tests pass. Since we are mostly testing the core engine for now, we will have to separate the unit tests from the benchmarks, but both don't have to be limited to only certain modules, as every part of the engine can be benchmarked for performance...

To be honest, Its my mistake that I just plainly stated "benchmarks" rather than to detail it out, so I'll update that bit quickly. thanks for pointing it out :+1:

Yeffian commented 2 years ago

Makes sense, thanks for the clarification 👍

AurumByte commented 2 years ago

There we go, I hope everything is clear now. If there are any further clarifications, don't hesitate to give me a ping, I'll be happy to help :smile:

AurumByte commented 2 years ago

@YeffyCodeGit Lets put this issue on hold until the above mentioned issue is fixed

Yeffian commented 2 years ago

Yep, sounds good 👍