Friday, 15 May 2015

Unit Testing with a Mocked Class -


I have noticed some sites that you (developer) are implementing your class (x) that depend on any other class (Y) For information and assume that the class (y) has not been developed by your development team yet, then you should wanna class (y) to test your unit of class (x).

What do I need to know what should you do when the square (y) is finally implemented by the development team? Will the developer of Class X (X) now go back to the unit test, where he made a counterfeit orbit (Y) and instead call the real object?

And if we are putting real time timelines in perspective square (X) then one month or more before the month of class (y) and orbit (x) can be applied, The test is also written for class (x) maybe it has been assigned to other functions; How can this person now allot time to rewrite their old unit tests and re-invest time - will it not just be a management nightmare?

So, I would say that you get better separation and freedom in your tests, You can test the actual unit in this way, while you are testing the integration to replace the fake with examples of actual classes. This is actually the two schools of thought, personally, I am strange Like style and comfort to know it I am more flexible to change my test because I write them like this. If I did more of classical style testing then there would be more reasons for the test failure (any change in any underlying implementation may be that which My test subject depends on the behavioral behavior) and when there is a test failure, then it is less clear about the exact cause of the failure


No comments:

Post a Comment