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

Testability and "Wait, it broke again?" #872

Open
Salanto opened this issue Sep 28, 2022 · 4 comments
Open

Testability and "Wait, it broke again?" #872

Salanto opened this issue Sep 28, 2022 · 4 comments
Labels
internal For internal changes that do not affect the user

Comments

@Salanto
Copy link
Contributor

Salanto commented Sep 28, 2022

Testability is the hallmark of great software. Given we use Github Actions to get quick feedback on build errors on all platforms, it is only natural that we should consider the extra mile and start rewriting code with testability in mind.

Sadly, after reading through the major classes, it becomes obvious that AO2-Client has become so tightly woven that many features are not testable without a lot of overhead and hackery to get QTest to be able to properly test each individual segment, meaning we would spend a lot of time writing tests that may break simply due to some minor aspect changing and without an easy way to properly locate what exactly broke.

Moving forward contributions should be evaluated on grounds of testability as well to ensure that new code can be verified using a testing library of our choice to stop the guessing game of what broke this random feature today.

@Salanto Salanto added the internal For internal changes that do not affect the user label Sep 30, 2022
@oldmud0
Copy link
Member

oldmud0 commented Oct 1, 2022

I have never worked in the game industry, and game testing is something that I'd really like to know more about. My current knowledge of game testing is that it's relatively hard to automate testing for anything other than pure functions, at least without a custom library specifically for testing the game. There's also automated screenshot testing (like Dolphin's testing pipeline), which compares the game pixel-by-pixel at certain key moments. But most testing is relegated to human QA testers who deal with the brunt of testing objectives.

It would probably be beneficial to start with a black-box test for critical paths - start a server, have the client connect, click a character button on the grid, try to write/send evidence, etc. No need to expose the courtroom.cpp mess - just as long as all of the widgets are well-named, seems like that's all that's needed for testing.

@Salanto
Copy link
Contributor Author

Salanto commented Oct 1, 2022

A blackbox approach can work, but there are some questions left unanswered :

If we were to join a server, we would either need a way to host it in an action or someone needs to perma-host one, which in turn would also cause it to be a target for annoying people mischievous individuals. Any ideas on that cause I doubt actions would be happy if we tried to spawn an Akashi Server inside the action and connect our client to it.

A white box approach would help us test segments, but as your fairly pointed out there are some (almost all) segments that are not testable on an individual scale.

@Salanto Salanto added this to the 2.11 Full Release milestone Oct 11, 2022
@oldmud0
Copy link
Member

oldmud0 commented Nov 21, 2022

Any ideas on that cause I doubt actions would be happy if we tried to spawn an Akashi Server inside the action and connect our client to it.

This should work perfectly fine. Actions instances should allow listening on the loopback interface. Heck, I'm pretty sure you can run containers (Docker, Podman) inside Actions and they will work just fine.

@Salanto
Copy link
Contributor Author

Salanto commented Nov 22, 2022

After some research if found this article on Github about service containers : https://docs.github.com/en/actions/using-containerized-services/about-service-containers

If we containerise a test AO2-Server we should be able to do black-box testing on connectivity and handshake behaviour, etc without needing a fully-fledged external AO2 server.

@Salanto Salanto removed this from the 2.11 Full Release milestone Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal For internal changes that do not affect the user
Projects
None yet
Development

No branches or pull requests

2 participants