Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit test case generator [closed]

Has anybody tried any Unit Test generators for .Net?

I assume although it won't be any substitute for any good unit test written by a person who has written the functionality, but I think it will take away some of work and be a starting point on which we can better the unit tests.

Thanks.

like image 592
Biswanath Avatar asked Dec 10 '08 18:12

Biswanath


People also ask

What should I cover unit test with?

The purpose of a unit test in software engineering is to verify the behavior of a relatively small piece of software, independently from other parts. Unit tests are narrow in scope, and allow us to cover all cases, ensuring that every single part works correctly.

Can we generate test cases automatically?

The purpose of producing the tool to generate test cases automatically is to reduce the cost of testing the system as well as to save the time of deriving test cases manually. The system's requirements are transformed using use case diagrams, flow of events and sequence diagrams.


1 Answers

Unit test generation is the wrong way to perform unit testing. The proper way to do unit testing is to create test cases before you write functional code, then develop your code until the tests validate, this is know as TDD (Test Driven Development).

One of the key reasons unit test generation is a bad idea is because if there are any bugs in your existing code, the tests will be generated against those bugs, therefore if you fix them in the future, the bad tests will fail and you'll assume something is broken, when it's actually been fixed.

But since the code is written, it's now water under the bridge. And possible buggy unit tests are better than no unit tests at all. I've always preferred NUnit and there's a NUnit compatible test generator here (very affordable).

like image 95
TravisO Avatar answered Sep 28 '22 07:09

TravisO