Alex Rivera | Logout

Patterns for making c++ code easy to test

Asked 2009-11-05T14:39:40.920
11

Should you design your code to make testing easier? And if so how to design c++ code so that it is easy to test.

  • How do you apply dependency-injection in c++?
  • Should I implement the classes using a pure interface class as the base in order to simplify the creation of fake test objects?
    • That would force me into making a lot of virtual methods. Will that affect performance?
  • What else should I think about when designing for testability in c++?
Edit
Report

1 Answer

3

Maximum cohesion and minimum coupling.

This will make your life easier with testing.

answered 2009-11-05T14:47:49.093

Your Answer