[DiscordArchive] Regarding code style and other checks, maybe it's better to use a specialized tool for that? I just
[DiscordArchive] Regarding code style and other checks, maybe it's better to use a specialized tool for that? I just
Archived author: Deleted User • Posted: 2024-08-18T22:12:34.684000+00:00
Original source
The problem is that you can't force people to do what they don't want to do. It's a community project, it's always difficult to find testers so... But maybe without writing 100 tests an example could open the way (I'm planning to look into it but I don't know much about it yet).
Archived author: Rymercyble • Posted: 2024-08-18T22:13:17.287000+00:00
Original source
what ? yes i can....well not me specifically but project owner
Archived author: Bench • Posted: 2024-08-18T22:13:42.926000+00:00
Original source
No more contributors then
Archived author: Rymercyble • Posted: 2024-08-18T22:13:54.793000+00:00
Original source
well then no more bad code
Archived author: Rymercyble • Posted: 2024-08-18T22:14:03.973000+00:00
Original source
i mean its 1 possible approach
Archived author: walkline • Posted: 2024-08-18T23:26:27.649000+00:00
Original source
I don't quite agree with that.
You can't write tests for untestable code. To make the code testable, you need to get rid of singletons, utilize dependency injection, and work with interfaces and abstractions. So you need to refactor everything.
You can write some tests for isolated things, like these tests for configuration with environment variables – https://github.com/azerothcore/azerothco...Config.cpp, but we all know that the core functionality lies within the spell and entity systems, which are completely untestable.
Archived author: Rymercyble • Posted: 2024-08-18T23:36:11.181000+00:00
Original source
im not sure i see how are singletons or absence of abstraction limiting possibility to test stuff
Archived author: Rymercyble • Posted: 2024-08-18T23:37:14.197000+00:00
Original source
but i also never wrote tests in c++ so maybe its different here
Archived author: walkline • Posted: 2024-08-19T00:02:37.663000+00:00
Original source
You are probably writing tests in a dynamically typed language. I think you would agree that a crucial aspect of unit testing, when dealing with objects that have dependencies, is the use of mocks and stubs, right?
And if the object under test relies on a concrete implementation rather than an abstract dependency, you can’t inject a mock or stub (unlike in dynamically typed languages with duck typing).
As for singletons, they can complicate things further. Singletons make dependency injection more difficult, and its hard to isolate tests when you have global state.
Archived author: Rymercyble • Posted: 2024-08-19T00:16:03.598000+00:00
Original source
just to be clear im not saying its not making it more problematic but its still possible....ur tests wont be localized and isolated but u will still test if it works