c# - Do large enterprises utilize mocking/stubbing? -


Has anyone worked on a large company, or a huge project, which is successfully using unit testing?

Our current database has ~ 100 tables, in which there are ~ 100 total roots. Altogether there are ~ 4000 columns, and when completed, there will be ~ 2 million line codes. I was wondering - did companies (or very large) with databases of this size actually try to fake / stub their domain objects for testing? It has been two years since working in a large company, but at that time tests were conducted through all major application integration tests. Generally, unit testing was generally strong, if it requires more set-up.

I think unit testing is being wasted for some time but there are stable methods, as long as our test methods are longer or longer in writing compared to the actual code ... especially In order to make things worse for setup / arrangement, one of our developers tells us that Kent Beck's Chrysler project was such a delicate failure of unit testing and playful methods ... and There is not just a method that is well scales.

Any reference or experience will be great, management likes the idea of ​​unit testing, but if they see the amount of additional code, then we are writing (and our disappointment), they are happy to retreat Are there.

I have seen TDD work very well in large projects, especially to control the legacy code base To help bring in I have also seen a playful work on a large scale, though it is not enough just for fickle practices, I think a great post has written about how things boil things in a company. I suspect that in an organization, May be better fit. Definitely if the company culture is not a good match for the weird, since the time it is being used in many projects, this will not work (but nothing will happen, you end up with a company that Can not respond effectively to any change).

Nevertheless, testing of units of TDD ... codes alone can sometimes be difficult, and if there is a large data-driven domain object, then I do not fake it often. Instead, I use a builder pattern to make that domain easy to set up correctly.

If there is a complex behavior in the domain object, then I can fake it so that it can be guessed.

For me, the purpose of writing a unit test is not really for regression testing. It helps me to think about the behavior of the code, its responsibilities and how it helps to do this. Uses other pieces of code for It provides documents for other developers, and helps me to keep my design clean. I think of them as examples of examples of how you can use a piece of code, why it is important and What kind of behavior can you expect from it.

Thinking about them in this way, I write tests, making the code easier and safer, rather than putting it down, anyone can break it. I have found that joking everything, especially the domain Focusing on objects can be very brittle tests.

The objective of TDD is not not test if you want to test something, then you can get a tester to see it manually. The only reason is that the testers can not do this every time because we keep changing the code, so the purpose of TDD is to make the code easier to change. If your TDD is not making things easy for you, then find a different way to do this.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -