Re: Obfuscation & unit testing

Michael Reppy <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
Cory Foy wrote:
> Typically obsfucation is done just before the product releases, after 
> the unit testing has been done. Personally, my job involved flying 
> onsite to customers when systems go wrong, and debugging third-party 
> systems, and obsfucation ends up just delaying us getting the systems 
> online. I curse at SharePoint everytime we have to dig into it (yes, 
> aa() is calling into b() and it's call to zhfrtt() is taking 38 seconds).
> 
> I guess the question is, are you looking to run your unit tests after 
> obsfucation, or use obsfucated binaries?
> 

I appreciate the support problems with obfuscation, and I guess I'm just 
going to have to live with them as it is mostly not my call there.  I 
had already raised that issue with management and agreed to lose on it :-)

I want to be able to run the unit tests with and without obfuscation.  I 
am pretty leery of the idea of taking nicely tested code and then going 
and futzing with it right before packaging a release!  But if the unit 
test run is clean, it's probably not more broken than what I wrote in 
the first place.

What I envision is a TDD process without obfuscation most of the time. 
When an external release is made, the normal tests will be run, the 
application dlls will be obfuscated and the tests will be rerun to 
verify that there were no issues introduced by obfuscation.  I then want 
to package those very same dlls as the release items, so the release 
itself is tested.

Our application is complicated by the fact that we have a compact 
framework application which is 80% of the code and a small desktop 
component that is the remainder, so we've got two different platforms to 
target.

It seems if I rearrange how we are handling strong naming issues and set 
up the solution to deploy the application dlls and test dlls to one 
folder I can obfuscate the application dlls but not the test dlls and 
still have them linked and the tests continue to have their highly 
descriptive names but the stack traces show that they are testing the 
obfuscted dlls.

That all seemed to work fine.  The only potentially fatal flaw I found 
is with the strong naming issue, something I don't entirely understand 
in .net, particularly the differences between reflection on the desktop 
and handheld.  The help & support from the Dotfuscator people seemed to 
have a process for applying strong names after the fact, which I can 
follow after I spend some time figuring out what's going on.

Anyway, that's what I've figured out so far.  Any thoughts, advice & 
experience appreciated!

-Mikey Reppy
[email protected]


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.