The general purpose is assessment of the following learning outcomes:

1.Perform software development tasks using the techniques of Automated Testing, Continuous Integration and Test Driven Programming

2.Use Ant, JUnit and Eclipse both individually and jointly as tools for Automated Testing, Continuous Integration and Test Driven Programming with the main stress on JUnit testing and test driven programming with Eclipse.

The goal of this assignment is working on an initial (partial) implementation of a game "Hangman" in the style of Test Driven Programming in Java by using Unit Testing with JUnit4 in the framework of Eclipse. Two compatible Java files are given to you: a source file Hangman.java and JUnit4 test case HangmanTest.java, both implemented partially and Hangman.java also containing some bugs.

You will need to finish/correct this implementation and testing framework. All tests should succeed and the game should be functioning well. The game "Hangman" is described as follows:

The computer chooses a word (the "word-to-be-guessed"), and displays a star sign * for each letter in the word (the *-form of the word). The remainder of the game proceeds in rounds (a round is an attempt at guessing a letter in the word): In each round, the user inputs a letter. If that letter occurs in the word, then every occurrence of that letter in the word is shown (i.e., the letter is written instead of the *) and the round is over. If the letter does not occur in the word or is chosen repeatedly, the user loses a life and the round is again over.

Play continues in this way until either

  • all the letters in the answer have been input and the user has won, or
  • the user has lost all their lives (10) and the computer has won.

After each round, the user has the option of quitting or playing another round. If quitting, the number of rounds played is shown.

You can download the (correctly implemented compiled version of) Java class MyHangman.class into a directory of your choice and execute it using the command

java MyHangman

It has a slightly different name. You will work with Hangman.java, HangmanTest.java and their compiled classes.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.