Skip to content
Snippets Groups Projects
Commit 137047ed authored by Usman Irfan's avatar Usman Irfan
Browse files

Added Testing Functional Requirements

parent b1bab2a3
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -106,39 +106,220 @@ See Gantt Chart at the following url ...
\subsubsection{Area of Testing1}
\paragraph{Title for Test}
\paragraph{User Input}
\begin{enumerate}
\item{test-id1\\}
\subsubsection{Testing of Functions}
\item{\textbf{TID1}\\}
Type: Functional, Dynamic, Manual, Static etc.
Type: Functional, Dynamic, manual
Initial State: The desktop application starts waiting for the user to enter a command to begin.
Initial State:
Input: The user presses any button key.
Input:
Output: The desktop application begins moving the snake towards the Right.
Output:
How test will be performed: The test will be done dynamically, that means once the program will be executed the developer will press any key to see if it would run the game, making the snake to move.
\item{\textbf{TID2}\\}
Type: Functional, Dynamic, manual
How test will be performed:
Initial State: The desktop application executes and displays a screen with a headline \textbf{High Score:} in the top
\item{test-id2\\}
Input: NULL
Type: Functional, Dynamic, Manual, Static etc.
Output: The game would display the highest score of the user from the day they started to play till the present date.
Initial State:
How test will be performed: When the game is played for the first time its Highest Score should be 0, the developer plays for a while and tests the score they made by playing should be the highest score when playing the second time.\\
When the game is restarted or turned off the game still holds the highest score.\\
Two more scenarios to test the highest score requirement.\\
E.g., the current highest score is 85:\\
1. The user beats the highest score, and the highest score is updated to the user's score when playing the next time.\\
2. The user is not able to defeat the highest score and the highest score will still be 85 when they play the game next time.
\item{\textbf{TID3}\\}
Type: Functional, Dynamic, manual
Input:
Initial State: The desktop application executes and displays the snake at a random location.
Input: NULL
Output: The snake displays the snake at random location when played the next time.
Output:
How test will be performed: The user can track the location of the snake the first time the game is played. The game should be restarted to ensure that the snake's position changes every time the game starts.
\item{\textbf{TID4}\\}
Type: Functional, Dynamic, manual
How test will be performed:
Initial State: The snake's food is at a random location.
Input: NULL.
\end{enumerate}
Output: The food reappears on the screen at a random location when the snakes eat the previous one.
How test will be performed: The developer will test this requirement by moving the snake's head location equal to the food's location. When the snake eats the food, instantly another food should display on the screen at a random location.
\subsubsection{Area of Testing2}
...
\subsubsection{Testing of Keyboards/Mouse}
\item{\textbf{TID5}\\}
Type: Functional, Dynamic, manual
Initial State: The desktop application starts waiting for the user to enter a command to begin.
Input: The user presses F-11 key.
Output: The desktop application screen is changed to full-screen mode.
How test will be performed: The test will be done dynamically, that means once the program will be executed the developer will press the F-11 key to test if the size of the screen changes to full-screen mode.
\item{\textbf{TID6}\\}
Type:Functional, Dynamic, manual
Initial State: The game waits for the user to press a direction key to move the snake.
Input: The user presses UP key.
Output: The snake in the game would moves up by one-unit length.
How test will be performed: The test will be done dynamically, that means once the program will be executed the developer will press the UP key to test if the snake moves in the upward direction.
\item{\textbf{TID7}\\}
Type: Functional, Dynamic, manual
Initial State: The game waits for the user to press a direction key to move the snake.
Input: The user presses DOWN key.
Output: The snake in the game would moves down by one-unit length.
How test will be performed: The test will be done dynamically, that means once the program will be executed the developer will press the DOWN key to test if the snake moves in the downward direction.
\item{\textbf{TID8}\\}
Type: Functional, Dynamic, manual
Initial State: The game waits for the user to press a direction key to move the snake.
Input: The user presses LEFT key.
Output: The snake in the game would moves left by one-unit length.
How test will be performed: The test will be done dynamically, that means once the program will be executed the developer will press the LEFT key to test if the snake moves in the left direction.
\item{\textbf{TID9}\\}
Type: Functional, Dynamic, manual
Initial State: The game waits for the user to press a direction key to move the snake.
Input: The user presses RIGHT key.
Output: The snake in the game would moves right by one-unit length.
How test will be performed: The test will be done dynamically, that means once the program will be executed the developer will press the RIGHT key to test if the snake moves in the right direction.
\item{\textbf{TID10}\\}
Type: Functional, Dynamic, manual
Initial State: The desktop application executes and displays three modes to be played.
Input: Mouse Cursor
Output: The application should open the specific mode the user has requested to play.
How test will be performed: Different modes in the game will be opened using the mouse cursor, their display or speed should be different from other modes. Easy having the slowest speed and allowing the snake to exit from the one-direction boundary and enter from the other direction of the boundary (e.g. leaving from right side boundary and entering from the left side boundary). While playing the hard mode, the speed should be much faster than the Easy mode, and would not allow the snake to cross the boundary. If the snake touches the boundary the snake should die and terminating the game.
\item{\textbf{TID11}\\}
Type: Functional, Dynamic, manual
Initial State: The desktop application executes and displays three modes to be played.
Input: Mouse Cursor
Output: Changes the theme of the game application.
How test will be performed: If the game is initially set to Light mode. On clicking the Theme button the game changes the theme from Light to Dark theme.
\item{\textbf{TID12}\\}
Type: Functional, Dynamic, manual
Initial State: The initial length of the snake would be one-unit length.
Input: The user presses the Direction keys to control the snake
Output: The length of the snake should not equal to one-unit length when it dies (Hard mode would be an exception).
How test will be performed: The developer moves the snake by pressing the direction keys. When the snake's head location equals the food location, its length should be increased by five unit-length. When the snake dies its increase in length should be divisible by 5.
\item{\textbf{TID13}\\}
Type: Functional, Dynamic, manual
Initial State: The game is already executed, and the user is playing the game.
Input: The user presses the Space key to pause the snake.
Output: The snake's movement has been stopped.
How test will be performed: The developer will test this requirement by pressing the Spacebar key in between the game, will track down's snake location and see if the snake stops on the screen of the Spacebar key is pressed for the first time.
To test the pause movement, we can think of pausing and resuming of the game as two states. If the Spacebar key is pressed odd time it will be in the pause state else, it will be in the resume state.
\item{\textbf{TID14}\\}
Type: Functional, Dynamic, manual
Initial State: The snake's movement has been stopped.
Input: The user presses the Space key to resume the snake's movement.
Output: The snake's movement has been resumed.
How test will be performed: The developer will test this requirement by pressing the Spacebar key in between the game, will track down's snake location and see if the snake moves on the screen of the Spacebar key is pressed for the second time.
To test the pause movement, we can think of pausing and resuming of the game as two states. If the Spacebar key is pressed odd time it will be in the pause state else, it will be in the resume state.
\subsubsection{Area of Testing3}
\subsubsection{Testing of the game ending}
\item{\textbf{TID15}\\}
Type: Functional, Dynamic, manual
Initial State: The snake is not one-unit length..
Input: NULL.
Output: The screen displays a screen biting itself, and a message prompts on the screen display "GAME OVER!".
How test will be performed: The developer will test this requirement by moving the snake's head location equal to the snake's body location. When the snake eats its body the snake's movement should stop and will be able to see the error message.
\item{\textbf{TID16}\\}
Type: Functional, Dynamic, manual
Initial State: The snake is red colour
Input: NULL.
Output: The screen displays a screen biting itself in red colour .
How test will be performed: The developer will test this requirement by intentionally killing the snake. The function should change the snake's colour from green to red. If the snake's colour is red before replaying the game, the function passes its test (exception: the user presses the restart button and doesn't want to play the game till the end).
\end{enumerate}
\subsection{Tests for Nonfunctional Requirements}
......@@ -353,10 +534,10 @@ How test will be performed: Several peers will be asked to test the game from st
\section{Comparison to Existing Implementation}
\section{Unit Testing Plan}
The PyUnit testing framework would be used to test our desktop application.
\subsection{Unit testing of internal functions}
\subsection{Unit testing of output files}
The PyUnit testing framework will be used to test our source code's functions, this is an automated testing unit, and it provides classes which can ease different testing functions. Such functions that take arguments and return values can be tested in our unit testing. By using PyUnit we can check the robustness of our program, if wrong inputs are given will the program be able to handle such cases without crashing. Besides, the requirement of the program can be tested to see if our program matches with the functional and non-functional requirements of the program. E.g., the function that moves the snake in X-axis and Y-axis can be tested by entering the snake's X, Y location, the axis it wants to go and its direction (up or down for y-axis, and left or right for x-axis). The goal is to test as many functions examining all possible cases which can make our application run smoothly without crashing. \subsection{Unit testing of output files}
The testing of the output files through unit testing will tell the developers if all the test cases designed by them run efficiently. The snake's movement would be compared to the actual output if the user is pressing the UP key and the snake is moving in the respective direction it would pass the unit testing. Testing the output files can also help us to find that if different modes of the game are selected then different rules of the games should be followed. The game being played in the Hard mode could be tested that the snake is not allowed to cross boundaries and this could be compared with automated testing resulting us to know if our output files have passed their unit test.
\newpage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment