#10105: cremona_letter_code does not handle erronous input gracefully.
-------------------------------+--------------------------------------------
   Reporter:  drkirkby         |       Owner:  cremona 
       Type:  defect           |      Status:  new     
   Priority:  minor            |   Milestone:  sage-4.6
  Component:  elliptic curves  |    Keywords:          
     Author:                   |    Upstream:  N/A     
   Reviewer:                   |      Merged:          
Work_issues:                   |  
-------------------------------+--------------------------------------------
 Although I'm not a mathematician, I believe from reading the help page and
 looking at the examples, the Sage command {{{cremona_letter_code}}} should
 probably only work for non-negative integers. However, this is not the
 case.

 {{{

 sage: cremona_letter_code(23.23) # Invalid input, gives output.
 'x'
 sage: cremona_letter_code(-3)   # Invalid input, hangs using lots of CPU
 time.
 }}}

 Any attempt to send erroneous input to a command should generate an error
 message.

 There seems to be three problems with this.
  * Negative integers hang Sage, using lots of CPU time.
  * The documentation says "integers" but I think it should say "non-
 negative integers" - at least all the examples are either 0 or positive
 integers.
  * Floating point numbers produce output, despite the fact the
 documentation says the argument should be an integer.

 This was found by using Fuzz Testing
 http://en.wikipedia.org/wiki/Fuzz_testing
 where one purposely supplies invalid input, to check how software behaves.


 http://www.ibm.com/developerworks/java/library/j-fuzztest.html

 says ''Fuzz testing is a simple technique that can have a profound effect
 on your code quality.''

 I've marked it as a minor priority, as clearly its not a huge bug. But it
 would be worth fixing it.

 Dave

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10105>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to