OpenRakis / Spice86

Reverse engineer and rewrite real mode DOS programs!
Apache License 2.0
216 stars 18 forks source link

Tests: More unit tests #310

Open maximilien-noal opened 1 year ago

maximilien-noal commented 1 year ago

A lot of new code is not covered by unit tests. While it works since it's tested by try to make games run, it's harder without tests to detect regressions.

Also: https://stryker-mutator.io/docs/stryker-net/introduction/ "Stryker.NET offers you mutation testing for your .NET Core and .NET Framework projects. It allows you to test your tests by temporarily inserting bugs. Stryker.NET is installed using NuGet."

This package could help a lot to ensure new unit tests are sharp enough.

maximilien-noal commented 1 year ago

https://plugins.jetbrains.com/plugin/20747-unittestbot-net could really help with this !

Automated unit test generation tool for .NET code. Generating ready-to-use test cases with method bodies and inputs Maximizing branch coverage in regression suite while keeping the number of tests at minimum Capable to find deeply hidden code defects and express them as tests Applicable to LINQ syntax and complex generics Supporting .NET Framework, .NET Core, .NET 5, and .NET 6 Powered by V# — the custom symbolic execution engine

Sadly my version of Rider is too new ATM.

maximilien-noal commented 1 year ago

Also related: unit test for the CPU for all instructions beyond the 8086:

https://github.com/OpenRakis/Spice86/issues/228

maximilien-noal commented 1 year ago

For Code QA, maybe look into Jetbrains Qodana (github action) instead of GitHub's Code QL.

Also, once the coverage is good enough: https://github.com/simon-k/dotnet-code-coverage-badge

maximilien-noal commented 1 year ago

For integration tests, this may be worth it someday:

https://github.com/LightBDD/LightBDD

instead of SpecFlow.NET (which is slow)

maximilien-noal commented 1 year ago

For filesystem dependent parts: https://github.com/TestableIO/System.IO.Abstractions