GithubHelp home page GithubHelp logo

weekend-warrior's Introduction

The Ada Weekend Warrior Exercises

These exercises lean on Test-Driven Development (TDD), but they're not an exact match. For a more thorough introduction and explanation of TDD (using Minitest in Ruby), see the "Intro to TDD" over at JumpstartLab.

In these exercises, you will be provided a set of tests (instead of having to write your own). Your job is to read the tests, discern what they're asking you to do, then write the code that makes each test pass, one by one. The process should break down like this:

  1. Run the test suite. It's written using the Minitest framework, and can be run with $ ruby hello_world_test.rb.
  2. Read the error. Think about the error. Then make the smallest change possible to the code to fix the error (and just that one error).
  3. Run the tests again. You may get a new error. If you do, rinse and repeat. Think. Make the smallest change to fix that error. Run the tests again.
  4. When the first test passes, enable the next test in the suite by removing the skip in the test code.
  5. Wash, Rinse, Repeat: Delete one skip at a time, and make each test pass before you move to the next one.

Remember: the goal is to write code that is expressive and readable.

Running the Tests

All the tests for these exercises are written using the Minitest gem. This gem is provided in by default in newer distributions of ruby, but you can install it manually using $ gem install minitest if it doesn't appear in the output of $ gem list.

If you would like color output, you can require 'minitest/pride' in the test file. I may have done this in some of the test files already. ^_^

Understanding Test Failures

Failing tests (errors) look something like:

# Running:

ESSS

Finished in 0.001539s, 2599.0903 runs/s, 0.0000 assertions/s.

1) Error:
HelloWorldTest#test_no_name:
NameError: uninitialized constant HelloWorldTest::HelloWorld
  hello-world/hello_world_test.rb:5:in `test_no_name'

The letters ESSS show that there are four tests altogether, that one of them has an error (E), and that three of them are skipped (S). The goal is to have four passing tests. Passing tests are shown as dots (.).

The tests are run in a random order, which will result in the letters to display in random order as well.

An error (E) means that Ruby cannot execute the code because of things like missing files, syntax errors, or referring to things that don't exist.

A test failure (F) is when the program/code runs fine, but the test receives an outcome different from what it was told to expect.

Credits & License

Much of the content of this repo comes from the amazing Exercism project. I've adapted and modified language and exercises found there for the Ada classroom. All content in this repository is relased under the GNU Affero General Public License. Copyright © 2016, Ada Developers Academy.

weekend-warrior's People

Contributors

cheezitman avatar hamled avatar jnf avatar kariabancroft avatar susanev avatar

Watchers

 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.