I was talking about JUnit the other day. I heard a few voices from the audience asking about a significant benefit of JUnit. It appeared that for them JUnit was quite ordinary. JUnit allows to unit test software. If you have written a class, you can check whether its methods work really well according to the specifications using JUnit. You can test that class and its methods in isolation. Whether or not the rest of your work is even developed does not matter. Once you have a class ready, you can test it using JUnit. This alone is a huge benefit of JUnit.
You, nonetheless, have to provide the test cases, against which you want to check the methods, by yourself. For small methods, requiring only a handful of input arguments, and only a handful of possible values for those arguments, JUnit alone can suffice as a unit test framework. You can provide those values by reading the software specification. However, when the number of possible values to be input is very large, running the tests manually can be limiting. Even if you are using a smart way of providing the inputs, through looping, by employing a brute force testing scheme, there could be limits to what you can achieve with JUnit. You may not be able to test all the possible combinations of values which your method can accept. Moreover, the method under test might as well have failed on a certain combination that you failed to provide. Brute force algorithms work well when the combination of values is rather small. As you increase that number, brute force schemes begin to reveal their appetite for computing resources. Moreover, if the software is very sensitive to a certain range of inputs, it becomes all the more important to check its functioning against those values.
Search techniques based on meta-heuristics come in handy to rescue such situations. With search techniques, you can automate your tests. Search techniques are also well-known for exploring the regions of search space that are hard to reach manually or through other algorithms.
Meta-heuristic search algorithms, such as genetic algorithms have been widely applied to the feat of software testing in the past. The idea of coupling them with JUnit is also not very exceptional. Here I am listing a few links that reflect on this type of work. You never know you might like these ideas. And you may as well end up working on some of these for your future career.
Program testing is expensive and labor-intensive, often consuming more than half of the total development costs, and yet it is frequently not done well and the results are not always satisfactory. However, testing is the primary method to ensure that programs comply with requirements.
Test case prioritization is used in regression testing to schedule the execution order of test cases so as to expose faults earlier in testing. Over the pa
In this paper, we propose a model to reveal faults and kill mutant using genetic algorithms. The model first instruments the source and mutant program and
Improving Structural Testing of Object-Oriented Programs via Integrating Evolutionary Testing and Symbolic Execution
If you found an error, highlight it and press Shift + Enter or click here to inform us.