Software testing > Ruby >
Testing and Behaviour-Driven Development (BDD)
See also:
Table of Contents [hide]
Testing ∞
You would have to require pp
somewhere.
Other software ∞
-
- Behavior-driven
- Based on JBehave
- https://dannorth.net/2007/06/17/introducing-rbehave/
Tools/Systems ∞
Test-Driven ∞
Testing Tools ∞
-
- Shows you the most torturous code you wrote. The more painful the code, the higher the score. The higher the score, the harder it is to test.
-
- Analyzes ruby code for structural similarities. Differences in literal values, names, whitespace, and programming style are all ignored. Code that flay reports as similar is a good candidate for refactoring.
-
- Your tests should pass. Break your code. Now they should fail. You could check this by hand, but why bother? Use heckle and put it to the test.
-
- Mocha is a library for mocking and stubbing using a syntax like that of JMock. It can be used with many testing frameworks e.g. Test::Unit, RSpec, test/spec, expectations, Dust, MiniTest and even JtestR. Mocha provides a unified, simple and readable syntax for both traditional mocking and partial mocking.
-
- Might be a Rails thing... I don't understand it.
- Fixture replacement for focused and readable tests
- Remove duplication and confusion from your tests using factories.
factory_girl
allows you to quickly define prototypes for each of your models and ask for instances with properties that are important to the test at hand.- Factory Girl provides a framework and DSL for defining and using factories to create data records for ruby test suites. The goal is to be less error-prone, more explicit, and all-around easier to work with than Rails' fixtures.
-
- A continuous integration tool. Its basic purpose in life is to alert members of a software project when one of them checks something into source control that breaks the build.
Other ∞
-
- System Testing In Ruby. This doesn't mean "system testing of Ruby code", it means we used Ruby to create a tool for helping you automate your system tests. In short, Systir allows you to write system-level tests in "domain language", that is, language that pertains to your target software and its own particular constructs.
-
- A test/unit add-on to write test results in XML or HTML format.
Notes ∞
https://dannorth.net/introducing-bdd/
When you change code and a test fails, typically one of three things has happened:
- You have introduced a bug. Fix it.
- The intended behaviour was still relevant but has moved elsewhere. Move the test and maybe change it.
-
The behaviour was no longer correct – the premise of the system had changed. Delete the test.
-
- What to call your test is easy - it's a sentence describing the next behaviour in which you are interested.
-
How much to test becomes moot - you can only describe so much behaviour in a single sentence.
Media ∞
- The RSpec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends by David Chelimsky, Dave Astels, Zach Dennis, Aslak Hellesøy, Bryan Helmkamp, Dan North
- http://agile2009.agilealliance.org/taxonomy/term/123 [ 1 ] possibly was https://www.agilealliance.org/agile2009/taxonomy/term/123
Footnotes
Last updated 2022-04-07 at 01:56:59
- Poked.
- Pushed [[ZenTest]] into its own page.