Giter VIP home page Giter VIP logo

chef-testing's Introduction

Cooking recipes by testing first

This repo is a step by step example to learn how to create Chef cookbooks by testing first.

I'll try to follow the BDD/TDD approach and try the different tools from the Chef's ecosystem such Test-Kitchen, ChefSpec, ServerSpec, Foodcritic...

I won't try to describe the right way, just what makes more sense to me based in my own experience. It'll serve me to learn the tools, to proof some ideas and to have some examples. Also to have documented problem I'll run into and the solutions I'll find. I hope this help someone else.

NOTE: This repo and this document are WIP, it's not finished and you'll miss some final steps (by now).

The process

The process will be:

  1. Setup the minimal environment for testing how the new system should behave
  2. Create the minimal tests to check if the system behave as I wish
  3. Check that the tests doesn't pass
  4. Think about the simplest technical way to pass those tests
  5. Setup the minimal environment for testing this technical approach
  6. Create the minimal tests to check that minimal technical approach
  7. Check that the tests doesn't pass
  8. Create the minimal recipe to pass the technical tests
  9. Check that the tests do pass the technical tests
  10. Check that the tests do pass the behavior tests

Once I have this, I will think in another system behavior and repeat the process.

The use case

As example I will use the following example:

"I'd like to access with my browser to the system and read the sentence 'Hello world!' in my browser"

Pretty simple and common, isn't it?

How to organize the code an examples

I'll call the project webtest and I'll create a directory for every step I'll take. Something like this:

|-webtest-0
|-webtest-1
|-webtest-2
|-...
`-webtest-X

Each directory should be self-explanatory with its own README file to explain what is the goal for that step, the dependencies, processes and difficulties found in that step. See the current ones:

  • Webtest-0: Setup the testing environment.
  • Webtest-1: Define the business goal and write the integration tests.
  • Webtest-2: Define the technical specs and write some unit tests.
  • Webtest-3: Start writing recipes to pass the tests.

chef-testing's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.