Skip to main content
added 28 characters in body
Source Link
Simon Forsberg
  • 59.4k
  • 9
  • 156
  • 309
  1. Your test procedures aren't named very well. The name of the procedure should tell us what we're testing for. Labeling them as 1,2,3 means we have to look at the test code to figure out which test failed. Make the names clear and meaningful, even if they're abnormally long. That's okay for tests.

  2. It doesn't look like you've covered all of the possible test cases. It looks like it's possible for your input to have fourtwo consecutive slashes, but you don't test that possibility. You only test if there's one.

    String[] split = promptName.split("\\\\");
    
  1. Your test procedures aren't named very well. The name of the procedure should tell us what we're testing for. Labeling them as 1,2,3 means we have to look at the test code to figure out which test failed. Make the names clear and meaningful, even if they're abnormally long. That's okay for tests.

  2. It doesn't look like you've covered all of the possible test cases. It looks like it's possible for your input to have four consecutive slashes, but you don't test that possibility.

    String[] split = promptName.split("\\\\");
    
  1. Your test procedures aren't named very well. The name of the procedure should tell us what we're testing for. Labeling them as 1,2,3 means we have to look at the test code to figure out which test failed. Make the names clear and meaningful, even if they're abnormally long. That's okay for tests.

  2. It doesn't look like you've covered all of the possible test cases. It looks like it's possible for your input to have two consecutive slashes, but you don't test that possibility. You only test if there's one.

    String[] split = promptName.split("\\\\");
    
Source Link
RubberDuck
  • 30.9k
  • 6
  • 71
  • 174

  1. Your test procedures aren't named very well. The name of the procedure should tell us what we're testing for. Labeling them as 1,2,3 means we have to look at the test code to figure out which test failed. Make the names clear and meaningful, even if they're abnormally long. That's okay for tests.

  2. It doesn't look like you've covered all of the possible test cases. It looks like it's possible for your input to have four consecutive slashes, but you don't test that possibility.

    String[] split = promptName.split("\\\\");