Sunday, August 3, 2014

How to write Software Test Cases for dissertation

Test case structure


1.   What is a test case:

IEEE Standard 610 (1990) defines test case as follows:

“(1) A set of test inputs, execution conditions, and expected results developed for a particular objective, 
such as to exercise a particular program path or to verify compliance with a specific requirement.
“(2) (IEEE Std 829-1983) Documentation specifying inputs, predicted results, and a set of execution 
conditions for a test item.”

In Simple terms the test case can be defined as below:

A Test Case is set of preconditions and steps to be followed with input data and expected behavior 
to validate functionality of a system.

In simple words a test case is brief description of what to test and how to test


2.   Objective of writing test cases:
Objectives behind writing and executing the test cases are:

·        Find the defects in software products
·        Verify that the software meets the end user requirements
·        Improve software quality
·        Minimize the maintenance and software support costs
·        Avoid post deployment risks
·        Compliance with quality processes
·        Help management to make software delivery decisions

3.   Structure of the test case:

The main objective of the test is to find defects in the application or system. 
To achieve this test cases should be written well and should have the below details

1.    Test case number
2.    Test case name
3.    Test case description
4.    Pre conditions
5.    Test data/Input data
6.    Step name
7.    Step description/action
8.    Expected result


Test case number: A unique number to identify the test case

Test case name: The name of the test case is summary of the test objective 
typically written in one line.

E.g.  For example, if we take the requirement is like below

          “Employee creates a document and the manager can either approve it or reject it.”

For the above requirement, possible test cases could be

          1. Approve the document by manager
          2. Reject the document by manager
       
Test case description: The test case description is generally short description of the test 
objective written in two or three lines.

E.g. For the test case, Approve the document by manager, the description could be as below

Document is created by an employee and is sent to manager for approval, manager approves the 
document.

Pre conditions: Pre condition is a condition or predicate that must always be true just prior to 
the execution of a particular test objective. In other words Pre-Condition is the term itself
 indicates the Pre existing set of the condition that should be satisfied to perform a particular task.
         
E.g. for the above test case example, pre condition is document should be created by employee 
and it should be sent for approval

Test data/Input data: Test Data are data which have been specifically identified for use in tests.
 It is the data required to test the test case. Input data is to verify that a given set of input 
to a given function/program produces some expected result. Input 
can be valid data or invalid data.

E.g. In the above test case example, the test data can be employee user ID and password,
 manager user ID and password, document details sent for approval, environment details. All this 
type of data constitutes part of test data/input data.

Step Name: The sequences of actions are given a number to test the correct behavior/functionalities, 
features of an application called step name. It is like Step 1, Step 2 Step 3….etc. It can also be called 
as order of execution number.

Step Description: Simple description of the action performed on the application to get some 
expected output from this action.

Expected Result: It is the expected output from the system or application for the action 
performed on it.

E.g. For the test case in example, below could be the complete test case structure when we put
 all together






















4. 
















  Test case types:

Test cases are written in a positive perception and also in a negative perception. So Test cases could
 be positive test cases or negative test cases.

Positive Test case: Testing conducted on the application in a positive approach to determine what 
system supposed to do is called positive testing and the test cases written for this purpose are positive test cases.

E.g.  Check Login functionality with valid inputs.

Negative Test case: Testing a software application with a negative perception to check what system not 
supposed to do is called negative testing and the test cases written for this purpose are negative test cases.

E.g.  Check Login functionality with invalid inputs.




--------------------------------------------------------------------------------------------

Basics of Writing Test Cases:

#1. If test scenarios were all about, “What we are going to test” on the AUT – the test cases are all about
“How we are going to test a requirement”.
For example, if the test scenario is “Validate the Admin login functionality” – This would yield in 3 test cases (or conditions) –
 Login (successful), Login-unsuccessful when incorrect username is entered, Login-unsuccessful when incorrect password
 is entered. Each test case would in turn have steps
to address how we can check a particular test condition is satisfied or not.
#2. The input to create a test case document is FRD, Test scenarios created in the earlier step and any other reference
 documents if present.
#3. The test cases documentation is an important deliverable by the QA team and is shared to BA, PM and other teams,
when done for their feedback.
#4. Work is divided among the team members and each member is going to be responsible for creating test cases for a
certain module or a part of a certain module.
#5. Just like with the test scenarios, before we begin Test case documentation, a common template has to be agreed upon.
 Practically anything can be used to create test cases. The 2 most often used choices are MS Excel and MS word.
#6. The MS word template looks something like this:
Test cases MS word template
#7. The Excel template could look like the following:
qa training test cases samples xls
#8. From the above two templates it can be observed that the fields (or the components) that make up for a
test case are the same, the only difference is the way in which they are organized.
So, as long as there is a field for each of the type of information to be included in a test, the format of the
template does not matter. However, my personal favorite happens to be the excel sheet, because it is easy
 to expand, collapse, sort, etc. But again, choose any format that works best for you.

Fields in Test Cases:

Let us take a moment, to observe the fields that are part of a test case.
Test case Id and Test case description – these are the generic ones.
The other fields can be explained as follows:
a) Precondition - state of the AUT (the state in which the AUT needs to be for us to get started)
b) Input - data entry steps. For these steps it is important to note what kind of input info is required – Test data
c) Validation point/trigger/action – what is causing the validation to happen? (Click of a button or toggle or the
 link access. Make sure there is at least one validation point to a test case- otherwise it is all going to be data
entry with nothing to look for. Also to ensure that we have enough modularity, try not to combine too many
validation points into one test case. 1 per test case is optimum.)
d) Output - expected result
e) Post condition - This is additional information that is provided for the benefit of the tester, just to make the test
case more insightful and informative. This includes an explanation about what happens or what can be expected of the
AUT once all the test case steps are done.
---------------------------------------------------------------------------------------------
Source - http://erp-testing.blogspot.com/2012/04/test-case-structure.html
http://www.softwaretestinghelp.com/writing-test-cases-from-srs-software-testing-qa-training-day-4/


Home visits Individual / Group / Online classes in English / Sinhala / Tamil. 

Sample Projects/Assignments Exam Papers, Tutorials, Notes and Answers will we provided. 

Call +94 777 33 7279 | eMail itclasssl@gmail.com | Skype ITClassSL


Thursday, July 10, 2014

Common PHP MySQL Queries for Beginners and Advanced learners

Common MySQL Queries

Aggregates
Join or subquery?
Primary keys
Show
NULLs
Ordering resultsets
Date and time
Pagination
Relational division
Sequences
Aggregates and Statistics
Period arithmetic
Aggregates from bands of values
Pivot tables (crosstabs)
Spherical geometry
Scheduling
Statistics without aggregates
Data comparison
Frequencies
Graphs and Hierarchies
Stored procedures
Database metadata
Strings
JOIN
Foreign keys

eMail  ITClassSL@gmail.com

Call  +94 777 33 7279

Skype ITClassSL


Common PHP MySQL Queries for Beginners and Advanced learners




PHP Resource

 
 
 
 
 

12.7 Date and Time Functions

This section describes the functions that can be used to manipulate temporal values. See Section 11.3, “Date and Time Types”, for a description of the range of values each date and time type has and the valid formats in which values may be specified.
Table 12.13 Date/Time Functions
NameDescription
ADDDATE()Add time values (intervals) to a date value
ADDTIME()Add time
CONVERT_TZ()Convert from one timezone to another
CURDATE()Return the current date
CURRENT_DATE(), CURRENT_DATESynonyms for CURDATE()
CURRENT_TIME(), CURRENT_TIMESynonyms for CURTIME()
CURRENT_TIMESTAMP(), CURRENT_TIMESTAMPSynonyms for NOW()
CURTIME()Return the current time
DATE_ADD()Add time values (intervals) to a date value
DATE_FORMAT()Format date as specified
DATE_SUB()Subtract a time value (interval) from a date
DATE()Extract the date part of a date or datetime expression
DATEDIFF()Subtract two dates
DAY()Synonym for DAYOFMONTH()
DAYNAME()Return the name of the weekday
DAYOFMONTH()Return the day of the month (0-31)
DAYOFWEEK()Return the weekday index of the argument
DAYOFYEAR()Return the day of the year (1-366)
EXTRACT()Extract part of a date
FROM_DAYS()Convert a day number to a date
FROM_UNIXTIME()Format UNIX timestamp as a date
GET_FORMAT()Return a date format string
HOUR()Extract the hour
LAST_DAYReturn the last day of the month for the argument
LOCALTIME(), LOCALTIMESynonym for NOW()
LOCALTIMESTAMP, LOCALTIMESTAMP()Synonym for NOW()
MAKEDATE()Create a date from the year and day of year
MAKETIME()Create time from hour, minute, second
MICROSECOND()Return the microseconds from argument
MINUTE()Return the minute from the argument
MONTH()Return the month from the date passed
MONTHNAME()Return the name of the month
NOW()Return the current date and time
PERIOD_ADD()Add a period to a year-month
PERIOD_DIFF()Return the number of months between periods
QUARTER()Return the quarter from a date argument
SEC_TO_TIME()Converts seconds to 'HH:MM:SS' format
SECOND()Return the second (0-59)
STR_TO_DATE()Convert a string to a date
SUBDATE()Synonym for DATE_SUB() when invoked with three arguments
SUBTIME()Subtract times
SYSDATE()Return the time at which the function executes
TIME_FORMAT()Format as time
TIME_TO_SEC()Return the argument converted to seconds
TIME()Extract the time portion of the expression passed
TIMEDIFF()Subtract time
TIMESTAMP()With a single argument, this function returns the date or datetime expression; with two arguments, the sum of the arguments
TIMESTAMPADD()Add an interval to a datetime expression
TIMESTAMPDIFF()Subtract an interval from a datetime expression
TO_DAYS()Return the date argument converted to days
UNIX_TIMESTAMP()Return a UNIX timestamp
UTC_DATE()Return the current UTC date
UTC_TIME()Return the current UTC time
UTC_TIMESTAMP()Return the current UTC date and time
WEEK()Return the week number
WEEKDAY()Return the weekday index
WEEKOFYEAR()Return the calendar week of the date (0-53)
YEAR()Return the year
YEARWEEK()Return the year and week
 
 
 
Sample Projects/Assignments Exam Papers, Tutorials, Notes and Answers will be provided. Call+94 777 33 7279 | eMail itclasssl@gmail.com | Skype ITClassSL