From: brett l. <bre...@gm...> - 2010-03-23 20:44:52
|
On Tue, Mar 23, 2010 at 11:52 AM, Stefan Frey <ste...@we...> wrote: > I have added automated regression testing for Rails in CVS. Excellent. We've needed this for a while, and this is a good start. > How does it work: > * For a set of Rails save files (which are known that they are correct) game > reports are created and stored alongside with the save files. > Then each time the tests are run, each game is replayed by Rails on the new > code base and the game reports are compared to the stored ones. > This is fine as a starting point, but it's not how most traditional automated testing works. One goal that I hope we work toward is building on this foundation by developing unit and regression tests for each object that doesn't require a save file. Ideally, we should be able to build out mock objects of most things. If we can't, that might be an indicator that refactoring is needed. If nothing else, it should spawn some javadoc about why the object is difficult/impossible to test. > My proposal is: > > Convention for file names: > {18xx}_{noMap - if used}_{author}_{nb of players}_{end round}_{end > condition}_{special remarks} This filenaming convention is going to be very unwieldy. How about this: Save files: {game name}-{current round}-{unique identifier}.save Index file: savegame-tests.txt The save game will simply be something like 1870-OR5-1.save, 1830-SR2-4.save, etc. Then, the index file will track our notes about each saved game, and what tests it applies to. I think there's going to need to be more information than can be contained within the filename itself. Alternately, we can have each saved game with it's own {conventiion}.txt file that documents this, but that may be overkill. Of course, all of this should probably go under /test/savedgames, or something similarly named and organized away from the rest of the code. ---Brett. |