This is one of those engineering questions, where the answer usually depends on other factors, and often comes with experience. In this case, the addition of these functions is probably acceptable. Since this is a contrived example and not a real reference counted smart pointer, it is missing some functionality that makes it a bit difficult to test. Certainly, a real reference counted smart point would at least have something like the `get_value` method which you added.

I usually find that if I need to add methods to test an existing class, then the class is probably not complete. The unit test code is a client of the class, just like other parts of the production code. However, you have to exercise caution that to ensure that the unit tests are not testing implementation details of the class. If that happens, changes to the implementation of the class, which should remain hidden will leak out into the clients of the class. This breaks encapsulation and can cause significant problems in a large system.