Assignment 6: White-Box Testing: Goals
Assignment 6: White-Box Testing: Goals
(INDIVIDUAL ASSIGNMENT)
Goals:
● Get familiar with white-box testing.
● Understand some subtleties of structural coverage.
Preliminary Steps:
● Download the archive assignment6.tar.gz.
● Extract the archive in the root directory of the personal repo we assigned
to you:
https://github.gatech.edu/gt-omscs-se-2021spring/6300Spring21<GT username>.git
○ This will create a directory called Assignment6 in the root directory
of the repo. Hereafter, we will call this directory <dir>.
○ This will also create the following files:
■ <dir>/src/edu/gatech/seclass/OopsClass.java
A skeleton of the class that you need to complete for this
assignment.
■ <dir>/test/edu/gatech/seclass/ExampleTestSC1.java
An example of the kind of JUnit test classes you need to create for
this assignment.
■ <dir>/lib/junit-4.12.jar and <dir>/lib/hamcrest-core-1.3.jar
JUnit and Hamcrest libraries to be used for the assignment.
Instructions:
To complete the assignment, perform the following task (after reading the
instructions in their entirety):
○ The following table, where you can provide your responses as strings
(please note that the table in the code has a slightly different format
because we want to be able to run that part of the code):
// ================
//
// Replace the "?" in column “output” with “T”, “F”, or “E”:
//
// | a | b |output|
// ================
// | T | T | ? |
// | T | F | ? |
// | F | T | ? |
// | F | F | ? |
// ================
○ The following sentences, where you can again provide your responses as
strings (also in this case, the format in the code is different to make the
code executable):
//
// Replace the "?" in the following sentences with “NEVER”,
// “SOMETIMES” or “ALWAYS”:
//
// - Test suites with 100% statement coverage “?”
// reveal the fault in this method.
// - Test suites with 100% branch coverage “?”
// reveal the fault in this method.
// - Test suites with 100% path coverage “?”
// reveal the fault in this method.
// ================
Submission:
● As usual, commit and push your code to your individual, assigned private
repository.
● Make sure that all Java files are committed and pushed (i.e., class
OopsClass and any created JUnit test classes).
● Make also sure to commit and push the provided libraries (lib directory). To
do so, you may need to force add the jar files (i.e., “git add -f lib/*”),
which are typically excluded by the “.gitignore” file.
● You can check that you committed and pushed all the files you needed by
doing the following:
○ Clone a fresh copy of your personal repo in another directory
○ Go to directory Assignment6 in this fresh clone of your repo
○ Compile your code. One way to do is to run, from a Unix-like shell:
javac -cp lib/\* -d classes src/edu/gatech/seclass/OopsClass.java
test/edu/gatech/seclass/*.java
○ Run one or more of your tests. Again, from a Unix-like shell, you can
run:
java -cp classes:lib/\* org.junit.runner.JUnitCore
edu.gatech.seclass.<test class name> 1
(at least some of the tests should fail with an ArithmeticException)
● Submit on Gradescope a file called submission.txt that contains, in two
separate lines, (1) your GT username and (2) the commit ID for your
submission. For example, the content of file submission.txt for George P. Burdell
could look something like the following:
submission.txt
gpburdell1
81b2f59
As soon as you submit, Gradescope will check your assignment by making
sure that your files are present and in the correct location, compiling the code,
running your tests, and performing some sanity checks on the outcome of such
tests. If you pass all these checks, you will see a placeholder grade of 10 and a
positive message from Gradescope. Otherwise, you will see a grade of 0 and an
error message with some diagnostic information. Please note that a positive
response from Gradescope only indicates that you passed the sanity checks
and is meant to prevent a number of trivial errors. Please also note that if your
submission does not pass the Gradescope checks, it will not be graded and
will receive a 0, so please make sure to pay attention to the feedback you receive
when you submit and keep in mind that you can resubmit as many times as you
want before the deadline.2
1 If using a Windows-based system, you may need to replace “:” with “;” in the classpath (“-cp”).
2 Although we tested the checker, it is possible that it might not handle correctly some corner cases. If
you receive feedback that seems to be incorrect, please contact us on Piazza.