3

I have an app that is written and compiled in C# 5. We would like to use new features of C# 6 going forward for newer development. When we compile using the latest Tools and C# 6 Support, there are no errors, but is it going to affect the application in a way that would require us to regression test it?

fahadash
  • 3,133
  • 1
  • 30
  • 59
  • 3
    C# 6 is compiled with Roslyn so there's always a chance that something might not work quite the same. – TheLethalCoder Jan 05 '18 at 16:07
  • yea theres no way to know with how rigorous your testing is. – Daniel A. White Jan 05 '18 at 16:13
  • See also here for list of breaking changes: https://stackoverflow.com/questions/33954768/list-of-breaking-changes-in-roslyn – Amittai Shapira Jan 05 '18 at 16:16
  • 2
    The compiler is far less important than the .NET runtime it'll eventually be running on, simply because the JIT compiler does more work than the C# compiler -- even if no code changes at all, upgrading the runtime can break things. That said, any change the C# compiler induces in the bytecode can in turn affect the JIT compiler, so while it's less likely that upgrading the C# version breaks something, it's not impossible. Is there any reason, ever, why you would *not* regression test something after changing it, no matter how small the change? Isn't that what your test is *for*? – Jeroen Mostert Jan 05 '18 at 17:01
  • @JeroenMostert We have to sell the upgrade to the higher management, the cost to regression test the whole app is very high, it would become a tough sell if it has to be regression tested. – fahadash Jan 05 '18 at 19:47
  • 2
    If the cost is that high, there is almost certainly no way that going from C# 5 to C# 6 is worth it. Look at [the list](https://learn.microsoft.com/dotnet/csharp/whats-new/csharp-6) and judge for yourself if any of these features looks like something you can't do without -- it seems improbable. If you are combining this with a runtime upgrade (as in, getting performance improvements from moving to .NET 4.6/4.7) it's a much easier sell (a runtime upgrade will *definitely* need a regression test, this has been known to break apps). – Jeroen Mostert Jan 05 '18 at 20:43
  • 2
    Re: runtime upgrade: note that .NET 4, 4.5 and 4.5.1 are no longer supported (the only supported 4.x version is 4.5.2), so if you're still on one of those, you've got good grounds for upgrading (and regression testing). At which point you should aim for the highest possible version supported by your configuration, obviously, to get the most bang for your buck in the expensive regression test. – Jeroen Mostert Jan 05 '18 at 20:49

0 Answers0