By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,581 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,581 IT Pros & Developers. It's quick & easy.

i don't know how to write the test cases in programming languages

P: 1
how to apply the test cases in any of the language.tell them in breif explination and explain each of the test case
Jan 3 '20 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 203
For questions that demand theoretical/descriptive answers, I always suggest the OP to go through the web for articles and content. Those can indeed explain and provide the information in a more better and detailed way. Software testing is a broad topic. Companies recruit Software Testing Engineers for this job.

how to apply the test cases in any of the language.tell them in breif explination and explain each of the test case
It all depends on many factors I would say. First, on language. Say for example, Java can handle exceptions like divide by zero. But in C, there is no concept for the same. It may crash the program while running.
Secondly, it depends on how you plan to provide and check for the test cases. Here are some ways:
- Storing the test cases in a 2D array and passing each row to the method (the one having the functionality to be tested).
e.g. int arr[2][3]={{input1, input2, result1}, {input3, input4, result}};
- Storing the test cases in a file and reading from the same.
- Testing with command line arguments. (I would write a batch script to automate the whole task).
Also there are things called as Test Automation Frameworks. Like TestNG for Java.

i don't know how to write the test cases in programming languages
Test cases can be formed keeping these points in mind:
- check for valid data type values
- check for boundary/extreme/edge case values
- passing inputs of different data type (e.g. passing a character when a float value is expected)
- check for other invalid values like special characters etc.
Jan 3 '20 #2

Post your reply

Sign in to post your reply or Sign up for a free account.