Skip to content
juliet86 edited this page Jul 21, 2015 · 6 revisions

Code Samples is set of simple tests to emulate software development life cycle processes by the samples.

Testcase #1 Description: to test addition of positive numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input positive number (5) and push "Enter".
  2. Input positive number (5) and push "Enter".
  3. Push "+" and "Enter" Expected result: program makes correct calculation (5+5=10)

Testcase #2 Description: to test addition of negative numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input negative number (-5) and push "Enter".
  2. Input negative number (-5) and push "Enter".
  3. Push "+" and "Enter" Expected result: program makes correct calculation (-5+-5=10)

Testcase #3 Description: to test subtraction of positive numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input positive number (5) and push "Enter".
  2. Input positive number (5) and push "Enter".
  3. Push "-" and "Enter" Expected result: program makes correct calculation (5-5=0)

Testcase #4 Description: to test subtraction of negative numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input negative number (-5) and push "Enter".
  2. Input negative number (-5) and push "Enter".
  3. Push "-" and "Enter" Expected result: program makes correct calculation (-5--5=0)

Testcase #5 Description: to test multiplication of positive numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input positive number (5) and push "Enter".
  2. Input positive number (5) and push "Enter".
  3. Push "" and "Enter" Expected result: program makes correct calculation (55=25)

Testcase #6 Description: to test multiplication of negative numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input negative number (-5) and push "Enter".
  2. Input negative number (-5) and push "Enter".
  3. Push "" and "Enter" Expected result: program makes correct calculation (-5-5=-25)

Testcase #7 Description: to test division of positive numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input positive number (5) and push "Enter".
  2. Input positive number (5) and push "Enter".
  3. Push ":" and "Enter" Expected result: program makes correct calculation (5:5=1)

Testcase #8 Description: to test division of negative numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input negative number (-5) and push "Enter".
  2. Input negative number (-5) and push "Enter".
  3. Push ":" and "Enter". Expected result: program makes correct calculation (-5:-5=1)

Testcase #9 Description: to test division by zero Pre-conditions: open TestHost.exe Steps:

  1. Input any number and push "Enter".
  2. Input "0" and and push "Enter".
  3. Push ":" or "/" and "Enter". Expected result: "Attempted to divide by zero" message is shown.

Testcase #10 Description: to test addition of positive decimals. Pre-conditions: open TestHost.exe Steps:

  1. Input positive decimal (1.5) and push "Enter".
  2. Input positive decimal (1.1) and push "Enter".
  3. Push "+" and "Enter" Expected result: program makes correct calculation (1.5+1.1=2.6)

Testcase #11 Description: to test addition of negative decimals. Pre-conditions: open TestHost.exe Steps:

  1. Input negative decimal (-1.5) and push "Enter".
  2. Input negative decimal (-1.1) and push "Enter".
  3. Push "+" and "Enter" Expected result: program makes correct calculation (-1.5+-1.1=-2.6)

Testcase #12 Description: to test subtraction of positive decimals. Pre-conditions: open TestHost.exe Steps:

  1. Input positive decimal (1.5) and push "Enter".
  2. Input positive decimal (1.1) and push "Enter".
  3. Push "-" and "Enter" Expected result: program makes correct calculation (1.5-1.1=0.4)

Testcase #13 Description: to test subtraction of negative decimals. Pre-conditions: open TestHost.exe Steps:

  1. Input negative decimal (-1.5) and push "Enter".
  2. Input negative decimal (-1.1) and push "Enter".
  3. Push "-" and "Enter" Expected result: program makes correct calculation (-1.5--1.1=-0.4)

Testcase #14 Description: to test multiplication of positive decimals. Pre-conditions: open TestHost.exe Steps:

  1. Input positive decimal (5) and push "Enter".
  2. Input positive decimal (5) and push "Enter".
  3. Push "" and "Enter" Expected result: program makes correct calculation (1.51.1=1.65)

Testcase #15 Description: to test multiplication of negative decimals. Pre-conditions: open TestHost.exe Steps:

  1. Input negative decimal (-1.5) and push "Enter".
  2. Input negative decimal (-1.1) and push "Enter".
  3. Push "" and "Enter" Expected result: program makes correct calculation (-1.5-1.1=-2.6)

Testcase #16 Description: to test division of positive decimals. Pre-conditions: open TestHost.exe Steps:

  1. Input positive decimal (1.5) and push "Enter".
  2. Input positive decimal (1.1) and push "Enter".
  3. Push "/" or ":" and "Enter" Expected result: program makes correct calculation (1.5:1.1=1.36363636)

Testcase #17 Description: to test division of negative decimals. Pre-conditions: open TestHost.exe Steps:

  1. Input negative decimal (-1.5) and push "Enter".
  2. Input negative decimals (-1.1) and push "Enter".
  3. Push ":" or "/" and "Enter". Expected result: program makes correct calculation (-1.5:-1.1=-1.1)

Testcase #18 Description: to test button "q". Pre-conditions: open TestHost.exe Steps: push "q" button Expected result: program quits

Testcase #19 Description: to test capital "Q". Pre-conditions: open TestHost.exe Steps: push capital "Q" button Expected result: program quits

Testcase #20 Description: to test division of positive numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input positive number (5) and push "Enter".
  2. Input positive number (5) and push "Enter".
  3. Push "/" and "Enter" Expected result: program makes correct calculation (5:5=1)

Testcase #21 Description: to test division of negative numbers. Pre-conditions: open TestHost.exe Steps:

  1. Input negative number (-5) and push "Enter".
  2. Input negative number (-5) and push "Enter".
  3. Push "/" and "Enter". Expected result: program makes correct calculation (-5:-5=1)

Testcase #22 Description: to test operation field validation (letters). Pre-conditions: open TestHost.exe Steps:

  1. Input positive number (5) and push "Enter".
  2. Input positive number (5) and push "Enter".
  3. Input letter "j" Expected result: message "not appropriate character" appears.

Testcase #23 Description: to test first number field validation (letters). Pre-conditions: open TestHost.exe Steps:

  1. Input letter "j" and push "Enter".
  2. Input positive number (5) and push "Enter".
  3. Push "+" and "Enter" Expected result: message "not appropriate character" appears.

Testcase #24 Description: to test second number field validation (letters). Pre-conditions: open TestHost.exe Steps:

  1. Input positive number (5) and push "Enter".
  2. Input letter "j" and push "Enter".
  3. Push "+" and "Enter" Expected result: message "not appropriate character" appears.

Testcase #25 Description: to test operation field validation (special character). Pre-conditions: open TestHost.exe Steps:

  1. Input positive number (5) and push "Enter".
  2. Input positive number (5) and push "Enter".
  3. Input special character "}" Expected result: message "not appropriate character" appears.

Testcase #26 Description: to test first number field validation (special character). Pre-conditions: open TestHost.exe Steps:

  1. Input letter "}" and push "Enter".
  2. Input positive number (5) and push "Enter".
  3. Push "+" and "Enter" Expected result: message "not appropriate character" appears.

Testcase #27 Description: to test second number field validation (special character). Pre-conditions: open TestHost.exe Steps:

  1. Input positive number (5) and push "Enter".
  2. Input letter "}" and push "Enter".
  3. Push "+" and "Enter" Expected result: message "not appropriate character" appears.

Clone this wiki locally