Lab 6 - Trees

  1. Open your homework in IntelliJ (or other IDE, so you can edit and test it). The tests must be functional also.
  2.  If you do not have the latest state of your work in bitbucket (or github), create a "Before Lab" commit at the beginning of the lab and upload it. If necessary, see the materials of the first lab.
  3.  The teacher will assign you a partner for this lab.
  4. Explain to your partner how your program works. Show that all the tests pass your computer (if necessary, check the materials of the first lab), that the work has been submitted by the deadline and that all the items in the "checklist" have been met. The partner does the same and then compare the solutions to decide which solution to use as the basis for the extra work.
  5. Divide the roles: developer and tester. One partner (the "developer") is responsible for the Tnode.java file, the other partner (the "tester") for the TnodeTest.java file.
  6. Development: Update the buildFromRPN method to accept DUP, SWAP, and ROT operations in input with the following meanings:
See the Lab 4 for the meaning of these operations - when calculating a tree, the result must be the same as from the interpret method for the same input.
Examples:
Make changes to the buildFromRPN method. Be sure to try the previous examples.
  1. Testing: Write junit4 tests for the examples in the previous section (complete the TnodeTest.java file based on the examples there). Also include tests to verify underflow situations (DUP requires one, SWAP requires two, and ROT requires three subtrees).
  2. Make a new commit  "Develper: name, Tester: name" and upload it to bitbucket (or github), the partner will do the same with her code. Do this only AFTER THE TESTING PART IS FINISHED.
  3. Show the commit, the tests and running examples to the teacher. You can also run tests from the command line if there is a problem with the IDE.
  4.  The teacher asks questions and inputs grades to SIS.

Jaanus Pöial