Notes on Testing

Tic-Tac-Toe is an example of a digital product or system.

Software houses develop these products and deliver them to clients/customers when complete.

At each stage of development, code needs to be tested.

Here are some types of testing:

Type of test Description
Alpha Testing This is conducted by programming teams in-house. Individual modules are tested fully (unit testing) and the program is tested as modules are integrated into the program (integration testing). For example, once a module/function is designed, it needs to be fully tested.
Beta Testing Some representatives from the client are invited to test the product. They give feedback and the developers may have to fix any bugs or complete expected functionality.
Acceptance Testing The final product is given a final test after being delivered to the customer.

Types of test data

Especially when testing modules and integrating modules into a program, test data needs to be carefully selected.

It should include:

  • NORMAL TEST DATA - data that the module/system expects eg the user enters 16 when entering age data
  • ABNORMAL TEST DATA - data that the module/system doesn't expect but should be able to handle eg a user enters "Jack" instead of 16 when entering age data
  • EXTREME/BOUNDARY TEST DATA - imagine an input box expects data in the range 13-19 inclusive. When testing this, it is important to use the values 13 and 19, the values at the extreme edge of a range.

Imagine the consequence of not testing a product at various stages of development.

Tic Tac Toe

Project Work

So far we have looked at how to design computer programs which include:

  • variables (global and local) of type int, double, boolean, char, String
  • loops - for(){}, while(){}, do{}while()
  • selection - if, if(){}else{}, if(){}else if(){} else{}
  • assignment, using =
  • comparison using == and .equals()
  • functions, with return statements and parameters
  • arrays

In this project, we will attempt to code a JAVA Tic Tac Toe game by following a PYTHON tutorial!

LET'S DO THIS! It is a terrific test of your knowledge of programming in Java.

Task 1

Watch the video. Follow the steps. Make a tic-tac-toe game in Java. Remember to start a new project.

You may choose to use Global Variables, or adapt the code to reduce the number of global variables being used.

Task 2 - adaptive maintenance

Save your program code from Task 1, either by copy/pasting it into another document eg a Google Doc, or by doing Task 2 in another programming file.

Adapt the program so that it is Player vs Computer.

Task 3 - adaptive maintenance

Save your program code from Task 2, either by copy/pasting it into another document eg a Google Doc, or by doing Task 3 in another programming file.

Adapt the program so that, if the player wins, it asks for the player's name and stores the name and date of the game in a file.

Decide if you need to design a new function for this feature of your program.

Task 4 - screencasting

Choose Task 1, 2 or 3 and create a screencast, 2-3 minutes, with some commentary on your solution.

Show the program running and describe at least 1 significant black of cade which makes the program work as expected.

Recommended software is screencastomatic.

Rubric

Grade Descriptor
A The video is in .mp4 or avi format. It is between 2 and 3 minutes long. The student clearly introduces the game as it is running. The student then spends between 1 and 2 minutes describing a significant block(s) of code and how it contributes to the program. The explanation is clear and could be used to help a novice programmer understand how a part of the program works.
B The video is in .mp4 or avi format. It is between 2 and 3 minutes long. The student clearly introduces the game as it is running. The student then spends between 1 and 2 minutes describing a significant block(s) of code and how it contributes to the program. The explanation is a little confusing at the student needs more practice "talking about" code and how it works.
C The video is in .mp4 or avi format. It is less than 2 minutes long. The student introduces the game as it is running but this may not be clear. The student then spends less than a minute describing a significant block(s) of code and how it contributes to the program. The explanation is confusing at the student clearly needs more practice "talking about" code and how it works.

Notes on testing

Imagine if you were designing this product for a client/customer who is paying for it.

Testing a product thoroughly is critical to the successful outcome of product development.

Imagine delivering a product to a client that had not been thoroughly tested. What are the consequences of this?

Patience

The video tutorial is quite long - about an hour.

Every 15 or 20 minutes, get up, stretch your legs, get some water, clear your mind.