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
Next revision
Previous revision
teaching:labs:mdse:2013:bug_descriptions:jt-bug-cor112 [2013/11/14 17:51]
127.0.0.1 external edit
teaching:labs:mdse:2013:bug_descriptions:jt-bug-cor112 [2018/05/09 01:59] (current)
Line 1: Line 1:
 +====== Bug Cor112 ======
  
 +//Replace all placeholder words (written with underscores) by their suitable counterparts in the context of your Bug.//
 +
 +===== Inspired by =====
 +
 +  * [[http://​findbugs.sourceforge.net/​bugDescriptions.html#​RpC_REPEATED_CONDITIONAL_TEST | RpC: Repeated conditional tests (RpC_REPEATED_CONDITIONAL_TEST)]]
 +
 +===== Original Description =====
 +
 +"The code contains a conditional test is performed twice, one right after the other (e.g., x == 0 || x == 0). Perhaps the second occurrence is intended to be something else (e.g., x == 0 || y == 0)." -- 2013-10-28
 +
 +
 +
 +===== Detailed Description =====
 +
 + In the given statement one cannot have same conditional tests performed twice, whereas the second occurrence of the condition is intended to perform some other conditional test. 
 +
 +===== Sample Problem Scenario =====
 +
 +
 +<code Java>
 + ​public class BugCor112 {
 + 
 + int x;
 + int y;
 + String result;
 +
 + void findRpc()
 + {
 + if (x == 0 || x == 0)
 + {
 + result = "​Error:​ Repeated Conditional Test";
 + }
 + }
 +</​Code>​
 +
 +
 +===== Sample Fix =====
 +
 +
 +<code Java>
 + ​public class BugCor112 {
 + 
 + int x;
 + int y;
 + String result;
 +
 + void findRpc()
 + {
 + if (x == 0)
 + {
 + result = "Good: No Repeated Conditional Test";
 + }
 + }
 +</​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-cor112.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019