题目内容

The use of FakeWeb to stub external SOA requests in testing is an example of which design pattern?

A. Null object
B. Proxy
C. Adapter
D. Facade

查看答案
更多问题

Suppose you discover that your most recent release contains a bug whose regression test will require extensive mocking or stubbing because the buggy code is convoluted. Which action, if any, is NOT appropriate?

A. Do the refactoring using TDD on the release branch, and push the bug fix as new code with tests
B. Do the refactoring using TDD on a different branch, push the bug fix as new code with tests, then cherry-pick the fix into release
Create a regression test with the necessary mocks and stubs, painful though it may be, and push the bugfix and tests to release branch
Depending on project priorities and project management, any of the above might be appropriate

If you’ve been assigned to modify legacy code, which statement would make you happiest if true?

A. “It was originally developed using Agile techniques"
B. “It is well covered by tests”
C. “It’s nicely structured and easy to read”
D. “Many of the original design documents are available”

Suppose we want to add a Theater model to Rotten Potatoes, with the assumption that a Theater is associated with one Movie, but a given Movie could be showing at many Theaters. In our Rails app we would like to be able to write movie.theaters to obtain a list of all the theaters at which a movie is showing. Which statement is correct?

A. The movies table will need a foreign key theater_id. We must add has_many :theaters to the Movie model. We must add has_many :movies to the Theater model. We must add belongs_to :theater to the Movie model.
B. We must add has_many :theaters to the Movie model.
C. We must add has_many :movies to the Theater model.
D. We must add belongs_to :theater to the Movie model.

If using the DataMapper pattern with a NoSQL database and you want to do one-to-many associations, you can expect:

A. To have to write the association methods yourself
B. Better scalability
C. Worse scalability
D. All of the above are possible

答案查题题库