Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In my experience, any test toolkit you use is either going to work itself into your code in subtle ways, or never get to the depth you need (or both).</p> <p>It's possible to write custom test code and still keep the code clean for the app being tested. I did it on a large Windows C++ gui app that I needed to autotest. The basic idea is to create a new project, reference all the code from your base project, and write a new set of classes that derive from the base classes and that contain your testing code.</p> <p>In my case, I created a new Visual Studio project, but you can do the same with a new Qt project. The base classes may have to be refactored to expose the functions to be tested, of course. The test classes call the base class functions as needed - you can create an entire test gui if you want.</p> <p>As a very simple example, if this is your project...</p> <pre><code>class MyView : public QMainWindow {} class MyController {} class MyModel {} </code></pre> <p>...create a new project, pull in your base code, and add these:</p> <pre><code>class TestView : public MyView {} class TestController : public MyController {} class TestModel : public MyModel {} </code></pre> <p>In the end, after a little work, zero test code was in my base classes, and I was still able to tie in and fire off all kinds of repetitive autotests in a nice test gui.</p> <p>I'm not saying this is an easy or trivial task. I'm just encouraging you that it can be done. :-)</p> <p>EDIT: This is not a criticism of embedded unit testing, which is great if you can get it in place from the start of your project. But this was a large legacy app and it was a hard requirement that I didn't inject test code into the base code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload