O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

About unit testing

If you still think that we have written a whole lot of code for such a simple app, let me reveal to you a little secret: we have taken a lot of shortcuts.

Yes! In fact, we have limited our testing to usecases (functional tests), yet we should have written unit tests for the single business objects, by writing dedicated test harnesses for the entities project (and also for repositories, as soon as we add a real data backend), to make sure that each component behaves well in isolation. This is left as an exercise for you. Just follow what we have done for the usecases (and read the docs!).

Also, we have avoided handling all cases where things could go wrong (for example, in fetching data). We will look into some of these ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required