İstanbul evden eve nakliyat Beylikd¨¹z¨¹ evden eve nakliyat Tuzla evden eve nakliyat
Tutorial-12 To calculate the value of previous date and generate its Decision Table based Test Cases
Delicious Bookmark this on Delicious
software testing genius

Tutorial-12 To calculate the value of previous date and generate its Decision Table based Test Cases

Welcome to “Software Testing Genius”. Subscribe to my RSS feed for latest content on Software Testing.

Tutorial-12: To calculate the value of previous date and generate its Decision Table based Test Cases

Inputs for the Tutorial:
The present Date is an input as two integers a & b.

Objective of this Tutorial: There are two objectives of the tutorial like:

Objective –1:
To write a Program in C++ for the determining the value of previous dates based upon various combinations of present date as input.

Objective –2:

face="arial, helvetica, sans-serif"> Decision Table Based testing for situations in which a number of combinations of actions shall be taken for different conditions. Four parts of decision table being covered shall be: Condition Stub, Action Stub, Condition Entries and Action Entries.

Solution Part – 1: Program in C++

#include
#include
int main()
{
int day, month, year, flag=0;
printf(" enter the day value;");
scanf("%d",&day) ;
printf("enter the month value;");
scanf("%d",&month);
printf("enter the year value;");
scanf("%d",&year) ;
if(year> = 1900 && year< = 2025)
{
if(month==l||month==3||month==5||month==7||month==8||month==10||month==12)
{
if(day> = 1&&day<=31)
{
flag = 1;
}
else
{
flag = 0;
}
}
elseif (month==2)
{
int rval=0;
if(year%4==0)
{
rval=l;
if((year%100)==0 && (year%400)! = 0
{rval = 0;
}
}
if(rva1==&&(day>=1 &&day <=29))
{ flag = 1;
}
elseif (day>=1 &&day <=28)
{ flag = 1;
else
}
flag = 0;
}
}
if (flag)
{
if(day==1)
{
if(month==1)
{
year--;
day = 31;
month = 12;
}
else if(month==3)
{
int rval = 0;
if(year%4==0)
{
rval = 1;
if ((year%100) == 0 && (year%400): = 0)
{ravl = 0;
}
}
if (ravl==1)
{
day = 29;
month--;
}
else
{
day = 28;
month--;
}
}
else if (month==2|| month==4||month==6||month==9||month==)
{day = 31;
month--;
}
else
{
day = 30;
month--;
}
}
else
{
day--;
}
printf ("the next data is:%d-%d-%d", day, month, year) ;
}
else
{
printf ("the entered data is invalid: %d-%d-%d, day, month, year)
{
getche();
return 1;
}

Solution Part – 2: Decision Table Based Test Cases

Test Case ID

Month

Day

Year

Expected Output

1

June

1

1964

31 May 1964

2

June

21

1984

Impossible

3

May

1

1945

30 April 1945

4

March

31

2007

30 March 2007

5

August

29

2007

28 August 2007

6

February

29

1962

Impossible


Screenshot with a sample output is as under:



Many More Articles & Tutorials on Black Box Testing 

Largest Database of Sample Papers - 1000+ Unique Questions for ISTQB Foundation Exam

ISTQB Foundation Exam - Full Crash Course for Download

ISTQB Advanced CTAL Test Analysts Exam - Full Crash Course for Download


ISTQB Advanced CTAL Test Manager Exam - Full Crash Course for Download


What Successful Testers say about the Quality of this website

If you want to keep track of further articles on Software Testing,
I suggest you to subscribe my
RSS feed
.

You can also Subscribe by E-mail
and get All New articles delivered directly to your Inbox.

Get your Absolutely Free Copy of Several MS PowerPoint Presentations & E-Books related to ISTQB, HP Load Runner, IBM RFT, HP QTP & QC Certification Exams, prepared by Popular Writers & Trainers, by writing to: Software.testing.genius@gmail.com

Full Study Material for Popular Certification Exams:

Study Material - HP QTP & QC Certification Exam

Study Material - IBM RFT Certification Exam

Study Material - HP LoadRunner Certification Exams for All Modules

Study Material - ISTQB Certification Exam

Most Popular Topics in Demand:

Practical Roadmap to QTP Certification

Practical Roadmap to CSTE Certification

Consolidated Study Material - Testing & QA

Rehearsal of QTP in 1 Hr. -  Interview Questions

 

Comments :

comments ↓


Leave Your Comments: (*) Marked Fields are Mandatory

You can apply basic formatting to the text

Name *
 
Email Address *
 
Website
 
Speak your mind
characters
sex hikayeleri