1.1.3 Hands-on: Fix the bug

Course subject(s) Module 1. Automated Software Testing

Let’s fix the bug in the NumFinder program. After all, we don’t like bugs!

  1. Open the NumFinder class that is inside the tudelft.numfinder package in the mooc examples project.
  2. Open the NumFinderMain class, also in the same package.
  3. Run the main file. You can do that by clicking on the green arrow near the public static void main line.
  4. You should see the buggy output!
  5. Now, go back to the NumFinder class and fix the bug!
  6. Go back to the main class and run it again to make sure the output is now correct.
  7. Try different inputs and outputs and see if you can find more bugs. Try corner cases. For example, what happens if we pass a nullĀ to this method?
Creative Commons License
Automated Software Testing: Practical Skills for Java Developers by TU Delft OpenCourseWare is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at https://online-learning.tudelft.nl/courses/automated-software-testing-practical-skills-for-java-developers/.
Back to top