/It doesn't make sense to retrospectively create unit test for an existing application/
Useful for when you're going to make changes and you want to ensure they don't break your existing app, especially for code that you inherited and may not fully understand. That was the impetus behind that feature. Definitely seems backwards though. Eric On Wed, Jul 22, 2020 at 8:23 AM Christof Wollenhaupt < chris...@wollenhaupt.org> wrote: > > Having said that, TDD does work "best" for new development, and many VFP > > devs are not doing a ton of apps from scratch which is why it may not > have > > caught on. It also works best with logic that's not buried in the UI, and > > unfortunately a lot of us buried it there (forgive me father). > > We have used FoxUnit for our FoxPro DOS based application. That program > was certainly not written with unit tests or even classes in mind. But even > a procedure with private variables can be a testable unit if you design the > interface carefully. > > It doesn't make sense to retrospectively create unit test for an existing > application, I agree. However, when you modify existing code it's often > possible to move the parts that you need to change out of the SCX Click or > whatever method into a separate class. There is no need to do this all at > once, just when you need to make changes to code anyway. > > When code uses functions like MESSAGEBOX(), etc. you can replace those > with a simple messagebox or dialog class (such as the one in INTL) and then > in your test mock this class. Various tests can then cover multiple paths > through the code depending on a simulated choice a user made. You can also > assert that certain messages are shown to the user by making a call an > expectation in foxmock and then verify those afterwards. > > -- > Christof > > --- StripMime Report -- processed MIME parts --- > multipart/alternative > text/plain (text body -- kept) > text/html > --- > [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/CAAwxvUke6bPNeB+hEhE6SqZ0j82zaDVG7=nnuahrtdcompl...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.