Debugging tip: Conditional breakpoints in IntelliJ platforms

Why not a simple breakpoint?

Often while developing tests you might want the debugger to pause only when a specific condition happens.

Conditional breakpoints to the rescue

To show this in action, I will assume a test program which given a number num determines if it is a prime or not and a simple test for this.

Conclusion

This is very useful and is available in all the IDE’s provided by Jetbrains. With this debugging feature, I can easily make the debugger stop at the condition that I can about, without changing the code/test data that’s feeding into the method. Go ahead try it, You will wonder how you even debugged earlier without this feature.

References:

Conditional breakpoints in Pycharm

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store