TS 60 RUBYdbg

Ruby debugger Test Specification for "NetBeans 6.0"

Author: Tomas Musil
Version: 1
Last update: 13/07/2007
Introduction: This tests basic scenarios of ruby debugger
Comments: none

Contents


Test suite: "Types of ruby debuggers

Purpose: To test behaviour of netbeans with various debugger types
Setup: We distinguish currently between three types of debuggers - classic (aka slow] ruby debugger, fast ruby debugger (available in form of ruby gems) and classic jruby debugger. Fast jruby debugger is not available yet (is in development). This testsuite contains matrix,which tests all possibile combination of setups and debuggers. Repeat following testcase for all lines of matrix. Maxtrx can be downloaded here.

  1. "Basic debugger test"
    1. setup all conditions as defined on current line (e.g. install/deinstall fast debugger, check /usr/local/bin permissions if on linux, etc), start ide with fresh userdir, create project
    2. put breakpoint (in case of rails create controller with some action, at put breakpoint in the action)
    3. run debugger (ctrl-f5).
    • EXPECTED RESULT: The result is defined for each line of the matrix.


Test suite: Debugger basic operations

Purpose: to test basic debugger operations
Setup: Test for all three types of debugger (jruby, classic ruby, fast ruby).

  1. Debugger start in ruby project
    1. Have a ruby project opened
    2. Put some breakpoint on some line in main.rb file
    3. run debugger (ctrl-f5)
    • EXPECTED RESULT: Debugger starts, and stops at breakpoint
  2. Debugger start on single file
    1. Have a ruby project opened
    2. create new unit test using New file dialog
    3. in the test, put breakpoint on some line
    4. run debugger using ctrl-shift-f5
    • EXPECTED RESULT: Debugger starts, and stops at breakpoint in test
  3. "Debugger stop"
    1. Have a ruby project opened
    2. Put some breakpoint on some line in main.rb file
    3. run debugger (ctrl-f5)
    4. push F8 repeatedly until the program finishes
    • EXPECTED RESULT: Program is finished and debugger exits. Check that there's no process running
  4. "Debugger kill"
    1. Have a ruby project opened
    2. Put some breakpoint on some line in main.rb file
    3. run debugger (ctrl-f5)
    4. kill debugger by killing it's process (the re x button in output window
    • EXPECTED RESULT: Debugger is killed. Check that there's no process running
  5. "Debugger finish"
    1. Have a ruby project opened
    2. Put some breakpoint on some line in main.rb file
    3. run debugger (ctrl-f5)
    4. as soon as debugger stops at breakpoint, finish debugger session (shift-f5)
    • EXPECTED RESULT: Debugger is finished. Check that there's no process running
  6. "More debugging session"
    1. Have a ruby project opened
    2. Put some breakpoint on some line (which iis not the last line of executable code in main.rb file
    3. run debugger (ctrl-f5)
    4. as soon as debugger stops at breakpoint, push f8
    5. run debugger again (new session) (ctrl-f5)
    • EXPECTED RESULT: There are 2 sessions running. You can switch between them using Sessions view (alt-shift-6)



Test suite: Basic usage of debugger

Purpose: To test basic debugger usage
Setup: test with all three types of debugger. Create project, have a main.rb file which contains following:

require 'date'
d = Date.today;
puts d

and put breakpoint to second line.
Teardown: finish debugger session after each testcase

  1. "step over"
    1. start debugger, wait until it stops at breakpoint
    2. push F8 (step over)
    • EXPECTED RESULT: program counter moves to the next line (puts d)
  2. "step into and step out"
    1. start debugger, wait until it stops at breakpoint
    2. push F7 (step into)
    3. debugger opens date.rb file and program counter is in method today()
    4. push CTRL-F7 (step out)
    • EXPECTED RESULT: program counter jumps to the third line of main.rb (puts d)


Test suite: Basic usage of debugger 2

Purpose: To test basic debugger usage
Setup: test with all three types of debugger. Create project, have a main.rb file which contains following:

puts "a"
puts "b"
puts "c"
puts "d"
puts "e"


and put breakpoint to second and fourth line.
Teardown: finish debugger session after each testcase

  1. "continue"
    1. start debugger, wait until it stops at breakpoint (line 2)
    2. push F5 (continue)
    • EXPECTED RESULT: program counter stops at second breakpoint (line 4)
  2. "Run to cursor"
    1. delete second breakpoint (on line four)
    2. start debugger, wait until it stops at first breakpoint
    3. move cursor to line with puts "d"
    4. push F4 (run to cursor)
    • EXPECTED RESULT: debugger stops at line with puts "d"
  3. "Baloon evaluation"
    1. start debugger, wait until it stops at first breakpoint (line 2)
    2. mark the first line (puts "a") in editor, using shift
    3. put and hold mouse cursor over this marked selection
    • {{{1}}}



Test suite: Working with views

Purpose: To test views that debugger provides
Setup: test with all three types of debugger. Create project, have a main.rb file which contains following:

def fib(n)
  if n<2 then
    return n
  else
    return fib(n-1) + fib(n-2)
  end
end

5.times do |i|
  puts fib(i)
end


and put breakpoint to line with puts fib(i).

  1. "Default views"
    1. start debugger, wait until it stops at breakpoint
    • EXPECTED RESULT: Watches, Local variables and Call stack views should be opened
  2. "Local variables + global variables"
    1. start debugger, wait until it stops at breakpoint
    2. switch to the local variables view
    3. push F8 repeatedly
    • EXPECTED RESULT: Local variables contains only local variable 'i'. As you push F8, value increases. Check also Global variables node, it should contain global variables for your program context, such as name of script ($0), etc.
  3. "Call stack"
    1. start debugger, wait until it stops at first breakpoint
    2. In call stack, there's only one frame on the stack
    3. push F7 to step in, program counter jumps into fib() method
    • EXPECTED RESULT: In call stack, there are now two frames on the stack
  4. "Local variables reflecting changes in call stack "
    1. Perform testcase "Call stack"
    2. In call stack view, doubleclick to the bottom frame
    3. check that local variables now contain variable 'i'
    4. In call stack view, doubleclick to the top frame
    5. check that local variables now contain variable 'n'
    • EXPECTED RESULT: Local variables view depends on frame selected in call stack view
  5. "Watches view"
    1. delete breakpoint from line with puts fib(i)
    2. place a new breakpoint to line with return fib(n-1) + fib(n-2)
    3. start debugger, wait until it stops at breakpoint
    4. in the Watches view, add three watches (using popup) for n, n-1 and n-2
    5. push F5 (continue)several times and check watches are updating
    6. try to remove some watch (e.g. n) using context menu, watch is removed
    • EXPECTED RESULT: Watches view works as expected.
  6. "Breakpoints view"
    1. open breakpoints view (alt-shift-6)
    2. Add some breakpoints, using editor (currently New breakpoint dialog is not implemented for ruby debugger)
    3. try disabling breakpoint using view
    4. try enabling breakpoint using view
    5. try disabling all breakpoints using view
    6. try enabling all breakpoints using view
    7. try deleting some breakpoint
    8. select more breakpoints and group them
    9. try deleting some breakpoints
    • EXPECTED RESULT: Breakpoints view works as expected.



THREADS



Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo