I’ve been working in windows forms applications and ASP.Net applications for the past 10 months. I’ve always wondered how to perform proper unit testing on the complete application in a robust manner covering all the scenarios. I’ve the following questions regarding them –
- What are the standard mechanisms in
performing unit testing and writing test cases? - Does the methodologies change based
on the application nature such as
Windows Forms, Web applications etc? - What is the best approach to make
sure we cover all the scenarios? Any
popular books on this? - Popular tools for performing unit
testing?
If you want to know how to test whole application, it’s not a unit test, since the unit when talking about .Net applications is a class or method. I guess your confusion arouse from the fact that the automated thing you create is a test unit (you do unit tests with tests units, but you can also do integration tests with test units…). You are probably talking about automated integration tests or acceptance tests (which should never be automatic).
Testing models such as V-Model define at least three test phases:
Now, to answer your questions:
You should use .Net Test Units for that purpose. In order to test user interaction (you can test a user interaction with a screen), you can use a external application (check the links below). Some robot might automate such tests to you.
Indeed. For example, a batch application can be unit tested through the sole use of test units. Tests cases for batch systems can also be more lax, but will need more data input to check all the constraints.
I’m not sure that there’s a real way to make sure that you covered every scenario, but what you should do is define what you are testing against. Like I said before, you should unit test against the technical specification, so if your spec is well written, you should be able to clearly identify the test cases. If you feel the need to test against something that wasn’t specified, then you should be improving your design techniques.
List of GUI testing tools
List of unit testing frameworks
Hope this helps.