Java Development Exercises
Java Development Exercises
Exercise #1: Waking Up and Smelling the Roses (or the Coffee)
Things To Do
Exercises #2: Connecting the Dots (or the Class Files)
Things To Do
Fibonacci1.java:
A Java program mentioned in this exercise
Exercise #3: Enjoying Coffee at Home
Things To Do
Exercise #4: Give a Man a Fish...
Things To Do
Java Documentation Described in This Exercise:
Documentation of a Class for Java 8
Documentation of this Class for Java 11
Documentation of this Class for Java 12
Programs Considered, So Far
Fibonacci1.py: Python implementation of an algorithm considered in Lecture #2
Fibonacci1.java: Java implementation of an algorithm considered in Lecture #2
Fibonacci2.py: Python implementation of an algorithm considered in Tutorial Exercise #3
Fibonacci2.java: Java implementation of an algorithm considered in Tutorial Exercise #3
Fibonacci2a.java: Better Java implementation of an algorithm considered in Tutorial Exercise #3
Fibonacci3.py: Python implementation of an algorithm considered in Lecture #3
Fibonacci3.java: Java implemenation of an algorithm considered in Lecture #3
Fibonacci3a.java: Better Java implmenentation of an algorithm considered in Lecture #3
Fibonacci4.py: Python implementation of an algorithm considered in Tutorial Exercise #4
Fibonacci4.java: Java implementation of an algorithm considered in Tutorial Exercise #4
Fibonacci4a.java: Better Java implementation of an algorithm considered in Tutorial Exercise #4
Exercise #5: What Do You Mean, My Code isn't Flawless, Part One...
Things To Do
Java Code
Fibonacci2b.java: Yet another Java implementation of an algorithm considered in Tutorial Exercise #3
Fibonacci3b.java: Yet another Java implementation of an algorithm considered in Lecture #3
Fibonacci4b.java: Yet another Java implementation of an algorithm considered in Tutorial Exercise #4
FibLoopTest.java: Unit tests for the program “Fibonacci3b.java”, implemented using JUnit
Additional Documentation
junit.org/junit4: Home page for Version 4 of the “junit” Test Harness
www.vogella.com/tutorials/JUnit/article.html: A readable tutorial about how to use JUnit to implement unit tests
Exercise #6: What Do You Mean, My Code Isn't Flawless, Part Two...
Things To Do
Java Code:
Fibonacci3b.java: Program to be Tested
Shell Scripts and Output
test_Fibonacci3b_main.sh: Shell script to test the main method of the above program
test_main_output.txt: Output that should be proved using the above shell script
test_Fibonacci3b.sh: Another shell sccript that also includes unit testing of the method fibLoop
mywiki.wooledge.org/BashGuide: A well-regarded tutorial about the development of Bash shell scripts
Exercise #7: Documentation on Steroids I — How To Be More Assertive
Things To Do
Java Code
Fibonacci3c.java: From Lecture #3 — A reliable, but less efficient, Fibonacci number calculator
Fibonacci4c.java: From Tutorial Exercise 4; the program to be considered in this exercise
Exercise #8: Holy Software Flaw, Batman!!!! How are We Going to Get Out of This?!?!?
Things To Do
Fibonacci4c.java: Deliberately incorrect implementation of an algorithm from Tutorial Exercise #4
Oracle’s Documentation of jdb
Exercise #9: Documentation on Steriods II — javadoc
Things To Do
Fibonacci.java:
Yet another version of the “Fibonacci number calculator” program
An Even Better Way to Compute the Fibonacci Numbers:
Sketch of the proof of correctness of the new algorithm implemented in the above program
SlowFibonacciTest.java:
JUnit tests for the “slowFibonacci” method
EvalTest.java:
JUnit tests for the “eval” method
test_Fibonacci_main.sh:
Shell script with tests for the main method in the above class
test_Fibonacci.sh:
Shell script providing tests for the entire Fibonacci class
Fibonacci.html:
Documentation of the above class produced using the “javadoc” utility
Oracle’s Documentation for Javadoc
cpsc 331
computer science
faculty of science
u of c
cpsc 331
introduction
algorithm analysis
basic data structures
& adts
binary search trees
hash tables
searching and sorting
graph algorithms
conclusion
java development
assignments
tests