Skip to main content
LessonGrades 9 - 12

Java Code: Does It Work? Test and Test Again

Photo shows a person typing on a laptop, which displays codes, in various text colors.Students get a taste of programming code

Testing is critical to any design, whether the creation of new software or a bridge across a wide river. Despite risking the quality of the design, the testing stage is often hurried in order to get products to market. In this lesson, students focus on the testing phase of the software/systems design process. They start by exploring existing examples of program testing using the CodingBat website, which contains a series of problems and challenges that students solve using the Java programming language. Working in teams, students practice writing test cases for other groups' code, and then write test cases for a program before writing the program itself.

The testing process is a crucial step of the engineering design process. One of the most critical areas in software development is to adequately test the code written by programmers. Software engineers must thoroughly test all aspects (cases) of a program to see if it stands up to the rigorous demands that consumers place on the application. Programs that are not properly tested may not be well received by the public and might end up costing more money for a business in order to fix problems after the fact. In the lesson and its associated activity, students design test cases for a program to fully test it, see the value of testing and learn how it is a valuable part of the larger engineering design process.

After this lesson, students should be able to:

  • Explain the role that testing plays in the software/systems design process.
  • Select a set of test cases for a section of program code.
  • Evaluate test cases for completeness and code coverage.
  • Analyze program code for defects based on the results of test cases.

More Like This