Team1

Virtual Tutor

Alpha Testing

Version <1.0

Team Members

Name / ID
1. Muhammad Imam Jafer Othman / 227542
2. Saleh Fahad Saleh Al-Zaid / 222852
3. Naser Meshal Al-Ansari / 213175
4. Salman Rahmat Ali Al-Ansari / 227618
5. Abdallah Muhammad Joud / 225656
6. Abdul-Rahman Muhammad Dawood / 215365
Virtual Tutor / Version: <1.0>
Alpha Testing / Date: 5/20/2007

Revision Document History

Date / Version / Description / Author
5/20/2007 / 1.0 / First Draft / All Members

Table of Contents

1.Introduction

1.1Purpose

1.2Scope

2.White-box Testing

2.1The Testers

Abdullah Joud.

Mohammad Imam.

2.2The Procedure

2.3The White-box Test Cases

2.3.1Search Package

2.3.2Net Package

2.3.3GainKnowledge Package

3.Black-box Testing

3.1The Testers

Nasser Al-Ansari.

Salman Al-Ansari.

Saleh Al-Zaid (UI tester)

3.2The functionality tested

3.3The Procedure Performed

3.4Black-box Test Cases Before Debugging

3.4.1Search Package

3.4.2Proxy Configuration

3.4.3UI Package

3.4.4Gain Knowledge Package

3.4.5QA Package

3.4.6Net Package

3.5Bugs Fixing

3.5.1Video with no query shows results.

3.5.2GainKnowledge, Answer Q, Answer Q Online, Text Search and Video Search with no queries should show a message that the user should input.

3.5.3Exception occurred when tried to register in the server and the server is not running

3.5.4Was not able to read from docx file.

3.5.5"Voice Not Supported" alert message,” Voice Configuration" item disabled in main menu. (If the system doesn't have SAPI)

3.5.6When disconnecting an online virtual tutor when the server is not running, an exception occurs while it should an error message.

3.5.7When disconnecting an online virtual tutor when the server is running, it does not disappear from the list.

3.5.8Reading docx raise a problem.

3.6Black-box Test Cases after Debugging

3.6.1Search Package

3.6.2Proxy Configuration

3.6.3UI Package

3.6.4Gain Knowledge Package

3.6.5QA Package

3.6.6Net Package

3.7User Interface Black-box Test Cases

3.7.1Welcome Screen

3.7.2Main Menu Options

3.7.3Gain Knowledge Screens

3.7.4Answer Question Screens

3.7.5Answer Question Online Screens

3.7.6Get Online Resources Screens

3.7.7Voice Configuration Screens

3.7.8Proxy Configuration Screens

Alpha Testing

1.Introduction

1.1Purpose

The purpose of this document is to present the alpha testingand both white-box and black-box test cases of the Virtual Tutor system that have been done by the testing team. Alpha testing is the testing performed internally by the testing team assigned. This document will offer information about the testers, procedure performed and results. It will give a brief idea about the bugging and the debugging phase too.

1.2Scope

This document will offer information about the testers; procedure performed and results of carrying out the test cases. It will give a brief idea about the bugs discovered during the testing process and the results after the debugging. Moreover, a separate section under black-box testing is dedicated for user interface testing.

2.White-box Testing

2.1The Testers

Abdullah Joud.

Mohammad Imam.

2.2The Procedure

The process of white-box testing started with revision of the early designed test cases. Because of the continuous evolution of the design and the code, some of the test cases were modified and some of them were even replaced by new ones. All members have participated in the revision stage. Then came the NUnit testing stage where the revised test cases were coded to be run later. Then came the running phase where the coded test cases were run and the results were collected. Almost all of the test cases have passed. Then came the debugging phase where the bugs identification started from the failed test cases in order to be debugged. Keep in mind that the methods which were tested are those who have a returned value. The ones with the void return type were ignored.

2.3The White-box Test Cases

2.3.1Search Package

2.3.1.1SearchInterface Class

Method Name:SubmitSearchQuery(string searchQuery, SearchType type)

Input:stringsearchQuery, SearchType type

Output: string result

Testing Algorithm Code:

[Test]

publicvoid TestSubmitSearchQuery_WT1a()

{

SearchInterface test = newSearchInterface();

string actualValue = test.SubmitSearchQuery("Wikipedia", SearchType.Text);

Assert.AreEqual("OK", actualValue);

}

[Test]

publicvoid TestSubmitSearchQuery_WT1b()

{

SearchInterface test = newSearchInterface();

string actualValue = test.SubmitSearchQuery("Wikipedia", SearchType.Video);

Assert.AreEqual("OK", actualValue);

}

[Test]

publicvoid TestSubmitSearchQuery_WT1c()

{

SearchInterface test = newSearchInterface();

string actualValue = test.SubmitSearchQuery("Wikipedia", SearchType.Text);

Assert.AreEqual("Error in contacting search service.", actualValue);

}

[Test]

publicvoid TestSubmitSearchQuery_WT1d()

{

SearchInterface test = newSearchInterface();

string actualValue = test.SubmitSearchQuery("Wikipedia", SearchType.Video);

Assert.AreEqual("Error in contacting search service.", actualValue);

}

Number: / WT1
Title / Submit Search Query
Package Name: / Search
Class Name: / SearchInterface
Method Name: / SubmitSearchQuery
Description: / This method submits the search query to either MSN or YouTube search service. It returns a string representing whether the search was done or not.
Inputs: / searchQuery: string value of the search query provided by the user.
type: enumeration that specifies the type of the search "Video" or "Text".
Outputs: / result: text representing whether the search is done or not.
Test Cases:
Test Case Number: / WT1a
Equivalence Class / This test case covers the path when the user submits a non empty query value with correct settings for internet connectivity.
Input: / searchQuery = "Wikipedia"
type = SearchType.Text
Expected Output: / "OK"
Actual Output: / "OK"
Result: / Pass
Test Case Number: / WT1b
Equivalence Class / This test case covers the path when the user submits a non empty query value with correct settings for internet connectivity.
Input: / searchQuery = "Wikipedia"
type = SearchType.Video
Expected Output: / "OK"
Actual Output: / "OK"
Result: / Pass
Test Case Number: / WT1c
Equivalence Class / This test case covers the path when the user submits a non empty query value with wrong settings for internet connectivity.
Input: / searchQuery = "Wikipedia"
type = SearchType.Video
Expected Output: / "Error in contacting search service."
Actual Output: / "Error in contacting search service."
Result: / Pass
Test Case Number: / WT1d
Equivalence Class / This test case covers the path when the user submits a non empty query value with wrong settings for internet connectivity.
Input: / searchQuery = "Wikipedia"
type = SearchType.Video
Expected Output: / "Error in contacting search service."
Actual Output: / "Error in contacting search service."
Result: / Pass

Method Name:FilterResults(SearchResponse results)

Input:SearchResponse results

Output: none

Testing Algorithm Code:

[Test]

publicvoid TestFilterResults_WT2a()

{

SearchInterface test = newSearchInterface();

SearchResponse resultsTest = newSearchResponse();

SourceResponse[] responses = newSourceResponse[1];

Result[] results = newResult[5];

for (int i = 0; i < 5; i++)

{

results[i] = newResult();

results[i].Url = "test";

results[i].Title = "test";

}

SourceResponse response = newSourceResponse();

response.Results = results;

responses[0] = response;

resultsTest.Responses = responses;

test.filterResults(resultsTest);

ListVTSearchResponse> check = test.GetResults();

Assert.AreEqual(5, check.Count);

}

[Test]

publicvoid TestFilterResults_WT2b()

{

SearchInterface test = newSearchInterface();

SearchResponse resultsTest = newSearchResponse();

SourceResponse[] responses = newSourceResponse[1];

Result[] results = newResult[12];

for (int i = 0; i < 12; i++)

{

results[i] = newResult();

results[i].Url = "test";

results[i].Title = "test";

}

SourceResponse response = newSourceResponse();

response.Results = results;

responses[0] = response;

resultsTest.Responses = responses;

test.filterResults(resultsTest);

ListVTSearchResponse> check = test.GetResults();

Assert.AreEqual(10, check.Count);

}

Number: / WT2
Title / FilterResults
Package Name: / Search
Class Name: / SearchInterface
Method Name: / FilterResults
Description: / This method filters the results that came after an MSN search query.
Inputs: / results: SearchRespone represents the results from the MSN search service
Outputs: / No output but the method updates the result set of the SearchInterface Class.
Test Cases:
Test Case Number: / WT2a
Equivalence Class / This test case covers the path when the result count is less than 10;
Input: / results = new Reponse[5]
Expected Output: / 5
Actual Output: / 5
Result: / Pass
Test Case Number: / WT1b
Equivalence Class / This test case covers the path when the result count is greater than 10;
Input: / results = new Reponse[12]
Expected Output: / 10
Actual Output: / 10
Result: / Pass

2.3.2Net Package

2.3.2.1Server Class

Method Name:GetOnlineList()

Input:none

Output: string list

Testing Algorithm Code:

[Test]

publicvoid TestGetOnlineList_WT3a()

{

Server server = newServer();

string test = server.GetOnlineList();

server.Close();

Assert.AreEqual("", test);

}

[Test]

publicvoid TestGetOnlineList_WT3b()

{

Server server = newServer();

server.Register("2135468", "Koko", new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork,System.Net.Sockets.SocketType.Stream,System.Net.Sockets.ProtocolType.Tcp));

server.Register("2135469", "BoBo", new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp));

string test = server.GetOnlineList();

server.Close();

bool check = test.Contains("Koko") & test.Contains("BoBo");

Assert.IsTrue(check);

}

Number: / WT3
Title / Get Online Tutors List
Package Name: / Net
Class Name: / Server
Method Name: / GetOnlineList
Description: / This method returns a list of VirtualTutor clients currently online on the server.
Inputs: / none
Outputs: / list: text representing the list of clients in id/nick pairs.
Test Cases:
Test Case Number: / WT3a
Equivalence Class / This test case covers the path when there are no clients currently connected.
Input: / NA
Expected Output: / ""
Actual Output: / Exception
Result: / Fail
Test Case Number: / WT3b
Equivalence Class / This test case covers the path when 2 clients are connected.
Input: / Connect two clients to the server with nicks "Koko" and "BoBo"
Expected Output: / string list contains "Koko","BoBo"
Actual Output: / string list contains "Koko","BoBo
Result: / Pass

Method Name:Register(string address, string nick, Socket mySocket)

Input:string address, string nick, Socket mySocket

Output: int id

Testing Algorithm Code:

[Test]

publicvoid TestRegister_WT4a()

{

int check = server.Register("123", "Hamdan", new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp));

Assert.AreNotEqual(-1, check);

}

[Test]

publicvoid TestRegister_WT4b()

{

int check = server.Register(null, null, null);

Assert.AreEqual(-1, check);

}

Number: / WT4
Title / Register new Client
Package Name: / Net
Class Name: / Server
Method Name: / Register
Description: / This method registers a new client in the server.
Inputs: / address: a string representing the address of the client
nick: a string representing the client's nick name
mySocket: the client Socket.
Outputs: / id: integer which represents the id of the registered client
Test Cases:
Test Case Number: / WT4a
Equivalence Class / This test case covers the path when the client successfully registers.
Input: / address = "123"
nick = "Hamdan"
mySocket = new Socket();
Expected Output: / id != -1
Actual Output: / id != -1
Result: / Pass
Test Case Number: / WT4b
Equivalence Class / This test case covers the path when the client doesn't register successfully.
Input: / address = "123"
nick = "Hamdan"
mySocket = null;
Expected Output: / -1
Actual Output: / -1
Result: / Pass

2.3.3GainKnowledge Package

2.3.3.1ReversedAIML class

Method Name: ProcessDoc

Input: string: textToBeSplit

Output:ArrayList: sentences

Testing Algorithm Code:

[Test]

publicvoid TestProcessDoc_WT5a()

{

ReversedAIML temp = newReversedAIML();

Assert.AreEqual(0, temp.ProcessDoc("").Count);

}

[Test]

publicvoid TestProcessDoc_WT5b()

{

ReversedAIML temp = newReversedAIML();

ArrayList actual = temp.ProcessDoc("Hey! How do u do?");

ArrayList expect = newArrayList();

expect.Add("Hey");

expect.Add("How do u do");

Boolean iden = actual.Count.Equals(expect.Count);

for (int i = 0; i < actual.Count; i++)

{

iden = iden & (actual.GetEnumerator().ToString()).Equals(expect.GetEnumerator().ToString());

actual.GetEnumerator().MoveNext();

expect.GetEnumerator().MoveNext();

}

Assert.IsTrue(iden);

}

[Test]

publicvoid TestProcessDoc_WT5c()

{

ReversedAIML temp = newReversedAIML();

ArrayList actual = temp.ProcessDoc("My name is silver. I am a pirate...");

ArrayList expect = newArrayList();

expect.Add("My name is silver");

expect.Add("I am a pirate...");

Boolean iden = actual.Count.Equals(expect.Count);

for (int i = 0; i < actual.Count; i++)

{

iden = iden & (actual.GetEnumerator().ToString()).Equals(expect.GetEnumerator().ToString());

actual.GetEnumerator().MoveNext();

expect.GetEnumerator().MoveNext();

}

Assert.IsTrue(iden);

}

publicvoid TestProcessDoc_WT5d()

{

ReversedAIML temp = newReversedAIML();

ArrayList actual = temp.ProcessDoc("My gpa is 2.3. I wish my gpa was 4.0!");

ArrayList expect = newArrayList();

expect.Add("My gpa is 2.3");

expect.Add("I wish my gpa was 4.0");

Boolean iden = actual.Count.Equals(expect.Count);

for (int i = 0; i < actual.Count; i++)

{

iden = iden & (actual.GetEnumerator().ToString()).Equals(expect.GetEnumerator().ToString());

actual.GetEnumerator().MoveNext();

expect.GetEnumerator().MoveNext();

}

Assert.IsTrue(iden);

}

publicvoid TestProcessDoc_WT5e()

{

ReversedAIML temp = newReversedAIML();

ArrayList actual = temp.ProcessDoc("Mr. X is 2.2 tall! Mrs. X is 1.2 tall.");

ArrayList expect = newArrayList();

expect.Add("Mr. X is 2.2 tall");

expect.Add("Mrs. X is 1.2 tall");

Boolean iden = actual.Count.Equals(expect.Count);

for (int i = 0; i < actual.Count; i++)

{

iden = iden & (actual.GetEnumerator().ToString()).Equals(expect.GetEnumerator().ToString());

actual.GetEnumerator().MoveNext();

expect.GetEnumerator().MoveNext();

}

Assert.IsTrue(iden);

}

Number: / WT5
Title / GainKnowledgeProcessDoc
Package Name: / GainKnowledge
Class Name: / RevesedAIML
Method Name: / ProcessDoc
Description: / Gets a string contiaining the information and returns an ArrayList of sentences
Inputs: / textToBeSplit: string variable containing the document in text (from the adapter) to be split
Outputs: / sentences: an ArrayList of the sentences
Test Cases:
Test Case Number: / WT5a
Equivalence Class / This test case covers the case when textToBeSplit is empty
Input: / textToBeSplit = ""
Expected Output: / Sentences = empty ArrayList
Actual Output: / Sentences = empty ArrayList
Result: / Pass
Test Case Number: / WT5b
Equivalence Class / This test case covers the case when textToBeSplit is nonempty and sentences end with ‘?’ or ‘!’
Input: / textToBeSplit = "Hey! How do u do?"
Expected Output: / Sentences = expect ArrayList
Actual Output: / Sentences = actual ArrayList
Result: / Pass
Test Case Number: / WT5c
Equivalence Class / This test case covers the case when textToBeSplit is nonempty and sentences end with ‘.’ Or ‘…’
Input: / textToBeSplit = "My name is silver. I am a pirate..."
Expected Output: / Sentences = expect ArrayList
Actual Output: / Sentences = actual ArrayList
Result: / Pass
Test Case Number: / WT5d
Equivalence Class / This test case covers the case when textToBeSplit is nonempty and sentences contains decimal numbers
Input: / textToBeSplit = "My gpa is 2.3. I wish my gpa was 4.0!"
Expected Output: / Sentences = expect ArrayList
Actual Output: / Sentences = actual ArrayList
Result: / Pass
Test Case Number: / WT5e
Equivalence Class / This test case covers the case when textToBeSplit is nonempty and sentences contains abbreviations
Input: / textToBeSplit = "Mr. X is 2.2 tall! Mrs. X is 1.2 tall."
Expected Output: / Sentences = expect ArrayList
Actual Output: / Sentences = actual ArrayList
Result: / Pass
2.3.3.2AbstractAdapter

Method Name:CreateAdapter(string filename)

Input:stringfilename.

Output: new AbstractAdapter()

Testing Algorithm Code:

[Test]

public void TestCreateAdapter_WT6a(string filename)

{

int extPoint = filename.LastIndexOf('.');

string extension = filename.Substring(extPoint + 1);

AbstractAdapter adapter;

if (extension == "pdf")

{

adapter = new PDFAdapter();

}

elseif (extension == "docx")

{

adapter = newDocxAdapter();

}

else

{

adapter = newTextAdapter();

}

Assert.AreEqual(“pdf”,extension);

}

Number: / WT6
Title / CreateAdapter
Package Name: / GainKnowledge
Class Name: / AbstractAdapter
Method Name: / CreateAdapter
Description: / This method creates an appropriate adapter (for pdf, docx or txt) on the fly.
Inputs: / results: string filename
Outputs: / Returns the appropriate adapter
Test Cases:
Test Case Number: / WT6a
Equivalence Class / This test case covers the path when the input is a pdf file
Input: / filename = “computers.pdf”
Expected Output: / extension = “pdf”
Actual Output: / extension = “pdf”
Result: / Pass
2.3.3.3TextAdapter

Method Name:ConvertFormat(string filename)

Input:stringfilename.

Output: string text.

Testing Algorithm Code:

[Test]

publicvoid TestConvertFormatText_WT7a(string filename)

{

StreamReader reader = newStreamReader(filename);

string text = reader.ReadToEnd();

Assert.AreEqual(“Computer is a machine”, text);

}

Number: / WT7
Title / ConvertFormat
Package Name: / GainKnowledge
Class Name: / TextAdapter
Method Name: / ConvertFormat
Description: / This method returns the content of a text (.txt) file.
Inputs: / results: string filename
Outputs: / Returns the content of the text file.
Test Cases:
Test Case Number: / WT7a
Equivalence Class / This test case covers the only path of the method (No branches are available in the method).
Input: / filename = “computers.txt” containing the string “Computer is a machine”
Expected Output: / text = “Computer is a machine”
Actual Output: / text = “Computer is a machine”
Result: / Pass
2.3.3.4DocxAdapter

Method Name:ConvertFormat(string filename)

Input:stringfilename.

Output: string documentContent.

Testing Algorithm Code:

[Test]

publicvoid TestConvertFormatDocx_WT8a(string filename)

{

string documentContent = "";

WordDocument doc = newWordDocument(filename);

foreach (IBlockElement blockElement in doc.Body.Content)

{

if (blockElement isParagraph)

{

Paragraph currentParagraph = (Paragraph)blockElement;

foreach (IParagraphContent paragraphContent in currentParagraph.Content)

{

if (paragraphContent isRun)

{

Run currentRun = (Run)paragraphContent;

foreach (IRunContent runContent in currentRun.Content)

{

if (runContent isText)

{

Text currentText = (Text)runContent;

documentContent += currentText.Value;

}

}

}

}

}

}

Asssert.Equal(“Computer is a machine”,documentContent); }

Number: / WT8
Title / ConvertFormat
Package Name: / GainKnowledge
Class Name: / DocxAdapter
Method Name: / ConvertFormat
Description: / This method returns the content of a docx (.docx) file.
Inputs: / results: string filename
Outputs: / Returns the content of the text file.
Test Cases:
Test Case Number: / WT8a
Equivalence Class / This test case covers the default path of the method.
Input: / filename = “computers.docx” containing the string “Computer is a machine”
Expected Output: / text = “Computer is a machine”
Actual Output: / text = “Computer is a machine”
Result: / Pass

3.Black-box Testing

3.1The Testers

Nasser Al-Ansari.

Salman Al-Ansari.

Saleh Al-Zaid (UI tester)

3.2The functionality tested

Almost all functionality aspects of Virtual Tutor were tested as the system was treated like a black-box. Namely, the functions tested were: Knowledge gaining, Question answering (online and offline), VT Server, Search (web and video).

3.3The Procedure Performed

The process of black-box testing started with revision of the early designed test cases. Because of the continuous evolution of the design and the code, some of the test cases were modified and some of them were even replaced by new ones. Then came the running phase where the revised test cases were run and the results were collected. Most of the test cases have passed. Then came the debugging phase where the bugs identification started from the failed test cases in order to be debugged. The black-box test cases were run again after debugging and this time all of them passed. God be praised…

3.4Black-box Test Cases Before Debugging

3.4.1Search Package

This section contains the test cases in Search Package