Discussion 06 - Matrix2

Discussion 06 - Matrix2 - Masanao Yajima Debugging Look at...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Masanao Yajima
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Debugging Look at ipf.R for your homework
Background image of page 2
There is no bug-less code. Most serious: bug that is not detected except for special cases. ( and it’s usually very critical…) Pretty serious: something that is hard to notice unless you look carefully. Mildly serious: ones that show up in the test Less serious: bug that gives you error instantly So a good programmer is a good debugger. Writes a good test Patiently follow the problem to its source Know common errors people make Can come up with special case that may be a problem
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What are the ways to debug? Printing out the result cat() print() Using debugging functions debug() browser() trace() Running test cases Use version control software Have a milestone so you know where to go back
Background image of page 4
Here is an example: I’m getting Inf out of my function. > fun <- function(x) {for(i in 1:10) x=x*x; return(x)}
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

Discussion 06 - Matrix2 - Masanao Yajima Debugging Look at...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online