Spice86 icon indicating copy to clipboard operation
Spice86 copied to clipboard

Tests: More unit tests

Open maximilien-noal opened this issue 1 year ago • 5 comments

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 avatar May 10 '23 21:05 maximilien-noal

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 avatar May 19 '23 09:05 maximilien-noal

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

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

maximilien-noal avatar May 30 '23 10:05 maximilien-noal

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 avatar Jul 07 '23 17:07 maximilien-noal

For integration tests, this may be worth it someday:

https://github.com/LightBDD/LightBDD

instead of SpecFlow.NET (which is slow)

maximilien-noal avatar Aug 22 '23 20:08 maximilien-noal

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

maximilien-noal avatar Aug 23 '23 18:08 maximilien-noal