Structuring RSpec structure and code for tests with very large coverage?

I just started to study a project that has> 20k unit tests written in Rspec (the project itself is not written in Ruby, but only test cases). In the future, the number of tests is expected to increase significantly in the future as more functionality is added. What has already happened (over a long period) is that RSpec began to be a particularly good solution for testing this project, but as the project grew, the rather complicated structure of their RSpec test cases greatly bit them. One of the biggest problems they encountered is the taxonomy in their test code - the structure (or lack thereof) in the designation of their test cases, lights, helper code, etc. In their test cases.

As you could imagine, s> 20k unit tests have many methods with very similar names, using helper methods that are loaded from the global namespace.

To highlight only one area where the problem bites, there are 10 databases in this application. Checking the structure of tables / columns / views / constraints / stored procedures / ... for all these databases is something that (quite reasonably) is considered within the framework of existing RSpec unit tests. However, the total number of DDL objects in this set of databases that need to be checked is possibly> 10000; covering the entire spectrum of structural checks of the database and the ability to selectively test only subsets of the database structure, requires either:

  • 10,000 individual methods (and I immediately rule out this option!)

  • ( -, + + +...),
  • , . , , ,...
  • ( RSpec),
  • - (, , , ).

, , - , , ...

- , , - RSpec? , , RSpec .

+3
1

RSpec Book - RSpec, BDD ( , , ). , , ( 12) ( 17).

.

, , . , DB, table column .

+1

Source: https://habr.com/ru/post/1731135/


All Articles