SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
teaching:labs:mdse:2013:bug_descriptions:jt-bug-cor50 [2014/01/30 22:56]
127.0.0.1 external edit
teaching:labs:mdse:2013:bug_descriptions:jt-bug-cor50 [2018/05/09 01:59] (current)
Line 1: Line 1:
 +====== Bug Cor 50 ======
  
 +===== Inspired by =====
 +
 +  * [[http://​http://​findbugs.sourceforge.net/​bugDescriptions.html#​VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED]]
 +
 +===== Original Description =====
 +
 +(VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED)
 +
 +A format-string method with a variable number of arguments is called, but more arguments are passed than are actually used by the format string. This won't cause a runtime exception, but the code may be silently omitting information that was intended to be included in the formatted string.
 +
 +===== Detailed Description =====
 +
 +When is used the method Format to insert values of the variables in a string, is possible that the number of arguments doesn'​t fit with the 
 +number of variables fixed in the string. Therefore, this inconsistency will only be seen in the moment that is executed the method.
 +
 +===== Sample Problem Scenario =====
 +
 +//Add here a minimal example where the problem occurs. It should be possible to use this code for testing our analysis://
 +<code Java>
 +
 + ​String StringVar = String.format("​The value of the float variable is %f, while the value of the integer variable is %d",​floatVar);​
 +
 +</​Code>​
 +
 +===== Sample Counter Scenario =====
 +
 +
 +<code Java>
 +
 + ​String StringVar = String.format("​The value of the float variable is %f, while the value of the integer variable is %d",​floatVar,​integerVar);​
 +
 +</​Code>​
 +
 +
 +===== Sample Fix =====
 +
 +
 +<code Java>
 +
 + ​String StringVar = String.format("​The number of variables is decision of the programmer, therefore one sample fix could be let the without extra parameters"​);​
 +
 +</​Code>​
 +
 +===== Evaluation Results =====
 +
 +^  Benchmark project ​ ^  Precision ​             ^^^  Recall ​               ^^^
 +|                     ​| ​ FB    |  JT    |  Delta  |  FB    |  JT    |  Delta |
 +|  Project ...        |  ...%  |  ...%  |  ...%   ​| ​ ...%  |  ...%  |  ...%  |  ​
 +|  Project ...        |  ...%  |  ...%  |  ...%   ​| ​ ...%  |  ...%  |  ...%  |   
 +FB = FindBugs, JT = JTransformer,​ Delta = JTransformer - FindBugs
 + 
teaching/labs/mdse/2013/bug_descriptions/jt-bug-cor50.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019