What is it?
Simply unit testing is testing your code with some test data. Unit tests are used to test the behavior and functionality of the system. Unit testing makes testing your data automated and repeatable. It is also can be identified as Test Driven Development (TDD) Method. The idea behind unit testing is to create a set of tests for each software component. unlike manual tests, it's cheap to perform them repeatedly.
Mocking
Mocking is primarily used in unit testing. An object under test may have dependencies on other (complex) objects. To isolate the behavior of the object you want to test you replace the other objects by mocks that simulate the behavior of the real objects. This is useful if the the real objects are impractical to incorporate into the unit test.
In short, mocking is creating objects the simulate the behavior of real objects.
Some Mocking frameworks
- NMock
- EasyMock.NET
- TypeMock Isolator Commercial / Paid
- Rhino Mocks
- Moq
- NSubstitute
- JustMock Commercial / Paid
- FakeItEasy
No comments:
Post a Comment