Unit Tests For Libraries

Moved from UnitTests

I've read a lot about UnitTests and ExtremeProgramming in general and I've recently begun implementing my own tests for a series of C++ experiments I'm doing at home. And while I find UnitTests very helpful, I've come up with a few thoughts.

If one has several separate libraries that are used by several applications. Would one normally make UnitTests for each library separately, running those as the libraries were developed and not link those tests into each app, or would one link the tests into each and every app, even if the team using a library isn't touching the underlying code?

If one is supposed to run the tests for a library too, what about other apps' tests. And should the library team run the apps' tests too? The dependencies can get pretty hairy here.

--AndreasAxelsson

If the developers aren't changing the library code, then there is little need for them to unit test it. They don't get anything from the main benefits of unit tests, help in developing new code and avoiding regressions. But they may want to run the library's unit tests once for every new version they receive, just to make sure the library works in their environment.

The library developers can be helped by the users, for instance by using a real application as a regression test for their library.


EditText of this page (last edited January 8, 2003) or FindPage with title or text search