# Chef development model for new cooks

**URL:** <https://discourse.chef.io/t/chef-development-model-for-new-cooks/6400>\
**Category:** Chef Infra (archive)\
**Created:** [March 3, 2015, 9:09pm UTC](https://discourse.chef.io/t/chef-development-model-for-new-cooks/6400 "2015-03-03T21:09:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Freiberger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/robert_freiberger/32/142_2.png) [@Robert\_Freiberger](https://discourse.chef.io/u/Robert_Freiberger)\
**Post date:** [March 3, 2015, 9:09pm UTC](https://discourse.chef.io/t/chef-development-model-for-new-cooks/6400/1 "2015-03-03T21:09:43Z")

</div>

Hello Chef,

I’m very new to Ruby and Chef, where I have created basic cookbooks and  
recipes using various resources. At work, I’m starting to add my cookbooks  
into production but they need to pass various testing.

From many Chef guides and books, I’m not understanding the full path of  
proper Chef development. I have started to learn about using berks, and  
bundle, but how should I use foodcritic over the other tools like ChefSpec  
and ServerSpec?

Any comments are greatly welcome!

Thanks,  
Robert

---

<div class="post-metadata">

**Author:** ![sjmh](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/sjmh/32/124_2.png) [@sjmh](https://discourse.chef.io/u/sjmh)\
**Post date:** [March 3, 2015, 9:20pm UTC](https://discourse.chef.io/t/chef-development-model-for-new-cooks/6400/2 "2015-03-03T21:20:06Z")

</div>

I don’t think you’d use one over the other.

As a relatively new Chef myself, I’ve found that there is a place for all three. FoodCritic is a linter. It catches common mistakes and makes you conform to the ChefStyle guide.

ChefSpec is for testing that your cookbook is saying that it’s doing something. ( [https://sethvargo.com/unit-testing-chef-cookbooks/](https://sethvargo.com/unit-testing-chef-cookbooks/) ). IE - My cookbook says to install the package httpd on a RedHat system. You should spend some time on Seth’s blog - lots of good information there.

ServerSpec is, for me, the final test. It actually runs and tests the system to make sure that what I told my cookbook to do, actually works right on a system.

I run all these through TestKitchen and Guard ( This post is a little outdated but helped me out quite a bit: [https://micgo.net/](https://micgo.net/) ).

I’m sure other Chefs will have more substantial information ( or correct mine ).

–

sh

?

* * *

From: Robert Freiberger [rfreiberger@gmail.com](mailto:rfreiberger@gmail.com)  
Sent: Tuesday, March 03, 2015 1:09 PM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Chef development model for new cooks

Hello Chef,

I’m very new to Ruby and Chef, where I have created basic cookbooks and recipes using various resources. At work, I’m starting to add my cookbooks into production but they need to pass various testing.

From many Chef guides and books, I’m not understanding the full path of proper Chef development. I have started to learn about using berks, and bundle, but how should I use foodcritic over the other tools like ChefSpec and ServerSpec?

Any comments are greatly welcome!

Thanks,  
Robert

---

<div class="post-metadata">

**Author:** ![nathwill](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/nathwill/32/25_2.png) [@nathwill](https://discourse.chef.io/u/nathwill)\
**Post date:** [March 3, 2015, 10:25pm UTC](https://discourse.chef.io/t/chef-development-model-for-new-cooks/6400/3 "2015-03-03T22:25:04Z")

</div>

we use a full mix of testing frameworks as well, each covering what they're  
good for. rubocop for ruby style, foodcritic for cookbook linting, chefspec  
for unit testing, and serverspec for integration testing. I second the  
recommendation to check out Seth's blog, lots of good stuff there

for reference, i've got a fairly well-tested public cookbook that shows how  
they kind of fit together over at  
[GitHub - nathwill/chef-haproxy-ng: [deprecated] resource-driven haproxy chef cookbook](https://github.com/nathwill/chef-haproxy-ng) (check out the test and spec  
directories, and the Rakefile).

HTH,

- Nathan

On Tue, Mar 3, 2015 at 1:20 PM, Hajducko, Steven \<[Steven\_Hajducko@intuit.com](mailto:Steven_Hajducko@intuit.com)

> wrote:

> I don't think you'd use one over the other.
> 
> As a relatively new Chef myself, I've found that there is a place for  
> all three. FoodCritic is a linter. It catches common mistakes and makes  
> you conform to the ChefStyle guide.
> 
> ChefSpec is for testing that your cookbook is saying that it's doing  
> something. ( [Unit Testing Chef Cookbooks | Seth Vargo](https://sethvargo.com/unit-testing-chef-cookbooks/) ). IE -  
> My cookbook says to install the package httpd on a RedHat system. You  
> should spend some time on Seth's blog - lots of good information there.
> 
> ServerSpec is, for me, the final test. It actually runs and tests the  
> system to make sure that what I told my cookbook to do, actually works  
> right on a system.
> 
> I run all these through TestKitchen and Guard ( This post is a little  
> outdated but helped me out quite a bit: [https://micgo.net/](https://micgo.net/) ).
> 
> I'm sure other Chefs will have more substantial information ( or correct  
> mine ).
> 
> --
> 
> sh
> 
> ## ​
> 
> _From:_ Robert Freiberger [rfreiberger@gmail.com](mailto:rfreiberger@gmail.com)  
> _Sent:_ Tuesday, March 03, 2015 1:09 PM  
> _To:_ [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> _Subject:_ [chef] Chef development model for new cooks
> 
> Hello Chef,
> 
> I'm very new to Ruby and Chef, where I have created basic cookbooks and  
> recipes using various resources. At work, I'm starting to add my cookbooks  
> into production but they need to pass various testing.
> 
> From many Chef guides and books, I'm not understanding the full path of  
> proper Chef development. I have started to learn about using berks, and  
> bundle, but how should I use foodcritic over the other tools like ChefSpec  
> and ServerSpec?
> 
> Any comments are greatly welcome!
> 
> Thanks,  
> Robert
