Brad Wilson<p>I love theories in <span class="h-card" translate="no"><a href="https://dotnet.social/@xunit" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>xunit</span></a></span>.</p><p>The <a href="https://mastodon.social/tags/Roslyn" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Roslyn</span></a> analysis testing framework does not love theories.</p><p>The compilation step for running an analyzer/fixer test is so expensive that it encourages massive test collapse.</p><p>In one example, I went from testing 12 permutations to testing 36, and the time spent running them went down by 20%. Better coverage, faster, but the result is giant tests born of copy/paste.</p><p>Before: <a href="https://github.com/xunit/xunit.analyzers/blob/4d9048672a0ae0de6980b5f7e0f87ce560814dde/src/xunit.analyzers.tests/Analyzers/X1000/MemberDataShouldReferenceValidMemberTests.cs#L255-L401" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/xunit/xunit.analyze</span><span class="invisible">rs/blob/4d9048672a0ae0de6980b5f7e0f87ce560814dde/src/xunit.analyzers.tests/Analyzers/X1000/MemberDataShouldReferenceValidMemberTests.cs#L255-L401</span></a> </p><p>After: <a href="https://github.com/xunit/xunit.analyzers/blob/db66d95621a7a51a24e21b164bdf996554301e30/src/xunit.analyzers.tests/Analyzers/X1000/MemberDataShouldReferenceValidMemberTests.cs#L255-L432" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/xunit/xunit.analyze</span><span class="invisible">rs/blob/db66d95621a7a51a24e21b164bdf996554301e30/src/xunit.analyzers.tests/Analyzers/X1000/MemberDataShouldReferenceValidMemberTests.cs#L255-L432</span></a></p><p><a href="https://mastodon.social/tags/DotNet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DotNet</span></a> <a href="https://mastodon.social/tags/CSharp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CSharp</span></a> <a href="https://mastodon.social/tags/Analyzer" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Analyzer</span></a></p>