Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - why use quick and nimble vs XCTest

Quick is a behavior-driven development testing framework. I'd like to know why this could be better then doing regular XCTests. Nimble is only a matcher library but it makes the tests easy to read like writing things like expect(13) > 9.

To me Quick provides a new vocabulary for writing tests (that XCTests doesnt have) and makes you focus on writing a unit test. Basically it is a feature induced path to TDD. When a test fails its also much more descriptive.

The other thing i noticed is that if i want to see what a method does, if i go to the quick spec i can easily read whats being tested and then know more about the method instead of writing comments on the method. So the quick spec acts as comments on the method.

Is there anything more i should know about Quick or BDD ?

like image 987
j2emanue Avatar asked Aug 18 '15 13:08

j2emanue


People also ask

Why use Quick and Nimble?

Quick and Nimble are frameworks that are used in Unit tests in iOS. Quick is a testing framework and Nimble is a matching framework. They help us to write tests more easily and readably in addition to verifying how your programs behave.

What is XCTest used for?

Use the XCTest framework to write unit tests for your Xcode projects that integrate seamlessly with Xcode's testing workflow. Tests assert that certain conditions are satisfied during code execution, and record test failures (with optional messages) if those conditions aren't satisfied.

What is XCTest?

483. A testing framework that allows to create and run unit tests, performance tests, and UI tests for your Xcode project. Tests assert that certain conditions are satisfied during code execution, and record test failures if those conditions are not satisfied.


1 Answers

You need to evaluate what you need.

I've been using Quick (and Nimble) for a long time and my big concern about it is that is not possible to run a single test case. The thing is Quick generates runtime test cases and that is the reason because of is not possible to run them individually, even if you use fit().

like image 200
eMdOS Avatar answered Oct 03 '22 06:10

eMdOS