r/java • • 18d ago

How to Automate Testing of a Java Swing Application

https://testdriver.ai/blog/test-java-swing-app/
8 Upvotes

5 comments sorted by

10

u/DanLynch 18d ago

Bringing in a whole different non-JVM framework and language just to test a Java application seems like a lot of friction. I would much rather write my tests in Java.

5

u/lazystone 18d ago

But there is an AI in it! Can't you see?

4

u/Gleethos 18d ago

I personally think decoupling view code from the view model and then writing tests against a headless application is always the more robust and sustainable solution. But you have to be strict about MVVM/MVC/MVI, etc...

2

u/paul_h 18d ago

I made a small swing demo app for test automation some years ago: https://github.com/paul-hammant/swing_component_testing