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.