views:

56

answers:

4

I have a system that has many components interacting with each other. It occured to me to run tests as part of the installation process to make sure it works correctly in the client machine.

Does this sound like a reasonable idea? Have you seen it done? What framework would you use to run the tests?

A: 

Doing some kind of post-install testing to check the install status seems like a very reasonable thing to do. Whether you call it or treat it like unit testing might confuse the subject. Unless of course your are installing 3rd part components for developers and you want to test the build.

Brian Ensink
+1  A: 

I don't think that you'd want to run your entire suite of unit tests. Depending on how large the application and how large the suite of tests, this may become a very expensive part of the installation process. Also, unit tests should functional blocks in isolation, independent of their environment.

What might be more valuable is a collection of tests, packaged as a stand-alone program, that specifically target the aspects of the installation that may be problematic. For example, making sure that registry keys were written to the expected location on a 32-bit vs. 64-bit machine or that a temporary file area is readable/writable.

Doug Mulley
A: 

Some sort of validation that the install was successful and that the necessary components are available makes sense. But I'm thinking you might be barking up the wrong tree with unit tests.

Unit tests are to make sure code still works after part of the system has been altered. You might could twist a unit testing framework to accomplish what you need, but not being its primary mission, you might run into unexpected problems.

Jason
so what would you suggest? a simple .net command line? or a Powershell sript? I asked about the Unit testing b/c all the framework is already in place and I would not have to reprogram it myself.
Nestor
+1  A: 

Unit tests (ideally) should be environmentally independent, so I don't think you would want to run unit tests after software installation. However, you should run system verification tests, which verify that the environmental conditions required by your software exist. Common examples of environmental conditions are: availability of web services, proper file access permissions, and availability of network access.

Phillip Ngan