- May 31, 2012
- 18
- 17
- Home Country
- United Kingdom
In Media Portal 1 the unit tests are clearly not being used which makes development difficult and risky.
Problem:
1) They are still configured to build with the .NET Framework 3.5 which doesn't work because the rest of the system was already upgraded to .NET 4.
2) They don't compile for various other reasons.
3) They are dependent on a third party tool which is closed source and has no direct download link, i.e. Typemock.
4) They have clearly been set aside because they are hidden in a different solution which does not build and large portions of the code are commented out.
5) No evidence of any Test Driven Development because of the above, especially #4. Unit tests should be in the same solution as the code, ready to use, integrated with Visual Studio.
Background / Justification:
So I thought I finished a plugin patch which operates on external data and want to test it, but there is nowhere for me to add this test. Worse, it looks like nobody does any testing at all! In this case especially, I must work with a complex and sparsely documented component, WebEPG, with most debug information either missing or deliberately disabled in the code! The complexity of the templates and regular expressions one must build to extract the data make it overly time consuming and very frustrating. When a unit test existed it would be a quick case of stepping through targeted code (without the whole system built and installed) with the debugger to get straight to the cause.
Goals:
1) Restore the unit tests to the solutions using the current testing frameworks.
2) Remove third party closed source dependencies, i.e. Typemock. This is especially annoying since they have no NuGet package and do not offer a direct download link (really pushing you towards the free trial of the paid version, requiring your personal data).
3) Re-activate as many of the existing/forgotten unit tests. Remove code which is depreciated.
4) From this baseline, as a proof of concept, finally add my unit test in the proper location (what should have been easy in the first place).
5) Update documentation/wiki/standards/forum to make it clear of their existence and encourage quality/TDD.
So far it looks like XUnit.NET (NUnit replacement available via NuGet) should be used with some kind of auto-mocking extension(s) (to replace Typemock) such as AutoFixture with NSubstitute or Rhino Mocks, etc... basically whatever fits best with current .NET and Visual Studio versions, is popular, open source or free from Microsoft, maintained and can be used/built without complexity or obscurity.
I've already got plenty of XUnit experience and how to migrate to it so that'll be done quickly. I'll start with the TVLibrary solution so I can get my WebEPG patch tested and submitted. Right now I'm researching the best Typemock replacement which is the only delay, but should be done carefully (suggestions welcome).
Problem:
1) They are still configured to build with the .NET Framework 3.5 which doesn't work because the rest of the system was already upgraded to .NET 4.
2) They don't compile for various other reasons.
3) They are dependent on a third party tool which is closed source and has no direct download link, i.e. Typemock.
4) They have clearly been set aside because they are hidden in a different solution which does not build and large portions of the code are commented out.
5) No evidence of any Test Driven Development because of the above, especially #4. Unit tests should be in the same solution as the code, ready to use, integrated with Visual Studio.
Background / Justification:
So I thought I finished a plugin patch which operates on external data and want to test it, but there is nowhere for me to add this test. Worse, it looks like nobody does any testing at all! In this case especially, I must work with a complex and sparsely documented component, WebEPG, with most debug information either missing or deliberately disabled in the code! The complexity of the templates and regular expressions one must build to extract the data make it overly time consuming and very frustrating. When a unit test existed it would be a quick case of stepping through targeted code (without the whole system built and installed) with the debugger to get straight to the cause.
Goals:
1) Restore the unit tests to the solutions using the current testing frameworks.
2) Remove third party closed source dependencies, i.e. Typemock. This is especially annoying since they have no NuGet package and do not offer a direct download link (really pushing you towards the free trial of the paid version, requiring your personal data).
3) Re-activate as many of the existing/forgotten unit tests. Remove code which is depreciated.
4) From this baseline, as a proof of concept, finally add my unit test in the proper location (what should have been easy in the first place).
5) Update documentation/wiki/standards/forum to make it clear of their existence and encourage quality/TDD.
So far it looks like XUnit.NET (NUnit replacement available via NuGet) should be used with some kind of auto-mocking extension(s) (to replace Typemock) such as AutoFixture with NSubstitute or Rhino Mocks, etc... basically whatever fits best with current .NET and Visual Studio versions, is popular, open source or free from Microsoft, maintained and can be used/built without complexity or obscurity.
I've already got plenty of XUnit experience and how to migrate to it so that'll be done quickly. I'll start with the TVLibrary solution so I can get my WebEPG patch tested and submitted. Right now I'm researching the best Typemock replacement which is the only delay, but should be done carefully (suggestions welcome).