View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Spring2004 Midterm Review: Testing and Refactoring

1. What is SUnit and why would you want to use it?
2. What is refactoring and why would you want to do it?
3. Name one kind of refactoring and the problem it is supposed to solve.

1. Wrong answer
2. Scenario testing is testing what should objects do? (a part of CRC cards). You do this to figure out what objects are involded with certain events. – I think that's wrong too, but not completely wrong.
3. Helps you understand what the code must do. Helps you to know when the code is done

1 What is SUnit and why would you want to use it? SUnit is a system for automating the testing of your code. You would want to use it because it can be easily run many times to check your code for you. If some expected behavior changes or breaks, SUnit (with the proper tests) will immediately pick up on it.

2 What is scenario-based testing and why would you want to do it? Scenario based testing is a form where one tests your expectations by describing them as scenarios. A given scenario might be to say that "Bob will want to modify number of oranges produced." You would then test your system with that scenario, to see if Bob can actually change the number of oranges. This is an effective testing measure when automated tests aren't possible. It is helpful in designing what the system should do, and making sure that it does that. An example of this is in the QA process for Mozilla. With each new release they have people run "smoketests" which are just simple scenarios that everybody will go through with their browser on a given day.

3 What are the advantages of defining test case before you write code? The main advantage is clarity. If you've written the test case, you know exactly what you expect the code to do. This makes it much easier to actually code because you no longer have questions about the how the code will be used. It's also helps you know when you're finished. If the test case passes, the code is usable.

Andrew has nailed it pretty well on all of these. Rich LeBlanc

Link to this Page