Activity: Get started with JUnit
(no submission)
Purpose:
Get started with JUnit; verify that your testing environment is set properly
Require: Java 8 (or higher), JUnit (you are recommended to use the latest version, JUnit 5).
If you have not set up your testing environment, please refer to
the Schedule page for details on JUnit 5.
Additional resources:
You may find class discussions on RIPR model,
test automation, and characteristics of good tests
helpful when designing and automating your tests.
Instruction:
You may work alone or with another student in this course.
Consider ArrayOperations.java.
- Apply the RIPR concept to design tests.
- Develop at least 4 JUnit tests to evaluate
the ArrayOperations.numZero() method.
- At least one of your tests must detect the fault in the subject under test
— that is, your test case causes the failure to propagate
and your test oracle reveals the failure.
- You may create a new JUnit test file or
add your JUnit tests to the
ArrayOperationsNumZeroTest.java template.