This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 1 UVa CS205 Engineering Software 081112 Unit Testing UVa CS205 Engineering Software 081112 Unit Tests Â¡ Unit tests give evidence of the correctness of individual modules (i.e., in Java, classes or methods) Â¡ Writing test cases: Â¢ Test all paths through the code thoroughly . Â¢ Test incrementally Â¡ "code a little, test a little, code a little ...." Â¢ Test-Driven programming (concept of eXtreme programming) Â¡ Write tests first. Â¡ Then write code, stopping as soon as all tests are passed. Â¢ Separate out the specification tests from the implementation tests Â¡ Ã† if you change the implementation, only change the implementation tests UVa CS205 Engineering Software 081112 More on Unit Tests Â¡ More on writing test cases: Â¢ Common practice in large project to run test suite frequently Â¡ at least once a day Â¡ before checking code into repository Â¢ Test each module in isolation so that if you make changes in other modules tests donâ€™t need to be rerun Â¢ Create mock objects as substitutes for the rest of the program....
View Full Document
- Spring '08
- open source software, UVa CS205 Engineering, CS205 Engineering Software