Posts

Showing posts with the label legacy

Writing Test Cases

Application support teams who are maintaining pre-written applications may be disappointed to find that test cases have not been written prior. The recommendation is not to stop work and start writing test cases. Instead, test cases should be written incrementally . Every time you need to “touch” the application code, you should write the test cases directed at that aspect. For example: Every enhancement to the system should be supplemented with newly created test cases Every bug you attempt to fix should be supplemented with pre-fix and post-fix test cases In so doing, the risky and unstable portions of the system will be covered by test cases. At the same time, if test cases are regressed, a previously fixed bug will not resurface! See a related article

Unit testing legacy code

What is legacy code? Some define legacy code as code without proper unit tests . Consider these: Did you just write some legacy code yesterday? What happens when you are tasked to take over the maintenance of someone else's code; someone's legacy code? What happens when you need to modify someone's legacy code? Some steps to take when planning to unit test legacy code: identify the area of change build safety net over the area before touching/ changing it refactor the code to ease adding new code write unit test for issue write code for fix/ enhancements Some links to refer to: http://members.pingnet.ch/gamma/junit.htm http://c2.com/cgi/wiki?UnitTestingLegacyCode http://spin.atomicobject.com/2008/12/29/testing-and-legacy-code-a-primer http://www.ibm.com/developerworks/java/library/j-testng/