Testing 白盒试验
我只是想知道以下代码中的状态覆盖率/决策覆盖率/条件覆盖率之间有什么区别Testing 白盒试验,testing,white-box-testing,Testing,White Box Testing,我只是想知道以下代码中的状态覆盖率/决策覆盖率/条件覆盖率之间有什么区别 public static void main (String args []) { char letter=' '; String word= "", vowels = "aeiouAEIOU"; int i, numVowels= 0, numCons= 0, wordLength= 0; word = JOptionPane.showInputDialog("Input a word
public static void main (String args [])
{
char letter=' ';
String word= "", vowels = "aeiouAEIOU";
int i, numVowels= 0, numCons= 0, wordLength= 0;
word = JOptionPane.showInputDialog("Input a word: " );
if (word.length() > 10 || word.length() < 3)
word = JOptionPane.showInputDialog("Input another word: ");
wordLength= word.length();
for (i = 0; i < wordLength; i++)
letter = word.charAt(i);
if (vowels.indexOf(letter) != -1)
numVowels = numVowels+1;
numCons = wordLength-numVowels;
JOptionPane.showMessageDialog(null, "Number of vowels: "+ numVowels);
JOptionPane.showMessageDialog(null, + " Consonants: " + numCons);
}
publicstaticvoidmain(字符串参数[])
{
字符字符='';
字串=”,元音=”aeiouAEIOU”;
int i,numowels=0,numCons=0,wordLength=0;
word=JOptionPane.showInputDialog(“输入一个单词:”);
if(word.length()>10 | | word.length()<3)
word=JOptionPane.showInputDialog(“输入另一个单词:”);
wordLength=word.length();
对于(i=0;i
另外,任何if语句中都没有大括号。不同的工具使用稍微不同的术语来解释这些数字。对于ex jacoco,使用以下术语
如果您能告诉我们您用于计算覆盖率的工具,可能会有所帮助。然后我们可以将其应用于代码For循环中应该有大括号。对吗?