Menu

#255 Integrate testing with debugger

open
nobody
None
5
2005-06-27
2005-06-27
Dan Smith
No

I would like to debug a specific test method. In order to do so, I
must do the following in the interactions pane after setting up the
appropriate breakpoints (to be completely correct, there might be
other methods that should be invoked):

MyTestClass t = new MyTestClass();
t.setUp();
t.testSomething();

If I need to do it again, I have to repeat those 3 statements. Since
bugs are often exposed by tests, a more elegent solution is
desireable.

EASY SOLUTION: Allow debugging and testing to happen
concurrently, permitting the user to "Test Current File" and hit the
breakpoint.

ELEGENT SOLUTION: When the user right-clicks in a test method
body, have a "Debug test method" option. A breakpoint is
automatically created at the first line of the method. (Of course, in
order to do this, the editor needs to have a symbolic understanding
of the text, similar to that required for code completion.)

Discussion

  • Charles Reis

    Charles Reis - 2005-06-27

    Logged In: YES
    user_id=429731

    The easy solution you mention worked in the past. We
    designed the JUnit integration and debugger so that you
    could set a breakpoint in a test, run the test, and debug it. If
    it doesn't currently work, then it's probably a regression.

    The elegant solution would be nice, though. For simplicity of
    the first implementation, maybe you could just require the
    user to right-click on the test method name in the text.

    Charlie

     
  • Dan Smith

    Dan Smith - 2005-06-27

    Logged In: YES
    user_id=1060117

    You're right. I had the impression that user interaction was suspended
    while tests ran, but either that was never a bug or it has been fixed.

    My request for the "elegant solution" still stands.

     
  • Mathias Ricken

    Mathias Ricken - 2006-04-24

    Logged In: YES
    user_id=1075744

    The "easy solution" has been re-implemented a few weeks ago
    after the "working directory/interactions restart" changes
    and works.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.