New answers tagged

1

The trade-off between inheritance and composition is exactly the same for test code as it is for business code. Composition requires delegating calls for all functionality that you want to project to your own public interface. That means that composition becomes more cumbersome the larger the functionality that you want to reuse. Inheritance achieves the ...


-1

White Box Testing Is a verification technique software engineers can use to examine if their code works as expected. There are six basic types of testing: unit, integration, function/system, acceptance, regression, and beta. White-box testing is used for three of these six types: Unit testing: Unit testing is important for ensuring the code is solid ...


0

tldr; The first "weak" version implies you wrote the entire implementation to pass the one test. You should use each of the brute force tests to drive your implementation, one at a time. Okay the long version. You tagged this with #TDD so I'll answer how I'd do this in a TDD based way. Generally you want to start with the simplest cases first and build ...


1

The language is immaterial. Whether your database changing code is testable is all that matters. In any language you can access the database in a way that makes testing difficult. Is knowledge of your particular database spread throughout your code (or is it located in one place)? Is it difficult to swap in a different database? How hard would it be to ...


1

ok we have some different terms here, so here's what's going on We have Unit Testing. Other levels are integration testing, performance testing, etc. rspec can be used for many of the above levels of testing, e.g. against models, controllers and views through Capybara features tests. the word 'spec' comes from specification which is at the heart of a test ...


6

Look at the following diagram. It illustrates the relationship between Test-Driven Development (TDD) and Acceptance Test-Driven Development (ATDD): Notice that the inner loop, TDD, is enveloped by the outer loop, ATDD. Requirements (illustrated by the Acceptance Criteria box) drive the creation of automated acceptance tests, which in turn drive the ...



Top 50 recent answers are included