People at my company see unit testing as a lot of extra work, that offers fewer benefits than existing functional tests. Are unit and integration tests worth it? Note a large existing codebase that wasn't designed with testing in mind.
相关问题
- Dependencies while implementing Mocking in Junit4
- How to unit test a reactive component where ngCont
- MongoError: pool is draining, new operations prohi
- Access for global variables JavaScript unit testin
- Get access to Angular service instance from JavaSc
相关文章
- How to replace file-access references for a module
- How to mock methods return object with deleted cop
- What is a good way of cleaning up after a unit tes
-
EF6 DbSet
returns null in Moq - Web Test recorder does not allow me to record a te
- React testing library: Test attribute / prop
- React/JestJS/Enzyme: How to test for ref function?
- Factory_girl has_one relation with validates_prese
As it happens, I read a paper last night on this very subject. The authors compare projects within four groups at Microsoft and IBM, contrasting, in hindsight, projects which used both unit testing and functional testing and projects which used functional testing alone. To quote the authors:
This indicates that it is certainly worth doing unit testing when you add new functionality to your project.
Yes they are worth it, I am now faster at coding since I started unit testing my code. I spend less time fixing bugs and more time thinking about what my code should do.
You test when you want to know something about something. If you know that your product (system, unit, service, component...) is going to work, then there's no need to test it. If you're uncertain as to whether it will work, you probably have some questions about it. Whether those questions are worth answering is a matter of risk and priorities.
If you're sure that your product will work, and you don't have any questions about it, there is still one question that's worth asking: why don't I have any questions?
---Michael B.