You are on page 1of 32

Visual Programming in C#

Ripple Primary School Math Tutor


Table of Contents
Part 1: introduction and acknowledgement.......................................................................
!cknowledgement:.........................................................................................................
"ntroduction:...................................................................................................................
Re#uirement !nalysis:...................................................................................................
$unctional re#uirements: %System must do&..................................................................
'on()unctional re#uirements:.........................................................................................*
Part +: ,ogic "mplementation- Code "mplementation..........................................................
Class diagram )or Math Tutor So)tware:..........................................................................
Student ta/le screen shot:..............................................................................................
S0, C123 )or student ta/le:.........................................................................................4
"mplementation o) user data capturing in C#:................................................................4
Pu/lic Varia/les )or random num/ers and results:.........................................................5
Random 'um/er generator )or addition and multiplication:...........................................5
Random 'um/er generator )or Su/traction and 2i6ision:.............................................5
!rithmetic operation class:...........................................................................................17
!ssignment o) random num/er to la/els in )orms:.......................................................11
Result o) random num/ers:..........................................................................................11
8ome Screen............................................................................................................... 11
Code to check i) answer /o9 is empty:.........................................................................1+
Code to check i) entered answer is numeric or not:.....................................................1
:.................................................................................................................................... 1
2iscussion on user "nter)aces o) Math Tutor so)tware and importance o) good user
e9perience................................................................................................................... 1;
Structure principle:....................................................................................................... 1;
Visi/ility principle:.........................................................................................................1;
Simplicity principle:...................................................................................................... 1;
$eed/ack principle:......................................................................................................1;
Tolerance principle:......................................................................................................1*
Reuse principle:........................................................................................................... 1*
!ddition: $orm.............................................................................................................. 1*
Su/traction: $orm........................................................................................................ 14
2i6ision: $orm.............................................................................................................. +7
Multiplication: $orm......................................................................................................+
Main )orm:)orm............................................................................................................. +*
$inish )orm:.................................................................................................................. +5
So)tware testing............................................................................................................... +5
"mportance o) testing:..................................................................................................+5
Types o) so)tware testing:............................................................................................7
System security:........................................................................................................... 1
Conclusion:...................................................................................................................... 1
<i/liography..................................................................................................................... 1
Documentation of this project is structured in three parts, which are introduction
and acknowledgement, Requirement Analysis, Logic implementation and Testing
against user requirements
!art "# introduction and acknowledgement
Acknowledgement#
Thank to lecturer o) our 6isual programming su/=ect Mr. 3matchandirane Vasu )or
6alua/le guidance and ad6ice.
$ntroduction#
Ripple Primary School> a school in ,ondon wants to moti6ate students to learn
mathematics /y creating math(teaching so)tware called %ath Tutor. The primary goal is
to make the e9perience )un while the students learn /asic arithmetic operations such as
Addition> Subtraction> Multiplication and Division.
Requirement Analysis#
This section will )ocus on use re#uirements capturing and detailed discussion on what
system must achie6e in order to /e success)ul? to do this )unctional and non()unctional
re#uirements will /e captured.
&unctional requirements# '(ystem must do)
,ist o) )unctional re#uirements )or Ripple Primary School
Store student personal details such as name> class> password> description and
"2.
Three tasks )or each arithmetic operation %!ddition> Multiplication> Su/traction>
Multiplication&.
System must generate Random num/ers )or each task
System must not allow student to proceed to the ne9t challenge until success)ul
completion o) current arithmetic tasks.
System must generate new num/ers i) student is )ailing to answer current tasks.
System must gi6e positi6e )eed/ack on students progress
System must gi6e encouraging )eed/ack on student@s )ailure.
System must pro6ide su))icient help to complete the task.
$or graphical illustration o) )unctional re#uirements Ase case diagram has /een used to
simpli)y student@s interaction with math tutor system. Three actors ha6e /een identi)ied in
the system> which are listed /elow.
Student:
Primary user o) the system who will take /asic arithmetic #uiBBes.
Random 'um/er:
"t is a li/rary in C# programming which generates Random num/ers )rom a minimum
6alue to ma9imum 6alue.
!rithmetic system:
This is a class in Math tutor application> which compares student answer with actual
answer o) the task.
$igure 1.1: Ase case 2iagram )or Math Tutor so)tware
*on+functional requirements#
,ist o) non()unctional re#uirements )or proposed so)tware system
Ase o) appropriate images )or nursery students
Ase o) easily reada/le )ont and siBe.
!art ,# Logic $mplementation- Code $mplementation
Class diagram for %ath Tutor (oftware#
$ig +.1: Class diagram )or Math Tutor so)tware
(tudent table screen shot#
CStudentsD data/ase ha6e /een created to store student in)ormation in MyS0, ser6er.
$ig +.+: student login detail ta/le description )or Math Tutor so)tware
(.L C/D0 for student table#
CR3!T3 T!<,3 log2etails
%
"2 6archar%**&>
$irst'ame6archar%**&>
stdEclass6archar%17&>
password6archar%**&>
descrition6archar%+**&>
PR"M!RF G3F %"2&
&?
$mplementation of user data capturing in C1#
! class called C2<C%C# 2ata/ase Connector& is created in Visual Studio +71
pro)essional edition.
Method d/msConnector is created to store student details in data/ase. "nput
parameters )or this method are String "2> String 'ame> String stdClass and descrition .
Class is instantiated in Math tutor 8ome )orm %)orm1&.
using System?
usingSystem.Collections.Heneric?
usingSystem.,in#?
usingSystem.Te9t?
usingSystem.Threading.Tasks?
usingMyS#l.2ata.MyS#lClient?
usingSystem.Iindows.$orms?
namespaceMath!cademy
J
classC2<C
J
pu/lic6oid2/msConnector% string id> string 'ame> stringstdClass> stringpassword>
stringdescrition&
J
stringConnectorString K LSer6erKlocalhost? port K7.? 2ata/aseKstudents? AidKroot?
passwordK1+;*.4M57L?
try
J
MyS#lConnection connector K newMyS#lConnection%ConnectorString&?
connector.1pen%&?
MyS#lCommand"nscommand K connector.CreateCommand%&?
"nscommand.CommandTe9t K L"'S3RT "'T1 logdetails%"2> )irst'ame>
stdEclass>password>descrition& V!,A3S%N)irst'ame> NstdEclass> Npassword>
Ndescrition> Nid&L?
"nscommand.Prepare%&?
"nscommand.Parameters.!ddIithValue%LN)irst'ameL> 'ame&?
"nscommand.Parameters.!ddIithValue%LNstdEclassL> stdClass&?
"nscommand.Parameters.!ddIithValue%LNpasswordL> password&?
"nscommand.Parameters.!ddIithValue%LNdescritionL> descrition&?
"nscommand.Parameters.!ddIithValue%LNidL>id&?
"nscommand.39ecute'on0uery%&?
:
catch%MyS#l39ception e9&
J
Message<o9.Show%e9.Message&?
:)inally J
:
:
:
:
"nstantiation in Math tutor home screen in order to capture user data )rom ; te9t /o9es
and one rich te9t /o9.
C2<C conn K newC2<C%&?
conn.2/msConnector%te9t<o91.Te9t> te9t<o9+.Te9t> te9t<o9.Te9t> te9t<o9;.Te9t>
te9t<o9*.Te9t&?
!ddition add K new!ddition%&?
add.Show%&?
this.8ide%&?
!ublic 2ariables for random numbers and results#
pu/licint 6al1> 6al+> 6al> 6al;> 6al*> 6al.?
int result1> result+> result?
Random num/ers are assigned to a/o6e 6aria/les %6al1> 6al+> 6al> 6al;> 6al*> 6al.&.
2ata type )or 6aria/les is int.
Random *umber generator for addition and multiplication#
Si9 random num/ers has /een assigned )or each task. "n case o) )ailure to answer
#uestions success)ully student can regenerate new num/ers.
Random rand K newRandom%&?
6al1K rand.'e9t%;> 17&?
6al+ K rand.'e9t%.> 1+&?
6al K rand.'e9t%M> 1;&?
6al; K rand.'e9t%17> 1.&?
6al* K rand.'e9t%1+> 1M&?
6al. K rand.'e9t%1;> +7&?
Random li/rary is used to generate random num/er )or #uiBBes. $rom 6al+ to 6al. each
6alue is greater than one /e)ore> this techni#ue is used to make a per)ect pair o) random
num/ers.
Random *umber generator for (ubtraction and Di3ision#
Random rand K newRandom%&?
6al1 K rand.'e9t%11> +7&?
6al+ K rand.'e9t%1> 17&?
6al K rand.'e9t%1*> ++&?
6al; K rand.'e9t%5> 1*&?
6al* K rand.'e9t%+*> 7&?
6al. K rand.'e9t%1> 17&?
!gain same random num/er generator li/rary is used? /ut com/ination o) random
num/er must /e di))erent )or these two arithmetic operations that is why " ha6e kept )irst
random num/er /igger that ne9t consecuti6e 6alue.
Arithmetic operation class#
using System?
using System.Collections.Heneric?
using System.,in#?
using System.Te9t?
using System.Threading.Tasks?
namespace Math!cademy
J
class !rithmatic1perations
J
int result?
pu/lic int !ddition%int 6al1>int 6al+&

J
result K 6al1 O 6al+?
return result?

:
pu/lic int Multiplication%int 6al1> int 6al+&
J
result K 6al1 P 6al+?
return result?
:
pu/lic int 2i6ision%int 6al1> int 6al+&
J
result K 6al1 - 6al+?
return result?
:
pu/lic int Su/straction%int 6al1> int 6al+&
J
result K 6al1 ( 6al+?
return result?
:
:
:
!/o6e code is )or arithmetic operation on randomly generated 6alues. !s we discussed
there are )our arithmetic operations we ha6e to do in our math tutor so)tware.
Assignment of random number to labels in forms#
la/el1.Te9t K Con6ert.ToString%6al1&?
la/el.Te9t K Con6ert.ToString%6al+&?
la/el*.Te9t K Con6ert.ToString%6al&?
la/el4.Te9t K Con6ert.ToString%6al;&?
la/el5.Te9t K Con6ert.ToString%6al*&?
la/el11.Te9t K Con6ert.ToString%6al.&?
!/o6e code is used in all )our )orms. Random num/ers will /e assigned to all la/els.
Result of random numbers#
int result1> result+> result will hold the answer o) two 6alues )or each arithmetic
operation.
4ome (creen
8ome screen is di6ided in groups o) o/=ect> one is Sign Ap and other one is ,ogin. The
)orm is instantiated using C2<C conn K newC2<C%&? Method.
Signup: will take user input )rom students in te9t/o9es and e6entually store that data in
pro6ided data/ase.
C2<C conn K newC2<C%&?
conn.2/msConnector%te9t<o91.Te9t> te9t<o9+.Te9t> te9t<o9.Te9t> te9t<o9;.Te9t>
te9t<o9*.Te9t&?
!ddition add K new!ddition%&?
add.Show%&?
this.8ide%&?
!/o6e code will take data )rom te9t<o91> te9t<o9+> te9t<o9> te9t<o9; and te9t<o9* and
store it into MyS0, 2ata/ase.
Code to check if answer bo5 is empty#
i) %String."s'ull1r3mpty%te9t<o91.Te9t& QQ string."s'ull1r3mpty%te9t<o9+.Te9t& QQ
String."s'ull1r3mpty%te9t<o9.Te9t&&
J
Message<o9.Show%L!nswer )ield cannot /e emptyL&?
return?
:
!/o6e code noti)ies user i) it is le)t empty. ") answer )ields are empty then system will not
go )urther. Screen shot o) that is attached /elow.

Code to check if entered answer is numeric or not#

pri6ate 6oid te9t<o9+EGeyPress%o/=ect sender> GeyPress36ent!rgs e&
J
char keypress K e.GeyChar?
i) %char."s2igit%keypress& RR e.GeyChar KK Con6ert.ToChar%Geys.<ack&&
J
:
else
J
Message<o9.Show%LFou Can 1nly 3nter ! 'um/erSL&?
e.8andled K true?
:
6
!/o6e code checks entered answer is numeric or not i) answer is not in numeric )ormat
system will show error message on the screen which is included /elow.
Discussion on user $nterfaces of %ath Tutor software and importance of good user
e5perience
!ny user inter)ace must /e /ased on si9 principles? /ut /e)ore discussing those
principles " would like to include a #uote /y inter)ace e9pert Te)) Rasking according to
him CAs far as the customer is concerned, the interface is the product. Now discussing
six principles
(tructure principle#
Aser inter)ace must /e designed in purpose)ul way. Putting related elements together
and separating irrele6ant ones. Structure principle is )oundation )or all user inter)aces
architecture.
2isibility principle#
! good design should make all options 6isi/le )or gi6en task any con)using elements in
user inter)ace must /e eliminated in early stages. ! good design must not gi6e user
alternati6es or unneeded in)ormation.
(implicity principle#
2esign must look simple> make tasks easy> communicating and most importantly must
pro6ide user shortcuts.
&eedback principle#
! good user inter)ace should keep its users in)ormed on their actions or errors they
would )ace during tasks.
Tolerance principle#
The user inter)ace should /e tolerant and )le9i/le. Reducing cost o) mistakes /y allowing
undoing are redoing is 6ery important too.
Reuse principle#
! good user inter)ace design must reuse internal> e9ternal elements and /eha6iours.
Maintaining consistency is 6ery important in this task.
2uring design o) Math tutor so)tware all principles are considered and implemented 6ery
care)ully.
Addition# &orm
Control and properties used )or this )orm:
'ame Purpose 'um/er o) time used
Te9t /o9es To get user input )or
answers

<uttons To generate random


num/ers and check
answers
+
,a/els To show random num/ers
generated /y Random
li/rary.
1;
pri6ate 6oid /utton1EClick%o/=ect sender> 36ent!rgs e&
J
Random rand K new Random%&?
6al1K rand.'e9t%;> 17&?
6al+ K rand.'e9t%.> 1+&?
6al K rand.'e9t%M> 1;&?
6al; K rand.'e9t%17> 1.&?
6al* K rand.'e9t%1+> 1M&?
6al. K rand.'e9t%1;> +7&?
la/el1.Te9t K Con6ert.ToString%6al1&?
la/el.Te9t K Con6ert.ToString%6al+&?
la/el*.Te9t K Con6ert.ToString%6al&?
la/el4.Te9t K Con6ert.ToString%6al;&?
la/el5.Te9t K Con6ert.ToString%6al*&?
la/el11.Te9t K Con6ert.ToString%6al.&?
result1 K arith.!ddition%6al1> 6al+&?
result+ K arith.!ddition%6al> 6al;&?
result K arith.!ddition%6al*> 6al.&?
la/el1;.Te9t K LL?
la/el1.Te9t K LL?
:
pri6ate 6oid /utton+EClick%o/=ect sender> 36ent!rgs e&
J
int answer1 K Con6ert.To"nt+%te9t<o91.Te9t&?
int answer+ K Con6ert.To"nt+%te9t<o9+.Te9t&?
int answer K Con6ert.To"nt+%te9t<o9.Te9t&?
i) %result1 KK answer1 RR result+ KK answer+ RR result KK answer&
J
la/el1.$oreColor K Color.Hreen?
la/el1.Te9t K LI1ISS Fou Hot it rightL O L 'ow yoUre ready to take Su/straction
challengeL?
Message<o9.Show%la/el1.Te9t&?
Su/straction su/s K new Su/straction%&?
su/s.Show%&?
this.8ide%&?
:
else
J
la/el1;.$oreColor K Color.Red?
la/el1;.Te9t K LIrong answer> /ut always remem/er practice makes man per)ect L O
LPlease try againL?
Message<o9.Show%la/el1;.Te9t&?
this.Show%&?
:
"n a/o6e code random num/ers are getting assigned to la/els when user clicks on
generate num/ers %,a/el 1> > *> 4> 5> 11&. The )orm instantiates the !rithmetic operation
class in order to get answer and that answer is checked with the actual user input.
(ubtraction# &orm
Control and properties used )or this )orm:
Control and properties used )or this )orm:
'ame Purpose 'um/er o) times used
Te9t /o9es To get user input )or
answers

<uttons To generate random


num/ers and check
answers
+
,a/els To show random num/ers
generated /y Random
1;
li/rary.
using System?
usingSystem.Collections.Heneric?
usingSystem.ComponentModel?
usingSystem.2ata?
usingSystem.2rawing?
usingSystem.,in#?
usingSystem.Te9t?
usingSystem.Threading.Tasks?
usingSystem.Iindows.$orms?
namespaceMath!cademy
J
pu/lic partial class Su/straction : $orm
J
!rithmatic1perationsarith K new !rithmatic1perations%&?
pu/licint 6al1> 6al+> 6al> 6al;> 6al*> 6al.?
int result1> result+> result?
pu/licSu/straction%&
J
"nitialiBeComponent%&?
:
pri6ate 6oid /utton1EClick%o/=ect sender> 36ent!rgs e&
J
Random rand K new Random%&?
6al1 K rand.'e9t%11> +7&?
6al+ K rand.'e9t%1> 17&?
6al K rand.'e9t%1*> ++&?
6al; K rand.'e9t%5> 1*&?
6al* K rand.'e9t%+*> 7&?
6al. K rand.'e9t%1> 17&?
la/el1.Te9t K Con6ert.ToString%6al1&?
la/el.Te9t K Con6ert.ToString%6al+&?
la/el*.Te9t K Con6ert.ToString%6al&?
la/el4.Te9t K Con6ert.ToString%6al;&?
la/el5.Te9t K Con6ert.ToString%6al*&?
la/el11.Te9t K Con6ert.ToString%6al.&?
result1 K arith.Su/straction%6al1> 6al+&?
result+ K arith.Su/straction%6al> 6al;&?
result K arith.Su/straction%6al*> 6al.&?
:
pri6ate 6oid /utton+EClick%o/=ect sender> 36ent!rgs e&
J
int answer1 K Con6ert.To"nt+%te9t<o91.Te9t&?
int answer+ K Con6ert.To"nt+%te9t<o9+.Te9t&?
int answer K Con6ert.To"nt+%te9t<o9.Te9t&?
i) %result1 KK answer1 RR result+ KK answer+ RR result KK answer&
J
la/el1.$oreColor K Color.Hreen?
la/el1.Te9t K LI1ISS Fou Hot it rightL O L 'ow yoUre ready to take 2i6ision challengeL?
Message<o9.Show%la/el1.Te9t&?
2i6ision di6 K new 2i6ision%&?
di6.Show%&?
this.8ide%&?
:
else
J
la/el1;.$oreColor K Color.Red?
la/el1;.Te9t K LIrong answer> /ut always remem/er practice makes man per)ect L O
LPlease try againL?
Message<o9.Show%la/el1;.Te9t&?
:
:
:
:
"n a/o6e code random num/ers are getting assigned to la/els when user clicks on
generate num/ers %,a/el 1> > *> 4> 5> 11&. The )orm instantiates the !rithmetic operation
class in order to get answer and that answer is checked with the actual user input.
Di3ision# &orm
Control and properties used )or this )orm:
'ame Purpose 'um/er o) times used
Te9t /o9es To get user input )or
answers

<uttons To generate random


num/ers and check
answers
+
,a/els To show random num/ers
generated /y Random
li/rary.
1;
using System?
usingSystem.Collections.Heneric?
usingSystem.ComponentModel?
usingSystem.2ata?
usingSystem.2rawing?
usingSystem.,in#?
usingSystem.Te9t?
usingSystem.Threading.Tasks?
usingSystem.Iindows.$orms?
namespaceMath!cademy
J
pu/lic partial class 2i6ision : $orm
J
!rithmatic1perationsarith K new !rithmatic1perations%&?
pu/licint 6al1> 6al+> 6al> 6al;> 6al*> 6al.?
int result1> result+> result?
pu/lic 2i6ision%&
J
"nitialiBeComponent%&?
:
pri6ate 6oid /utton1EClick%o/=ect sender> 36ent!rgs e&
J
Random rand K new Random%&?
6al1 K rand.'e9t%1*> +*&?
6al+ K rand.'e9t%1>17&?
6al K rand.'e9t%1*> +*&?
6al; K rand.'e9t%1>17&?
6al* K rand.'e9t%1*> +*&?
6al. K rand.'e9t%1>17&?
la/el1.Te9t K Con6ert.ToString%6al1&?
la/el.Te9t K Con6ert.ToString%6al+&?
la/el*.Te9t K Con6ert.ToString%6al&?
la/el4.Te9t K Con6ert.ToString%6al;&?
la/el5.Te9t K Con6ert.ToString%6al*&?
la/el11.Te9t K Con6ert.ToString%6al.&?
result1 K arith.2i6ision%6al1> 6al+&?
result+ K arith.2i6ision%6al> 6al;&?
result K arith.2i6ision%6al*> 6al.&?
:
pri6ate 6oid /utton+EClick%o/=ect sender> 36ent!rgs e&
J
int answer1 K Con6ert.To"nt+%te9t<o91.Te9t&?
int answer+ K Con6ert.To"nt+%te9t<o9+.Te9t&?
int answer K Con6ert.To"nt+%te9t<o9.Te9t&?
i) %result1 KK answer1 RR result+ KK answer+ RR result KK answer&
J
la/el1.$oreColor K Color.Hreen?
la/el1.Te9t K LI1ISS Fou Hot it rightL O L 'ow yoUre ready to take multiplication
challengeL?
Message<o9.Show%la/el1.Te9t&?
Multiplication multi K new Multiplication%&?
multi.Show%&?
this.8ide%&?
:
else
J
la/el1;.$oreColor K Color.Red?
la/el1;.Te9t K LIrong answer> /ut always remem/er practice makes man per)ect L O
LPlease try againL?
Message<o9.Show%la/el1;.Te9t&?
:
:
:
:
"n a/o6e code random num/ers are getting assigned to la/els when user clicks on
generate num/ers %,a/el 1> > *> 4> 5> 11&. The )orm instantiates the !rithmetic operation
class in order to get answer and that answer is checked with the actual user input.
%ultiplication# &orm
Control and properties used )or this )orm:
'ame Purpose 'um/er o) times used
Te9t /o9es To get user input )or
answers

<uttons To generate random


num/ers and check
answers
+
,a/els To show random num/ers
generated /y Random
li/rary.
1;
using System?
usingSystem.Collections.Heneric?
usingSystem.ComponentModel?
usingSystem.2ata?
usingSystem.2rawing?
usingSystem.,in#?
usingSystem.Te9t?
usingSystem.Threading.Tasks?
usingSystem.Iindows.$orms?
namespaceMath!cademy
J
pu/lic partial class Multiplication : $orm
J
!rithmatic1perationsarith K new !rithmatic1perations%&?
pu/licint 6al1> 6al+> 6al> 6al;> 6al*> 6al.?
int result1> result+> result?
pu/lic Multiplication%&
J
"nitialiBeComponent%&?
:
pri6ate 6oid /utton1EClick%o/=ect sender> 36ent!rgs e&
J
Random rand K new Random%&?
6al1 K rand.'e9t%+> 17&?
6al+ K rand.'e9t%+> 1+&?
6al K rand.'e9t%+> 1;&?
6al; K rand.'e9t%+> 1.&?
6al* K rand.'e9t%+> 1M&?
6al. K rand.'e9t%+> +7&?
la/el1.Te9t K Con6ert.ToString%6al1&?
la/el.Te9t K Con6ert.ToString%6al+&?
la/el*.Te9t K Con6ert.ToString%6al&?
la/el4.Te9t K Con6ert.ToString%6al;&?
la/el5.Te9t K Con6ert.ToString%6al*&?
la/el11.Te9t K Con6ert.ToString%6al.&?
result1 K arith.Multiplication%6al1> 6al+&?
result+ K arith.Multiplication%6al> 6al;&?
result K arith.Multiplication%6al*> 6al.&?
la/el1;.Te9t K LL?
la/el1.Te9t K LL?
:
pri6ate 6oid /utton+EClick%o/=ect sender> 36ent!rgs e&
J
int answer1 K Con6ert.To"nt+%te9t<o91.Te9t&?
int answer+ K Con6ert.To"nt+%te9t<o9+.Te9t&?
int answer K Con6ert.To"nt+%te9t<o9.Te9t&?
i) %result1 KK answer1 RR result+ KK answer+ RR result KK answer&
J
la/el1.$oreColor K Color.Hreen?
la/el1.Te9t K LI1ISS Fou Hot it rightL O L 'ow yoUre ready to take multiplication
challengeL?
Message<o9.Show%la/el1.Te9t&?
$inish )inish K new $inish%&?
)inish.Show%&?
this.8ide%&?
:
else
J
la/el1;.$oreColor K Color.Red?
la/el1;.Te9t K LIrong answer> /ut always remem/er practice makes man per)ect L O
LPlease try againL?
Message<o9.Show%la/el1;.Te9t&?
this.Show%&?
:
:
:
:
"n a/o6e code random num/ers are getting assigned to la/els when user clicks on
generate num/ers %,a/el 1> > *> 4> 5> 11&. The )orm instantiates the !rithmetic operation
class in order to get answer and that answer is checked with the actual user input.
%ain form#form
Control and properties used )or this )orm:
'ame Purpose 'um/er o) times used
Te9t /o9es To get user input )or
answers
4
<uttons To generate random +
num/ers and check
answers
Hroup <o9 To group all related
elements at one place
+
,a/els To show random num/ers
generated /y Random
li/rary.
M
using System?
usingSystem.Collections.Heneric?
usingSystem.ComponentModel?
usingSystem.2ata?
usingSystem.2rawing?
usingSystem.,in#?
usingSystem.Te9t?
usingSystem.Threading.Tasks?
usingSystem.Iindows.$orms?
namespaceMath!cademy
J
pu/lic partial class $orm1 : $orm
J
pu/lic $orm1%&
J
"nitialiBeComponent%&?
:
pri6ate 6oid $orm1E,oad%o/=ect sender> 36ent!rgs e&
J
:
pri6ate 6oid /utton1EClick%o/=ect sender> 36ent!rgs e&
J
C2<C conn K new C2<C%&?
conn.2/msConnector%te9t<o91.Te9t> te9t<o9+.Te9t> te9t<o9.Te9t> te9t<o9;.Te9t>
te9t<o9*.Te9t&?
!ddition add K new !ddition%&?
add.Show%&?
this.8ide%&?
:
pri6ate 6oid /utton+EClick%o/=ect sender> 36ent!rgs e&
J
C2<C conn K new C2<C%&?
:
:
:
Code in the a/o6e ta/le helps user to make registration in the system. 1n success)ul
registration or login> user can take arithmetic challenges. The )orm instantiates the
C2<C class to make connection with MyS0, ser6er.
Checking user input code:
i) %result1 KK answer1 RR result+ KK answer+ RR result KK answer&
J
la/el1.$oreColor K Color.Hreen?
la/el1.Te9t K LI1ISS Fou Hot it rightL O L 'ow yoUre ready to take multiplication
challengeL?
Message<o9.Show%la/el1.Te9t&?
$inish )inish K new $inish%&?
)inish.Show%&?
this.8ide%&?
:
else
J
la/el1;.$oreColor K Color.Red?
la/el1;.Te9t K LIrong answer> /ut always remem/er practice makes man per)ect L O
LPlease try againL?
Message<o9.Show%la/el1;.Te9t&?
this.Show%&?
Code a/o6e checks user input with actual answer. ") user input is wrong system will not
allow user to go )or the ne9t challenge.
&inish form#
(oftware testing
$mportance of testing#
! so)tware de6eloper can commit errors during de6elopment stage. Some errors are not
does not impact )unctionality o) the so)tware /ut some errors can /reak entire so)tware.
So> in these kind o) situations taking care o) errors is 6ery important /e)ore deploying
so)tware in working en6ironment.
,ets take a real world e9ample o) "nternet /anking> i) a /ank customer trans)ers some
amount to other account and gets con)irmation o) trans)er? /ut person at the other end
who was supposed get the money did not recei6ed it. 'ow to settle this dispute /oth
account holders will go to the /ank /ecause o) errors in "nternet /anking so)tware.
This is one situation where testing cannot /e ignored. 2eployment o) so)tware system
/e)ore testing can impact end user o) the so)tware 6ery /adly.
<ut the testing is not =ust a/out getting errors out. Testing also 6alidates standards o) the
so)tware system. <elow are some e9amples> which are included in testing standards.
Aser re#uirement 6eri)ication: checking de6eloped system components against
user re#uirement speci)ication document.
Validation: it assures all components de6eloped are meeting user re#uirements
and is it what customer is looking )orV
Types of software testing#
<lack /o9 testing :in this testing tests are /ased on )unctionality and user
re#uirements.
Ihite /o9 testing :in this testing tests are /ased on internal logic o) the so)tware
i.e. statements> /ranches> paths and conditions. !nother name )or this testing is
glass /o9 testing.
Anit testing: this is testing o) indi6idual components o) the so)tware %Sprints in
agile Scrum en6ironment&. Testing typically done /y programmers not /y testers.
"ncremental integration testing: !lso called continues testing> this is typically
done when new )unctionality is added in the so)tware. Can /e done /y de6eloper
or tester.
"ntegration testing :this is testing o) all com/ined modules %or sprints& a)ter
integration testing. Typically done in distri/uted systems and ser6er applications.
$unctional testing : this testing completely ignores internal )unctionality o) the
so)tware and )ocuses on the actual output gi6en /y so)tware and checks i) they
are meeting user re#uirements.
System testing: 3ntire system is tested as per end user re#uirements.
3nd(to(end testing: This testing is similar to system testing? /ut it in6ol6es real
world use i.e. interacting with data/ases> hardware> communication de6ices and
network systems.
Sanity testing: this testing is to ensure so)tware is per)orming well to accept
ma=or testing e))orts. ") system is not per)orming well or not sta/le enough it can
/e assigned to )i9.
Stress testing : in this testing system is stretched /eyond speci)ication to check
how and when system is reaching crashing point and when it )ails. i.e. Comple9
data/ase #ueries and large amount o) storage load.
Per)ormance testing: this testing is to check whether system is meeting
per)ormance re#uirements or not.
Asa/ility testing: this testing checks user )riendliness o) the system. ".e. proper
documentation help o) the system. "n other words system na6igation is checked
in this testing.
Re)erence %http:--www.so)twaretestinghelp.com-types(o)(so)tware(testing-&.
Aser-System !ction 1utput Comment%s&
Validate and capture user
data )rom registration )orm
Aser data success)ully
stored in MyS0, data/ase
Hoal achie6ed
Henerate random num/ers
i) user clicks on generate
random num/ers /utton
'um/ers Henerated using
Random li/rary
Hoal achie6ed
2o not proceed i) answer is
wrong
Positi6e and encouraging
message
Hoal achie6ed
8elp menu "n)ormation a/out how to
use system
Hoal achie6ed
Check answer when user
clicks on check answer
/utton
") answer is right proceed to
ne9t task
Hoal achie6ed
") answer /o9 is empty
noti)y user
Show pop up message )ield
cannot /e empty.
Hoal achie6ed
Check i) user input is other
than num/ers
Show warning message )or
wrong input
Hoal achie6ed
(ystem security#
$n math tutor software security is top priority that7s why all student data is
stored in password+protected database 8nregistered user is not allowed to
take qui99es in our math tutor software
%oreo3er students cannot take any qui99es without logging in to the
system &or login in username and password fields are pro3ided for all
users
Conclusion#
"n math tutor so)tware all )unctional and non()unctional re#uirements are achie6ed
according to instruction pro6ided in assignment /rie). This so)tware can /e impro6ed in
many ways> especially in Aser inter)ace and user e9perience.
8owe6er> " really en=oyed learning e9perience> which " ha6e encountered during
de6elopment o) Math tutor so)tware.
:ibliography
1. http:--www.so)twaretestinghelp.com-types(o)(so)tware(testing-
+. http:--/okardo.com-principles(o)(user(inter)ace(design-

You might also like