Hi, Guys, I met a interview questions today, the question is to test this bool function bool match (string s, string p); string p is a pattern string, that means include character such as '?' or '*' e.g. if s = 'panic' and p='pani?', it will return true, if s ='panic' and p ='p*', it will return true, if s = 'panic' and p= '??' it will return false.
I don't know how to write down test cases and how to classify the test cases such as valid or invalid, boundary test , could anyone help me out?
I cudnt understand your question, but still i wud suggest is you should write test case having string- s as the super set of p-pattern. means p must have each char assigend to s.
can u pl. test , what kind of testing it is....white/black. so that we can find a solution to it.
Hi, these are the following test cases which you can write for the asked function.. Let me tell
you first what I understood from the question because according to that I have written the cases. According to what I
saw, string s and string p are compared and resulted true only if both characters match. (even one character from s can match p). The "?" and "*" is just like replacement for any one character. s=panic , p = pani? ------ Valid s=panic , p = pani* ------ Valid s=panic , p = p? ------ Valid s=panic , p = p* ------ Valid s=panic , p = p*nic ------ Valid s=panic , p = p*ni? ------ InValid s=panic , p = ?pnic ------ InValid s=panic , p = ?? ------ InValid s=panic , p = *? ------ InValid s=panic , p = ** ------ InValid s=panic , p = pan?? ------ InValid These are few test cases which
I think can be written.. Correct me if am wrong..
Latest Answer : A test case is a document containing series of action,events,input,expected result and actual result. The optional fields are TestCase ID,Test Case Description/Procedure, Expected Result, Author, Check Box to determine whether that step can ...
Latest Answer : actually tracibility matrix is not only the answer becoz trecibility matrix is made by the test lead with some testcase IDS using FRS documents and with these he will check the test cases which are made by the testing team tht ...
Effictive test case contain Test case describtion,test i/p data,exp o/p and actual o/p.
Latest Answer : In general we write Prerequsite and Setup condition first then1. Testcsae ID2. Testcase name3. Objective4. Steps to be taken5. Expected result6. Actual result7. Pass/fail ...
Latest Answer : The more negative u think the more brilliant test engineer ur.so before writing test cases think in all negative angles and start working on it.Test engineers' work is to prove the development team wrong. ...
1.How prepare good test case2.How prepare test case for winrunner and load runner3.how prepare client side test cases(ex:Screens)Please send me to example test cases for above 3Thanks and Regards.Nagaraju
Latest Answer : Test case for cut/Paste in XL=>Verify that the Excel is install in your computer or not.=>Verify that the Excel is open and work carrectly=>Verify that the text is cut and save in clipboard after cutting a text.=>verify that the Text(which ...
Latest Answer : Test Cases for Mobile Phone:1)Chek whether Battery is inserted into mobile properly2)Chek Switch on/Switchoff of the Mobile3)Insert the sim into the phone n chek 4)Add one user with name and phone number in Address book5)Chek the Incoming call ...
C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
ERP Success cases You have probably heard a lot about ERP systems especially about their implementation and its advantages and disadvantages Here you will find that there are no unachievable targets and that every effort brings benefits These are the stories of people who found success through ERP i
C Function Passing Types In this C tutorial you will learn about function passing types two types of arguments passing in functions passed by value and passed by reference are discussed here mosgoogle center The arguments passed to a function can be performed in two ways Passed
DECODE is used to decode a CHAR or VARCHAR2 or NUMBER into any of several different character strings or numbers based on value. That is DECODE does a value-by-value substitution. For every value that is given in the DECODE function it makes an if then check and matches the value. The general format
What is the return value from printf() function?
printf function always returns the number of characters printed. Let us understand this with an example:
main()
{
int a=10;
printf("%d",printf("%d %d %d", a,a,a));
}
In this above program the inner printf i
The declaration of main can be done as
int main()
One more declaration that can be taken by main is command line arguments form
int main(int argc, char *argv[])
or this can also be written as
int main(argc, argv)
int argc;
char *argv[];
NOTE: It is not possible for one to declare the main
Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out.
Let us understand this concept with an example.
For instance consider a function sample called within it 4 times as given in program below:
main()
{
int a=50;
When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below
main()
{
int x;
printf(“%d”,x);
z= sample()
}
sample()
{
printf(“Testing program”);
}
Output is
&n
The default return value from a function is int. In other words, unless explicitly specified the default return value by compiler would be integer value from function.
When a programmer wants other than integer values to be returned from function then it is essential that the pro
Generally in C program the function definition and calling takes the form as given below:
main()
{
int x,y,z;
z=sample(x,y);
printf(“%d”,z);
}
sample(x1,y1)
int x1,y1;
{
int z1;
z1= x1 - y1;
return(z1);
}
Here what happens is the values x, y gets passed to x1,y1