What do you mean by "FOSS"?
As for stub functions, read the CxxTest documentation section on Mock Objects. As pointed out in "xUnit Test Patterns" by Gerard Meszaros, code needs to accommodate testability. That means calling global functions in a way that stubs can be plugged in and also using "glue" classes that can wrap production classes/functions in real code and provide test-oriented alternative classes in unit test programs.Often, according to Meszaros, to be able to unit test legacy code effectively, it will be necessary to change the legacy code some. Many times, for example, I have written test-oriented derived classes that make private/protected functions of the base class public, so that the unit tests can exercise them directly.
Hi Karen,
Thanks for your reply. What I meant by FOSS was free and open source software.
For stubbing, I believe there is going to be a lot of effort. I will get back after reading the mock section and related samples.
--
You received this message because you are subscribed to a topic in the Google Groups "CxxTest Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cxxtest-forum/P4rIr7JOcMY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cxxtest-foru...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 12-Jun-2014 4:27 am, "Karen Morrissey" <kamor...@kamorrissey.com> wrote:What do you mean by "FOSS"?As for stub functions, read the CxxTest documentation section on Mock Objects. As pointed out in "xUnit Test Patterns" by Gerard Meszaros, code needs to accommodate testability. That means calling global functions in a way that stubs can be plugged in and also using "glue" classes that can wrap production classes/functions in real code and provide test-oriented alternative classes in unit test programs.Often, according to Meszaros, to be able to unit test legacy code effectively, it will be necessary to change the legacy code some. Many times, for example, I have written test-oriented derived classes that make private/protected functions of the base class public, so that the unit tests can exercise them directly.
--