Giter Site home page Giter Site logo

trivia-golden-master's Introduction

Golden Master files for Trivia

Trivia is a terrible, terrible piece of software, which is why it's perfect for use in practicing working with legacy code. One of the most important things to do when dealing with old, crufy codebases is to create a regression test suite. This is what these three shell scripts do: create a "Golden Master" which stops you from making stupid mistakes while you get the code properly under test.

Step 1

Generate some regression tests. Adapt your entry point so it takes one argument, a random seed, and use that to seed your random number generator. Then run this:

generate "<your command here>" "<number of tests to create>" "<output directory>"

Running against the Java code, it took one and a half minutes on a fairly beefy computer to generate 1000 test cases. You're better off reimplementing this in your language of choice so you don't have the initialisation overhead, but these scripts will do in a pinch.

Step 2

Go change your code.

Step 3

Verify your changes.

verify "<your command here>" "<output directory>"

Step 4

You can do one of three things here.

If your code passes, good. Commit.

If your code doesn't pass and you were expecting it to, revert.

If your code doesn't pass because you deliberately made some changes in the output, bless your changes:

bless "<your command here>" "<output directory>"

Step 5

Repeat.

trivia-golden-master's People

Contributors

samirtalwar avatar

Stargazers

Tomasz Bartczak avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.