And the refactor created the library. Test it?

I understand that this is a subjective question and therefore may be closed, but I think it is worth asking.

Say, when you create an application using TDD and go through the refactor, a library appears. If you take the code from the main application and put it in a separate assembly, do not waste time writing tests that cover the code, even if the main application is already testing it? (This is just a refactor.)

For example, in the NerdDinner application , we see shells for FormsAuthentication and MembershipProvider. These objects would be very convenient in several applications, and therefore they could be extracted from the NerdDinner application and put into their own assembly and reused.

If you write NerdDinner today, from scratch, and notice that you have a bag for really useful wrappers and services, and you bring them to a new assembly, you create new tests that completely cover your new assembly, is it possible to repeat the tests? Is it enough to say that if your main application runs green in all of its tests, will your new build be effectively covered?

Although my NerdDinner example may be too simplistic to really worry, I think more about larger APIs or libraries. So you write tests to re-cover what you tested before (maybe a problem because you probably start by going through all your tests), or do you just write tests as the new build evolves?

+3
1

, , ; . , , , ; .

+2

All Articles