unit testing - Which Layer should test in n-layer architecture -
we use n-layer architecture in our application. suppose use 3 layer application , use mvc pattern presentation layer,which layer should test? how can find testability point in application?
- presentation layer?
- business layer
- data layer
- all of them?
only test layers want sure work. 3 of above seem things important have working. wouldn't want remove of them.
trying find testability points in existing software hasn't been designed can challenge. there's book, working legacy code, legacy defined code without tests, talks issue. basically, if don't design testability, it's can hard shoe-horn in, you'll need refactor.
the trick going adding test infrastructure code: mocks, stubs, , other test components allow isolate bits under test. helpful when test db, don't want run real query, it'll take long , want tests fast. dependency injection can helpful more static languages, c++/c , java.
Comments
Post a Comment