Perform control-flow testing on a fault-seeded Java program, Printtokens.java.
project slides | project rubric
- Identify and fix faults through testing.
- Unit testing: maximize edge coverage for all non-main methods.
- End-to-end testing: maximize edge coverage for all methods through the main method.
1 Test Case Preparation
- Draw control flow graphs (Video).
- List test paths in the graphs (Video).
- Derive test cases from test paths (Oracle: provides the expected outputs for the given inputs).
2 Testing
- Write test methods based on test cases.
- Execute test methods and check execution status.
- Fix faults when failures occur or after executing all test methods.
- Update test methods (and test cases) and repeat the process if necessary.
3 Reports
- A list of identified faults and corrections.
- One HTML coverage report for unit testing.
- One HTML coverage report for end-to-end testing.
- Check all the deliverables in the project slides.
- Put all the deliverables in Branch main in a folder "deliverables".
- Commit the changes before the deadline.
-
IDE: Eclipse IDE, VS Code, or others.
-
Java SE 16 (Need to create an account to download. This version is tested and other versions may work.)
Note: Highly recommend to use Eclipse. However, you can use other IDEs.
1 Launch a terminal.
2 Clone your GitHub project repository locally using the Terminal (with the main branch fetched).
-
Navigate to the directory for your project in the Terminal.
-
Prepare for the clone command.
-
GitHub_project_name: Name of your project GitHub repository.
-
access_token: Personal access token of your GitHub account.
-
Clone command:
git clone https://<access_token>@github.com/cse4321/<GitHub_project_name>.git
-
3 Check out the other branches to explore how to write test methods with command "git checkout branch-name".
- eclipse-eg-tests: the branch containing an example program and test files based on Eclipse IDE.
- vsc-maven-eg-tests: the branch containing an example program and test files based on VS Code.
4 Create your own branch to write your tests with your preferred IDE.
1 Set up user info (if not configured).
git config user.name "your GitHub account name"
git config user.email "your email" 2 Stage all modified files.
git add .3 Commit the changes.
git commit -m "commit message"4 Push the changes to the main branch in the project repository in GitHub.
git push origin main