Question

I'm writing my first large GUI application, which has hundreds of features and expected behaviors, and I'm in need to track and test these as I make changes and add functionality.

How is this done, with what tools, and specifically how can it be done for Python and GTK+3? I'm not a software engineer, so I don't even know the terminology. I guess it's about unit testing (which I'm not familiar with), but that's probably only part of the story.

Was it helpful?

Solution

Testing GUI desktop applications is usually not fun at all.

Better make your code modular, divide it into pieces, draw strict "lines" between the parts of your application. Then, write tests for each part of it, separately. This is where unittest framework from the standard library would help.

If the application is written following some traditional pattern, like MVC - what to test and how would be more clear to you.

Make your tests module by module, function by function measuring coverage and looking at coverage reports at every step - aim to a high-percent coverage. That wouldn't actually mean that you don't have any errors, but, at least, it would mean that high percentage of your code is executed. Mock python module would help with testing different, difficult-to-reproduce situations.

Also see: Writing unit tests in Python: How do I start?

Besides, you would probably want to test how do your parts interact and work together. This is there you would probably need some end-to-end UI tests. As an option, take a look at sikuli project - it's actually framework and UI agnostic since it's based on screensots/images.

Also see:

Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top